/* GrindSplit marketing site. Tokens mirror GS in the app's DesignSystem.swift. */
:root {
  --ground: #000;
  --raised: #1A1C20;
  --elevated: #31363E;
  --hairline: #333A2A;
  --hairline-strong: #4A5638;
  --ink: #F2F4EF;
  --ink-2: #9BA391;
  --ink-3: #7C8472;
  --on-accent: #0D0F0B;
  --accent: #9EE81B;
  --accent-deep: #5FD400;
  --accent-bright: #A8F029;
  --attention: #FFD21B;
  --critical: #FF4438;
  --suggestion: #3E9BFF;
  --bolt: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
  --display: "Barlow Condensed", "SF Pro Display", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 5vw, 48px);
  --max: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.label {
  font: 600 13px/1 var(--display);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
h1, h2, h3 { font-family: var(--display); font-style: italic; font-weight: 800; line-height: .95; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(40px, 6vw, 68px); letter-spacing: -.01em; }
h3 { font-size: 26px; font-weight: 700; line-height: 1.05; }
.lede { color: var(--ink-2); font-size: clamp(17px, 2vw, 20px); max-width: 58ch; }

/* 12° — the angle the bolt cuts through the G (GSSlant.lean in the app). */
.slant { clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(0, 0, 0, .72); backdrop-filter: blur(14px); border-color: var(--hairline); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.nav__logo { display: inline-block; padding-block: 15px; }
.nav__logo img { height: 18px; width: auto; }
.nav__links { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  text-decoration: none; color: var(--ink-2);
  font: 600 15px/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
  transition: color .2s;
}
.nav__links a:hover { color: var(--ink); }
.nav__actions { display: flex; align-items: center; gap: 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; background: var(--accent); color: var(--on-accent);
  font: 700 15px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; font-style: italic;
  text-decoration: none; border: 0; white-space: nowrap;
}
.pill--ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 2s infinite; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: 140px; padding-bottom: 96px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 20%, transparent 75%);
  opacity: .35;
}
.hero__glow {
  position: absolute; width: 720px; height: 720px; right: -120px; top: 40px; border-radius: 50%;
  background: radial-gradient(circle, rgba(158, 232, 27, .28), transparent 62%);
  filter: blur(20px); animation: pulse 6s ease-in-out infinite; pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(56px, 9vw, 112px); letter-spacing: -.015em; margin: 18px 0 22px; }
.hero h1 em { font-style: italic; background: var(--bolt); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 32px; }
.badge img { height: 54px; width: auto; }
.badge--soon { position: relative; }
.soon {
  font: 700 13px/1 var(--display); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 8px;
}
.hero__facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 40px; color: var(--ink-3); font: 600 14px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.hero__facts span::before { content: "/ "; color: var(--accent); }

/* Load-in sequence — runs once; reduced-motion users get the final state. */
.rise { animation: rise .9s var(--ease) both; }
.rise:nth-child(2) { animation-delay: .08s; }
.rise:nth-child(3) { animation-delay: .16s; }
.rise:nth-child(4) { animation-delay: .24s; }
.rise:nth-child(5) { animation-delay: .32s; }

/* ---------- Phone frames (real app screenshots) ---------- */
.stage { position: relative; display: grid; place-items: center; min-height: 600px; }
.phone {
  position: relative; width: 290px; max-width: 100%;
  border-radius: 46px; padding: 11px; background: #15171a;
  box-shadow: 0 0 0 1px #2a2e33, 0 40px 80px -20px rgba(0, 0, 0, .9), 0 0 120px -30px rgba(158, 232, 27, .35);
}
.hero .phone { animation: float 7s ease-in-out infinite, rise 1s .2s var(--ease) both; }
.phone::before { /* Dynamic Island */
  content: ""; position: absolute; top: 22px; left: 50%; translate: -50% 0; z-index: 3;
  width: 30%; height: 26px; border-radius: 20px; background: #000;
}
/* Exactly the iPhone Pro screen ratio (1206x2622), so screenshots fill it with no cropping. */
.screen { position: relative; aspect-ratio: 1206 / 2622; border-radius: 36px; overflow: hidden; background: var(--ground); }
.screen img { width: 100%; height: 100%; object-fit: cover; }

.chip {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: rgba(26, 28, 32, .86); backdrop-filter: blur(10px);
  border: 1px solid var(--hairline-strong); border-radius: 6px; font: 600 13px/1.2 var(--body);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .8); white-space: nowrap;
  animation: float 6s ease-in-out infinite, rise .9s var(--ease) both;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip i.lime { background: var(--accent); }
