/* ---------- Theme tokens ---------- */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #6b635b;
  --line: #e7e0d6;
  --accent: #c2410c;
  --accent-soft: #fde7da;
  --ph: #efe8de;
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #141210;
  --surface: #1d1a17;
  --text: #f3eee8;
  --muted: #a39a90;
  --line: #2f2a25;
  --accent: #fb923c;
  --accent-soft: #3a2416;
  --ph: #26221e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141210; --surface: #1d1a17; --text: #f3eee8; --muted: #a39a90;
    --line: #2f2a25; --accent: #fb923c; --accent-soft: #3a2416; --ph: #26221e;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; }
.muted { color: var(--muted); }

/* ---------- Top bar (hidden until you scroll past the hero) ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  transform: translateY(-100%); visibility: hidden; transition: transform .3s ease, visibility 0s linear .3s; }
.nav.show { transform: none; visibility: visible; transition: transform .3s ease; }
.nav-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; text-decoration: none; white-space: nowrap; }
.section-bar { flex: 1; display: flex; justify-content: flex-end; gap: 4px; }
.sb-chip { text-decoration: none; font-size: .88rem; font-weight: 500; padding: 7px 14px; border-radius: 999px; border: 1px solid transparent; color: var(--muted); white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.sb-chip:hover { border-color: var(--line); color: var(--text); }
.sb-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.theme-btn, .menu-btn { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: .92rem; }
.menu-btn { display: none; align-items: center; gap: 8px; }
.burger { font-size: 1.05rem; }
.sb-progress { height: 2px; margin-bottom: -1px; position: relative; }
.sb-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; padding-top: 80px; padding-bottom: 48px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 16px; }
.hero-label { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.hero-label::before { content: ""; width: 22px; height: 2px; background: var(--accent); }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: 20px; }
.hero h1 em { color: var(--accent); font-style: italic; font-weight: 400; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 34em; }
.cta-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.cta-row.center { justify-content: center; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 500; font-size: .95rem; background: var(--surface); transition: transform .15s, border-color .15s; }
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Placeholders (delete once real images are in) ---------- */
.placeholder { background: var(--ph); border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); display: grid; place-items: center; text-align: center; font-size: .9rem; min-height: 180px; }
.placeholder small { opacity: .7; font-size: .75rem; }
.placeholder.round { aspect-ratio: 1; border-radius: 50%; max-width: 340px; margin-left: auto; }
.placeholder.tall { min-height: 320px; }
.hero-photo img { aspect-ratio: 1; object-fit: cover; border-radius: 50%; max-width: 340px; margin-left: auto; }
.todo { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; font-size: .88rem; margin-top: 12px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats div { background: var(--surface); padding: 22px; }
.stats strong { display: block; font-family: var(--serif); font-size: 2rem; color: var(--accent); }
.stats span { color: var(--muted); font-size: .88rem; }

/* ---------- Sections ---------- */
.section { padding-top: 96px; }
.section h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin-bottom: 32px; }
.num { font-family: var(--sans); font-size: .85rem; color: var(--accent); vertical-align: middle; margin-right: 10px; letter-spacing: .05em; }
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; }
.two-col p + p { margin-top: 14px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline > li { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 0 0 36px 28px; position: relative; }
.timeline > li::before { content: ""; position: absolute; left: -8px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.when { color: var(--muted); font-size: .88rem; padding-top: 3px; }
.what h3 { font-size: 1.25rem; }
.what h3 span { color: var(--accent); }
.where { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.what ul { padding-left: 18px; }
.what li { margin-top: 6px; }

/* ---------- Work cards ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 15px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .88rem; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 8px; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px -12px rgb(0 0 0 / .18); }
.card.hidden { display: none; }
.card-img { min-height: 150px; margin: -6px -6px 6px; }
.tag { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.card h3 { font-size: 1.15rem; }
.card p { color: var(--muted); font-size: .93rem; }
.link { margin-top: auto; color: var(--accent); font-weight: 500; text-decoration: none; font-size: .92rem; }

/* ---------- Education ---------- */
.edu { display: grid; gap: 20px; }
.edu-item { display: grid; grid-template-columns: 80px 1fr; gap: 20px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.logo-ph { min-height: 80px; font-size: .7rem; }
.edu-item h3 { font-size: 1.15rem; }

/* ---------- Life ---------- */
.intro { max-width: 40em; margin-bottom: 28px; }
.hobbies { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.hobby { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.hobby span { font-size: 1.8rem; }
.hobby h4 { margin: 8px 0 4px; }
.hobby p { color: var(--muted); font-size: .9rem; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 12px; }
.gallery > * { min-height: 0; height: 100%; }
.gallery .wide { grid-column: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; padding-bottom: 40px; }
.contact h2 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 12px; }
.contact p { color: var(--muted); }
.footer { border-top: 1px solid var(--line); padding: 28px 20px; color: var(--muted); font-size: .85rem; text-align: center; margin-top: 60px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } html { scroll-behavior: auto; } }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; margin-left: auto; }
  .section-bar { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; gap: 4px; padding: 10px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px -18px rgb(0 0 0 / .35); }
  .section-bar.open { display: flex; }
  .sb-chip { padding: 11px 14px; border-radius: 10px; font-size: 1rem; }
  .hero, .two-col { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .hero-photo { order: -1; }
  .placeholder.round, .hero-photo img { max-width: 200px; margin: 0; }
  .stats, .hobbies { grid-template-columns: repeat(2, 1fr); }
  .timeline > li { grid-template-columns: 1fr; gap: 4px; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
}

/* ---------- Longer-form copy ---------- */
.prose p { max-width: 38em; }
.story { margin: 4px 0 10px; max-width: 42em; }
.what ul { color: var(--muted); }
.what ul b { color: var(--text); font-weight: 600; }

/* ---------- My story ---------- */
.story-intro { font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.45; align-self: center; }
.story-intro strong { color: var(--accent); font-weight: 600; }
.chapters { list-style: none; margin-top: 48px; display: grid; gap: 0; counter-reset: ch; }
.chapter { display: grid; grid-template-columns: 170px 1fr; column-gap: 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.ch-when { grid-row: span 2; color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; padding-top: 6px; }
.chapter h3 { font-size: 1.45rem; margin-bottom: 8px; }
.chapter p:not(.ch-when) { color: var(--muted); max-width: 44em; }
.sub { font-size: 1.4rem; margin: 40px 0 18px; }
.traits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.trait { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.trait span { font-size: 1.6rem; }
.trait h4 { margin: 8px 0 4px; }
.trait p { color: var(--muted); font-size: .9rem; }
@media (max-width: 820px) {
  .chapter { grid-template-columns: 1fr; }
  .ch-when { grid-row: auto; padding: 0 0 4px; }
  .traits { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .traits { grid-template-columns: 1fr; } }
.chapter strong { color: var(--accent); font-weight: 600; }

/* ---------- Article pages (case studies, blog posts) ---------- */
.article-bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.article-bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.back { text-decoration: none; color: var(--muted); font-size: .92rem; }
.back:hover { color: var(--accent); }
.article { max-width: 820px; margin: 0 auto; padding: 64px 20px 40px; }
.article .eyebrow { margin-bottom: 12px; }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 16px; }
.article .lede { margin-bottom: 8px; }
.article h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 56px 0 14px; }
.article h3 { font-size: 1.15rem; margin-bottom: 6px; }
.article p { margin-top: 12px; }
.article p.muted, .article .card p { margin-top: 4px; }
.article ul, .article ol { padding-left: 20px; margin-top: 10px; }
.article li { margin-top: 6px; }
.article figure { margin: 24px 0 0; }
.article figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: #14213d; }
.article figcaption { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.grid { display: grid; gap: 14px; margin-top: 18px; }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.box h3 { font-size: 1.05rem; }
.box p { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.box.hl { border-color: var(--accent); }
.flow { display: grid; gap: 10px; margin-top: 18px; }
.flow .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.flow .in { font-size: .85rem; color: var(--muted); text-align: center; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.flow .arrow { text-align: center; color: var(--accent); line-height: 1; }
.chain { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.chain .st { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: .88rem; font-weight: 500; }
.chain .by { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.chain i { color: var(--muted); font-style: normal; }
.funnel { margin-top: 18px; display: grid; gap: 10px; }
.funnel div { display: grid; grid-template-columns: 1fr 48px; align-items: center; gap: 12px; }
.funnel span { display: block; background: var(--accent); color: #fff; border-radius: 8px; padding: 8px 12px; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel b { font-family: var(--serif); font-size: 1.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .85rem; color: var(--muted); }
.pull { font-family: var(--serif); font-size: 1.35rem; line-height: 1.4; border-left: 3px solid var(--accent); padding-left: 18px; margin-top: 28px; }
.impact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.impact .box strong { display: block; font-family: var(--serif); font-size: 1.25rem; color: var(--accent); margin-bottom: 4px; }
@media (max-width: 720px) {
  .grid.g2, .grid.g3, .impact, .flow .row3 { grid-template-columns: 1fr; }
  .flow .in:not(:first-child) { display: none; }
}
.card-img.thumb { min-height: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #14213d; }
.card-img.thumb img { width: 100%; height: 150px; object-fit: cover; object-position: left top; }
.card .link + .link { margin-top: 0; }
.mini-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.mini-stats b { color: var(--accent); font-family: var(--serif); font-size: 1.1rem; }
.edu-logo { width: 80px; height: 80px; object-fit: contain; background: #fff; border-radius: 50%; padding: 6px; border: 1px solid var(--line); }
.hobby { display: flex; flex-direction: column; padding: 12px 12px 18px; }
.hobby h4 { margin: 12px 6px 4px; }
.hobby p { margin: 0 6px; }
.hobby-img { aspect-ratio: 4 / 3; min-height: 0; border-radius: 10px; overflow: hidden; }
.hobby-img img { width: 100%; height: 100%; object-fit: cover; object-position: 75% 60%; }
.hobby p.credit { margin-top: auto; padding-top: 10px; font-size: .7rem; opacity: .75; }
.credit a { color: inherit; }
.menu-current { white-space: nowrap; }
.hobbies { grid-template-columns: repeat(3, 1fr); }
.collage { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 3fr 2fr; gap: 3px; }
.collage img { width: 100%; height: 100%; object-fit: cover; object-position: center; min-height: 0; }
.collage .c-wide { grid-column: span 2; }
@media (max-width: 820px) { .hobbies { grid-template-columns: 1fr; } }
.edu-logo-fill { padding: 2px; }
.hero-photo img { width: 100%; height: auto; border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line), 0 20px 40px -20px rgb(0 0 0 / .35); }
.candid { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 5; max-height: 460px; }
.candid img { width: 100%; height: 100%; object-fit: cover; object-position: 22% 40%; }
@media (max-width: 820px) { .candid { aspect-ratio: 4 / 3; } .candid img { object-position: 20% 35%; } }
button.btn { font: inherit; font-weight: 500; font-size: .95rem; color: inherit; cursor: pointer; }
