/* ============================================================
   Recaptr — recaptr.css
   Recaptr's own identity, separate from Overton Forge: graphite,
   signal green, violet, restore blue (mirrors Brand.swift). Broadcast
   and game-HUD cues: REC light, timecode, corner brackets, marker
   flags, keycaps. Used by the landing page and the doc pages.
   ============================================================ */

:root {
  --rc-ink:       #121518;   /* page */
  --rc-graphite:  #1B1F23;   /* surface */
  --rc-graphite-2:#242A30;   /* raised */
  --rc-line:      #2F363E;
  --rc-signal:    #8DFCB7;   /* go / markers */
  --rc-violet:    #A179F2;
  --rc-restore:   #5EB2D6;
  --rc-rec:       #FF5F57;
  --rc-beige:     #CFCAC2;   /* body */
  --rc-white:     #F4F0E8;   /* headings */
  --rc-dim:       #8F969D;

  --head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", monospace;

  --radius: 12px;

  /* Motion: one curve; 300ms for colour, 500ms for movement */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-colour: 300ms;
  --t-move: 500ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--rc-ink);
  color: var(--rc-beige);
  font: 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--rc-signal); text-underline-offset: 3px; }

::selection { background: var(--rc-violet); color: var(--rc-ink); }

h1, h2, h3 {
  font-family: var(--head);
  color: var(--rc-white);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* Landing only, so the Support and Privacy pages keep their line breaks */
.landing :is(h1, h2, h3) { text-wrap: balance; }
.landing p { text-wrap: pretty; }

h2 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; margin-bottom: 36px; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.015em; }

code { font: 0.88em var(--mono); color: var(--rc-white); }

kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 1px 7px;
  font: 700 0.78em/1.6 var(--mono);
  text-align: center;
  color: var(--rc-white);
  background: linear-gradient(180deg, #2C333B, #20262C);
  border: 1px solid #3A424B;
  border-bottom: 3px solid #0B0D0F;
  border-radius: 6px;
  white-space: nowrap;
  vertical-align: 0.08em;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 40px);
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 21, 24, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rc-line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 60px;
}

.logo {
  display: inline-flex;
  align-items: center;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--rc-white);
  text-decoration: none;
}

