/* ============================================================
   Touch Recorder — index landing page
   Anti-vibecoder rewrite. Apple-restraint + spec-sheet labels +
   real Pixel-8 bezel framing + dark Material native palette.
   Scoped to index.html only. Legal pages stay on legal-style.css.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg:        #272727;
  --bg-elev:   #343434;
  --ink:       #FAFAFA;
  --ink-mute:  #C7C7C7;
  --ink-faint: #6F6F6F;
  --rule:      #3F3F3F;

  --brand-blue: #03A9F4;
  --brand-red:  #F44336;
  --gold:       #FFB300;

  --shell: 1180px;
  --gutter: clamp(20px, 5vw, 56px);

  --font-display: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", system-ui, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "JetBrains Mono", "Menlo", monospace;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

::selection { background: var(--brand-blue); color: #000; }

/* ---------- shell ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- mono spec label ---------- */
.spec {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: none;
}
.spec strong { color: var(--ink-mute); font-weight: 500; }

/* ---------- appbar ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(39, 39, 39, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.appbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.appbar-mark {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}
.appbar-mark .name { color: var(--ink); font-family: var(--font-display); font-size: 14px; letter-spacing: 0; }
.appbar-mark .name b { font-weight: 600; }
.appbar-mark .blue { color: var(--brand-blue); }
.appbar-mark .red  { color: var(--brand-red); }

.appbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: background-color 200ms ease, color 200ms ease;
}
.appbar-cta:hover { background: var(--ink); color: #000; }
.appbar-cta svg { width: 12px; height: 12px; }

/* ---------- hero ---------- */
.hero {
  padding: clamp(56px, 10vw, 120px) 0 clamp(72px, 12vw, 140px);
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(48px, 8vw, 80px);
  align-items: center;
}
@media (min-width: 1080px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.6fr);
    gap: clamp(40px, 5vw, 72px);
  }
}

.hero-spec-top {
  display: flex;
  gap: 20px;
  margin-bottom: 28px;
}
.hero-spec-top span { white-space: nowrap; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 12vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  word-break: normal;
  overflow-wrap: normal;
}
.wordmark .blue { color: var(--brand-blue); display: block; }
.wordmark .red  { color: var(--brand-red);  display: block; }
.wordmark .red::after { content: "."; color: var(--brand-red); }
@media (min-width: 1080px) {
  .wordmark { font-size: clamp(72px, 7.4vw, 96px); }
}

.hero-tagline {
  margin-top: 32px;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.5;
  color: var(--ink-mute);
  max-width: 36ch;
}

.hero-ctas {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #000;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  transition: transform 200ms ease, background-color 200ms ease;
}
.cta-primary:hover { background: var(--brand-blue); transform: translateY(-1px); }
.cta-primary svg { width: 14px; height: 16px; }

.cta-link {
  font-size: 14px;
  color: var(--ink-mute);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 200ms ease, border-color 200ms ease;
}
.cta-link:hover { color: var(--ink); border-color: var(--ink); }

/* ---- pixel-8 phone bezel ----
   Outer hardware shell around the screenshot.
   PNG inside provides screen content; CSS provides device chassis. */
.phone {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  background: #0B0B0B;
  border: 1px solid #2A2A2A;
  border-radius: 42px;
  padding: 8px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 6px 18px -6px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.phone::after {
  /* side power button silhouette (right edge) */
  content: "";
  position: absolute;
  right: -1px;
  top: 22%;
  width: 2px;
  height: 60px;
  background: #1A1A1A;
  border-radius: 2px;
}
.phone img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 34px;
  background: #000;
}
@media (max-width: 480px) {
  .phone { max-width: 250px; border-radius: 34px; padding: 6px; }
  .phone img { border-radius: 28px; }
  .phone::after { height: 44px; top: 24%; }
}

.hero-spec-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--rule);
  padding-left: 24px;
}
.hero-spec-side .label { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; }
.hero-spec-side .value { font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.hero-spec-side .meta  { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); line-height: 1.6; }
@media (max-width: 1079px) {
  .hero-spec-side { border-left: 0; padding-left: 0; padding-top: 24px; border-top: 1px solid var(--rule); }
}

/* ---------- generic section ---------- */
.section {
  padding: clamp(72px, 11vw, 140px) 0;
  border-bottom: 1px solid var(--rule);
}
.section-head {
  margin-bottom: clamp(40px, 6vw, 72px);
  max-width: 720px;
}
.section-head .spec { display: block; margin-bottom: 14px; }
.section-head h2 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.section-head .lede {
  margin-top: 18px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--ink-mute);
  max-width: 56ch;
}

/* ---------- feature posters (§01) ---------- */
.posters { display: flex; flex-direction: column; gap: clamp(64px, 9vw, 120px); }
.poster {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}
@media (min-width: 820px) {
  .poster { grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr); }
  .poster.flip { grid-template-columns: minmax(0, 0.55fr) minmax(0, 0.45fr); }
  .poster.flip .poster-art { order: -1; }
}
.poster-art .phone { max-width: 300px; }
.poster-copy .spec { display: block; margin-bottom: 14px; }
.poster-copy h3 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.poster-copy p {
  margin-top: 18px;
  font-size: clamp(15px, 1.5vw, 17px);
  color: var(--ink-mute);
  max-width: 42ch;
}
.poster-meta {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
}
.poster-meta span { white-space: nowrap; }
.poster-meta b { color: var(--ink-mute); font-weight: 500; }

