/* ============================================================
   BUILD ATLAS  ·  shizu.me
   A survey of what Phil built with Claude.
   ============================================================ */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink:      #06070b;
  --ink-2:    #0a0c13;
  --ink-3:    #0f1220;
  --card:     #0c0f1a;
  --card-hi:  #12162400;
  --line:     rgba(255, 255, 255, 0.09);
  --line-2:   rgba(255, 255, 255, 0.14);

  --text:     #e9edf6;
  --muted:    #9aa4bd;
  --faint:    #5f6885;

  --active:   #ffce6a;   /* brightest star: touched Aug */
  --warm:     #7fb6ff;   /* mid: Jul */
  --resting:  #6470a0;   /* dim: Jun or earlier */
  --accent:   #6aa8ff;   /* atlas lines, links */

  --display: "Space Grotesk", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans:    "Inter", system-ui, -apple-system, sans-serif;

  --maxw: 1180px;
  --pad: clamp(1.15rem, 4vw, 3.5rem);
  --gutter: clamp(1rem, 2.2vw, 1.5rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--ink); }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

.mono {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* skip link */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--ink);
  padding: 0.6rem 1rem; font-family: var(--mono); font-size: 0.8rem;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(0.9rem, 2vw, 1.4rem) var(--pad);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom-color: var(--line);
}
.nav__brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.nav__brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--active);
  box-shadow: 0 0 12px 2px var(--active);
}
.nav__links { display: flex; gap: clamp(0.9rem, 2vw, 1.7rem); align-items: center; }
.nav__links a {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  position: relative; padding: 0.2rem 0; transition: color 0.25s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--accent); transition: width 0.3s var(--ease);
}
.nav__links a:hover, .nav__links a:focus-visible { color: var(--text); }
.nav__links a:hover::after, .nav__links a:focus-visible::after { width: 100%; }

.nav__toggle {
  display: none; background: none; border: 1px solid var(--line-2);
  color: var(--text); font-family: var(--mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.1em; padding: 0.5rem 0.8rem;
  border-radius: 4px; cursor: pointer;
}

@media (max-width: 820px) {
  .nav__links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center;
    gap: 1.6rem; background: color-mix(in srgb, var(--ink) 96%, transparent);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    transform: translateY(-100%); transition: transform 0.5s var(--ease);
    z-index: 90;
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { font-size: 1rem; }
  .nav__toggle { display: inline-block; position: relative; z-index: 95; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: clamp(2.5rem, 6vh, 5rem);
  overflow: hidden;
  isolation: isolate;
}
/* static first-frame fallback painted behind the canvas */
.hero__poster {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(1200px 700px at 72% 18%, rgba(106, 168, 255, 0.12), transparent 60%),
    radial-gradient(900px 600px at 20% 85%, rgba(255, 206, 106, 0.08), transparent 55%),
    radial-gradient(circle at 50% 40%, #0a0d17 0%, var(--ink) 70%);
}
.hero__canvas {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%; display: block;
}
.no-webgl .hero__canvas { display: none; }

.hero__sub code {
  font-family: var(--mono); font-size: 0.85em;
  color: var(--accent); background: rgba(106, 168, 255, 0.08);
  padding: 0.1em 0.4em; border-radius: 4px;
}

section[id] { scroll-margin-top: 80px; }
.hero::after { /* vignette + bottom fade for legibility */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, var(--ink) 2%, rgba(6, 7, 11, 0.35) 30%, transparent 55%),
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(6, 7, 11, 0.55) 100%);
}

.hero__inner { position: relative; z-index: 2; width: 100%; }

.hero__eyebrow {
  color: var(--accent);
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.1rem; align-items: center;
  margin-bottom: clamp(1rem, 3vh, 1.8rem);
}
.hero__eyebrow .sep { color: var(--faint); }

.hero__title {
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-size: clamp(3.4rem, 15vw, 12rem);
  text-transform: uppercase;
  margin: 0 0 clamp(1.2rem, 3vh, 2rem);
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .word { display: inline-block; will-change: transform; }
.hero__title .atlas {
  color: transparent;
  -webkit-text-stroke: 1.4px var(--text);
  text-stroke: 1.4px var(--text);
}

.hero__sub {
  max-width: 44ch;
  font-size: clamp(1.02rem, 0.95rem + 0.6vw, 1.35rem);
  color: var(--text);
  margin-bottom: 1rem;
}
.hero__meta {
  color: var(--muted); font-family: var(--mono); font-size: 0.76rem;
  letter-spacing: 0.03em; text-transform: none;
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-bottom: clamp(1.6rem, 4vh, 2.4rem);
}
.hero__meta .sep { color: var(--faint); }

/* status legend */
.legend { display: flex; flex-wrap: wrap; gap: 0.7rem 1.4rem; align-items: center; }
.legend__item { display: inline-flex; align-items: center; gap: 0.55rem; }
.legend__star {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
}
.legend__star--active  { background: var(--active);  box-shadow: 0 0 14px 3px color-mix(in srgb, var(--active) 70%, transparent); }
.legend__star--warm    { background: var(--warm);    box-shadow: 0 0 9px 1px color-mix(in srgb, var(--warm) 55%, transparent); }
.legend__star--resting { background: var(--resting); }
.legend__label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--muted); }
.legend__label b { color: var(--text); font-weight: 500; }

