/* Spinjam site. Mode B, the approved graphic-only direction: rings, tactile
   panels and directional light rather than photography. Yellow marks the
   primary action or the product's own graphic and nothing else.

   Type is Barlow, self-hosted. The brand has NOT designated a supporting font
   family, so this is a site choice, not canon. It was picked to match the
   wordmark's character: low-contrast grotesk, slightly rounded, athletic.
   Semi Condensed carries display, regular carries body.

   Values come from brand/docs/brand-tokens.json at the repo root. That file is
   the authority: a colour here that disagrees with it is a defect here.

   The pack defines seven colours and no more. Where a page needs something the
   pack does not name — a state tone, a third surface — take the app's measured
   token from app/lib/theme.dart rather than inventing one. Site and app are
   the same brand on two screens. brand/USAGE.md carries the whole rule. */

/* ---- type: Barlow, self-hosted. No CDN, no external host on this site. ---- */
@font-face {
  font-family: 'Barlow';
  src: url('/assets/fonts/barlow-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/assets/fonts/barlow-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  src: url('/assets/fonts/barlow-semi-condensed-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Barlow Semi Condensed';
  src: url('/assets/fonts/barlow-semi-condensed-800.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  --bg:        #0B0B0B;   /* brand dark */
  --panel:     #1A1A1A;   /* brand charcoal */
  --panel-2:   #232323;   /* charcoal, one 1.13 step up: the app ramp's step */
  --yellow:    #FFE600;   /* brand yellow, 15.5:1 on the ground */
  --good:      #3DD68C;   /* kGood, app/lib/theme.dart — a state, not the accent */
  --critical:  #FF5252;   /* kCritical, app/lib/theme.dart — 5.4:1 on the panel */

  --text:      #FFFFFF;   /* brand white */
  --text-dim:  #E9E9E9;   /* brand light grey */
  --text-faint:#BFBFBF;   /* brand grey, 10.7:1 on the ground */
  --border:    rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);

  --radius:    16px;
  --radius-sm: 10px;
  --maxw:      1120px;

  --font: 'Barlow', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
          Arial, "Apple Color Emoji", sans-serif;
  --font-display: 'Barlow Semi Condensed', 'Barlow', system-ui, -apple-system,
          "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(16px, 1rem + 0.15vw, 18px);
  line-height: 1.6;
  letter-spacing: 0.005em;
  overflow-x: hidden;               /* guard against accidental h-scroll */
  /* ambient depth: a low yellow glow up top, warm and off-centre */
  background-image:
    radial-gradient(120% 70% at 72% -10%, rgba(255, 230, 0, 0.10), transparent 55%),
    radial-gradient(90% 60% at 8% 4%, rgba(255, 230, 0, 0.04), transparent 60%);
  background-attachment: fixed;
}

/* Mode B asks for oversized cropped rings, directional light and physical
   texture. Two flywheel rings crop off the viewport corners, a low diagonal
   streak reads as motion, and a fine grain kills the banding a flat dark page
   gets on cheap panels. All decorative, all behind the content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 88% 6%, transparent 0 292px,
      rgba(255, 230, 0, 0.20) 292px 295px, transparent 296px),
    radial-gradient(circle at 88% 6%, transparent 0 338px,
      rgba(255, 255, 255, 0.05) 338px 340px, transparent 341px),
    radial-gradient(circle at 88% 6%, transparent 0 214px,
      rgba(255, 255, 255, 0.07) 214px 215px, transparent 216px),
    radial-gradient(circle at 4% 88%, transparent 0 246px,
      rgba(255, 255, 255, 0.055) 246px 248px, transparent 249px),
    repeating-linear-gradient(114deg,
      rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 190px);
}

/* Grain. A single inline turbulence, no request, no external host. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.05'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

/* ---- accessibility helpers ---- */
.visually-hidden {
  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: 12px; top: -60px;
  background: var(--yellow); color: #000; font-weight: 700;
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 20; transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

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

/* ---- layout shell ---- */
.site-header,
.hero,
.features,
.waitlist,
.footer-inner {
  width: min(100% - 2.5rem, var(--maxw));
  margin-inline: auto;
}

/* ---- header ---- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0;
}
.nav-cta {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.nav-cta:hover { color: var(--text); border-color: var(--border-strong); }

/* ---- hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem);
}

.eyebrow {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.tagline {
  font-family: var(--font-display);
  margin: 1.1rem 0 0;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
}

.lede {
  margin: 1.1rem 0 0;
  max-width: 44ch;
  color: var(--text-dim);
  font-size: 1.02rem;
}

.hero-btn { margin-top: 1.8rem; }

/* hero graphic */
.hero-graph {
  position: relative;
  margin: 0;
}
.hero-graph-glow {
  position: absolute;
  inset: -8% -6% -12% -6%;
  background: radial-gradient(60% 60% at 50% 50%, rgba(255, 230, 0, 0.16), transparent 70%);
  filter: blur(28px);
  z-index: 0;
  animation: breathe 6s ease-in-out infinite;
}
.hero-graph-img {
  position: relative;
  z-index: 1;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 28px 70px rgba(0, 0, 0, 0.6);
}
.hero-graph-cap {
  position: relative;
  z-index: 1;
  margin-top: 0.9rem;
  font-size: 0.82rem;
  color: var(--text-faint);
  text-align: center;
}
.cap-yellow { color: var(--yellow); font-weight: 600; }
.cap-white  { color: var(--text); font-weight: 600; }

@keyframes breathe {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

/* ---- features / beats (editorial numbered list, not a card grid) ---- */
.features { padding: clamp(1rem, 3vw, 2rem) 0 clamp(3rem, 7vw, 5.5rem); }

.heading-accent { color: var(--yellow); }

.section-heading {
  font-family: var(--font-display);
  margin: 0 0 2rem;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.beats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: clamp(1.4rem, 3vw, 2.6rem);
}
.beat {
  padding-top: 1.3rem;
  border-top: 1px solid var(--border);
}
.beat-index {
  display: block;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
}
.beat-title {
  font-family: var(--font-display);
  margin: 0 0 0.45rem;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.beat-desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
  max-width: 32ch;
}

/* ---- waitlist ---- */
.waitlist { padding: 0 0 clamp(3rem, 7vw, 5.5rem); }

.waitlist-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 42%),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 26px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.8rem, 4vw, 3rem);
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.waitlist-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
  opacity: 0.7;
}
.waitlist-heading {
  font-family: var(--font-display);
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.waitlist-sub {
  margin: 0.6rem 0 1.6rem;
  color: var(--text-dim);
}

.waitlist-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.waitlist-input {
  flex: 1 1 220px;
  min-width: 0;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  padding: 0.85rem 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.waitlist-input::placeholder { color: var(--text-faint); }
.waitlist-input:focus-visible {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 230, 0, 0.25);
}

/* ---- buttons (black on yellow — the primary action) ---- */
.btn {
  font-family: var(--font-display);
  display: inline-block;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--yellow);
  color: #000;
  padding: 0.85rem 1.5rem;
  box-shadow: 0 6px 22px rgba(255, 230, 0, 0.18);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }
