/* SnapSplit — shared site styles
   Tokens pulled directly from SSColors.swift ("Safelight"): a warm,
   near-black room with one amber lamp left burning, and a cool, fixed
   counter-tone for whatever's being measured against.

   Type is a single system stack, split into two voices by weight/width
   only — the same approach as SSTypography.swift (compressed+heavy for
   structure, plain+regular for reading), not two paired webfonts. On an
   Apple device this renders actual San Francisco. */

:root {
  --bg: #0b0a09;
  --surface: #151210;
  --surface-elevated: #221e1a;
  --text: #f5f0ea;
  --text-secondary: rgba(245, 240, 234, 0.62);
  --text-tertiary: rgba(245, 240, 234, 0.38);
  --hairline: rgba(245, 240, 234, 0.1);
  --accent: #ffaa2b;
  --accent-wash: rgba(255, 170, 43, 0.14);
  --on-accent: #0b0a09;
  --archive: #9aaab5;
  --archive-wash: rgba(154, 170, 181, 0.16);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --container: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ambient-y: 34%;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The one lamp: a soft warm glow, fixed to the viewport, whose vertical
   position (--ambient-y) main.js updates on scroll — it drifts down the
   page with you rather than sitting still, which is the whole "feeling
   of travel" the flat dark ground was missing on its own. */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(60vh circle at 50% var(--ambient-y), var(--accent-wash) 0%, transparent 70%);
}

img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 800;
  font-stretch: condensed;
  letter-spacing: -0.015em;
  line-height: 1.02;
  margin: 0;
}
h1 { font-size: clamp(40px, 6.4vw, 76px); font-weight: 900; }
h2 { font-size: clamp(30px, 4.2vw, 48px); }
h3 { font-size: 24px; }

p { margin: 0; color: var(--text-secondary); max-width: 54ch; }
.lede { font-size: 18px; line-height: 1.55; color: var(--text-secondary); }

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 20px 0;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(11, 10, 9, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--hairline);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.wordmark {
  font-family: var(--font);
  font-weight: 800;
  font-stretch: condensed;
  font-size: 19px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}
.nav-links { display: flex; gap: 24px; font-size: 14px; color: var(--text-secondary); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--text); }

/* ---------- Hero ---------- */

.hero { position: relative; z-index: 2; padding: 22vh 0 14vh; text-align: center; }
.hero .container { display: flex; flex-direction: column; align-items: center; }
.hero h1 { max-width: 15ch; margin: 0 auto 26px; }
.hero .lede { max-width: 46ch; margin: 0 auto 28px; }
.hero .note { font-size: 13px; color: var(--text-tertiary); margin-top: 14px; }

.store-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.store-btn:hover { filter: brightness(1.08); box-shadow: 0 8px 28px var(--accent-wash); }

.hero h1, .hero .lede, .hero .store-btn, .hero .note {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 1s var(--ease) both;
}
.hero .lede { animation-delay: 0.1s; }
.hero .store-btn { animation-delay: 0.2s; }
.hero .note { animation-delay: 0.3s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Scroll-linked reveal ---------- */

.reveal { height: 320vh; position: relative; z-index: 2; }
.reveal-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.reveal-stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reveal-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-wash) 0%, transparent 70%);
  pointer-events: none;
  /* JS sets the full `transform` (translate(-50%,-50%) scale(...)) on
     scroll; this is just the resting value before JS first runs. */
  transform: translate(-50%, -50%);
}
.rcard {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 320px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  will-change: transform, opacity;
}
.rcard-fill { position: absolute; inset: 0; border-radius: 20px; opacity: 0.55; }
.rcard-then { border: 1px solid rgba(154, 170, 181, 0.4); }
.rcard-then .rcard-fill { background: linear-gradient(160deg, rgba(154, 170, 181, 0.16), transparent 60%); }
.rcard-now { border: 1px solid rgba(255, 170, 43, 0.55); }
.rcard-now .rcard-fill { background: linear-gradient(160deg, rgba(255, 170, 43, 0.18), transparent 60%); }
.rcard-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(11, 10, 9, 0.62);
}
.rcard-then .rcard-tag { color: var(--archive); }
.rcard-now .rcard-tag { color: var(--accent); }

/* width:100% (not just max-width) matters here: every child is
   position:absolute, so this box has no in-flow content to size itself
   by and would otherwise collapse toward zero width. */
.reveal-copy { position: relative; width: 100%; margin-top: 44px; text-align: center; max-width: 480px; min-height: 84px; padding: 0 24px; }
.reveal-copy h3 { margin-bottom: 10px; }
.reveal-copy p { margin: 0 auto; }
.reveal-phase {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  will-change: opacity, transform;
}
.reveal-progress {
  position: absolute;
  bottom: 6vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.reveal-progress span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hairline);
  transition: background-color 0.3s;
}
.reveal-progress span.active { background: var(--accent); }

/* ---------- Sections ---------- */

section.plain { position: relative; z-index: 2; padding: 14vh 0; }
.section-copy { max-width: 640px; }
.section-copy h2 { margin-bottom: 18px; }
.section-copy .lede { margin-bottom: 22px; }

.chevron-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 3px;
}
.chevron-link svg { transition: transform 0.2s var(--ease); }
.chevron-link:hover { border-color: var(--accent); color: var(--accent); }
.chevron-link:hover svg { transform: translateX(3px); }

/* ---------- Pro ---------- */

.pro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.pro-list { list-style: none; margin: 0; padding: 0; }
.pro-list li {
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
  color: var(--text);
  font-size: 15px;
}
.pro-list li:last-child { border-bottom: 1px solid var(--hairline); }

/* ---------- Footer ---------- */

footer { border-top: 1px solid var(--hairline); padding: 40px 0; position: relative; z-index: 2; }
footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
}
footer .foot-links { display: flex; gap: 22px; }
footer a { text-decoration: none; color: var(--text-secondary); }
footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .pro-grid { grid-template-columns: 1fr; gap: 32px; }
  .reveal-stage { height: 340px; }
  .rcard { width: 190px; height: 254px; }
}

/* ---------- Reduced motion: skip the scrub, show the resting state ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1, .hero .lede, .hero .store-btn, .hero .note { opacity: 1; transform: none; animation: none; }
  .reveal { height: auto; }
  .reveal-sticky { position: relative; height: auto; padding: 10vh 0; }
  .reveal-stage {
    position: relative;
    height: auto;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
  }
  .rcard { position: relative; top: auto; left: auto; transform: none !important; }
  .reveal-glow { display: none; }
  .reveal-copy { position: relative; margin-top: 0; }
  .reveal-phase {
    position: relative;
    opacity: 1 !important;
    transform: none !important;
    margin-bottom: 36px;
  }
  .reveal-progress { display: none; }
}
