/* ---------- Tokens ---------- */
:root {
  --bg: #f6f1e7;
  --bg-2: #efe7d8;
  --card: #fffaf0;
  --ink: #1d1a16;
  --muted: #6b6257;
  --line: #ddd2bf;
  --accent: #e2552b;
  --accent-ink: #fff;
  --green: #2f6b4f;
  --gold: #c58a1c;
  --shadow: 0 20px 50px -25px rgba(60, 40, 10, .35);
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 22px;
  --wrap: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110f; --bg-2: #1b1714; --card: #1e1a17; --ink: #f2eadc; --muted: #a2988a;
    --line: #322b25; --accent: #ff7a4d; --accent-ink: #1a0d07; --green: #7fc8a0; --gold: #e9b75a;
    --shadow: 0 20px 50px -25px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  --bg: #14110f; --bg-2: #1b1714; --card: #1e1a17; --ink: #f2eadc; --muted: #a2988a;
  --line: #322b25; --accent: #ff7a4d; --accent-ink: #1a0d07; --green: #7fc8a0; --gold: #e9b75a;
  --shadow: 0 20px 50px -25px rgba(0, 0, 0, .8);
}

/* ---------- Base ---------- */
@view-transition { navigation: auto; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.65 var(--sans); overflow-x: hidden;
  transition: background .4s, color .4s;
}
body::before { /* paper grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 8vw, 6rem); }
h2 { font-size: clamp(2rem, 5vw, 3.4rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; }
em { font-family: var(--serif); font-style: italic; color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
section { padding: clamp(56px, 9vw, 120px) 0; }
.eyebrow { font: 500 .78rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.lead { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.split { display: grid; gap: clamp(28px, 5vw, 70px); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 880px) { .split { grid-template-columns: 5fr 7fr; } .split.rev { grid-template-columns: 7fr 5fr; } }

/* ---------- Reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Header ---------- */
.nav { position: fixed; top: 14px; left: 50%; translate: -50% 0; z-index: 50; width: min(var(--wrap), 100% - 24px);
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 20px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); transition: transform .4s, background .4s; }
.nav.hide { transform: translateY(-140%); }
.logo { font: 600 1.35rem var(--serif); text-decoration: none; margin-right: auto; letter-spacing: -.03em; }
.logo span { color: var(--accent); display: inline-block; animation: bounce 2.4s infinite; }
@keyframes bounce { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-6px); } 90% { transform: translateY(1px); } }
.nav nav { display: flex; gap: 2px; }
.nav nav a { text-decoration: none; font-size: .93rem; padding: 8px 14px; border-radius: 999px; color: var(--muted); transition: .25s; }
.nav nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav nav a.on { color: var(--accent-ink); background: var(--accent); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 1rem; transition: transform .3s; }
.icon-btn:hover { transform: rotate(20deg) scale(1.06); }
.burger { display: none; }
@media (max-width: 800px) {
  .burger { display: grid; }
  .nav nav { position: fixed; top: 62px; left: 0; right: 0; flex-direction: column; padding: 14px; gap: 4px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
    opacity: 0; pointer-events: none; transform: translateY(-10px) scale(.98); transition: .3s; }
  .nav.open nav { opacity: 1; pointer-events: auto; transform: none; }
  .nav nav a { font: 500 1.5rem var(--serif); padding: 12px 18px; color: var(--ink); }
}

