/* Sam Whitfield — homepage. YungStufi Neon design system (tokens v2), Night theme.
   Token names match the system's tokens.json 1:1. */

:root {
  /* Primitives: neon pairs */
  --neon-blue: #0099ff;   --neon-blue-deep: #00263f;
  --neon-pink: #ff0099;   --neon-pink-deep: #3f0026;   --neon-pink-light: #ff66c2;
  --neon-yellow: #ffcc00; --neon-yellow-deep: #3f3200;
  --neon-green: #00ff99;  --neon-green-deep: #003f26;
  /* Primitives: neutral ramp (only the steps Night uses) */
  --neutral-0: #ffffff;
  --neutral-300: #bdbdbd;
  --neutral-800: #333333;
  --neutral-900: #262626;
  /* Semantic (Night) */
  --surface-100: var(--neutral-800);
  --surface-200: var(--neutral-900);
  --ink: var(--neutral-0);
  --ink-muted: var(--neutral-300);
  --border: #ffffff1f;
  --focus-ring: var(--neon-pink-light);
  --link: var(--neon-green);
  /* Space, shape, stroke */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --radius-sm: 4px;
  --radius-control: 8px;
  --radius-md: 12px;
  --stroke-neon: 4px;
  --stroke-line: 2px;
  /* Layout and components */
  --layout-page-max: 1080px;
  --layout-gutter: 32px;
  --layout-section-gap: 96px;
  --layout-block-gap: 32px;
  --layout-grid-gap: 16px;
  --layout-topbar-h: 64px;
  --control-h: 44px;
  --control-pad-x: 16px;
  --card-pad: 24px;
  --z-topbar: 20;
  --z-skip: 70;
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

.tone-blue   { --neon: var(--neon-blue);   --deep: var(--neon-blue-deep); }
.tone-pink   { --neon: var(--neon-pink);   --deep: var(--neon-pink-deep); }
.tone-yellow { --neon: var(--neon-yellow); --deep: var(--neon-yellow-deep); }
.tone-green  { --neon: var(--neon-green);  --deep: var(--neon-green-deep); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--layout-topbar-h); }
body {
  margin: 0;
  /* Fill the screen so the footer sits at the bottom; the lamp takes up the slack. */
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  background: var(--surface-100);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px; line-height: 24px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--layout-page-max); margin: 0 auto; padding-inline: var(--layout-gutter); }

/* ---------- SkipLink ---------- */
.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: var(--z-skip);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-control);
  background: var(--neon-pink); color: var(--neon-pink-deep);
  font-weight: 700; font-size: 15px; line-height: 20px; text-decoration: none;
}
.skip-link:focus { top: var(--space-2); }

