/*
 * v2.css - design system for the home page, /about and /partnership.
 * One set of tokens and components; no template CSS. The blog keeps blog.css.
 */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg: #0a0e14;
  --surface: #0e131b;
  --card: #121924;
  --card-hover: #151e2b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e6edf3;
  --muted: #a3b0bd;
  --dim: #7f8c9a;
  --accent: #4da3ff;
  --accent-strong: #2f8cf0;
  --accent-dim: rgba(77, 163, 255, 0.12);
  --accent-line: rgba(77, 163, 255, 0.35);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --max: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #7dbcff; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 200;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: #04101f; font-weight: 600;
}
.skip-link:focus { top: 12px; color: #04101f; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--header-h);
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.site-header.is-scrolled { background: rgba(10, 14, 20, 0.92); border-bottom-color: var(--border); }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand__mark {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #13233b, #070b12); border: 1px solid var(--accent-line);
  font-size: 13px; font-weight: 700; letter-spacing: -0.03em; color: #fff;
}
.brand__mark span { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.site-nav a.is-active, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a.site-nav__cta {
  margin-left: 8px; color: var(--text);
  border: 1px solid var(--border-strong);
}
.site-nav a.site-nav__cta:hover { border-color: var(--accent-line); background: var(--accent-dim); }

.nav-toggle {
  display: none; width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: transparent; color: var(--text); cursor: pointer;
}
.nav-toggle__bar { display: block; width: 18px; height: 2px; margin: 4px auto; background: currentColor; border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-open .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 16px 20px; background: rgba(10, 14, 20, 0.98);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav-open .site-nav { transform: none; opacity: 1; visibility: visible; }
  .site-nav a { padding: 12px 8px; font-size: 16px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .site-nav a.site-nav__cta { margin: 12px 0 0; text-align: center; border-radius: var(--radius-sm); }
}

/* ── Buttons ────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: 15px; font-weight: 600; line-height: 1.2;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #04101f; }
.btn--primary:hover { background: #6db4ff; color: #04101f; }
.btn--ghost { background: rgba(255, 255, 255, 0.03); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { color: var(--text); border-color: var(--accent-line); background: var(--accent-dim); }

/* ── Type helpers ───────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.lead { font-size: 18px; line-height: 1.75; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* ── Hero (home) ────────────────────────────────────────── */
.hero {
  position: relative; display: flex; align-items: center;
  min-height: min(92vh, 860px); padding: calc(var(--header-h) + 56px) 0 72px;
  background: #070b12 url("../images/hero-bg.jpg") center / cover no-repeat;
  background-image: image-set(url("../images/hero-bg.webp") type("image/webp"), url("../images/hero-bg.jpg") type("image/jpeg"));
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0; height: 160px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.hero__inner { position: relative; z-index: 1; }
.hero__title {
  margin-top: 18px; max-width: 16ch;
  font-size: clamp(40px, 6.4vw, 76px); font-weight: 700; line-height: 1.04; letter-spacing: -0.035em;
}
.hero__lead { margin-top: 22px; max-width: 640px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.7; color: #c3cdd8; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; list-style: none;
  font-family: var(--mono); font-size: 13.5px; color: var(--muted);
}
.hero__meta li { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta i { color: var(--accent); font-size: 13px; }
.hero .actions { margin-top: 36px; }

/* ── Page hero (about, partnership) ─────────────────────── */
.page-hero {
  position: relative; padding: calc(var(--header-h) + 72px) 0 64px;
  background:
    radial-gradient(60% 80% at 15% 0%, rgba(77, 163, 255, 0.12), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-hero__title {
  margin-top: 16px; max-width: 20ch;
  font-size: clamp(34px, 5vw, 56px); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em;
}
.page-hero__title mark { background: none; color: var(--accent); }
.page-hero__lead { margin-top: 20px; max-width: 680px; }
.page-hero .actions { margin-top: 30px; }

/* ── Sections ───────────────────────────────────────────── */
.section { padding: 96px 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section--tight { padding: 64px 0; }
.section__head { max-width: 720px; margin-bottom: 48px; }
.section__head h2 { margin-top: 10px; font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; }
.section__head p { margin-top: 14px; color: var(--muted); font-size: 17px; }
.section__more { margin-top: 36px; }

/* ── Summary + quick facts ──────────────────────────────── */
.summary { display: grid; gap: 40px; }
.summary__text { max-width: 820px; }
.summary__text p { font-size: 17.5px; line-height: 1.8; color: #c3cdd8; }
.summary__text p + p { margin-top: 18px; }
.summary__text .actions { margin-top: 28px; }
/* Quick facts: a grid of cells; the 1px gap shows the border colour between them. */
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.facts div { padding: 20px 24px; background: var(--card); }
.facts dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.facts dd { margin-top: 4px; font-size: 15px; color: var(--text); line-height: 1.55; }

/* ── Focus areas ────────────────────────────────────────── */
.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.focus-item { padding: 28px; background: var(--bg); transition: background 0.2s; }
.section--alt .focus-item { background: var(--surface); }
.focus-item:hover { background: var(--card); }
.focus-item__icon { color: var(--accent); font-size: 20px; }
.focus-item h3 { margin-top: 14px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.focus-item p { margin-top: 8px; font-size: 15px; line-height: 1.65; color: var(--muted); }

/* ── Case studies ───────────────────────────────────────── */
.cases { display: grid; gap: 20px; }
.case {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 40px;
  padding: 32px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.2s;
}
.case:hover { border-color: var(--border-strong); }
.case__index { font-family: var(--mono); font-size: 13px; color: var(--dim); }
.case__title { margin-top: 8px; font-size: 22px; font-weight: 650; line-height: 1.3; letter-spacing: -0.015em; }
.case__context { margin-top: 10px; font-size: 14px; color: var(--accent); }
.case__period { margin-top: 2px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.case__role { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.case .tags { margin-top: 18px; }
.case__body { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px 24px; }
.case__body dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); padding-top: 3px; }
.case__body dd { font-size: 15.5px; line-height: 1.7; color: #c3cdd8; }
.case__body dt.is-key, .case__body dt.is-key + dd { color: var(--text); }
.case__body dt.is-key { color: var(--accent); }

/* ── Tags ───────────────────────────────────────────────── */
/* align-content keeps pills their natural height when the list sits in a taller grid row. */
.tags { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; gap: 8px; list-style: none; }
.tag {
  display: inline-flex; align-items: center; min-height: 28px; padding: 3px 12px; border-radius: 999px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.4; color: #bcd6f5;
  background: var(--accent-dim); border: 1px solid rgba(77, 163, 255, 0.22);
}

/* ── How I work ─────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; counter-reset: step; }
.step { padding: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.step__head { display: flex; align-items: center; justify-content: space-between; }
.step__num { font-family: var(--mono); font-size: 13px; color: var(--dim); }
.step__icon { color: var(--accent); }
.step h3 { margin-top: 14px; font-size: 18px; font-weight: 600; }
.step p { margin-top: 6px; font-size: 15px; line-height: 1.65; color: var(--muted); }
.principles { margin-top: 24px; padding: 28px 32px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.principles h3 { font-size: 18px; font-weight: 600; }
.checklist { margin-top: 16px; list-style: none; columns: 2; column-gap: 40px; }
.checklist li { position: relative; padding-left: 26px; margin-bottom: 12px; break-inside: avoid; font-size: 15.5px; line-height: 1.6; color: #c3cdd8; }
.checklist li::before {
  content: "\f00c"; font-family: "Font Awesome 5 Free"; font-weight: 900;
  position: absolute; left: 0; top: 2px; font-size: 12px; color: var(--accent);
}
.checklist--single { columns: 1; }

/* ── Experience timeline ────────────────────────────────── */
.timeline { list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 207px; top: 8px; bottom: 8px; width: 1px; background: var(--border-strong); }
.timeline__item { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 54px; position: relative; padding-bottom: 44px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: 202px; top: 8px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline__item.is-current::before { background: var(--accent); }
.timeline__period { font-family: var(--mono); font-size: 13.5px; color: var(--muted); padding-top: 2px; }
.timeline__role { font-size: 19px; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; }
.timeline__company { margin-top: 2px; font-size: 15px; color: var(--accent); }
.timeline__note { margin-top: 8px; font-size: 14.5px; font-style: italic; color: var(--muted); }
.timeline__points { margin-top: 14px; list-style: none; }
.timeline__points li { position: relative; padding-left: 18px; margin-bottom: 8px; font-size: 15.5px; line-height: 1.7; color: #c3cdd8; }
.timeline__points li::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.timeline .tags { margin-top: 14px; }

.edu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 48px; }
.edu__card { padding: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.edu__card h3 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.edu__card p { margin-top: 10px; font-size: 16px; }
.edu__card p + p { margin-top: 4px; }
.edu__card .muted { font-size: 14.5px; }

/* ── Stack tiers ────────────────────────────────────────── */
.tiers { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.tier { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: start; gap: 32px; padding: 26px 28px; }
.tier + .tier { border-top: 1px solid var(--border); }
.tier h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.tier h3 i { color: var(--accent); font-size: 14px; }
.tier__note { margin-top: 6px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.tier:nth-child(3) .tag { color: var(--muted); background: rgba(255, 255, 255, 0.03); border-color: var(--border-strong); }

/* ── Writing ────────────────────────────────────────────── */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
}
.post:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }
.post img { aspect-ratio: 1200 / 630; width: 100%; height: auto; object-fit: cover; border-bottom: 1px solid var(--border); }
.post__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.post__cat { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.post__title { margin-top: 8px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.post__excerpt { margin-top: 8px; font-size: 14.5px; line-height: 1.6; color: var(--muted); flex: 1; }
.post__meta { margin-top: 14px; font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.topic {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font-size: 14px; color: var(--muted); border: 1px solid var(--border-strong);
}
.topic:hover { color: var(--text); border-color: var(--accent-line); }
.topic i { color: var(--accent); font-size: 12px; }

/* ── Repos ──────────────────────────────────────────────── */
.repos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.repo {
  display: flex; flex-direction: column; gap: 10px; padding: 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.repo:hover { color: var(--text); border-color: var(--accent-line); }
.repo__name { font-family: var(--mono); font-size: 16px; font-weight: 500; }
.repo__name i { color: var(--muted); margin-right: 8px; }
.repo__desc { font-size: 15px; color: var(--muted); }

/* ── Recommendations ────────────────────────────────────── */
.quotes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.quote { padding: 28px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.quote blockquote { margin: 0; font-size: 16px; line-height: 1.75; color: #c3cdd8; }
.quote figcaption { margin-top: 18px; font-size: 14.5px; }
.quote figcaption span { display: block; color: var(--muted); }

/* ── Contact ────────────────────────────────────────────── */
.contact { display: block; }
.contact-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 820px; list-style: none; }
.contact-link {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
  transition: border-color 0.15s;
}
.contact-link:hover { color: var(--text); border-color: var(--accent-line); }
.contact-link i { width: 20px; text-align: center; color: var(--accent); font-size: 17px; }
.contact-link__label { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.contact-link__value { display: block; font-size: 15.5px; overflow-wrap: anywhere; }


/* ── Partnership ────────────────────────────────────────── */
.glance { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.glance__item { display: flex; gap: 14px; padding: 24px; }
.glance__item + .glance__item { border-left: 1px solid var(--border); }
.glance__item i { margin-top: 4px; color: var(--accent); width: 20px; text-align: center; }
.glance__who { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.glance__what { margin-top: 2px; font-size: 16.5px; font-weight: 600; }
.glance__detail { margin-top: 4px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split__side { display: flex; flex-direction: column; padding: 28px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.split__side--primary { border-color: var(--accent-line); }
.split__label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.split__foot { margin-top: auto; padding-top: 18px; font-size: 14px; color: var(--muted); }
.split__foot i { color: var(--accent); margin-right: 6px; }
.prose { max-width: 760px; }
.prose p { font-size: 17.5px; line-height: 1.8; color: #c3cdd8; }
.prose p + p { margin-top: 16px; }
.prose strong { color: var(--text); }
.faq { max-width: 820px; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; cursor: pointer; list-style: none; font-size: 16.5px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "\f067"; font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 12px; color: var(--accent); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { padding: 0 32px 20px 0; color: var(--muted); line-height: 1.75; }
.cta-panel {
  padding: 48px; text-align: center; border-radius: 16px; border: 1px solid var(--accent-line);
  background: radial-gradient(80% 120% at 50% 0%, rgba(77, 163, 255, 0.14), transparent 70%), var(--card);
}
.cta-panel h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -0.02em; }
.cta-panel p { margin: 12px auto 0; max-width: 560px; color: var(--muted); }
.cta-panel .actions { justify-content: center; margin-top: 26px; }
.cta-panel .cta-panel__alt { margin-top: 16px; font-size: 14.5px; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { padding: 40px 0; border-top: 1px solid var(--border); background: var(--bg); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer nav a { font-size: 14px; color: var(--muted); }
.site-footer nav a:hover { color: var(--text); }
.site-footer__copy { font-size: 13.5px; color: var(--dim); }
.site-footer__social { display: flex; gap: 14px; }
.site-footer__social a { color: var(--muted); font-size: 17px; }
.site-footer__social a:hover { color: var(--text); }

/* ── Reveal on scroll (only when JS is running, and never with reduced motion) ── */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site:hover, .site:hover .site__shot img { transform: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .post:hover { transform: none; }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case { grid-template-columns: 1fr; gap: 24px; }
  .steps, .focus-grid, .posts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .contact-links, .facts { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .container { padding: 0 20px; }
  .hero { min-height: auto; padding: calc(var(--header-h) + 48px) 0 64px; }
  .steps, .focus-grid, .posts, .repos, .quotes, .edu, .split { grid-template-columns: 1fr; }
  .glance { grid-template-columns: 1fr; }
  .glance__item + .glance__item { border-left: 0; border-top: 1px solid var(--border); }
  .case { padding: 24px 20px; }
  .case__body { grid-template-columns: 1fr; gap: 4px; }
  .case__body dd { margin-bottom: 12px; }
  .tier { grid-template-columns: 1fr; gap: 14px; padding: 22px 20px; }
  .timeline::before { left: 5px; }
  .timeline__item { grid-template-columns: 1fr; gap: 6px; padding-left: 30px; }
  .timeline__item::before { left: 0; }
  .checklist { columns: 1; }
  .principles { padding: 24px 20px; }
  .cta-panel { padding: 36px 20px; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}

.steps--four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .steps--four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .steps--four { grid-template-columns: 1fr; } }

/* ── Partnership (Australia): time-zone table ───────────── */
.hours { margin-top: 40px; max-width: 820px; }
.hours table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.hours caption { caption-side: top; text-align: left; padding-bottom: 12px; font-size: 15px; font-weight: 600; color: var(--text); }
.hours th, .hours td { padding: 14px 18px; text-align: left; font-size: 15px; border-top: 1px solid var(--border); }
.hours thead th { border-top: 0; font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.hours tbody th { font-weight: 600; color: var(--text); }
.hours td { color: var(--muted); }
.hours td.mono { color: var(--accent); }
.hours__note { margin-top: 12px; font-size: 14px; color: var(--muted); }
@media (max-width: 760px) {
  .hours th, .hours td { padding: 12px 12px; font-size: 14px; }
  .hours thead { display: none; }
  .hours tr { display: grid; grid-template-columns: 1fr; padding: 10px 0; border-top: 1px solid var(--border); }
  .hours tbody tr:first-child { border-top: 0; }
  .hours th, .hours td { border-top: 0; padding: 2px 14px; }
}
.hours__dst { display: block; margin-top: 2px; font-family: var(--sans); font-size: 13px; color: var(--dim); }
.hours td { white-space: nowrap; }
@media (max-width: 760px) { .hours td { white-space: normal; } }

/* ── Live websites ──────────────────────────────────────── */
.sites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; }
.sites > li { display: flex; }
.site {
  display: flex; flex-direction: column; width: 100%; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
  transition: border-color 0.15s, transform 0.2s;
}
.site:hover { color: var(--text); border-color: var(--accent-line); transform: translateY(-2px); }
.site__shot {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(135deg, #13233b, #070b12); border-bottom: 1px solid var(--border);
}
.site__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.4s var(--ease); }
.site:hover .site__shot img { transform: scale(1.03); }
.site__placeholder { font-size: 34px; color: var(--accent); opacity: 0.8; }
.site__body { display: flex; flex-direction: column; min-width: 0; padding: 18px 20px 20px; }
.site__cat { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.site__name { display: flex; align-items: center; gap: 8px; font-size: 16.5px; font-weight: 600; }
.site__ext { font-size: 11px; color: var(--dim); transition: color 0.15s; }
.site:hover .site__ext { color: var(--accent); }
.site__domain { margin-top: 2px; font-family: var(--mono); font-size: 12.5px; color: var(--accent); overflow-wrap: anywhere; }
.site__desc { margin-top: 8px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
@media (max-width: 1024px) { .sites { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .sites { grid-template-columns: 1fr; } }

/* ── Backend architecture diagrams ──────────────────────── */
.arch-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.arch-list { display: grid; gap: 28px; }
.arch { padding: 32px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.arch__label { display: inline-block; padding: 3px 10px; border-radius: 999px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(77, 163, 255, 0.25); }
.arch__label--ref { color: #e0b65c; background: rgba(224, 182, 92, 0.1); border-color: rgba(224, 182, 92, 0.3); }
.arch__head h3 { margin-top: 12px; font-size: 22px; font-weight: 650; letter-spacing: -0.015em; }
.arch__summary { margin-top: 6px; max-width: 760px; font-size: 15.5px; color: var(--muted); }
.arch__canvas { margin-top: 24px; padding: 16px; overflow-x: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.arch__canvas svg { display: block; width: 100%; min-width: 720px; height: auto; }
.arch__notes { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; margin-top: 24px; }
.arch__notes h4 { margin: 0 0 12px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.arch__notes .checklist li { font-size: 15px; }

.arch-box rect { fill: var(--card); stroke: var(--border-strong); stroke-width: 1.2; }
.arch-box--accent rect { fill: rgba(77, 163, 255, 0.08); stroke: var(--accent-line); }
.arch-box--store rect { fill: rgba(124, 92, 255, 0.08); stroke: rgba(124, 92, 255, 0.4); }
.arch-title { font-family: var(--sans); font-size: 14px; font-weight: 600; fill: var(--text); }
.arch-line { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.arch-group rect { fill: rgba(77, 163, 255, 0.03); stroke: var(--accent-line); stroke-dasharray: 6 5; }
.arch-group-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; fill: var(--accent); }
.arch-arrow polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.arch-head { fill: var(--accent); }
.arch-label { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.arch-bus { stroke: var(--border-strong); stroke-width: 1.2; }
@media (max-width: 900px) { .arch__notes { grid-template-columns: 1fr; gap: 20px; } }
@media (max-width: 760px) { .arch { padding: 22px 18px; } .arch__canvas { padding: 10px; } }

/* Links the Cloudflare middleware hides by country (functions/_middleware.ts) must stay hidden, even on buttons. */
[hidden] { display: none !important; }

/* ── Motion ──────────────────────────────────────────────
 * Purposeful and cheap: only opacity and transforms animate, the diagram pulses pause off screen,
 * and everything below is switched off for people who ask for reduced motion.
 */

/* Hero entrance: eyebrow, title, intro, facts and buttons rise in one after another. */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero__text > *, .page-hero .container > * { animation: rise 0.7s var(--ease) both; }
.hero__text > :nth-child(2), .page-hero .container > :nth-child(2) { animation-delay: 0.08s; }
.hero__text > :nth-child(3), .page-hero .container > :nth-child(3) { animation-delay: 0.16s; }
.hero__text > :nth-child(4), .page-hero .container > :nth-child(4) { animation-delay: 0.24s; }
.hero__text > :nth-child(5), .page-hero .container > :nth-child(5) { animation-delay: 0.32s; }
.hero__text > :nth-child(n + 6), .page-hero .container > :nth-child(n + 6) { animation-delay: 0.4s; }

/* Reading progress under the header. */
.scroll-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; pointer-events: none; }
.scroll-progress span {
  display: block; height: 100%; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--accent), #7c5cff);
}

/* Experience timeline: an accent line draws down the track as you scroll through it. */
.timeline::after {
  content: ""; position: absolute; left: 207px; top: 8px; bottom: 8px; width: 1px;
  background: var(--accent); transform-origin: top; transform: scaleY(1);
}
.motion .timeline::after { transform: scaleY(var(--drawn, 0)); }
.timeline__item::before { z-index: 1; transition: background 0.3s, box-shadow 0.3s; }
.timeline__item.is-visible::before { box-shadow: 0 0 0 4px var(--accent-dim); }

/* Architecture diagrams: a short pulse travels along each arrow while the diagram is on screen. */
@keyframes flow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.arch-pulse {
  fill: none; stroke: #9fd0ff; stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 6 94; stroke-dashoffset: 100; opacity: 0;
  filter: drop-shadow(0 0 4px rgba(77, 163, 255, 0.9));
}
.arch__canvas.is-live .arch-pulse { opacity: 1; animation: flow 3.2s linear infinite; }

/* Interactive cards lift slightly toward the cursor. */
.case, .step, .repo, .contact-link { transition: border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.case:hover, .step:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }

@media (prefers-reduced-motion: reduce) {
  .hero__text > *, .page-hero .container > * { animation: none; }
  .hero-visual { animation: none; }
  .hero-pulse, .hero-core-glow { animation: none !important; }
  .hero-pulse { display: none; }
  .arch__canvas .arch-pulse { display: none; }
  .timeline::after { transform: none; }
  .case:hover, .step:hover { transform: none; }
}

@media (max-width: 760px) {
  .timeline::after { left: 5px; }
}

/* ── Mouse interactions (html.pointer: real mouse, motion allowed; see public/js/v2.js) ── */

/* Spotlight: a soft glow that follows the cursor inside a card, under the card's content. */
.pointer .spotlight { position: relative; isolation: isolate; }
.pointer .spotlight::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(77, 163, 255, 0.10), transparent 60%);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.pointer .spotlight:hover::after { opacity: 1; }
.pointer .spotlight:hover { border-color: var(--accent-line); }

/* Magnetic buttons ease back when the cursor leaves. */
.pointer .btn--primary, .pointer .site-nav__cta { transition: transform 0.25s var(--ease), background 0.15s, border-color 0.15s, color 0.15s; }

/* Website screenshots drift with the cursor. */
.pointer .site:hover .site__shot img { transform: scale(1.06) translate(var(--px, 0), var(--py, 0)); transition: transform 0.2s linear; }

/* Architecture diagrams: hovering a component highlights it. */
.arch-box rect { transition: stroke 0.2s, fill 0.2s; }
.arch-box:hover rect { stroke: var(--accent); fill: rgba(77, 163, 255, 0.12); }
.arch-box:hover .arch-title { fill: #fff; }

/* ── Background field (public/js/v2.js) ─────────────────────
 * Fixed behind all content; sections are slightly translucent so the grid shows through,
 * while cards keep solid backgrounds so text never sits on moving dots.
 */
.bg-field { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.section--alt { background: rgba(18, 25, 36, 0.55); }
.page-hero { background: radial-gradient(60% 80% at 15% 0%, rgba(77, 163, 255, 0.12), transparent 70%); }

/* ── Hero visual: animated system diagram (src/components/home/HeroSystem.tsx) ── */
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 32px; align-items: center; }
.hero__grid .eyebrow { letter-spacing: 0.08em; }
.hero__grid .actions { gap: 10px; }
.hero__grid .actions .btn { padding: 10px 16px; font-size: 14.5px; }
.hero__grid .hero__title { font-size: clamp(40px, 5vw, 64px); }
.hero__grid .hero__title { max-width: 14ch; }
.hero-visual { margin: 0; perspective: 1200px; animation: rise 0.9s var(--ease) 0.35s both; }
.hero-visual__panel {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d; transition: transform 0.25s var(--ease);
  background: rgba(14, 20, 30, 0.72); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(77, 163, 255, 0.06) inset;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: hidden;
}
.hero-visual__bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.hero-visual__dots { display: inline-flex; gap: 6px; }
.hero-visual__dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.hero-visual__svg { position: relative; display: block; width: 100%; height: auto; padding: 14px 10px 4px; }
.hero-visual__legend {
  display: flex; align-items: center; gap: 18px; padding: 10px 16px 14px;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}
.hero-visual__legend span { display: inline-flex; align-items: center; gap: 6px; }
.hero-visual__caption { margin-left: auto; color: var(--dim); }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; }
.hero-dot--req { background: #9fd0ff; box-shadow: 0 0 6px rgba(77, 163, 255, 0.9); }
.hero-dot--data { background: #b9a6ff; box-shadow: 0 0 6px rgba(124, 92, 255, 0.9); }

.hero-node rect { fill: rgba(18, 25, 36, 0.95); stroke: var(--border-strong); stroke-width: 1.2; transition: stroke 0.2s, fill 0.2s; }
.hero-node--core rect { fill: rgba(77, 163, 255, 0.10); stroke: var(--accent-line); }
.hero-node--data rect { fill: rgba(124, 92, 255, 0.08); stroke: rgba(124, 92, 255, 0.4); }
.hero-node:hover rect { stroke: var(--accent); fill: rgba(77, 163, 255, 0.14); }
.hero-node__label { font-family: var(--sans); font-size: 11.5px; font-weight: 600; fill: var(--text); }
.hero-node--ext rect { fill: rgba(224, 182, 92, 0.07); stroke: rgba(224, 182, 92, 0.38); }
.hero-node__sub { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
.hero-link { fill: none; stroke: rgba(77, 163, 255, 0.45); stroke-width: 1.4; stroke-linejoin: round; }
.hero-head { fill: rgba(77, 163, 255, 0.7); }
.hero-pulse {
  fill: none; stroke: #9fd0ff; stroke-width: 2.6; stroke-linecap: round;
  stroke-dasharray: 8 92; stroke-dashoffset: 100;
  filter: drop-shadow(0 0 4px rgba(77, 163, 255, 0.95));
}
/* The traces show the flow; the always-on pulses were noise. */
.hero-pulse { display: none; }
/* Links into the data stores carry purple pulses. */
.hero-link--data .hero-pulse { stroke: #c9bbff; filter: drop-shadow(0 0 4px rgba(124, 92, 255, 0.95)); }
.hero-core-glow { transform-origin: 318px 140px; opacity: 0.8; }
.hero-visual.is-paused { --hero-play: paused; }

@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 560px; }
}
@media (max-width: 560px) {
  .hero-visual { display: none; }
}

/* Hero panel: architecture tabs, crossfade, and the mouse-driven dot grid behind the diagram. */
.hero-visual__tabs { display: flex; gap: 4px; min-width: 0; }
.hero-visual__tab {
  padding: 4px 10px; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; color: var(--dim); white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.hero-visual__tab:hover { color: var(--text); }
.hero-visual__tab[aria-selected="true"] { color: var(--text); background: rgba(255, 255, 255, 0.05); border-color: var(--border-strong); }
.hero-diagram { opacity: 0; transition: opacity 0.5s var(--ease); pointer-events: none; }
.hero-diagram.is-active { opacity: 1; pointer-events: auto; }

.hero-visual__stage { position: relative; overflow: hidden; }
.hero-visual__grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(150, 190, 240, 0.13) 1px, transparent 1.4px);
  background-size: 18px 18px; background-position: 9px 9px;
}
@media (prefers-reduced-motion: reduce) {
  .hero-diagram { transition: none; }
}

/* Hero diagram: zones, observability bar. */
.hero-zone { fill: rgba(255, 255, 255, 0.015); stroke: rgba(255, 255, 255, 0.09); stroke-dasharray: 4 4; }
.hero-zone__label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--dim); }
.hero-obs rect { fill: rgba(77, 163, 255, 0.05); stroke: rgba(77, 163, 255, 0.25); }
.hero-obs text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }

/* About facts: profile links and GitHub achievements. */
.facts__link { color: var(--text); }
.facts__link:hover { color: var(--accent); }
.facts__link i { margin-left: 4px; font-size: 10px; color: var(--dim); }

/* ── Modern motion layer ─────────────────────────────────────
 * Aurora behind the hero, a travelling border beam on the diagram panel, request traces in the
 * diagram, a word-by-word title reveal and focus-in section reveals. Transforms/opacity only;
 * everything is off under reduced motion (see the block at the end).
 */

/* Aurora: two soft, static colour fields behind the hero. */
.hero__aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora {
  position: absolute; width: 560px; height: 560px; border-radius: 50%; filter: blur(60px); opacity: 0.55;
  mix-blend-mode: screen;
}
.aurora--blue {
  left: 8%; top: 4%; background: radial-gradient(circle at 40% 40%, rgba(77, 163, 255, 0.55), transparent 65%);
}
.aurora--violet {
  right: 4%; bottom: -10%; background: radial-gradient(circle at 60% 60%, rgba(124, 92, 255, 0.45), transparent 65%);
}


.hero-visual__panel { position: relative; }

/* Request traces: hops light up in order, like spans in a distributed trace. */
.hero-node rect { transition: stroke 0.35s, fill 0.35s, filter 0.35s; }
.hero-node.is-hot rect { stroke: #9fd0ff; fill: rgba(77, 163, 255, 0.22); filter: drop-shadow(0 0 8px rgba(77, 163, 255, 0.75)); }
.hero-node.is-hot .hero-node__label { fill: #fff; }
.hero-link { transition: stroke 0.35s, stroke-width 0.35s; }
[data-link].is-hot .hero-link { stroke: #9fd0ff; stroke-width: 2.2; }
.hero-visual__trace { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; color: var(--dim); }
.hero-visual__trace-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #5ee39a; box-shadow: 0 0 8px rgba(94, 227, 154, 0.8);
}
.hero-visual__route { font-weight: 500; color: #bcd6f5; transition: opacity 0.25s; }
.hero-visual__route.is-changing { opacity: 0; }

/* Sections: cards come into focus as they scroll in. */
.js .reveal { filter: blur(6px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease); }
.js .reveal.is-visible { filter: none; }

/* Card borders catch the light under the cursor. */
.pointer .spotlight::before {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(159, 208, 255, 0.55), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.pointer .spotlight:hover::before { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { filter: none; }
}
@media (max-width: 760px) {
  .aurora { width: 360px; height: 360px; filter: blur(48px); }
}
