/* ==========================================================================
   DAN ANDREWS — one page

   Built in the same grammar as granite.coach: two tones and a single accent.
   Black and white carry everything. One mint green is permitted exactly once,
   on the correction in the hero — the moment the sentence changes its mind —
   because that gesture is the whole idea, and colour that means one thing keeps
   meaning it. Nothing else is ever green.

   Every neutral is mixed from --fg, so the whole page flips with two swaps and
   the accent stays put. Fonts are self-hosted; the page calls no third party.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono.woff2") format("woff2");
}

:root {
  --bg: #000000;
  --fg: #FFFFFF;

  color-scheme: dark;

  --dim:    color-mix(in srgb, var(--fg) 62%, var(--bg));
  --faint:  color-mix(in srgb, var(--fg) 46%, var(--bg));
  --line:   color-mix(in srgb, var(--fg) 14%, var(--bg));
  --line-2: color-mix(in srgb, var(--fg) 30%, var(--bg));

  /* The one green — the mint from the Granite app's correction chip. Fixed
     across both inversions: a correction must read the same whichever way the
     page is flipped, so it sits outside the invertible palette. */
  --accent: #7FF3CB;

  --sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 34rem;
  --gutter:  clamp(1.5rem, 7vw, 6rem);
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg: #FFFFFF;
  --fg: #000000;
  color-scheme: light;

  --dim:   color-mix(in srgb, var(--fg) 66%, var(--bg));
  --faint: color-mix(in srgb, var(--fg) 52%, var(--bg));
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.62;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(4.5rem, 16vh, 11rem) var(--gutter) 4rem;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 2.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

.name {
  margin: 0 0 2rem;
  font-size: clamp(2.4rem, 1.9rem + 3.4vw, 4rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.thesis {
  margin: 0 0 1.6rem;
  font-size: clamp(1.5rem, 1.25rem + 1.3vw, 2rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

/* The single permitted use of colour on the page. The struck phrase recedes;
   the replacement lands in mint — the sentence changing its mind, the same
   move the product makes when the coach changes a weight. */
.correction { white-space: normal; }

.correction del {
  text-decoration: none;
  color: var(--faint);
  position: relative;
}
.correction del::after {
  content: "";
  position: absolute;
  left: -0.05em; right: -0.05em;
  top: 52%;
  height: 0.09em;
  background: var(--faint);
  transform: scaleX(0);
  transform-origin: left;
  animation: strike 0.6s var(--ease) 0.9s forwards;
}

.correction ins {
  text-decoration: none;
  color: var(--accent);
  opacity: 0;
  animation: reveal 0.5s var(--ease) 1.45s forwards;
}

@keyframes strike { to { transform: scaleX(1); } }
@keyframes reveal { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .correction del::after { animation: none; transform: scaleX(1); }
  .correction ins { animation: none; opacity: 1; }
}

.lede {
  margin: 0;
  max-width: 30rem;
  color: var(--dim);
}

/* The studio wordmark — always the mono face, whether it sits in prose or a row */
.studio {
  font-family: var(--mono);
  font-size: 0.9em;
  letter-spacing: -0.01em;
  color: var(--fg);
}

/* Inline link in the lede: a quiet underline that firms up on hover, no colour */
.lede a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--line-2);
  transition: text-decoration-color 0.3s var(--ease);
}
.lede a:hover, .lede a:focus-visible { text-decoration-color: var(--fg); outline: none; }

/* ── Blocks ───────────────────────────────────────────────────────────── */

.block {
  margin-top: clamp(3.5rem, 9vh, 6rem);
  padding-top: clamp(2rem, 5vh, 3rem);
  border-top: 1px solid var(--line);
}

/* No divider above the first section — Current focus leads straight on from the hero */
.block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.label {
  margin: 0 0 1.6rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.prose {
  margin: 0 0 1.1rem;
  color: var(--dim);
}
.prose:last-child { margin-bottom: 0; }

/* Now — a small stack of rows, the way the Granite sheets read */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { margin-top: 0.4rem; }

.row {
  display: block;
  padding: 0.9rem 0;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.rows li:first-child .row { border-top: 1px solid var(--line); }

.row-name {
  display: block;
  font-size: 1.075rem;
  font-weight: 550;
  letter-spacing: -0.015em;
}
.row-note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.94rem;
  color: var(--dim);
}

a.row { transition: padding-left 0.35s var(--ease); }
a.row:hover, a.row:focus-visible { padding-left: 0.5rem; outline: none; }
a.row .row-name { position: relative; }
a.row .row-name::after {
  content: "↗";
  font-family: var(--mono);
  font-size: 0.8em;
  margin-left: 0.5em;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
a.row:hover .row-name::after, a.row:focus-visible .row-name::after { opacity: 1; }

.aside {
  margin: 1.4rem 0 0;
  font-size: 0.94rem;
  color: var(--faint);
}

/* Worked with — a mono credits line, names carried in the reading tone */
.clients {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(0.92rem, 0.88rem + 0.25vw, 1.05rem);
  line-height: 1.75;
  letter-spacing: -0.01em;
  color: var(--dim);
}

/* Elsewhere — inline links + contact */
.links {
  list-style: none;
  margin: 0 0 2.2rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
}
.links a, .contact a {
  color: var(--fg);
  text-decoration: none;
  position: relative;
}
.links a::after, .contact a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.15em;
  height: 1px;
  background: var(--line-2);
  transform: scaleX(1);
  transform-origin: left;
  transition: background 0.3s var(--ease);
}
.links a:hover::after, .links a:focus-visible::after,
.contact a:hover::after, .contact a:focus-visible::after { background: var(--fg); }

.contact {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.94rem;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

footer {
  margin-top: clamp(4rem, 12vh, 7rem);
}

.colophon {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--faint);
}

/* ── Theme switch — fixed, top-right ──────────────────────────────────── */
.switch {
  position: fixed;
  top: clamp(1.05rem, 2.4vw, 1.85rem);
  right: clamp(1.25rem, 5vw, 3rem);
  z-index: 60;
  appearance: none;
  background: none;
  border: 0;
  padding: 6px;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
.switch-track {
  display: block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  position: relative;
  transition: border-color 0.3s var(--ease);
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--fg);
  transition: transform 0.4s var(--ease), background 0.5s var(--ease);
}
[data-theme="light"] .switch-thumb { transform: translateX(20px); }
.switch:hover .switch-track,
.switch:focus-visible .switch-track { border-color: var(--fg); }
.switch:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }

/* ── Intro loader (WebGL) ─────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  transition: opacity 0.6s var(--ease);
}
#loader.done { opacity: 0; pointer-events: none; }
#loader-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.loader-pct {
  position: absolute;
  left: clamp(1.5rem, 7vw, 6rem);
  bottom: clamp(1.5rem, 7vh, 4rem);
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: #8f8f8f;
}
.loader-pct .loader-unit { opacity: 0.5; margin-left: 1px; }
html.loading { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  #loader { display: none; }
}

::selection { background: var(--accent); color: #04140b; }
