:root {
  --bg: #f7f7f5; --surface: #ffffff; --ink: #121316; --muted: #62656e; --line: #e4e4e0; --soft: #efefec;
  --accent: #9a6b1f; --ok: #22a06b;
  --font: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --radius-lg: 28px; --radius: 18px;
  --shadow: 0 24px 60px -30px rgba(18,19,22,.35);
  color-scheme: light;
}
:root[data-theme="dark"] { --bg: #0c0d10; --surface: #15171c; --ink: #f2f2ef; --muted: #9a9ca6; --line: #262931; --soft: #1b1e24; --accent: #d9b26a; --shadow: 0 24px 60px -30px rgba(0,0,0,.9); color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0c0d10; --surface: #15171c; --ink: #f2f2ef; --muted: #9a9ca6; --line: #262931; --soft: #1b1e24; --accent: #d9b26a; --shadow: 0 24px 60px -30px rgba(0,0,0,.9); color-scheme: dark; }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background .3s ease, color .3s ease; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 46rem; }

/* top bar + header */
.topbar { display: flex; gap: 2rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); padding: .9rem 0; border-bottom: 1px solid var(--line); }
.topbar b { color: var(--ink); font-weight: 600; }
.topbar .live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: .45rem; vertical-align: 1px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; }
.wordmark { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.04em; text-decoration: none; }
.wordmark span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem; }
.nav a { text-decoration: none; font-size: .9rem; font-weight: 600; color: var(--muted); padding: .45rem .9rem; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--soft); }
.head-actions { display: flex; align-items: center; gap: .6rem; }
.theme { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.theme svg { width: 18px; height: 18px; }
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; } :root[data-theme="dark"] .theme .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .sun { display: block; } :root:not([data-theme="light"]) .theme .moon { display: none; } }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.25rem; border-radius: 999px; font-weight: 700; font-size: .92rem; text-decoration: none; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); transition: transform .15s ease; }
.btn:hover { color: var(--bg); transform: translateY(-2px); }
.btn.line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.line:hover { color: var(--ink); border-color: var(--ink); }

