/* ==========================================================================
   Tokens. Dark is the primary look; light follows the visitor's OS setting.
   Gradient palette: amber, coral, hibiscus, with a sea-teal counterpoint.
   ========================================================================== */
:root {
  --bg: #0b0b0c;
  --bg-raise: #121214;
  --text: #ededea;
  --muted: #94938f;
  --faint: #5f5e5b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --amber: #ffb547;
  --coral: #ff6a3d;
  --hibiscus: #ff3d7f;
  --sea: #14b8a6;
  --accent: #ff7a4d;
  --grad: linear-gradient(100deg, var(--amber), var(--coral) 45%, var(--hibiscus));

  --btn-bg: #ededea;
  --btn-text: #0b0b0c;
  --header-bg: rgba(11, 11, 12, 0.72);
  --aurora-opacity: 0.45;
  --grain-opacity: 0.07;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --header-h: 64px;
  --radius: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ee;
    --bg-raise: #fbfaf7;
    --text: #141413;
    --muted: #63615c;
    --faint: #9a978f;
    --line: rgba(20, 20, 19, 0.09);
    --line-strong: rgba(20, 20, 19, 0.18);
    --accent: #e4552a;
    --btn-bg: #141413;
    --btn-text: #f5f3ee;
    --header-bg: rgba(245, 243, 238, 0.75);
    --aurora-opacity: 0.38;
    --grain-opacity: 0.05;
  }
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  /* Sticky footer: the page is a full-height column and main absorbs the spare space. */
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  font-feature-settings: "ss01", "cv11";
}

/* Film grain over everything: keeps gradients from looking flat/digital. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  opacity: var(--grain-opacity);
  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 type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--coral); color: #fff; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0 0 1em; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 200;
  background: var(--btn-bg); color: var(--btn-text); padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.site-header.is-scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--line);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-weight: 500; letter-spacing: -0.01em; }
.brand em { font-size: 1.15em; }

.site-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.site-nav a { color: var(--muted); transition: color 0.2s ease; }
.site-nav a:hover, .site-nav a.is-active { color: var(--text); }
.site-nav .nav-cta {
  color: var(--text); padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.site-nav .nav-cta:hover { border-color: var(--text); }

.nav-toggle {
  display: none; position: relative; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; cursor: pointer;
}
.nav-toggle-bar, .nav-toggle-bar::before {
  position: absolute; left: 12px; width: 14px; height: 1.5px; background: var(--text);
  transition: transform 0.25s ease;
}
.nav-toggle-bar { top: 16px; }
.nav-toggle-bar::before { content: ""; left: 0; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(-6px) rotate(-90deg); }

/* ==========================================================================
   Shared bits
   ========================================================================== */
.meta-line {
  display: flex; align-items: center; gap: 10px; margin-bottom: 28px;
  font: 400 13px/1.4 var(--mono); color: var(--muted); letter-spacing: 0.02em;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--sea);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--sea) 60%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.display {
  font-size: clamp(2.25rem, 5vw, 4.25rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 500;
  max-width: 19ch;
}
.display em { letter-spacing: -0.02em; }

.lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--muted); max-width: 52ch; margin: 0; }
.lead a { color: var(--text); text-decoration: underline; text-decoration-color: var(--coral); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.lead a:hover { text-decoration-color: var(--amber); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.button {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-text); font-weight: 500; font-size: 15px;
  position: relative; isolation: isolate; overflow: hidden;
  transition: transform 0.2s ease, color 0.3s ease;
}
/* Gradient sweeps in on hover. */
.button::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad);
  opacity: 0; transition: opacity 0.3s ease;
}
.button:hover { transform: translateY(-1px); color: #160a05; }
.button:hover::before { opacity: 1; }

.link-arrow { display: inline-flex; gap: 8px; font-size: 15px; color: var(--text); position: relative; }
.link-arrow::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--grad);
  transform: scaleX(0.25); transform-origin: left; transition: transform 0.35s ease;
}
.link-arrow:hover::after { transform: scaleX(1); }

/* ==========================================================================
   Aurora. Soft, slowly drifting gradient light.
   ========================================================================== */