.hero__cue {
  position: absolute; left: var(--pad); bottom: clamp(1rem, 3vh, 1.6rem);
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); z-index: 2;
}
.hero__cue .bar { width: 34px; height: 1px; background: var(--faint); position: relative; overflow: hidden; }
.hero__cue .bar::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: translateX(-100%); animation: cue 2.6s var(--ease) infinite;
}
@keyframes cue { 0% { transform: translateX(-100%); } 55%,100% { transform: translateX(100%); } }

/* atlas hover tooltip (project name on star hover) */
.tip {
  position: fixed; z-index: 40; pointer-events: none;
  transform: translate(-50%, -160%); opacity: 0;
  transition: opacity 0.18s var(--ease);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em;
  padding: 0.34rem 0.6rem; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 5px; white-space: nowrap; color: var(--text);
}
.tip.is-on { opacity: 1; }
.tip .st { color: var(--faint); }
.tip .hint { color: var(--accent); }
.tip .hint::before { content: " · "; color: var(--faint); }

.hero__hint { margin-top: clamp(1rem, 2.6vh, 1.6rem); color: var(--faint); font-size: 0.66rem; letter-spacing: 0.08em; }
.hero__hint span { color: var(--accent); }

/* a clicked star scrolls to its card and pulses it */
.proj.is-target {
  border-color: color-mix(in srgb, var(--st-color) 62%, var(--line-2));
  animation: targetPulse 1.7s var(--ease);
}
@keyframes targetPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st-color) 55%, transparent); }
  100% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--st-color) 0%, transparent); }
}

/* ============================================================
   SECTION SHELL
   ============================================================ */
.section { position: relative; padding-block: clamp(4rem, 11vh, 8.5rem); }
.section--tight { padding-block: clamp(3rem, 7vh, 5rem); }

.eyebrow { color: var(--accent); display: inline-block; margin-bottom: 1rem; }

/* overview / intro */
.overview__grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
}
.overview__lede {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.5rem, 1.1rem + 1.9vw, 2.6rem);
  line-height: 1.18; letter-spacing: -0.01em; color: var(--text);
}
.overview__lede b { color: var(--active); font-weight: 500; }
.overview__note { color: var(--muted); font-size: 0.98rem; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter); margin-top: clamp(2.5rem, 6vh, 4rem);
  border-top: 1px solid var(--line); padding-top: clamp(1.6rem, 4vh, 2.4rem);
}
.stat__num {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem); line-height: 1;
  letter-spacing: -0.02em;
}
.stat__num .u { color: var(--accent); }
.stat__label { color: var(--muted); font-family: var(--mono); font-size: 0.68rem; margin-top: 0.5rem; }

/* ============================================================
   GROUPS + PROJECT CARDS
   ============================================================ */
.group { border-top: 1px solid var(--line); padding-top: clamp(2rem, 5vh, 3.2rem); }
.group + .group { margin-top: clamp(3rem, 8vh, 6rem); }

.group__head { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem clamp(1.2rem, 3vw, 2.6rem); align-items: start; margin-bottom: clamp(2rem, 5vh, 3rem); }
.group__num {
  font-family: var(--mono); font-weight: 700; font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--accent); grid-row: 1 / span 2; padding-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.group__title {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.7rem, 1.1rem + 3vw, 3.2rem); line-height: 1.02; letter-spacing: -0.015em;
}
.group__lede { color: var(--muted); max-width: 62ch; margin-top: 0.5rem; }
.group__tag { color: var(--faint); font-style: normal; }

.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: var(--gutter);
}

.proj {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--card), var(--ink-2));
  border: 1px solid var(--line); border-radius: 12px;
  padding: 1.35rem 1.35rem 1.5rem;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.proj::before { /* status accent edge */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--st-color); opacity: 0.8;
}
.proj[data-status="active"]  { --st-color: var(--active); }
.proj[data-status="warm"]    { --st-color: var(--warm); }
.proj[data-status="resting"] { --st-color: var(--resting); }

