/* ---------- Base ---------- */
:root { --ink: #0b1220; --brand: #10b981; --brand-dark: #059669; --line: #e2e8f0; }
html { scroll-padding-top: 4.5rem; }
body { overflow-x: hidden; }
.section { padding: 5rem 0; }
.page-top { padding-top: 8rem; }
@media (max-width: 640px) { .section { padding: 3.5rem 0; } .page-top { padding-top: 6.5rem; } }

.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-dark); margin-bottom: .5rem; }

/* ---------- Header ---------- */
.site-header { color: #fff; background: rgba(11, 18, 32, .85); backdrop-filter: blur(12px); transition: background .3s, transform .3s, box-shadow .3s; }
.home-page .site-header.at-top { background: transparent; backdrop-filter: none; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.nav-link { position: relative; color: rgba(255,255,255,.85); transition: color .2s; }
.nav-link:hover, .nav-link.is-active { color: #fff; }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--brand); transform: scaleX(0); transition: transform .25s; }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(to top, rgba(11,18,32,.95) 0%, rgba(11,18,32,.45) 45%, rgba(11,18,32,.25) 100%), var(--hero-bg) center/cover no-repeat; }
.hero-in { opacity: 0; transform: translateY(16px); animation: rise .8s ease forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Components ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: box-shadow .25s, transform .25s; }
a.card:hover, .card:hover { box-shadow: 0 12px 32px rgba(15,23,42,.08); }
a.card:hover { transform: translateY(-3px); }
#blog-filters + .grid > div > .card { width: 100%; }

.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .9rem; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { border: 1px solid rgba(255,255,255,.4); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-outline { border: 1px solid var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-red { background: #dc2626; color: #fff; }
.btn-red:hover { background: #b91c1c; }

.icon-badge { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none; border-radius: .75rem; background: #ecfdf5; color: var(--brand-dark); }
.tag { display: inline-block; padding: .25rem .7rem; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: .8rem; font-weight: 500; }
.stat { padding: .35rem .9rem; border-radius: 999px; background: #ecfdf5; color: #065f46; }
.social-chip { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: #334155; font-size: 1.1rem; transition: all .2s; }
.social-chip:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-2px); }

.filter-btn { padding: .4rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .85rem; font-weight: 500; color: #475569; transition: all .2s; }
.filter-btn:hover { border-color: var(--ink); }
.filter-btn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.field { display: block; }
.field > span { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .35rem; color: #334155; }
.field input, .field textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: .6rem; padding: .65rem .9rem; background: #fff; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.alert { padding: .75rem 1rem; border-radius: .6rem; font-size: .9rem; }
.alert-ok { background: #ecfdf5; color: #065f46; }
.alert-error { background: #fef2f2; color: #991b1b; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2.75rem; }
.timeline::before { content: ""; position: absolute; left: 1.1rem; top: .5rem; bottom: .5rem; width: 2px; background: linear-gradient(var(--brand), #cbd5e1); }
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-dot { position: absolute; left: -2.75rem; top: 1rem; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 999px; background: #fff; border: 2px solid var(--brand); color: var(--brand-dark); font-size: .8rem; }
.timeline-item[data-type="travel"] .timeline-dot { border-color: #f59e0b; color: #b45309; }
.timeline-item[data-type="study"] .timeline-dot { border-color: #6366f1; color: #4338ca; }

/* ---------- Vlogs ---------- */
.yt-play { position: absolute; inset: 0; margin: auto; width: 4rem; height: 2.8rem; display: grid; place-items: center; border-radius: .8rem; background: rgba(220,38,38,.92); color: #fff; transition: transform .2s; }
.yt-lite:hover .yt-play { transform: scale(1.08); }

/* ---------- Map ---------- */
.leaflet-popup-content { margin: .75rem 1rem; font-family: Inter, sans-serif; }
.map-pop b { display: block; color: var(--ink); margin-bottom: .25rem; }
.map-pop a { color: var(--brand-dark); font-weight: 600; }

/* ---------- Article body ---------- */
.prose-body { color: #334155; line-height: 1.8; font-size: 1.06rem; }
.prose-body > * + * { margin-top: 1.1em; }
.prose-body h1, .prose-body h2, .prose-body h3 { color: var(--ink); font-weight: 700; line-height: 1.3; margin-top: 1.8em; }
.prose-body h1 { font-size: 2rem; } .prose-body h2 { font-size: 1.55rem; } .prose-body h3 { font-size: 1.25rem; }
.prose-body a { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 3px; }
.prose-body ul { list-style: disc; padding-left: 1.4rem; } .prose-body ol { list-style: decimal; padding-left: 1.4rem; }
.prose-body li + li { margin-top: .35em; }
.prose-body blockquote { border-left: 4px solid var(--brand); padding: .25rem 0 .25rem 1rem; font-style: italic; color: #475569; }
.prose-body img { border-radius: .75rem; }
.prose-body code { background: #f1f5f9; padding: .1em .35em; border-radius: .3em; font-size: .9em; }
.prose-body pre { background: var(--ink); color: #e2e8f0; padding: 1rem; border-radius: .75rem; overflow-x: auto; }
.prose-body pre code { background: none; padding: 0; }
.prose-body table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose-body th, .prose-body td { border: 1px solid var(--line); padding: .5rem .75rem; text-align: left; }

.resume-h { font-size: .8rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--brand-dark); margin-bottom: .6rem; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* =============== Creative layer =============== */
.bg-paper { background: #faf7f2; }
.text-gradient { background: linear-gradient(100deg, #34d399, #22d3ee 45%, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Hero */
.hero { background: radial-gradient(ellipse at top, #13213a 0%, var(--ink) 65%); }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.aurora { position: absolute; inset: 0; filter: blur(70px); opacity: .55; pointer-events: none; }
.aurora span { position: absolute; width: 42vmax; height: 42vmax; border-radius: 50%; animation: drift 18s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: #10b981; top: -15%; left: -10%; }
.aurora span:nth-child(2) { background: #0ea5e9; bottom: -20%; right: -10%; animation-delay: -6s; }
.aurora span:nth-child(3) { background: #f59e0b; top: 30%; left: 45%; width: 26vmax; height: 26vmax; opacity: .5; animation-delay: -12s; }
.aurora-soft { opacity: .25; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

.pulse-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 rgba(16,185,129,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.typer { color: #fff; font-weight: 600; border-bottom: 2px solid var(--brand); }
.caret { margin-left: 2px; color: var(--brand); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.photo-stack { position: relative; aspect-ratio: 4/5; transition: transform .2s ease-out; transform-style: preserve-3d; }
.photo-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 1.5rem; border: 6px solid #fff; box-shadow: 0 30px 60px rgba(0,0,0,.45); }
.stack-back { transform: rotate(8deg) translate(1.2rem, .4rem); filter: saturate(.8) brightness(.85); }
.stack-front { transform: rotate(-3deg); }
.float-badge { position: absolute; left: var(--x); top: var(--y); display: inline-flex; gap: .4rem; align-items: center; padding: .4rem .8rem; border-radius: 999px; background: rgba(255,255,255,.12); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.2); font-size: .8rem; font-family: ui-monospace, monospace; white-space: nowrap; animation: bob 6s ease-in-out infinite; animation-delay: var(--t); }
.float-badge i { color: var(--brand); }
@keyframes bob { 50% { transform: translateY(-12px); } }

.scroll-cue { position: absolute; bottom: 1.75rem; left: 50%; translate: -50% 0; width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.4); border-radius: 999px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: #fff; animation: wheel 1.8s infinite; }
@keyframes wheel { to { transform: translateY(14px); opacity: 0; } }

/* Marquee */
.marquee { overflow: hidden; padding: 1rem 0; transform: rotate(-1.2deg) scale(1.02); margin-top: -1rem; position: relative; z-index: 2; box-shadow: 0 10px 30px rgba(16,185,129,.25); }
.marquee-track { display: flex; gap: 1.5rem; align-items: center; width: max-content; animation: marquee 40s linear infinite; font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; }
.marquee-track i { font-size: .7rem; opacity: .6; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Three sides */
.side-card { position: relative; display: flex; flex-direction: column; padding: 2rem; border-radius: 1.5rem; overflow: hidden; min-height: 300px; transition: transform .35s, box-shadow .35s; }
.side-card:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 24px 50px rgba(15,23,42,.18); }
.tone-code { background: var(--ink); color: #e2e8f0; }
.tone-lens { background: #fef3c7; color: #422006; }
.tone-road { background: #d1fae5; color: #064e3b; }
.side-num { position: absolute; right: 1.25rem; top: .5rem; font-family: "Playfair Display", serif; font-size: 5rem; font-weight: 600; opacity: .1; }
.side-icon { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 1rem; background: currentColor; }
.side-icon i { color: #fff; font-size: 1.2rem; }
.tone-code .side-icon { background: var(--brand); }
.tone-code .side-icon i { color: var(--ink); }
.side-card::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; border: 22px solid currentColor; opacity: .06; transition: transform .5s; }
.side-card:hover::after { transform: scale(1.4); }
.trait { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-radius: .9rem; background: #fff; border: 1px dashed #cbd5e1; font-size: .85rem; font-weight: 500; color: #334155; transition: border-color .2s, transform .2s; }
.trait i { color: var(--brand-dark); }
.trait:hover { border-color: var(--brand); transform: translateY(-2px); }

/* Road timeline */
.road { position: relative; padding: 1rem 0; }
.road::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; background: repeating-linear-gradient(to bottom, #334155 0 18px, transparent 18px 32px); border-radius: 4px; }
.road-stop { position: relative; width: 50%; padding: 0 2.75rem 2.25rem; }
.road-stop.is-left { margin-right: auto; text-align: right; }
.road-stop.is-right { margin-left: 50%; }
.road-dot { position: absolute; top: .5rem; width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: 0 0 0 6px #faf7f2; z-index: 1; }
.is-left .road-dot { right: -1.3rem; }
.is-right .road-dot { left: -1.3rem; }
.road-stop[data-type="travel"] .road-dot { background: #f59e0b; }
.road-stop[data-type="study"] .road-dot { background: #6366f1; }
.road-card { position: relative; display: inline-block; text-align: left; padding: 1.25rem 1.4rem; background: #fff; border-radius: 1rem; box-shadow: 0 10px 30px rgba(15,23,42,.07); transition: transform .3s; }
.road-card:hover { transform: scale(1.03); }
.road-year { display: block; font-family: "Playfair Display", serif; font-size: 2rem; font-weight: 600; line-height: 1; color: var(--brand-dark); margin-bottom: .35rem; }
.road-stop[data-type="travel"] .road-year { color: #b45309; }
.road-end { text-align: center; position: relative; }
.road-end span { display: inline-block; padding: .5rem 1.2rem; border-radius: 999px; background: var(--ink); color: #fff; font-family: "Playfair Display", serif; font-style: italic; }
@media (max-width: 767px) {
  .road::before { left: 1.3rem; }
  .road-stop, .road-stop.is-left, .road-stop.is-right { width: 100%; margin: 0; padding: 0 0 1.75rem 3.75rem; text-align: left; }
  .is-left .road-dot, .is-right .road-dot { left: 0; right: auto; }
  .road-end { text-align: left; padding-left: 2.5rem; }
}

/* Polaroids */
.polaroids { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; padding: 1rem 0; }
.polaroid { display: block; width: 200px; padding: .7rem .7rem 0; background: #fff; box-shadow: 0 14px 30px rgba(15,23,42,.15); transform: rotate(var(--r)); transition: transform .35s, box-shadow .35s; }
.js .polaroid.reveal.is-visible { transform: rotate(var(--r)); }
.polaroid:hover, .js .polaroid.reveal.is-visible:hover { transform: rotate(0) scale(1.08); z-index: 2; box-shadow: 0 24px 50px rgba(15,23,42,.25); }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.polaroid span { display: block; padding: .7rem 0 .9rem; text-align: center; font-family: "Caveat", "Segoe Print", cursive; font-size: 1.15rem; color: #334155; }
@media (min-width: 1024px) { .polaroid { width: 210px; } .polaroid:nth-child(even) { margin-top: 2.5rem; } }

.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.5rem; background: rgba(11,18,32,.92); backdrop-filter: blur(6px); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 85vh; border-radius: .75rem; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: rise .35s ease; }
.lightbox-close { position: absolute; top: 1rem; right: 1rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 1.2rem; }

/* Map */
.map-frame { border-radius: 1.5rem; overflow: hidden; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 80px rgba(0,0,0,.45); background: #1e293b; }
.stat-dark { display: inline-flex; gap: .4rem; align-items: center; padding: .4rem 1rem; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }

/* Vlogs */
.vlog-card { background: #fff; border-radius: 1.25rem; overflow: hidden; border: 1px solid var(--line); transition: transform .3s, box-shadow .3s; }
.vlog-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(15,23,42,.12); }
.vlog-card img { transition: transform .6s; }
.vlog-card:hover img { transform: scale(1.06); }

/* Bento skills */
.bento { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .bento { grid-template-columns: repeat(3, 1fr); } .bento-wide { grid-column: span 2; } }
.bento-cell { position: relative; padding: 1.6rem; border-radius: 1.25rem; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.bento-cell[data-spotlight]::before { content: ""; position: absolute; inset: 0; background: radial-gradient(260px circle at var(--mx, -100px) var(--my, -100px), rgba(16,185,129,.14), transparent 60%); pointer-events: none; }
.bento-cta { display: flex; flex-direction: column; gap: .4rem; min-height: 180px; background: linear-gradient(135deg, var(--brand), #0ea5e9); color: #fff; border: 0; transition: transform .3s; }
.bento-cta:hover { transform: translateY(-4px) rotate(.5deg); }

/* Featured blog */
.featured-post { position: relative; display: block; border-radius: 1.5rem; overflow: hidden; min-height: 340px; color: #fff; }
.featured-post img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.featured-post:hover img { transform: scale(1.05); }
.featured-post::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,18,32,.95), rgba(11,18,32,.2) 70%); }
.featured-body { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 2rem; }
.badge-new { display: inline-block; padding: .25rem .75rem; border-radius: 999px; background: var(--brand); color: var(--ink); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }

.magnetic { transition: transform .2s ease-out, background .2s, color .2s; }

/* Scroll progress bar */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #34d399, #22d3ee, #fbbf24); z-index: 70; }

@media (prefers-reduced-motion: reduce) {
  .aurora span, .marquee-track, .float-badge { animation: none !important; }
  *, .hero-in, .js .reveal { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}
@media print { .site-header, footer, #contact { display: none !important; } .page-top { padding-top: 0; } }

/* ---------- Small screens ---------- */
/* The tilted marquee band is wider than the screen; clip it without breaking sticky headers */
html, body { overflow-x: clip; }
@media (max-width: 640px) {
  /* Keep the floating badges beside the photo inside the screen */
  .float-badge { left: clamp(.25rem, var(--x), calc(100% - 7rem)); font-size: .75rem; }
}