.aurora { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; opacity: var(--aurora-opacity); }
.hero .aurora { -webkit-mask-image: linear-gradient(#000 82%, transparent 100%); mask-image: linear-gradient(#000 82%, transparent 100%); }
.aurora-low { -webkit-mask-image: linear-gradient(transparent, #000 40%); mask-image: linear-gradient(transparent, #000 40%); }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(90px); mix-blend-mode: screen;
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { width: 52vw; height: 52vw; left: 38%; top: -28%; background: var(--coral); }
.aurora span:nth-child(2) { width: 38vw; height: 38vw; left: 66%; top: 6%; background: var(--hibiscus); animation-duration: 28s; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 34vw; height: 34vw; left: 50%; top: 30%; background: var(--sea); opacity: 0.6; animation-duration: 34s; animation-delay: -12s; }
@media (prefers-color-scheme: light) { .aurora span { mix-blend-mode: multiply; } }
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-6vw, 4vh, 0) scale(1.08); }
  100% { transform: translate3d(4vw, -3vh, 0) scale(0.95); }
}

/* ==========================================================================
   Hero
   ========================================================================== */
/* Fills exactly one screen (svh = small viewport height, so mobile browser bars don't crop it).
   The header overlaps the top via the negative margin; content is vertically centred. */
.hero {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  margin-top: calc(var(--header-h) * -1);
  padding: calc(var(--header-h) + 48px) 0 clamp(56px, 10vh, 112px);
  display: flex; flex-direction: column; justify-content: center;
}
.hero .display { margin-bottom: 48px; }
/* Readability over the aurora: a soft fade behind the text column, and brighter hero copy. */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 30%, color-mix(in srgb, var(--bg) 35%, transparent) 58%, transparent 78%);
}
.hero .lead { color: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.hero .meta-line { color: color-mix(in srgb, var(--text) 72%, var(--bg)); }
.scroll-cue {
  position: absolute; left: 50%; bottom: 24px; width: 1px; height: 40px; overflow: hidden;
  background: var(--line-strong);
}
.scroll-cue::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%;
  background: linear-gradient(var(--amber), var(--hibiscus));
  animation: cue 2.2s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}
@keyframes cue { to { top: 100%; } }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px 64px; flex-wrap: wrap; }


/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: clamp(80px, 12vw, 144px) 0 0; }
.section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 56px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -0.035em; }
.section-head .link-arrow { margin-left: auto; }
.index { font: 13px var(--mono); color: var(--faint); transform: translateY(-0.9em); }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 64px; }
.split > .section-head { flex-direction: column; gap: 12px; align-self: start; position: sticky; top: calc(var(--header-h) + 32px); }
.split > .section-head .index { transform: none; }
.split > .section-head .link-arrow { margin-left: 0; }

.stack-line { font: 13px/1.6 var(--mono); color: var(--faint); margin: 0; }

/* ==========================================================================
   Case study
   ========================================================================== */
.case {
  position: relative; isolation: isolate; border-radius: calc(var(--radius) * 1.5);
  padding: clamp(28px, 4vw, 56px); background: var(--bg-raise);
}
/* Gradient hairline border + a glow that follows the cursor (set by JS). */
.case::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1;
  background:
    radial-gradient(500px circle at var(--mx, 70%) var(--my, 0%), color-mix(in srgb, var(--coral) 80%, transparent), transparent 60%),
    var(--line-strong);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.case::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(700px circle at var(--mx, 70%) var(--my, 0%), color-mix(in srgb, var(--coral) 9%, transparent), transparent 55%);
}

.case-title { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.case-logo { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; }
.case h3 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.03em; }
.case-tagline { margin: 4px 0 0; color: var(--muted); }
.case-link { margin-left: auto; }
.case-role { font: 13px var(--mono); color: var(--accent); margin: 0 0 32px; }
.case-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.case-cols h4 { font: 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 10px; }
.case-cols p { color: var(--muted); margin: 0; }

/* Architecture diagram */
.arch {
  margin: 48px 0 0; padding: 28px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg);
  display: grid; grid-template-columns: 1fr 56px 1.2fr 56px 1fr; align-items: center;
}
.arch-col { display: grid; gap: 8px; }
.arch-label { font: 11px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); margin: 0 0 6px; }
.node {
  padding: 10px 14px; border-radius: 10px; font-size: 14px;
  border: 1px solid var(--line-strong); background: var(--bg-raise);
}
.arch-core {
  padding: 16px; border-radius: 14px; position: relative;
  background: color-mix(in srgb, var(--coral) 6%, var(--bg-raise));
}
.arch-core::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.arch-core .arch-label { color: var(--accent); }
.node-core { border-color: color-mix(in srgb, var(--coral) 35%, var(--line)); }
.node-out { border-style: dashed; }
.arch-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

.arch-flow { position: relative; height: 2px; margin: 0 8px; background: var(--line-strong); overflow: hidden; }
.arch-flow span {
  position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--amber), var(--hibiscus), transparent);
  background-size: 50% 100%; background-repeat: no-repeat;
  animation: flow 2.6s linear infinite;
}
@keyframes flow { from { background-position: -100% 0; } to { background-position: 200% 0; } }