/* hero */
.hero { padding: 5.5rem 0 4rem; }
.hero h1 { font-size: clamp(2.8rem, 8.2vw, 7rem); font-weight: 800; line-height: .98; letter-spacing: -0.055em; }
.hero h1 .muted { color: var(--muted); }
.rotator { display: inline-grid; vertical-align: top; }
.rotator span { grid-area: 1 / 1; color: var(--accent); opacity: 0; transform: translateY(-.25em); transition: opacity .2s ease, transform .2s ease; white-space: nowrap; }
.rotator span.on { opacity: 1; transform: none; transition: opacity .45s ease .2s, transform .45s cubic-bezier(.2,.8,.2,1) .2s; }
.hero-points { margin-top: 3.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; list-style: none; }
.hero-points li { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.hero-points b { display: block; font-size: 1.05rem; letter-spacing: -0.01em; }
.hero-points span { color: var(--muted); font-size: .97rem; }
.hero .ctas { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2.5rem; }

/* statement with photo */
.statement { display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; align-items: center; padding: 5rem 0 2rem; border-top: 1px solid var(--line); }
.statement h2 { font-size: clamp(1.8rem, 3.8vw, 3rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.035em; }
.statement h2 em { font-style: normal; color: var(--muted); }
.statement .photo { aspect-ratio: 4 / 5; border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* section heads */
section.block { padding-top: 6rem; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.sec-head h2 { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 800; letter-spacing: -0.055em; line-height: .95; }
.sec-head h2 span { color: var(--accent); }
.sec-head p { color: var(--muted); max-width: 26rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.filters button { font: inherit; font-weight: 600; font-size: .88rem; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.count { font-size: .85rem; color: var(--muted); margin-bottom: 1.5rem; }

/* case studies */
.case { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.25rem, 3vw, 2.25rem); margin-bottom: 1.5rem; }
.case[hidden] { display: none; }
.case-top { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: start; }
.case h3 { font-size: clamp(1.5rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.12; max-width: 44rem; }
.case h3 b { font-weight: 800; }
.case h3 .rest { color: var(--muted); font-weight: 600; }
.tags { display: flex; gap: .4rem; flex-wrap: wrap; list-style: none; margin-top: .9rem; }
.tags li { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--soft); padding: .25rem .65rem; border-radius: 999px; }
.status { font-size: .8rem; font-weight: 700; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.status.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.status.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: .4rem; vertical-align: 1px; }

.stage { position: relative; margin-top: 1.5rem; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 7.5; background: var(--soft) center / cover no-repeat; }
.stage.top { background-position: top center; }
.stage::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,11,14,0) 40%, rgba(10,11,14,.55)); }
.stage.g1 { background-image: radial-gradient(120% 120% at 10% 0%, #f3dca6 0%, #b8862d 38%, #1a140b 100%); }
.stage.g2 { background-image: radial-gradient(120% 120% at 90% 10%, #c9a6a0 0%, #6e3b3f 40%, #140d10 100%); }
.stage.g3 { background-image: radial-gradient(120% 120% at 20% 100%, #6fe3c1 0%, #1d8a7a 40%, #0d1f24 100%); }
.prompt { position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%); width: min(92%, 34rem); display: flex; align-items: center; gap: .75rem; background: rgba(255,255,255,.94); color: #121316; border-radius: 999px; padding: .75rem .85rem .75rem 1.25rem; font-size: .95rem; font-weight: 500; box-shadow: 0 20px 40px -20px rgba(0,0,0,.6); }
.prompt .txt { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.prompt .typed { border-right: 2px solid #121316; padding-right: 2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { border-color: transparent; } }
.prompt .go { width: 34px; height: 34px; border-radius: 50%; background: #121316; display: flex; align-items: center; justify-content: center; flex: none; }
.prompt .go i { width: 5px; height: 5px; border-radius: 50%; background: #fff; margin: 0 1.5px; display: inline-block; animation: blink 1.2s infinite; }
.prompt .go i:nth-child(2) { animation-delay: .2s; } .prompt .go i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }
.stage .big-stat { position: absolute; right: 1.5rem; top: 1.25rem; text-align: right; color: #fff; font-weight: 800; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.05em; line-height: 1; text-shadow: 0 4px 24px rgba(0,0,0,.35); }
.stage .big-stat small { display: block; font-size: .8rem; font-weight: 600; letter-spacing: 0; opacity: .9; margin-top: .2rem; }

.case-body { display: grid; grid-template-columns: .9fr 1.1fr; gap: 2rem; margin-top: 1.75rem; }
.facts-list { display: grid; gap: .9rem; align-content: start; }
.facts-list div { font-size: .95rem; }
.facts-list dt { font-size: .78rem; font-weight: 700; color: var(--muted); }
.facts-list dd { margin-top: .1rem; }
.facts-list .outcome { font-weight: 600; }
.facts-list a { font-weight: 700; }
.points { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; list-style: none; }
.points li { background: var(--soft); border-radius: var(--radius); padding: 1.1rem 1.15rem; }
.points h4 { font-size: 1rem; letter-spacing: -0.01em; }
.points p { font-size: .9rem; color: var(--muted); margin-top: .3rem; line-height: 1.5; }

/* about */
.about { display: grid; grid-template-columns: .85fr 1.15fr; gap: 3rem; }
.about .photos { position: relative; min-height: 32rem; }
.about .photos .p1 { position: absolute; left: 0; top: 0; width: 70%; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.about .photos .p2 { position: absolute; right: 0; bottom: 0; width: 58%; aspect-ratio: 4 / 3; border-radius: var(--radius); border: 6px solid var(--bg); box-shadow: var(--shadow); }
.about h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; }
.about .bio { color: var(--muted); margin-top: 1.25rem; }
.about .bio + .bio { margin-top: .9rem; }
.journey { list-style: none; margin-top: 2.25rem; border-top: 1px solid var(--line); }
.journey li { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.journey b { font-size: 1rem; }
.journey span { color: var(--muted); font-size: .9rem; }
.journey time { color: var(--muted); font-size: .9rem; grid-row: span 2; align-self: center; white-space: nowrap; }

/* stack */
.stack-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; list-style: none; }
.stack-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem .9rem; text-align: center; font-weight: 700; font-size: .92rem; letter-spacing: -0.01em; transition: transform .2s ease, border-color .2s ease; }
.stack-grid li:hover { transform: translateY(-3px); border-color: var(--ink); }
.stack-grid li small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); margin-top: .15rem; }

/* blog */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; list-style: none; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.post-card .cover { aspect-ratio: 16 / 10; background: var(--soft) center / cover no-repeat; position: relative; }
.post-card .cover.fallback { display: grid; place-items: center; font-size: 3.2rem; font-weight: 800; color: #fff; background-image: radial-gradient(120% 120% at 90% 10%, #8fa3b8 0%, #34465c 40%, #0f141b 100%); }
.post-card .cover.fallback.health { background-image: radial-gradient(120% 120% at 10% 0%, #f3dca6 0%, #b8862d 38%, #1a140b 100%); }
.post-card .pill { position: absolute; left: .9rem; top: .9rem; font-size: .72rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; background: rgba(255,255,255,.94); color: #121316; }
.post-card .meta { padding: 1.1rem 1.2rem 1.35rem; }
.post-card time { font-size: .8rem; color: var(--muted); }
.post-card .t { display: block; font-weight: 700; font-size: 1.12rem; line-height: 1.3; letter-spacing: -0.02em; margin-top: .3rem; }
.post-card a:hover .t { color: var(--accent); }
.post-card .summary { display: block; color: var(--muted); font-size: .9rem; margin-top: .45rem; line-height: 1.5; }
.empty { color: var(--muted); padding: 1.5rem 0; grid-column: 1 / -1; }

/* contact */
.contact { margin-top: 7rem; background: var(--ink); color: var(--bg); border-radius: var(--radius-lg); padding: clamp(2rem, 6vw, 4.5rem); }
.contact h2 { font-size: clamp(2.4rem, 7vw, 5rem); font-weight: 800; letter-spacing: -0.055em; line-height: .95; }
.contact h2 span { color: var(--accent); }
.contact p { color: color-mix(in srgb, var(--bg) 70%, transparent); margin-top: 1.25rem; max-width: 32rem; font-size: 1.1rem; }
.contact .row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.contact .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.contact .btn:hover { color: var(--ink); }
.contact .btn.line { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.contact .btn.line:hover { color: var(--bg); border-color: var(--bg); }
.site-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 2.5rem 0; color: var(--muted); font-size: .875rem; }

/* protected photos */
.protected { background-color: var(--soft); background-position: center; background-size: cover; background-repeat: no-repeat; position: relative; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.protected::after { content: ""; position: absolute; inset: 0; }

/* scroll reveal */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; } .rv { opacity: 1; transform: none; transition: none; }
  .topbar .live::before, .prompt .typed, .prompt .go i { animation: none; }
  .rotator span { transition: none; }
}

/* post page */
.post { padding: 2.5rem 0 0; }
.post .back { font-size: .92rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.post header { margin: 2rem 0; }
.post h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; }
.post .meta { color: var(--muted); margin-top: 1rem; font-size: .95rem; }
.post-cover { aspect-ratio: 16 / 9; border-radius: 22px; margin-bottom: 2.5rem; }
.prose { font-size: 1.1rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; margin: 2em 0 0; }
.prose h3 { font-size: 1.15rem; margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--soft); padding: .05em .35em; border-radius: 5px; }
.prose pre { background: var(--soft); padding: 1rem 1.2rem; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--muted); }
.prose img { max-width: 100%; border-radius: 12px; }
.signoff { margin-top: 2.5rem; font-weight: 700; color: var(--accent); }

/* responsive */
@media (max-width: 960px) {
  .nav { display: none; }
  .hero-points { grid-template-columns: 1fr; }
  .statement, .about, .case-body { grid-template-columns: 1fr; }
  .statement .photo { max-width: 420px; }
  .stack-grid { grid-template-columns: repeat(3, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .about .photos { min-height: 28rem; max-width: 480px; }
}
@media (max-width: 600px) {
  .topbar .hide-sm { display: none; }
  .hero { padding-top: 3rem; }
  .stage { aspect-ratio: 4 / 3.6; }
  .points { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: 1fr; }
  .about .photos { min-height: 24rem; }
  .prompt { font-size: .85rem; bottom: 1rem; }
  .stage .big-stat { right: 1rem; top: 1rem; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .rotator span { white-space: normal; }
}

/* fly-through on scroll */
.fly { will-change: transform, opacity; transform-origin: 50% 100%; }
.hero h1 { will-change: transform, opacity; transform-origin: 0 50%; }