.proj:hover, .proj:focus-within {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--st-color) 45%, var(--line-2));
  box-shadow: 0 18px 44px -22px color-mix(in srgb, var(--st-color) 55%, transparent),
              0 1px 0 0 color-mix(in srgb, var(--st-color) 30%, transparent) inset;
}

/* linked cards: whole card is the click target (stretched link) */
.proj--linked { cursor: pointer; }
.proj__link { position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.proj__link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.proj--linked .proj__name { display: inline-flex; align-items: baseline; gap: 0.4rem; }
.proj--linked .ext {
  width: 0.66em; height: 0.66em; flex: none; align-self: center;
  color: var(--st-color); opacity: 0.55;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.proj--linked:hover .proj__name, .proj--linked:focus-within .proj__name { color: var(--accent); }
.proj--linked:hover .ext, .proj--linked:focus-within .ext { opacity: 1; transform: translate(2px, -2px); color: var(--accent); }

.proj__head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.7rem; }
.proj__name { font-family: var(--display); font-weight: 700; font-size: 1.22rem; letter-spacing: -0.01em; }
.proj__desc { color: var(--muted); font-size: 0.95rem; flex: 1; }
.proj__stack {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--faint); margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px solid var(--line);
}

.tag {
  flex: none; font-family: var(--mono); font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.28rem 0.5rem; border-radius: 999px; display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid color-mix(in srgb, var(--st-color) 40%, transparent);
  color: color-mix(in srgb, var(--st-color) 88%, white 12%);
  background: color-mix(in srgb, var(--st-color) 12%, transparent);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--st-color); }
.proj[data-status="active"] .tag::before { box-shadow: 0 0 8px 1px var(--active); }

/* ============================================================
   SIGNATURE THREADS
   ============================================================ */
.threads__head { margin-bottom: clamp(2.2rem, 5vh, 3.4rem); }
.threads__title {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.9rem, 1.1rem + 3.6vw, 3.6rem); line-height: 1; letter-spacing: -0.02em;
}
.threads__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gutter); }
.thread {
  border: 1px solid var(--line); border-radius: 12px; padding: 1.6rem 1.5rem;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.thread:hover { border-color: var(--line-2); transform: translateY(-3px); }
.thread__idx { color: var(--accent); font-family: var(--mono); font-size: 0.72rem; }
.thread__name { font-family: var(--display); font-weight: 700; font-size: 1.4rem; margin: 0.5rem 0 0.55rem; letter-spacing: -0.01em; }
.thread__blurb { color: var(--muted); font-size: 0.96rem; margin-bottom: 1.1rem; }
.thread__chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.03em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.24rem 0.6rem; background: rgba(255,255,255,0.02);
}

/* ============================================================
   CLOSING / FOOTER
   ============================================================ */
.closing { border-top: 1px solid var(--line); }
.closing__note {
  max-width: 66ch; color: var(--muted); font-size: 0.96rem;
}
.closing__note b { color: var(--text); font-weight: 500; }

.foot {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between;
  margin-top: clamp(2.5rem, 6vh, 4rem); padding-top: 1.5rem; border-top: 1px solid var(--line);
  color: var(--faint); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em;
}
.foot__brand { font-family: var(--display); font-weight: 700; letter-spacing: 0.14em; color: var(--text); font-size: 1rem; }
.foot a { color: var(--muted); transition: color 0.25s var(--ease); }
.foot a:hover { color: var(--accent); }

/* ============================================================
   REVEAL (JS-driven; safe defaults without JS)
   ============================================================ */
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }

/* word-split heading: hidden decorative words animate; accessible name preserved via aria-label */
.split .word { display: inline-block; }
.js .split .word { transform: translateY(105%); opacity: 0; }
.js .split.is-in .word { transform: none; opacity: 1; transition: transform 0.7s var(--ease), opacity 0.7s var(--ease); transition-delay: var(--d, 0ms); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .overview__grid { grid-template-columns: 1fr; align-items: start; gap: 1.6rem; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
  .threads__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .group__head { grid-template-columns: 1fr; }
  .group__num { grid-row: auto; }
  .cards { grid-template-columns: 1fr; }
  .hero { padding-bottom: 3.5rem; }
  .hero__cue { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .split .word { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__cue .bar::after { animation: none; }
  .proj, .thread, .nav { transition: none; }
  .proj.is-target { animation: none; }
}
