/* Home page and 404. Light by default from the OS, dark from the OS or html[data-theme]. Fonts come from fonts.css;
   only the roman faces are used here, so the 149 KB italic file is never requested. */
:root {
  --bg: #f6f1e8;
  --bg-2: #efe7da;
  --card: #fffaf2;
  --ink: #16130f;
  --ink-2: #4a433a;
  --muted: #6b6257;
  --line: rgba(22, 19, 15, .12);
  --line-2: rgba(22, 19, 15, .22);
  --ember: #c2410c;
  --ember-soft: rgba(194, 65, 12, .10);
  --glow: rgba(255, 106, 42, .22);
  --shadow: 0 1px 2px rgba(22, 19, 15, .05), 0 12px 32px -16px rgba(22, 19, 15, .22);
  --serif: var(--ff-display, 'Fraunces', 'Fraunces Fallback', Georgia, serif);
  --sans: var(--ff-body, 'Instrument Sans', 'Instrument Sans Fallback', 'Avenir Next', 'Segoe UI', sans-serif);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --wrap: 72rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d10; --bg-2: #11141a; --card: #141820; --ink: #f4ead8; --ink-2: #d6cbb8; --muted: #9a9082;
    --line: rgba(244, 234, 216, .10); --line-2: rgba(244, 234, 216, .22);
    --ember: #ff7a3d; --ember-soft: rgba(255, 122, 61, .12); --glow: rgba(255, 106, 42, .20);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d10; --bg-2: #11141a; --card: #141820; --ink: #f4ead8; --ink-2: #d6cbb8; --muted: #9a9082;
  --line: rgba(244, 234, 216, .10); --line-2: rgba(244, 234, 216, .22);
  --ember: #ff7a3d; --ember-soft: rgba(255, 122, 61, .12); --glow: rgba(255, 106, 42, .20);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ember); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
html:not(.js) .needs-js { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.muted { color: var(--muted); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 1.5rem; height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; background: var(--ink); color: var(--bg); font: 500 .95rem/1 var(--serif); }
.nav { display: flex; gap: 1.4rem; margin-left: auto; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ember); }
.theme { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.theme:hover { border-color: var(--ember); color: var(--ember); }
.theme-icon { width: 1rem; height: 1rem; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px currentColor; }
@media (max-width: 760px) {
  .nav { gap: 1rem; font-size: .9rem; }
  .nav a[href="#cases"], .nav a[href="#experience"] { display: none; }
  .brand-name { display: none; }
}

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(4rem, 12vw, 9rem) 0 clamp(3rem, 8vw, 6rem); border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: -30% -10% auto auto; width: min(70vw, 52rem); aspect-ratio: 1; background: radial-gradient(closest-side, var(--glow), transparent 70%); pointer-events: none; }
.hero-in { position: relative; }
.kicker { display: inline-flex; align-items: center; gap: .6rem; font: 500 .8rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.6rem; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px var(--ember-soft); }
h1 { font-size: clamp(3.4rem, 11vw, 8.5rem); letter-spacing: -.035em; line-height: .95; font-weight: 300; }
h1 em { font-style: normal; color: var(--ember); }
.hero-lead { max-width: 38rem; margin-top: 2rem; font-size: clamp(1.15rem, 2.2vw, 1.4rem); line-height: 1.5; color: var(--ink-2); }
.hero-tag { font: 300 clamp(1.1rem, 2vw, 1.3rem)/1.4 var(--serif); color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0 0; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.15rem; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font: 500 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.btn:hover { border-color: var(--ember); color: var(--ember); }
.btn-solid { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--ember); border-color: var(--ember); color: #fff; }
.stats { list-style: none; padding: 0; margin: clamp(3rem, 7vw, 5rem) 0 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stats li { padding: 1.25rem 1.25rem 0 0; }
.stats li + li { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.stats b { display: block; font: 300 clamp(2rem, 4vw, 2.8rem)/1 var(--serif); letter-spacing: -.02em; }
.stats span { display: block; margin-top: .5rem; font-size: .88rem; color: var(--muted); line-height: 1.35; }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats li:nth-child(3) { padding-left: 0; border-left: 0; }
}

/* Sections */
.sec { padding: clamp(4rem, 10vw, 7rem) 0; border-bottom: 1px solid var(--line); }
.sec-alt { background: var(--bg-2); }
.num { font: 500 .8rem/1 var(--mono); letter-spacing: .08em; color: var(--ember); margin-bottom: 1rem; }
h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.025em; }
.sec-head-row { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 1.25rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.sec-head-row .num { grid-column: 1 / -1; }
.sec-deck { margin: 0; color: var(--muted); justify-self: end; text-align: right; max-width: 26rem; }
.split { display: grid; grid-template-columns: minmax(10rem, 1fr) 2.6fr; gap: clamp(1.5rem, 5vw, 4rem); }
.prose { max-width: 42rem; color: var(--ink-2); }
.prose .big { font: 300 clamp(1.5rem, 3vw, 2.1rem)/1.25 var(--serif); color: var(--ink); letter-spacing: -.01em; margin-bottom: 1.2em; }
.prose a { color: var(--ember); }
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .sec-head-row { grid-template-columns: 1fr; }
  .sec-deck { justify-self: start; text-align: left; margin-top: .75rem; }
}

/* Work groups */
.group + .group { margin-top: clamp(3.5rem, 8vw, 5.5rem); }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; padding-bottom: 1rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.group-head h3 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.015em; }
.group-head p { margin: 0; }
.arrow { font-weight: 500; text-decoration: none; color: var(--ember); }
.arrow::after { content: " →"; }
.group-deck { max-width: 48rem; color: var(--ink-2); }
.fine { margin-top: 1.25rem; font-size: .82rem; color: var(--muted); }

.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); gap: 1rem; }
.card { position: relative; display: flex; flex-direction: column; padding: 1.4rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease; }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: var(--radius) var(--radius) 0 0; background: var(--accent, var(--ember)); opacity: .85; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent, var(--ember)) 55%, var(--line)); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.tile, .tile-img { flex: none; width: 3rem; height: 3rem; border-radius: 12px; }
.tile { display: grid; place-items: center; background: color-mix(in srgb, var(--accent, var(--ember)) 18%, var(--card)); color: color-mix(in srgb, var(--accent, var(--ember)) 70%, var(--ink)); font: 500 1.1rem/1 var(--serif); border: 1px solid color-mix(in srgb, var(--accent, var(--ember)) 35%, transparent); }
.tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; margin: 0; }
.tags span, .stack span { font: 500 .68rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: .35rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.card h4 { font-size: 1.5rem; letter-spacing: -.01em; margin-bottom: .4rem; }
.card-link { text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 2px solid var(--ember); outline-offset: 3px; }
.card-line { font-weight: 500; color: var(--ink); }
.card p { font-size: .95rem; color: var(--ink-2); }
.card .card-foot { margin: auto 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font: 500 .75rem/1.5 var(--mono); color: var(--muted); }
.card-foot a { position: relative; z-index: 1; color: var(--ember); }

.games { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .75rem; }
.games li { display: flex; gap: 1rem; align-items: center; padding: .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.games img, .games .tile { width: 3.5rem; height: 3.5rem; border-radius: 13px; flex: none; }
.games h4 { font-size: 1.1rem; margin-bottom: .2rem; }
.games h4 a { text-decoration: none; }
.games h4 a:hover { text-decoration: underline; }
.games p { margin: 0; font-size: .88rem; color: var(--muted); line-height: 1.4; }
.games .soon { border-style: dashed; }

/* Case studies */
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); gap: 1rem; }
.case { padding: clamp(1.4rem, 3vw, 2rem); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.case-meta { font: 500 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ember); }
.case h3 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); letter-spacing: -.015em; margin-bottom: 1.25rem; }
.case dl { margin: 0; display: grid; grid-template-columns: 6.5rem 1fr; gap: .7rem 1rem; font-size: .95rem; }
.case dt { font: 500 .72rem/1.9 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.case dd { margin: 0; color: var(--ink-2); }
.case dd:last-of-type { color: var(--ink); font-weight: 500; }
@media (max-width: 520px) { .case dl { grid-template-columns: 1fr; gap: .15rem; } .case dd { margin-bottom: .6rem; } }

/* Experience */
.timeline { list-style: none; padding: 0; margin: 0 0 2rem; }
.timeline li { position: relative; padding: 0 0 1.75rem 1.5rem; border-left: 1px solid var(--line-2); }
.timeline li::before { content: ""; position: absolute; left: -5px; top: .4rem; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ember); }
.timeline li:last-child { padding-bottom: 0; }
.timeline .when { font: 500 .75rem/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.timeline h3 { font-size: 1.4rem; }
.timeline .role { color: var(--ember); font-weight: 500; margin: .25rem 0 .5rem; }
.timeline p { color: var(--ink-2); max-width: 40rem; }
.stack { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 2rem; }
.links-row { display: flex; flex-wrap: wrap; gap: .6rem; }

/* Contact */
.sec-contact { text-align: center; border-bottom: 0; }
.sec-contact h2 { font-size: clamp(2.4rem, 7vw, 4.8rem); font-weight: 300; max-width: 16ch; margin: 0 auto; }
.contact-lead { max-width: 34rem; margin: 1.5rem auto 0; color: var(--ink-2); font-size: 1.1rem; }
.contact-mail { margin: 2rem 0 0; font: 300 clamp(1.6rem, 5vw, 3rem)/1.2 var(--serif); overflow-wrap: anywhere; }
.contact-mail a { color: var(--ember); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s; }
.contact-mail a:hover { background-size: 100% 1px; }
.sec-contact .hero-cta { justify-content: center; margin-bottom: 1.5rem; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 2rem 0; font-size: .88rem; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.foot p { margin: 0; }

/* 404 */
.lost { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: var(--pad); }
.lost h1 { font-size: clamp(2.6rem, 8vw, 5rem); }
.lost p { color: var(--ink-2); margin-top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
}
@media print {
  .top, .theme, .needs-js, .hero::before { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .case, .games li { box-shadow: none; break-inside: avoid; }
}