.waitlist-submit { flex: 0 0 auto; }

.waitlist-note {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.waitlist-status {
  margin: 0.7rem 0 0;
  min-height: 1.3em;
  font-size: 0.9rem;
  font-weight: 600;
}
.waitlist-status.is-success { color: var(--good); }
.waitlist-status.is-error   { color: var(--critical); }

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.2rem 0 3rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-copy {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer-builder { color: var(--text-dim); }

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
}
.footer-link {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.footer-link:hover { color: var(--text); border-color: var(--border-strong); }

.credits { max-width: 42ch; }
.credits-summary { cursor: pointer; list-style: none; }
.credits-summary::-webkit-details-marker { display: none; }
.credits-summary::before { content: "+ "; color: var(--yellow); font-weight: 700; }
.credits[open] .credits-summary::before { content: "– "; }
.credits-body {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-faint);
}
.credits-body p { margin: 0 0 0.5rem; }

/* ---- reveal-on-load (progressive; content is visible without JS) ---- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .beat, .waitlist-panel {
    animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .hero-copy > * { animation-delay: calc(var(--i, 0) * 60ms); }
  .beat:nth-child(1) { animation-delay: 80ms; }
  .beat:nth-child(2) { animation-delay: 150ms; }
  .beat:nth-child(3) { animation-delay: 220ms; }
  .beat:nth-child(4) { animation-delay: 290ms; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-graph-glow { animation: none; }
  body::before, body::after { display: none; }
  * { scroll-behavior: auto; }
}

/* ---- responsive ---- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    padding-top: 2rem;
  }
  .hero-graph { order: 2; }
  .beats { grid-template-columns: 1fr; gap: 0; }
  .beat { padding: 1.2rem 0; }
  .beat-desc { max-width: none; }
}

@media (max-width: 480px) {
  .nav-cta { display: none; }
  .waitlist-form { flex-direction: column; }
  /* column layout: the 220px flex-basis would otherwise size HEIGHT — reset it
     so the input is a normal single-line, full-width field above the button. */
  .waitlist-input { flex: none; width: 100%; }
  .waitlist-submit { width: 100%; }
}

/* ---------------------------------------------------------------------------
   Multi-page shell. The site grew from one landing page to four, so the header
   and footer became shared furniture rather than page decoration.
   --------------------------------------------------------------------------- */

.site-header {
  gap: 20px;
}

/* The reversed lockup, traced off the approved identity board. The standard
   lockup sets the wordmark in black and disappears on this ground. */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand-lockup img { display: block; height: 34px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }
/* The current-page marker is STATE, not an action. It sat in yellow next to a
   yellow CTA, which spends the accent twice on one row. */
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--text);
}
.site-nav .nav-cta { border-bottom: 0; }

@media (max-width: 640px) {
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 0.88rem; }
  .brand-lockup img { height: 26px; }
}

/* --- page shell for the inner pages -------------------------------------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}
.page .page-eyebrow {
  font-family: var(--font-display);
  color: var(--text-faint);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.page h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.page-lede { color: var(--text-dim); font-size: 1.12rem; margin: 0 0 40px; }
.page h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 44px 0 12px;
  letter-spacing: -0.01em;
}
.page h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 28px 0 8px; }
.page p, .page li { color: var(--text-dim); }
.page a { color: var(--text); text-underline-offset: 3px; }
.page a:hover { color: var(--yellow); }

/* A numbered walkthrough. The number IS the sequence, so it earns the marker. */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 28px 56px;
  border-left: 1px solid var(--border);
  margin-left: 16px;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -17px;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 0.78rem;
  display: grid;
  place-items: center;
}
.steps h3 { margin-top: 0; }

.callout {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 60%),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 28px 0;
}
.callout p:last-child { margin-bottom: 0; }

.spec-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.spec-table th, .spec-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.spec-table th { color: var(--text); font-weight: 600; }
.spec-table td { color: var(--text-dim); }

/* Wide content scrolls inside its own box so the page body never does. */
.scroll-x { overflow-x: auto; }

/* The hero headline was a <p> under a type-set wordmark. The wordmark is now
   the real lockup in the header, so the tagline became the <h1> and needs the
   size the wordmark used to carry. */
.hero-copy h1.tagline {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--text);
}