/* ---------- how-it-works (§02) ---------- */
.steps { display: grid; grid-template-columns: 1fr; gap: clamp(40px, 5vw, 64px); counter-reset: stepN; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { position: relative; padding-top: 28px; border-top: 1px solid var(--rule); }
.step .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.step h3 {
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.step h3 .accent-blue { color: var(--brand-blue); }
.step h3 .accent-red  { color: var(--brand-red); }
.step p {
  margin-top: 14px;
  color: var(--ink-mute);
  font-size: 15px;
  max-width: 36ch;
}

/* ---------- full feature list (§03) ---------- */
.feat-list { border-top: 1px solid var(--rule); }
.feat {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: clamp(28px, 4vw, 40px) 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 760px) {
  .feat { grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
}
.feat-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  padding-top: 6px;
}
.feat h3 {
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.feat p {
  margin-top: 10px;
  color: var(--ink-mute);
  font-size: 15px;
}
.feat-aside { color: var(--ink-faint); font-family: var(--font-mono); font-size: 12px; line-height: 1.7; }
.feat-aside b { color: var(--ink-mute); font-weight: 500; }
@media (max-width: 759px) {
  .feat-aside { grid-column: 1 / -1; padding-top: 4px; padding-left: 0; }
}

/* ---------- premium (§04) gold lives only here ---------- */
.premium { padding-top: 0; padding-bottom: 0; border-bottom: 1px solid var(--rule); }
.premium-inner {
  padding: clamp(72px, 11vw, 140px) 0;
}
.premium-head .spec { color: var(--gold); display: block; margin-bottom: 14px; }
.premium-mark {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--gold);
  line-height: 1;
}
.premium-mark::after { content: "."; }
.premium-lede {
  margin-top: 22px;
  font-size: clamp(16px, 1.7vw, 19px);
  color: var(--ink-mute);
  max-width: 52ch;
}
.premium-grid {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 56px);
}
@media (min-width: 820px) { .premium-grid { grid-template-columns: minmax(0, 0.5fr) minmax(0, 0.5fr); } }

.premium-rules { display: flex; flex-direction: column; }
.premium-rule {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}
.premium-rule:last-child { border-bottom: 1px solid var(--rule); }
.premium-rule .rid {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.06em;
  padding-top: 4px;
}
.premium-rule h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
.premium-rule p {
  margin-top: 6px;
  color: var(--ink-mute);
  font-size: 14px;
  line-height: 1.6;
}

.premium-tiers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
}
.premium-tiers span { padding: 6px 10px; border: 1px solid var(--gold); color: var(--gold); }

.premium-note {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.7;
  max-width: 38ch;
}

.premium-art { display: flex; flex-direction: column; gap: clamp(20px, 3vw, 32px); }
.premium-figures {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
}
.premium-figures > .premium-figure {
  flex: 1 1 0;
  min-width: 0;
  max-width: 280px;
}
.premium-figure { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.premium-figure .phone { max-width: 240px; }
@media (max-width: 480px) {
  .premium-figure .phone { max-width: 100%; }
}
.premium-figure figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--gold);
  text-align: center;
}
.premium-figure figcaption b { color: var(--ink); font-weight: 600; letter-spacing: 0.02em; }
.premium-figure figcaption span { color: var(--ink-faint); }

/* ---------- permissions (§06) ---------- */
.perms { border-top: 1px solid var(--rule); }
.perm {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: clamp(24px, 3.5vw, 36px) 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 760px) {
  .perm { grid-template-columns: 240px minmax(0, 1fr) minmax(0, 0.8fr); gap: 32px; align-items: baseline; }
}
.perm-name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.perm-name em { font-family: var(--font-mono); font-size: 11px; font-style: normal; color: var(--ink-faint); margin-left: 8px; letter-spacing: 0.06em; }
.perm-desc { color: var(--ink-mute); font-size: 15px; line-height: 1.55; }
.perm-why  { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); line-height: 1.7; }
.perm.gold .perm-name { color: var(--gold); }

/* ---------- final CTA (§07) ---------- */
.final {
  padding: clamp(96px, 14vw, 180px) 0;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.final .spec { display: block; margin-bottom: 22px; }
.final-mark {
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.final-mark .blue { color: var(--brand-blue); }
.final-mark .red  { color: var(--brand-red); }
.final-mark .red::after { content: "."; }
.final-lede {
  margin-top: 28px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--ink-mute);
  max-width: 48ch;
}
.final-cta-row { margin-top: 36px; display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }

/* ---------- floating overlay motif (decorative, in margins) ---------- */
.fw-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}
.fw-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}
.fw-strip .label { line-height: 1.6; }

/* ---------- footer ---------- */
.footer {
  padding: 48px 0 64px;
  color: var(--ink-faint);
  font-size: 13px;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.footer-row a { color: var(--ink-mute); border-bottom: 1px solid transparent; padding-bottom: 1px; transition: color 200ms ease, border-color 200ms ease; }
.footer-row a:hover { color: var(--ink); border-color: var(--ink); }
.footer-row .sep { color: var(--ink-faint); }
.footer-copy { margin-top: 18px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

/* ---------- sticky install pill (mobile only) ---------- */
.install-fab {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: #000;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.6);
}
.install-fab svg { width: 13px; height: 15px; }
.install-fab .tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}
@media (max-width: 720px) { .install-fab { display: flex; } }

/* ---------- subtle motion ---------- */
.fade-up { opacity: 0; transform: translateY(8px); transition: opacity 600ms ease, transform 600ms ease; }
.fade-up.in { opacity: 1; transform: translateY(0); }
@keyframes fwPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.pulse-once.in { animation: fwPulse 700ms ease-in-out 200ms 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }
  .fade-up { opacity: 1; transform: none; }
}

/* ---------- focus ring ---------- */
:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
}