.highlights {
  list-style: none; margin: 48px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px;
}
.highlights li { display: flex; gap: 14px; padding: 22px 0; border-top: 1px solid var(--line); }
.hl-num { font: 12px/1.9 var(--mono); color: var(--faint); }
.highlights strong { display: block; font-weight: 500; margin-bottom: 4px; }
.highlights p { margin: 0; font-size: 15px; color: var(--muted); }
.case .stack-line { margin-top: 28px; }

.cases { display: grid; gap: clamp(32px, 4vw, 48px); }

/* Headline results (big numbers) */
.results {
  margin: 40px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.results > div { padding: 24px 24px 26px 0; }
.results > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.results dt {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.05;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 10px;
}
.results dd { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* Role progression inside a case */
.case-timeline { list-style: none; margin: 36px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; }
.case-timeline li { flex: 1 1 200px; padding: 16px 20px 0 0; border-top: 2px solid var(--line); position: relative; }
.case-timeline li:first-child { border-top-color: var(--coral); }
.case-timeline span { display: block; font: 12px var(--mono); color: var(--faint); margin-bottom: 4px; }
.case-timeline strong { font-weight: 500; }

.ledger-title { font: 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin: 0 0 12px; }
.ledger + .ledger-title { margin-top: 48px; }

/* Case study parts: A product / B backend / C other engineering */
.case-part { margin-top: clamp(48px, 6vw, 72px); padding-top: 32px; border-top: 1px solid var(--line); }
.part-head { display: grid; grid-template-columns: 40px 1fr; gap: 4px 16px; margin-bottom: 28px; max-width: 760px; }
.part-num {
  grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  font: 12px var(--mono); color: var(--accent); border: 1px solid color-mix(in srgb, var(--coral) 45%, var(--line));
}
.part-head h4 { font-size: 1.35rem; letter-spacing: -0.02em; font-weight: 500; }
.part-head p { margin: 0; color: var(--muted); }
.case-part .arch { margin-top: 0; }
.case-part .results { margin-top: 32px; }
.case-part .highlights { margin-top: 32px; }
.product-part .case-cols h4 { margin-bottom: 8px; }
.product-part .results dt { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }

.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.feature-grid--five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .feature-grid--five { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .feature-grid, .feature-grid--five { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .feature-grid, .feature-grid--five { grid-template-columns: 1fr; } }
.feature-grid li {
  padding: 18px 18px 20px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.feature-grid li:hover { border-color: color-mix(in srgb, var(--coral) 45%, var(--line)); transform: translateY(-2px); }
.feature-grid strong { display: block; font-weight: 500; margin-bottom: 6px; }
.feature-grid p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }

.more-work { margin-top: 24px; display: grid; gap: 0; }
.row-item { padding: 28px 0; border-top: 1px solid var(--line); }
.row-kicker { font: 13px var(--mono); color: var(--accent); margin-bottom: 8px; }
.row-item h3 { font-size: 1.4rem; margin-bottom: 8px; }
.row-item p:last-child { color: var(--muted); margin: 0; }

/* ==========================================================================
   Expertise rows
   ========================================================================== */
.rows { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.row {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 4fr) minmax(0, 6fr);
  gap: 16px 32px; padding: 36px 0; border-top: 1px solid var(--line);
}
.row::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%;
  background: var(--grad); transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.row:hover::before { transform: scaleX(1); }
.row-num { font: 13px/2.2 var(--mono); color: var(--faint); }
.row h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -0.03em; }
.row-body p { color: var(--muted); }
.row-body .stack-line { margin-top: 4px; }

/* ==========================================================================
   About / principles
   ========================================================================== */
.about-body p { font-size: clamp(1.1rem, 1.7vw, 1.35rem); line-height: 1.5; letter-spacing: -0.01em; }
.about-body p + p { color: var(--muted); }
.principles { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.principles li { padding: 24px 0; border-top: 1px solid var(--line); }
.principles h3 { font-size: 1.05rem; font-weight: 500; margin-bottom: 8px; letter-spacing: -0.01em; }
.principles p { margin: 0; font-size: 15px; color: var(--muted); }

/* ==========================================================================
   Skills / education / writing
   ========================================================================== */
.skill-table { margin: 0; border-bottom: 1px solid var(--line); }
.skill-table > div { display: grid; grid-template-columns: 160px 1fr; gap: 8px 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.skill-table dt { font: 13px/1.9 var(--mono); color: var(--faint); }
.skill-table dd { margin: 0; }

.ledger { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.ledger li { display: grid; grid-template-columns: 160px 1fr; gap: 6px 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.ledger-date { font: 13px/1.9 var(--mono); color: var(--faint); }
.ledger strong { display: block; font-weight: 500; }
.ledger span { color: var(--muted); font-size: 15px; }
.ledger p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

.post-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.post-list a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 20px 0; border-top: 1px solid var(--line); transition: padding 0.3s ease, color 0.3s ease;
}
.post-list li:last-child a { border-bottom: 0; }
.post-list a:hover { padding-left: 10px; color: var(--accent); }
.post-list span { font-size: 1.1rem; }
.post-list time { font: 13px var(--mono); color: var(--faint); white-space: nowrap; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { position: relative; isolation: isolate; overflow: hidden; margin-top: clamp(96px, 14vw, 176px); padding: clamp(96px, 14vw, 176px) 0; border-top: 1px solid var(--line); }
.aurora-low span:nth-child(1) { top: 40%; left: -10%; }
.aurora-low span:nth-child(2) { top: 55%; left: 55%; }
.aurora-low span:nth-child(3) { top: 70%; left: 25%; }
.contact .display { margin-bottom: 24px; }
.contact .lead { margin-bottom: 40px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--line); color: var(--faint); font: 13px var(--mono); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 24px; padding-bottom: 28px; }
.social { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 24px; }
.social a:hover { color: var(--text); }

/* ==========================================================================
   Blog and post pages
   ========================================================================== */
.page { padding-top: clamp(64px, 10vw, 120px); padding-bottom: 120px; }
.page .kicker { font: 13px var(--mono); color: var(--faint); margin-bottom: 16px; }
.page h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); letter-spacing: -0.03em; margin-bottom: 28px; }
.page > p a, .page .lead a { color: var(--text); text-decoration: underline; text-decoration-color: var(--coral); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.post { max-width: 720px; }
.post .meta { display: flex; gap: 16px; font: 13px var(--mono); color: var(--faint); margin-bottom: 20px; }
.post .meta a:hover { color: var(--text); }
.prose { font-size: 1.08rem; line-height: 1.7; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose pre {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; overflow-x: auto; font: 14px/1.6 var(--mono);
}
.prose code { font-family: var(--mono); font-size: 0.88em; }
.prose :not(pre) > code { background: var(--bg-raise); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }

/* ==========================================================================
   Scroll reveal (JS adds .js to <html>)
   ========================================================================== */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .aurora span, .arch-flow span, .status-dot, .scroll-cue::after { animation: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1000px) {
  .split { grid-template-columns: 1fr; }
  .split > .section-head { position: static; flex-direction: row; align-items: baseline; gap: 20px; margin-bottom: 40px; }
  .split > .section-head .index { transform: translateY(-0.9em); }
  .split > .section-head .link-arrow { margin-left: auto; }
  .highlights { grid-template-columns: 1fr 1fr; }
  .arch { grid-template-columns: 1fr; gap: 0; }
  .arch-flow { width: 2px; height: 36px; margin: 8px auto; }
  .arch-flow span { background: linear-gradient(180deg, transparent, var(--amber), var(--hibiscus), transparent); background-size: 100% 50%; animation-name: flow-y; }
}
@keyframes flow-y { from { background-position: 0 -100%; } to { background-position: 0 200%; } }

@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 20px 24px; background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .site-nav a { padding: 14px 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { margin-top: 16px; text-align: center; border-bottom: 1px solid var(--line-strong); }
  .site-header:has(.is-open) { background: var(--bg); border-bottom-color: var(--line); }

  .hero .display { margin-bottom: 32px; }
  .aurora span:nth-child(1) { width: 110vw; height: 110vw; left: 10%; }
  .aurora span:nth-child(2) { width: 80vw; height: 80vw; left: 45%; }
  .aurora span:nth-child(3) { width: 70vw; height: 70vw; left: 0%; }

  .case-cols, .highlights, .principles { grid-template-columns: 1fr; gap: 0; }
  .results { grid-template-columns: 1fr 1fr; }
  .results > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .results > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .case-cols > div + div { margin-top: 24px; }
  .arch { padding: 18px; }
  .row { grid-template-columns: 1fr; gap: 8px; padding: 28px 0; }
  .row-num { line-height: 1; }
  .skill-table > div, .ledger li { grid-template-columns: 1fr; gap: 2px; }
  .post-list a { flex-direction: column; gap: 4px; }
}