/* Wordmark: lowercase re:captr in Unbounded. The colon's top dot is the REC light. */
.rc-wordmark {
  font-family: "Unbounded", var(--head);
  font-weight: 700;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.rc-colon {
  display: inline-block;
  position: relative;
  width: 0.185em;
  height: 0.56em;
  margin: 0 0.07em 0 0.08em;
  vertical-align: baseline;
}

.rc-colon i {
  position: absolute;
  left: 0;
  width: 0.185em;
  height: 0.185em;
  border-radius: 50%;
  background: currentColor;
}

.rc-colon i:first-child {
  top: 0;
  background: #FF5F57;
  box-shadow: 0 0 0.6em #FF5F57;
  animation: blink 1.6s ease-in-out infinite;
}

.rc-colon i:last-child { bottom: 0; }

.nav nav { display: flex; gap: 22px; }

.nav nav a {
  font-size: 0.92rem;
  white-space: nowrap;
  color: var(--rc-beige);
  text-decoration: none;
}

.nav nav a:hover { color: var(--rc-white); }

/* Landing: a plain solid bar (the doc pages keep theirs as is) */
.landing .nav {
  background: var(--rc-ink);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.landing .nav nav a { transition: color var(--t-colour) var(--ease); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* -------------------- Buttons -------------------- */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin: 28px 0 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 0.95rem/1.2 var(--head);
  text-decoration: none;
  transition: transform var(--t-colour) var(--ease), background var(--t-colour) var(--ease);
}

.btn:active { transform: scale(0.98); }

.btn-go {
  background: var(--rc-signal);
  color: var(--rc-ink);
}

a.btn-go:hover { background: #B4FDD0; }

.btn-go.is-disabled {
  background: var(--rc-graphite-2);
  color: var(--rc-dim);
  border-color: var(--rc-line);
  cursor: default;
}

.btn-line {
  color: var(--rc-signal);
  border-color: rgba(141, 252, 183, 0.45);
}

.btn-line:hover { background: rgba(141, 252, 183, 0.08); }

.text-link {
  font: 600 0.95rem/1.2 var(--head);
  color: var(--rc-white);
  text-decoration: underline;
  text-decoration-color: var(--rc-line);
  text-underline-offset: 5px;
  transition: text-decoration-color var(--t-colour) var(--ease);
}

.text-link:hover { text-decoration-color: var(--rc-signal); }

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

.hero {
  padding: clamp(40px, 6vh, 72px) 0 clamp(56px, 9vw, 104px);
}

/* Headline left, the pitch right, so the real window lands in the first screen */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px clamp(32px, 5vw, 64px);
}

.hero-icon {
  width: 88px;
  height: 88px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.hero-sub { max-width: 52ch; }

.req {
  font-size: 0.875rem;
  color: var(--rc-dim);
}

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

.hero-stage { margin-top: clamp(40px, 5vw, 64px); }

/* -------------------- App screenshot -------------------- */
/* A real window capture with a cut-out where the picture is; a clip from a
   real take plays underneath it. The video's own letterbox bars sit under the
   frame's bars, so only the picture area shows through. */

.app-shot { margin: 0; }

.app-live {
  position: relative;
  aspect-ratio: 2600 / 1496;
  background: #000;
  border-radius: 1.62% / 2.82%;
  border: 1px solid var(--rc-line);
  overflow: hidden;
}

.app-live-video {
  position: absolute;
  left: 0.62%;
  top: 1.71%;
  width: 98.75%;
  height: 96.53%;
  object-fit: fill;
}

.app-live-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.app-shot figcaption {
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--rc-dim);
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .app-live-video { display: none; }
  .app-live { background: url("img/recaptr-recording.jpg") center / cover no-repeat; }
  .app-live-frame { visibility: hidden; }
}

/* -------------------- Bands -------------------- */

.band {
  padding: clamp(64px, 9vw, 112px) 0;
}

.band + .band { padding-top: 0; }

/* Steps: one recording track, each step hanging off a marker flag */

.track {
  position: relative;
  height: 28px;
  border-radius: 6px;
  background: var(--rc-graphite-2);
  overflow: hidden;
}

/* A full-width layer slid by its own width, so the 2px head crosses the whole track */
.track .playhead {
  position: absolute;
  inset: 0;
  animation: play 12s linear infinite;
}

.track .playhead::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--rc-rec);
}

@keyframes play {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 40px 0 0 22px;
}

/* The marker flag: a stem up into the track and a pennant at its head */
.steps li::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 0;
  height: 96px;
  width: 2px;
  background: var(--rc-signal);
}

.steps li::after {
  content: "";
  position: absolute;
  top: -22px;
  left: 2px;
  width: 12px;
  height: 10px;
  background: var(--rc-signal);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.steps h3 { font-size: 1.6rem; }

.steps p { font-size: 0.97rem; max-width: 34ch; }

.keys { margin-top: auto; padding-top: 8px; }

.file {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px dashed rgba(161, 121, 242, 0.6);
  font: 400 0.75rem/1.4 var(--mono);
  color: var(--rc-violet);
}

/* Feature tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px clamp(32px, 6vw, 96px);
  max-width: 960px;
}

.tile h3 { margin-bottom: 8px; font-size: 1.35rem; }

.tile p { max-width: 44ch; }

/* Free */

.free {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: end;
  gap: 40px;
}

.free h2 { margin-bottom: 16px; }

.byline {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 8px;
  background: var(--rc-graphite);
  font-size: 0.95rem;
  color: var(--rc-white);
}

.byline strong { color: var(--rc-violet); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  border-radius: var(--radius);
  overflow: hidden;
}

.stats > div { padding: 18px 20px; background: var(--rc-graphite); }

.stats dt {
  font-size: 0.875rem;
  color: var(--rc-dim);
}

.stats dd {
  margin-top: 10px;
  font: 700 clamp(1.6rem, 3.4vw, 2.4rem)/1 var(--head);
  letter-spacing: -0.03em;
  color: var(--rc-signal);
}

.tip {
  margin-top: 48px;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: var(--rc-graphite);
}

.tip h3 { margin-bottom: 6px; }

/* Footnotes (Apple-style superscripts) */

.fn { font-size: 0.6em; line-height: 0; vertical-align: super; margin-left: 1px; }
.fn a { color: inherit; text-decoration: none; opacity: 0.8; }
.fn a:hover { opacity: 1; text-decoration: underline; }

.footnotes {
  padding: 24px 0;
  font-size: 0.8rem;
  color: var(--rc-dim);
}

.footnotes ol { padding-left: 1.2em; }
.footnotes li { scroll-margin-top: 80px; }
.footnotes li:target { color: var(--rc-white); }

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

.foot {
  padding: 28px 0 40px;
  background: var(--rc-graphite);
  font: 400 0.875rem/1.8 var(--body);
  color: var(--rc-dim);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.foot a { color: var(--rc-beige); }
.foot a:hover { color: var(--rc-white); }
.foot-help a { color: var(--rc-signal); }

.legal {
  flex-basis: 100%;
  max-width: 90ch;
  font: 400 0.72rem/1.6 var(--body);
  color: var(--rc-dim);
}

.doc footer .legal { display: block; margin-top: 10px; }

/* -------------------- Doc pages (support, privacy) -------------------- */

.doc main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

.doc .tag {
  margin: 48px 0 0;
  font: 400 0.75rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rc-dim);
}

.doc .tag::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--rc-rec);
  box-shadow: 0 0 10px var(--rc-rec);
  vertical-align: 1px;
}