.chip i.amber { background: var(--attention); }
/* Positioned against the phone, over parts of the screenshot with nothing in them: the status-bar
   row, and the strip below the tab bar (a cut-off row left over from the original capture). */
.device { position: relative; }
.chip--a { top: 8px; left: -84px; animation-delay: -2s, .5s; }
.chip--b { bottom: -14px; right: -64px; animation-delay: -4s, .7s; }

/* ---------- Sports marquee ---------- */
.marquee { border-block: 1px solid var(--hairline); overflow: hidden; padding: 22px 0; background: #050605; }
.marquee__track { display: flex; gap: 48px; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span {
  font: 800 italic 30px/1 var(--display); text-transform: uppercase; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 48px; white-space: nowrap;
}
.marquee span::after { content: ""; width: 10px; height: 18px; background: var(--accent); transform: skewX(-12deg); }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding-block: clamp(80px, 12vw, 140px); }
.section--flush-top { padding-top: 0; }
.section__head { display: grid; gap: 18px; margin-bottom: 56px; max-width: 760px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; padding: 28px 24px 26px; border-radius: 6px;
  background: var(--raised); border: 1px solid #22252a;
  transition: transform .4s var(--ease), border-color .3s;
}
.card::before { /* pointer spotlight */
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(158, 232, 27, .12), transparent 60%);
}
.card:hover { transform: translateY(-4px); border-color: var(--hairline-strong); }
.card:hover::before { opacity: 1; }
.card--wide { grid-column: span 2; }
.card__icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--accent); background: rgba(158, 232, 27, .1); margin-bottom: 22px; }
.card__icon svg { width: 22px; height: 22px; }
.card p { color: var(--ink-2); margin: 12px 0 0; font-size: 16px; line-height: 1.55; }
.card .tag { position: absolute; top: 24px; right: 22px; font: 600 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

/* Showcase */
.showcase { background: linear-gradient(180deg, transparent, #070806 30%, #070806 70%, transparent); }
.screens { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; justify-items: center; align-items: start; }
.screens figure { margin: 0; display: grid; gap: 22px; justify-items: center; }
.screens figure:nth-child(even) { margin-top: 64px; }
.screens .phone { width: 100%; max-width: 262px; border-radius: 40px; padding: 9px; }
.screens .phone::before { top: 18px; height: 22px; }
.screens .screen { border-radius: 32px; }
.screens figcaption { text-align: center; max-width: 30ch; }
.screens figcaption b { display: block; font: 700 italic 22px/1.1 var(--display); margin-bottom: 6px; }
.screens figcaption span { color: var(--ink-2); font-size: 15px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; border-top: 1px solid var(--hairline); list-style: none; margin: 0; padding: 0; }
.step { padding: 32px 28px 8px 0; border-right: 1px solid var(--hairline); position: relative; }
.step + .step { padding-left: 28px; }
.step:last-child { border-right: 0; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  display: block; font: 800 italic 64px/1 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--hairline-strong);
  margin-bottom: 18px; transition: -webkit-text-stroke-color .4s, color .4s;
}
.step:hover::before { color: var(--accent); -webkit-text-stroke-color: var(--accent); }
.step p { color: var(--ink-2); font-size: 16px; margin: 10px 0 0; }

/* Pricing + final CTA */
.pricing {
  position: relative; overflow: hidden; text-align: center; padding: clamp(56px, 8vw, 96px) var(--gutter);
  border: 1px solid var(--hairline); border-radius: 8px;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(158, 232, 27, .14), transparent 70%), var(--raised);
}
.pricing h2 { margin: 16px auto 18px; }
.pricing .lede { margin: 0 auto 34px; }
.pricing .hero__cta { justify-content: center; margin-top: 0; }

/* Footer */
.footer { border-top: 1px solid var(--hairline); padding-block: 56px 40px; color: var(--ink-3); font-size: 14px; }
.footer__top { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; margin-bottom: 36px; }
.footer__top > a:first-child { display: inline-block; padding-block: 14px; }
.footer__top img { height: 16px; width: auto; }
.footer nav { display: flex; flex-wrap: wrap; gap: 0 26px; margin-left: auto; }
.footer nav a { color: var(--ink-2); text-decoration: none; display: inline-block; padding-block: 11px; }
.footer nav a:hover { color: var(--accent); }
.footer p { margin: 0 0 10px; max-width: 88ch; line-height: 1.6; }
/* Meta's brand rules allow the glyph in white or black only, so hover changes opacity, never color. */
.social { display: inline-flex; color: #fff; opacity: .7; transition: opacity .2s; padding: 12px; margin: -12px; }
.social:hover { opacity: 1; }
.social svg { width: 22px; height: 22px; fill: currentColor; }

/* Simple pages (privacy, terms, support, 404) */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page main { flex: 1; padding-top: 160px; padding-bottom: 120px; }
.page main h1 { font-size: clamp(48px, 8vw, 88px); margin: 16px 0 24px; }
.page .lede { margin-bottom: 36px; }

/* Long-form legal/support content (privacy, terms, consumer health data, accessibility, support).
   The site's global h1/h2/h3 are large italic display type for marketing headlines — fine for the
   one page title above, wrong for a document with a dozen numbered subheadings, so this block
   resets typography for everything below the title rather than fighting that selector per element. */
.legal { max-width: 740px; color: var(--ink-2); line-height: 1.7; font-size: 16px; }
.legal .doc-meta { color: var(--ink-3); font-size: 14px; margin: -8px 0 32px; }
.legal .callout {
  font-weight: 600; color: var(--ink); background: var(--raised);
  border-left: 3px solid var(--attention); border-radius: 0 6px 6px 0;
  padding: 14px 18px; margin: 0 0 16px;
}
.legal h2 {
  font-family: var(--body); font-style: normal; font-weight: 700; text-transform: none;
  letter-spacing: 0; color: var(--ink); font-size: 22px; line-height: 1.25;
  margin: 44px 0 14px;
}
.legal h2:first-of-type { margin-top: 36px; }
.legal h3 {
  font-family: var(--body); font-style: normal; font-weight: 600; text-transform: none;
  letter-spacing: 0; color: var(--ink); font-size: 17px; line-height: 1.3;
  margin: 28px 0 10px;
}
.legal p, .legal ul, .legal ol { margin: 0 0 16px; }
.legal ul, .legal ol { padding-left: 22px; }
.legal li + li { margin-top: 6px; }
.legal strong { color: var(--ink); }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal .table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--hairline); border-radius: 6px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
.legal th, .legal td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.legal thead th { background: var(--raised); font: 600 11px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.legal tbody tr:last-child td { border-bottom: 0; }
.legal tbody tr:nth-child(odd) { background: rgba(255, 255, 255, .02); }

/* Updates (release notes) */
.updates { display: grid; gap: 14px; max-width: 760px; }
.update { background: var(--raised); border: 1px solid #22252a; border-radius: 6px; padding: 26px 28px; }
.update__meta { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; color: var(--ink-3); font: 600 13px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.update__version { color: var(--on-accent); background: var(--accent); padding: 5px 10px; }
.update h2 { font-size: 30px; }
.update ul { margin: 14px 0 0; padding-left: 20px; color: var(--ink-2); }
.update li + li { margin-top: 6px; }

/* ---------- Scroll reveal (only when JS runs, so content is never hidden without it) ---------- */
.js .reveal { opacity: 0; translate: 0 28px; transition: opacity .9s var(--ease), translate .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; translate: 0 0; }
.d-06 { --d: .06s; } .d-08 { --d: .08s; } .d-12 { --d: .12s; } .d-16 { --d: .16s; } .d-18 { --d: .18s; } .d-24 { --d: .24s; }

@keyframes rise { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulse { 0%, 100% { opacity: .75; scale: 1; } 50% { opacity: 1; scale: 1.06; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes marquee { to { translate: -50% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .screens { grid-template-columns: repeat(2, 1fr); row-gap: 56px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(3) { padding-left: 0; }
  .step:nth-child(n+3) { border-top: 1px solid var(--hairline); }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .hero { padding-top: 112px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .stage { min-height: 560px; }
  .screens figure:nth-child(even) { margin-top: 0; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .card--wide { grid-column: auto; }
  .steps { grid-template-columns: 1fr; }
  .step, .step + .step { padding-left: 0; border-right: 0; }
  .step + .step { border-top: 1px solid var(--hairline); }
  .chip { display: none; }
  /* Phones become a swipeable row instead of four tall stacked screens. */
  .screens { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 20px;
    margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 12px; scrollbar-width: none; }
  .screens::-webkit-scrollbar { display: none; }
  .screens figure { flex: 0 0 78%; scroll-snap-align: center; }
  .badge img { height: 48px; }
  .nav .pill { padding-inline: 14px; font-size: 13px; }
  .nav__logo img { height: 15px; }
  .nav__actions { gap: 14px; }
  .nav__actions .social svg { width: 20px; height: 20px; }
}

/* Touch screens: buttons at least 44pt tall (Apple's minimum touch target). */
@media (pointer: coarse), (max-width: 860px) {
  .pill { padding-block: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; translate: none; }
}