/* ---------- Buttons / chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px; text-decoration: none; font-weight: 500; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; font-family: inherit; font-size: 1rem; transition: transform .25s, box-shadow .25s, background .25s; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -12px var(--ink); }
.btn .arr { transition: transform .25s; }
.btn:hover .arr { transform: translateX(5px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.hot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.chips li, .chip { font: 400 .74rem var(--mono); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--bg); transition: .2s; }
.chips li:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.link { color: var(--accent); text-decoration: none; font-weight: 500; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s; }
.link:hover { background-size: 100% 1px; }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; position: relative; padding: 120px 0 90px; }
.hero canvas { position: absolute; inset: auto 0 0 0; width: 100%; height: 46%; pointer-events: none; }
.hero .wrap { position: relative; }
.hello { display: inline-flex; align-items: center; gap: 10px; font: 400 .85rem var(--mono); padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; margin-bottom: 28px; background: var(--card); }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.6s infinite; }
@keyframes wave { 0%, 60%, 100% { rotate: 0deg; } 10%, 30% { rotate: 16deg; } 20%, 40% { rotate: -8deg; } }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: block; animation: rise 1s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * .12s + .1s); }
@keyframes rise { from { transform: translateY(110%); } }
.rot { color: var(--accent); font-style: italic; display: inline-block; min-width: 4ch; }
.rot::after { content: ""; display: inline-block; width: 3px; height: .8em; background: currentColor; margin-left: 4px; animation: blink 1s steps(2) infinite; vertical-align: baseline; }
@keyframes blink { 50% { opacity: 0; } }
.hero .lead { margin: 26px 0 34px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.page-hero { padding: clamp(130px, 18vw, 200px) 0 clamp(30px, 5vw, 60px); }
.page-hero h1 { font-size: clamp(2.5rem, 7.5vw, 5.2rem); max-width: 14ch; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; background: var(--bg-2); }
.marquee div { display: flex; gap: 44px; width: max-content; animation: slide 38s linear infinite; font: 500 1.5rem var(--serif); font-style: italic; white-space: nowrap; }
.marquee:hover div { animation-play-state: paused; }
.marquee span::after { content: "✺"; margin-left: 44px; color: var(--accent); font-style: normal; font-size: 1rem; vertical-align: middle; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 34px); position: relative; overflow: hidden; transition: transform .35s, box-shadow .35s, border-color .35s; transform-style: preserve-3d; }
.card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card::after { content: ""; position: absolute; width: 260px; height: 260px; left: var(--mx, -300px); top: var(--my, -300px); translate: -50% -50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%); pointer-events: none; }
.card > * { position: relative; z-index: 1; }
.card .num { font: 400 .8rem var(--mono); color: var(--accent); margin-bottom: 18px; display: block; }
.card p:last-child { margin-bottom: 0; }
.emoji { font-size: 2rem; display: inline-block; margin-bottom: 14px; transition: transform .4s; }
.card:hover .emoji { transform: scale(1.2) rotate(-8deg); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stat { padding: 22px; border-radius: var(--radius); border: 1px dashed var(--line); }
.stat b { font: 500 clamp(2.4rem, 6vw, 3.6rem)/1 var(--serif); display: block; color: var(--accent); }
.stat span { font-size: .9rem; color: var(--muted); }
.note { border-left: 3px solid var(--accent); padding: 6px 0 6px 22px; font: italic 400 clamp(1.2rem, 2.4vw, 1.6rem)/1.4 var(--serif); margin: 30px 0; }
.avatar { aspect-ratio: 1; max-width: 340px; width: 100%; display: grid; place-items: center; font: 500 6rem var(--serif); color: var(--accent-ink);
  background: conic-gradient(from 120deg, var(--accent), var(--gold), var(--green), var(--accent)); animation: blob 12s ease-in-out infinite; }
@keyframes blob { 0%, 100% { border-radius: 58% 42% 55% 45% / 48% 60% 40% 52%; } 33% { border-radius: 42% 58% 38% 62% / 60% 40% 60% 40%; } 66% { border-radius: 50% 50% 62% 38% / 40% 55% 45% 60%; } }

/* ---------- Timeline ---------- */
.tl { position: relative; padding-left: 34px; }
.tl-line { position: absolute; left: 8px; top: 8px; bottom: 0; width: 2px; background: var(--line); }
.tl-line i { position: absolute; inset: 0; background: var(--accent); transform-origin: top; transform: scaleY(var(--p, 0)); }
.tl-item { position: relative; padding-bottom: clamp(40px, 6vw, 70px); }
.tl-item::before { content: ""; position: absolute; left: -33px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); transition: .4s; }
.tl-item.in::before { background: var(--accent); box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 20%, transparent); }
.tl-date { font: 400 .8rem var(--mono); color: var(--muted); }
.tl-item h3 { margin: 6px 0 2px; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.tl-role { color: var(--accent); font-weight: 500; margin-bottom: 18px; }
.proj { margin-top: 16px; }
.proj h4 { margin-bottom: 4px; }
.proj ul:not(.chips) { padding-left: 1.1em; margin: 14px 0 0; }
.proj ul:not(.chips) li { margin-bottom: 9px; }
.proj ul:not(.chips) li::marker { color: var(--accent); content: "→  "; }
.row { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.rows { border-top: 1px solid var(--line); }
.rows > div { padding: 20px 0; border-bottom: 1px solid var(--line); transition: padding .3s; }
.rows > div:hover { padding-left: 12px; }
.rows b { font: 500 1.2rem var(--serif); }

/* ---------- Work ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.filters button { font: 500 .9rem var(--sans); padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; transition: .25s; }
.filters button.on, .filters button:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.work { display: flex; flex-direction: column; }
.work .badge { align-self: flex-start; font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); margin-bottom: 18px; }
.work .big { font: 500 2.6rem/1 var(--serif); color: var(--accent); margin: 8px 0 14px; }
.work .chips { margin-top: auto; padding-top: 16px; }
.work.gone { display: none; }
.work .meta { font: 400 .78rem var(--mono); color: var(--muted); margin-bottom: 8px; }

/* ---------- Off the clock ---------- */
.eq { display: flex; gap: 5px; align-items: flex-end; height: 44px; margin-bottom: 16px; }
.eq i { width: 7px; background: var(--accent); border-radius: 3px; animation: eq 1s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.23s); height: 30%; }
@keyframes eq { to { height: 100%; } }
.seq { overflow-x: auto; padding-bottom: 6px; }
.seq-row { display: grid; grid-template-columns: 64px repeat(16, minmax(24px, 1fr)); gap: 5px; margin-bottom: 5px; align-items: center; min-width: 560px; }
.seq-row > span { font: 400 .75rem var(--mono); color: var(--muted); }
.step { aspect-ratio: 1; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; padding: 0; transition: transform .12s, background .15s; }
.step:nth-child(4n+2) { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.step.on { background: var(--accent); border-color: var(--accent); }
.step.now { transform: scale(1.18); box-shadow: 0 0 0 2px var(--gold); }
.seq-ctl { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 18px; }
.seq-ctl label { font: 400 .8rem var(--mono); color: var(--muted); display: flex; gap: 10px; align-items: center; }
input[type=range] { accent-color: var(--accent); }
.piano { position: relative; height: clamp(150px, 26vw, 230px); display: flex; user-select: none; touch-action: none; border-radius: 0 0 14px 14px; overflow: hidden; border-top: 8px solid var(--accent); box-shadow: var(--shadow); }
.key { flex: 1; background: #fffdf7; border: 1px solid #cdbfa8; border-top: 0; border-radius: 0 0 8px 8px; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; font: 400 .7rem var(--mono); color: #9a8d7a; transition: background .1s, transform .1s; transform-origin: top; }
.key.black { position: absolute; top: 0; width: 6.2%; height: 60%; background: #1d1a16; border-color: #000; color: #8f8474; z-index: 2; flex: none; translate: -50% 0; }
.key.down { background: var(--accent); color: #fff; transform: scaleY(.98); }
.trail { position: relative; }
.trail svg { width: 100%; height: auto; display: block; overflow: visible; }
.trail .ridge { fill: none; stroke: var(--line); stroke-width: 2; }
.trail .path { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; }
.trail .hill { fill: color-mix(in srgb, var(--green) 12%, transparent); }
.trail circle { fill: var(--accent); }
.trail text { font: 400 13px var(--mono); fill: var(--muted); }

/* ---------- Footer ---------- */
footer { background: var(--ink); color: var(--bg); border-radius: 40px 40px 0 0; padding: clamp(60px, 9vw, 110px) 0 30px; margin-top: 40px; }
footer .eyebrow { color: var(--accent); }
footer h2 { font-size: clamp(2.4rem, 8vw, 5.6rem); }
footer .mail { font: 500 clamp(1.1rem, 3.4vw, 2rem) var(--serif); font-style: italic; color: var(--accent); text-decoration: none; display: inline-block; border-bottom: 1px solid; margin: 10px 0 40px; transition: letter-spacing .4s; word-break: break-all; }
footer .mail:hover { letter-spacing: .02em; }
.foot { display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between; border-top: 1px solid color-mix(in srgb, var(--bg) 20%, transparent); padding-top: 24px; font: 400 .8rem var(--mono); opacity: .75; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