/* ---------- Button ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: var(--space-2) var(--control-pad-x);
  border-radius: var(--radius-control);
  background: var(--border); color: var(--ink);
  font-weight: 700; font-size: 15px; line-height: 20px; text-decoration: none;
  transition: filter .15s ease, background-color .15s ease;
}
.button-flat { background: transparent; }
.button-flat:hover { background: var(--border); }
.button-filled { background: var(--neon); color: var(--deep); }
.button-tinted { background: var(--deep); color: var(--neon); }
.button-filled:hover, .button-tinted:hover { filter: brightness(1.12); }
.button-lg { min-height: 52px; padding: 14px var(--space-6); font-size: 16px; }
.icon { flex: none; }

/* ---------- TopBar ---------- */
.topbar { position: sticky; top: 0; z-index: var(--z-topbar); background: var(--surface-200); }
.topbar-inner { display: flex; align-items: center; gap: var(--space-4); min-height: var(--layout-topbar-h); }
.topbar-name {
  margin-right: auto; border-radius: var(--radius-sm);
  font-weight: 800; font-style: italic; font-size: 18px; line-height: 24px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.nav { display: flex; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.nav-link { min-height: 40px; }

/* ---------- Lava lamp (the hero and links share one lamp) ---------- */
.lamp { position: relative; isolation: isolate; flex: 1 0 auto; }
.lava { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; contain: strict; }
.lava-goo { position: absolute; inset: 0; width: 100%; height: 100%; }

.art-spin { position: absolute; aspect-ratio: 1 / 1; }
.art-spin > .art-svg {
  display: block; width: 100%; height: 100%;
  animation: art-spin var(--spin, 90s) linear infinite var(--dir, normal);
}
.art-svg { overflow: visible; }
.art-outline { fill: var(--deep); stroke: var(--neon); stroke-width: var(--stroke-line); vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.art-ring { fill: var(--deep); }
.art-gap { fill: var(--surface-100); }
.art-core { fill: var(--neon); }
/* Ripples stay in place: they turn slowly and their rings pulse outward, like a drop hitting water */
.art-ripple path {
  transform-box: view-box; transform-origin: 100px 100px;
  animation: art-pulse 5s ease-in-out infinite;
}
.art-ripple path:nth-child(2) { animation-delay: -0.4s; }
.art-ripple path:nth-child(3) { animation-delay: -0.8s; }
.art-ripple path:nth-child(4) { animation-delay: -1.2s; }
.art-ripple path:nth-child(5) { animation-delay: -1.6s; }
.art-ripple path:nth-child(6) { animation-delay: -2s; }
.art-ripple path:nth-child(7) { animation-delay: -2.4s; }
.art-ripple path:nth-child(8) { animation-delay: -2.8s; }

@keyframes art-spin { to { transform: rotate(360deg); } }
@keyframes art-pulse { 50% { transform: scale(1.05); } }

/* ---------- Hero ---------- */
.hero {
  min-height: min(78vh, 720px);
  display: flex; flex-direction: column; justify-content: center; gap: var(--layout-block-gap);
  padding-block: var(--space-16);
}
/* NeonTitle, display size: stacked lines go blue → pink → yellow */
.neon-stack {
  margin: 0; display: flex; flex-direction: column; gap: var(--space-2);
  font-weight: 900; font-style: italic; line-height: .95; letter-spacing: -0.02em;
  font-size: clamp(60px, 9vw, 112px);
}
.neon {
  color: var(--deep);
  -webkit-text-stroke: var(--stroke-neon) var(--neon);
  -webkit-text-stroke-width: clamp(3px, 0.35vw, 5px);
  paint-order: stroke fill;
}
.lede { margin: 0; max-width: 34ch; font-size: 18px; line-height: 28px; color: var(--ink-muted); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Links ---------- */
.links { display: flex; flex-direction: column; gap: var(--layout-block-gap); padding-bottom: var(--layout-section-gap); }
.eyebrow {
  margin: 0; font-weight: 700; font-size: 13px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted);
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: var(--layout-grid-gap); }

/* Card, toned: deep fill, neon title. The title is the link and covers the whole card. */
.card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
  padding: var(--card-pad); border-radius: var(--radius-md);
  background-color: var(--deep); color: var(--ink);
}
.card:hover { background-image: linear-gradient(var(--border), var(--border)); }
.tag {
  align-self: flex-start; padding: 2px var(--space-2); border-radius: var(--radius-sm);
  background: var(--surface-200); color: var(--neon);
  font-weight: 700; font-size: 12px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase;
}
.card-title { margin: 0; font-weight: 800; font-style: italic; font-size: 24px; line-height: 30px; }
.card-link { color: var(--neon); text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-md); }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.card-text { margin: 0; color: #ffffffd9; }
.card-foot { margin: auto 0 0; padding-top: var(--space-2); display: flex; }
.card-cta { background: transparent; }

/* Reveal on scroll (main.js adds .js, .reveal and .is-visible) */
.js .reveal { opacity: 0; }
.js .reveal.is-visible { opacity: 1; animation: reveal .5s ease backwards; }
@keyframes reveal { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Footer ---------- */
.footer { background: var(--surface-200); color: var(--ink-muted); }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: var(--space-2) var(--space-6); padding-block: var(--space-6) var(--space-8);
  font-size: 15px; line-height: 22px;
}
.footer-inner p { margin: 0; }
.footer-small { font-size: 12px; line-height: 16px; }
/* Rotating quote (main.js swaps the text while it is faded out) */
.footer-text { transition: opacity .4s ease; }
.footer-text.is-changing { opacity: 0; }

/* ---------- Mid: tighter section gap (the top bar stays on one line) ---------- */
@media (max-width: 760px) {
  :root { --layout-section-gap: 80px; }
}

/* ---------- Narrow ---------- */
@media (max-width: 600px) {
  :root { --layout-gutter: 16px; --card-pad: 16px; }
  .hero { min-height: auto; padding-block: var(--space-12); }
  .lede { font-size: 16px; line-height: 24px; }
  .actions { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .art-spin > .art-svg, .art-ripple path { animation: none !important; }
  .button, .footer-text { transition: none; }
  .js .reveal, .js .reveal.is-visible { opacity: 1; animation: none; }
}