.doc h1 {
  margin: 14px 0 16px;
  font-size: clamp(2.4rem, 8vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.045em;
}

.doc h2 {
  margin: 44px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--rc-line);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.doc p,
.doc li { color: var(--rc-beige); }

.doc p + p { margin-top: 12px; }

.doc strong { color: var(--rc-white); }

.doc ul { padding-left: 20px; margin: 8px 0 12px; }

.doc li { margin: 6px 0; }

.doc .dim { color: var(--rc-dim); }

.doc .card {
  margin: 16px 0;
  padding: 4px 22px;
  background: var(--rc-graphite);
  border: 1px solid var(--rc-line);
  border-radius: var(--radius);
}

.doc .card p {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--rc-line);
}

.doc .card p:last-child { border-bottom: 0; }

.doc footer {
  margin-top: 64px;
  padding-top: 16px;
  border-top: 1px solid var(--rc-line);
  font: 400 0.75rem/1.8 var(--mono);
  color: var(--rc-dim);
}

.doc footer a { color: var(--rc-beige); }

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

@media (max-width: 900px) {
  .hero-grid,
  .free {
    grid-template-columns: 1fr;
  }
}

/* The looping demo over the steps. Its space is held before the script mounts it */
.how-demo {
  margin: clamp(28px, 4vw, 48px) auto clamp(40px, 5vw, 64px);
  max-width: 880px;
}

.how-demo-stage {
  aspect-ratio: 880 / 560;
  border-radius: var(--radius);
  overflow: hidden;
}

/* Lined up with the window inside the stage, not the stage's 40/880 gutter */
.how-demo figcaption {
  margin-top: calc(12px - 4.55%);
  padding: 0 4.55%;
  font-size: 0.72rem;
  color: var(--rc-dim);
  text-align: right;
}

/* Phones keep the step list; the script never mounts the demo there.
   The same query as the script's, negated, so no width shows an empty box */
@media not (min-width: 700px) {
  .how-demo { display: none; }
}

/* Under 900px the track turns vertical: steps hang off a line down the left */
@media (max-width: 900px) {
  .track { display: none; }

  .steps {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .steps li { padding: 0 0 36px 28px; }
  .steps li::before { top: 4px; }
  .steps li::after { top: 4px; }
}

@media (max-width: 600px) {
  .nav nav a[href="#how"] { display: none; }
  .nav nav { gap: 14px; }
  .nav nav a { font-size: 0.85rem; }

  .tiles {
    grid-template-columns: 1fr;
  }

  .actions .btn { flex: 1 1 100%; }
}

@media (max-width: 400px) {
  .stats > div { padding: 14px 12px; }

  /* Privacy stays one tap away from the footer and Support page */
  .nav nav a[href="privacy.html"] { display: none; }
}

/* -------------------- Accessibility -------------------- */

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
