/* fastrhq.com: one stylesheet for every page. Dark only, like the app. */

:root {
  --ground: #131415;
  --surface: #1c1e20;
  --line: #2b2e31;
  --text: #f3f4f2;
  --muted: #959b9e;
  --go: #65b863;
  --set: #ffce49;
  --ready: #ff2d42;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.6rem, 7vw, 4.6rem);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--go); text-underline-offset: 3px; }
a:hover { color: #86d184; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--set);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* ── Header / footer ─────────────────────────────────────────────── */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font: 800 1.15rem/1 var(--display); font-stretch: 125%; letter-spacing: 0.01em;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand:hover { color: var(--text); }
.nav { display: flex; gap: 20px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: var(--step--1);
  font-weight: 500; letter-spacing: 0.02em;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

.site-footer {
  border-top: 1px solid var(--line); margin-top: 96px; padding: 32px 0 48px;
  color: var(--muted); font-size: var(--step--1);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ── Start lights: the ready / set / go sequence from the app's run screen ── */

.lights { display: inline-flex; gap: 6px; vertical-align: middle; }
.lights i {
  width: 10px; height: 10px; border-radius: 50%; display: block;
  background: currentColor; opacity: 0.25;
}
.lights i:nth-child(1) { color: var(--ready); }
.lights i:nth-child(2) { color: var(--set); }
.lights i:nth-child(3) { color: var(--go); opacity: 1; box-shadow: 0 0 12px var(--go); }

@media (prefers-reduced-motion: no-preference) {
  .lights.live i { animation: stage 3.6s infinite; }
  .lights.live i:nth-child(1) { animation-name: stage-ready; }
  .lights.live i:nth-child(2) { animation-name: stage-set; }
  .lights.live i:nth-child(3) { animation-name: stage-go; }
}
@keyframes stage-ready { 0%, 8% { opacity: .25 } 10%, 30% { opacity: 1 } 32%, 100% { opacity: .25 } }
@keyframes stage-set   { 0%, 30% { opacity: .25 } 32%, 52% { opacity: 1 } 54%, 100% { opacity: .25 } }
@keyframes stage-go    { 0%, 52% { opacity: .25; box-shadow: none } 54%, 96% { opacity: 1; box-shadow: 0 0 12px var(--go) } 100% { opacity: .25 } }

/* ── Landing ─────────────────────────────────────────────────────── */

.hero { padding: 72px 0 56px; }
.hero .wrap {
  display: grid; gap: 48px; align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font: 500 var(--step--1)/1 var(--mono);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.hero h1 {
  margin: 20px 0 20px;
  font: 800 var(--step-4)/0.98 var(--display); font-stretch: 125%;
  letter-spacing: -0.01em; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--go); }
.hero p.lede { margin: 0; max-width: 34em; color: #c9cdcb; font-size: var(--step-1); line-height: 1.5; }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 32px; }
.badge-soon {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 12px;
  background: var(--text); color: var(--ground);
  font: 600 var(--step-0)/1 var(--body); text-decoration: none;
}
a.badge-soon:hover { background: #ffffff; color: var(--ground); }
.cta small { color: var(--muted); font-size: var(--step--1); }

/* ── iPhone mockup ── drawn in CSS around a real screenshot (which already carries the
   Dynamic Island and status bar). Width drives everything else. */
.iphone {
  --w: 300px;
  position: relative; width: var(--w); aspect-ratio: 552 / 1200;
  padding: calc(var(--w) * 0.035);
  border-radius: calc(var(--w) * 0.17);
  background: linear-gradient(145deg, #4a4d52 0%, #1d1f22 22%, #0b0c0d 55%, #2c2f33 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
    inset 0 0 0 4px #050505,
    0 40px 80px -20px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.6);
  box-sizing: content-box;
}
/* side buttons */
.iphone::before, .iphone::after {
  content: ""; position: absolute; width: 3px; border-radius: 2px; background: #2a2c30;
}
.iphone::before { left: -3px; top: 22%; height: 9%; box-shadow: 0 calc(var(--w) * 0.22) 0 #2a2c30; }
.iphone::after  { right: -3px; top: 28%; height: 14%; }
.iphone-screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: calc(var(--w) * 0.135); background: #000;
}
.iphone-screen img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}

/* ── Hero showcase: one phone cycling through the screens ── */
.showcase { position: relative; display: grid; justify-items: center; gap: 28px; }
.showcase-glow {
  position: absolute; z-index: 0; top: 8%; left: 50%; width: 420px; height: 420px;
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(101, 184, 99, 0.28), rgba(101, 184, 99, 0) 65%);
  filter: blur(10px); pointer-events: none;
}
.showcase .iphone { z-index: 1; --w: 290px; }
.showcase .iphone-screen img {
  opacity: 0; transform: scale(1.04) translateY(10px);
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(.2, .7, .2, 1);
}
.showcase .iphone-screen img.is-active { opacity: 1; transform: none; }

.showcase-tabs {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: min(420px, 100%);
}
.showcase-tabs button {
  position: relative; overflow: hidden; cursor: pointer; text-align: left;
  padding: 10px 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.showcase-tabs button b { display: block; color: var(--text); font: 700 0.9rem/1.2 var(--display); font-stretch: 110%; }
.showcase-tabs button span { display: block; margin-top: 3px; font-size: 0.72rem; line-height: 1.3; }
.showcase-tabs button[aria-selected="true"] { background: var(--surface); border-color: #3a3e42; color: #c9cdcb; }
.showcase-tabs button[aria-selected="true"] b { color: var(--go); }
.showcase-tabs button i {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--go); transform: scaleX(0); transform-origin: left;
}
.showcase-tabs button[aria-selected="true"] i { transform: scaleX(1); }
.showcase-tabs button.is-timing i { animation: dwell 3.6s linear forwards; }
@keyframes dwell { from { transform: scaleX(0) } to { transform: scaleX(1) } }

/* ── Fan of phones ── */
.fan-section { padding: 40px 0 72px; overflow: hidden; }
.section-title {
  margin: 0 0 48px; text-align: center; text-wrap: balance;
  font: 800 var(--step-3)/1.1 var(--display); font-stretch: 118%;
}
.section-title span { display: block; color: var(--muted); font: 400 var(--step-1)/1.4 var(--body); margin-top: 10px; }
.fan { display: flex; justify-content: center; perspective: 1800px; padding: 12px 0 24px; }
.fan .iphone {
  --w: 210px; margin: 0 -14px;
  --ry: calc((var(--i) - 1.5) * -14deg);
  --ty: calc((var(--i) - 1.5) * (var(--i) - 1.5) * 14px);
  transform: translateY(var(--ty)) rotateY(var(--ry));
  transition: transform 0.5s cubic-bezier(.2, .7, .2, 1);
  z-index: calc(4 - (var(--i) - 1.5) * (var(--i) - 1.5));
}
.fan .iphone:hover { transform: translateY(calc(var(--ty) - 18px)) rotateY(0deg) scale(1.03); z-index: 10; }

@media (prefers-reduced-motion: no-preference) {
  .fan .iphone { animation: bob 6s ease-in-out infinite; animation-delay: calc(var(--i) * -1.5s); }
  .fan .iphone:hover { animation-play-state: paused; }
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -10px; }
}
@media (prefers-reduced-motion: reduce) {
  .showcase .iphone-screen img { transition: none; }
}

.features { padding: 24px 0; }
.features .wrap {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.feature { background: var(--ground); padding: 32px; }
.feature .tag { color: var(--go); font: 500 var(--step--1)/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.feature h2 { margin: 14px 0 10px; font: 700 var(--step-2)/1.15 var(--display); font-stretch: 112%; text-wrap: balance; }
.feature p { margin: 0; color: #c2c6c4; max-width: 36em; }

.track-note { padding: 56px 0 0; }
.track-note .wrap {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start;
  padding: 24px; border: 1px solid #4a3a12; border-radius: 16px; background: #1d1a12;
}
.track-note .lights { margin-top: 6px; }
.track-note h2 { margin: 0 0 6px; font: 700 var(--step-1)/1.2 var(--display); font-stretch: 110%; }
.track-note p { margin: 0; color: #d6d2c4; }

/* ── Documents (privacy, terms, support) ─────────────────────────── */

.doc { padding: 56px 0 0; }
.doc .wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.doc h1 {
  margin: 0 0 8px; font: 800 var(--step-3)/1.05 var(--display); font-stretch: 120%; text-wrap: balance;
}
.doc .updated { margin: 0 0 32px; color: var(--muted); font: 500 var(--step--1)/1.4 var(--mono); }
.doc .summary {
  margin: 0 0 40px; padding: 20px 22px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.doc .summary p:first-child { margin-top: 0; }
.doc .summary ul { margin-bottom: 0; }
.doc article { max-width: 68ch; }
.doc article h2 {
  margin: 48px 0 12px; padding-top: 8px; scroll-margin-top: 24px;
  font: 700 var(--step-2)/1.2 var(--display); font-stretch: 110%; text-wrap: balance;
}
.doc article h3 { margin: 28px 0 8px; font: 600 var(--step-1)/1.3 var(--body); }
.doc article p, .doc article li { color: #d3d6d4; }
.doc article li + li { margin-top: 6px; }
.doc article strong { color: var(--text); }

.toc { position: sticky; top: 24px; font-size: var(--step--1); }
.toc p { margin: 0 0 10px; color: var(--muted); font: 500 0.75rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }

.table-wrap { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font: 500 0.75rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
td { color: #d3d6d4; }

.contact-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 0 40px; padding: 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.contact-card p { margin: 0; color: #d3d6d4; }
.contact-card a.button {
  display: inline-block; padding: 12px 18px; border-radius: 10px;
  background: var(--go); color: #0d1a0d; font-weight: 600; text-decoration: none;
}
.contact-card a.button:hover { background: #7fcf7d; color: #0d1a0d; }

details { border-bottom: 1px solid var(--line); padding: 16px 0; }
details summary {
  cursor: pointer; list-style: none; font: 600 var(--step-0)/1.4 var(--body); color: var(--text);
  display: flex; justify-content: space-between; gap: 16px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--muted); font: 400 1.25rem/1 var(--mono); }
details[open] summary::after { content: "–"; }
details p, details ol, details ul { color: #d3d6d4; }

/* ── Small screens ───────────────────────────────────────────────── */

@media (max-width: 860px) {
  .hero { padding-top: 48px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .features .wrap { grid-template-columns: 1fr; }
  .showcase .iphone { --w: 250px; }
  .fan { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; perspective: none; gap: 16px; padding-inline: 4px; }
  .fan .iphone { --w: 200px; margin: 0; flex: none; transform: none; scroll-snap-align: center; }
  .fan .iphone:hover { transform: translateY(-8px); }
  .feature { padding: 24px; }
  .doc .wrap { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .nav { gap: 14px; }
  .track-note .wrap { grid-template-columns: 1fr; }
  .toc ol { grid-template-columns: 1fr; }
}
