/* ==========================================================================
   Token Wire — website design system
   --------------------------------------------------------------------------
   Aesthetic direction: EDITORIAL MINIMALIST ("the wire").

   The identity is not invented here. Every token below is taken from the
   frozen identity contract measured off the approved UI reference
   (marketing/app-brief.md §7.2, docs/ui-design-spec.md §1.3):
     mode light · white reading surface · #F7F5F4 bands · #EFEFEF hairlines
     ink #1F2123 / #666666 · prominent fill #303439 · one coral accent
     platform sans only, NO remote font · no gradients, no glow, no shadows
     radius   chip 999 · button 12 · card 14 · sheet 20
     spacing  base 4, edges 16
   Distinctiveness comes from type scale, tabular figures, hairlines and
   asymmetry — not from colour or effects. Anything that would need a glow,
   a gradient or a third-party font is deliberately absent.
   ========================================================================== */

:root {
  /* colour (frozen identity tokens) */
  --bg: #ffffff;
  --surface-alt: #f7f5f4;
  --border: #efefef;
  --border-strong: #e2dfdd;
  --fg: #1f2123;
  --muted: #666666;
  --quiet: #a8a8a8;
  --inverse: #303439;
  --inverse-soft: #3c4147;
  --accent: #f0563a;        /* non-text emphasis only (dot, rule, focus) */
  --accent-text: #c7442a;   /* AA-compliant accent for text / links */
  --positive: #177a4b;
  --negative: #b8391f;
  --warning: #8a6d3b;

  /* type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* space */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 48px;
  --s9: 64px;
  --s10: 96px;

  /* radius */
  --r-chip: 999px;
  --r-btn: 12px;
  --r-card: 14px;

  /* motion */
  --fast: 120ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

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

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--inverse);
  color: #fff;
  padding: var(--s3) var(--s5);
  border-radius: 0 0 var(--r-btn) 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------- layout --- */

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--s5);
}

.band {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section {
  padding: var(--s10) 0;
}

.section--tight {
  padding: var(--s9) 0;
}

.hair {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 0;
}

/* ------------------------------------------------------------ typography --- */

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.022em;
  line-height: 1.08;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.35rem);
  letter-spacing: -0.032em;
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
}

h3 {
  font-size: 1.28rem;
  letter-spacing: -0.014em;
  line-height: 1.25;
}

p {
  margin: 0 0 var(--s4);
}

.lead {
  font-size: clamp(1.06rem, 1.5vw, 1.22rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 46ch;
}

.meta {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

.meta--quiet {
  color: var(--quiet);
}

.num {
  font-variant-numeric: tabular-nums;
}

.mark {
  background: var(--surface-alt);
  border-radius: 2px;
  padding: 0 3px;
}

/* ----------------------------------------------------------------- chrome --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s6);
  min-height: 68px;
  padding: var(--s2) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.14rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s6);
  margin-left: auto;
}

.nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: var(--s2) 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.nav a:hover {
  border-bottom-color: var(--accent);
}

.nav .nav__x {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.nav .nav__x:hover {
  color: var(--fg);
}

.nav__x svg {
  width: 15px;
  height: 15px;
  flex: none;
}

@media (max-width: 860px) {
  .site-header__inner {
    gap: var(--s3);
    padding: var(--s3) 0;
    min-height: 60px;
  }
  /* On a phone the four in-page anchors turn the header into a horizontally
     scrolled strip, which pushes the two required links — the X profile and
     the APK download — off the first screen. The hero already carries a
     full-size download CTA and the section jumps are a desktop convenience,
     so the phone header keeps the brand plus those two links, unwrapped. */
  .nav {
    order: 2;
    width: auto;
    margin-left: auto;
    gap: var(--s3);
    overflow: visible;
    padding-bottom: 0;
  }
  .nav > a:not(.nav__x):not(.btn) {
    display: none;
  }
  .nav .nav__x span {
    display: none;
  }
  .nav .btn {
    padding: 0 var(--s4);
    font-size: 0.9375rem;
    min-height: 44px;
  }
  .nav a {
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  padding: 0 var(--s6);
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease),
    color var(--fast) var(--ease), border-color var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}

.btn--primary {
  background: var(--inverse);
  color: #fff;
  min-height: 56px;
  padding: 0 var(--s7);
  font-size: 1.0625rem;
}

.btn--primary:hover {
  background: #1b1e21;
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--fg);
  background: var(--bg);
}

.btn--sm {
  min-height: 40px;
  padding: 0 var(--s5);
  font-size: 0.9375rem;
  border-radius: 10px;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
  margin: var(--s6) 0 var(--s4);
}

.apk-note {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 44ch;
  margin: 0;
}

.apk-note strong {
  color: var(--fg);
  font-weight: 600;
}

/* ------------------------------------------------------------------ hero --- */

.hero {
  padding: var(--s9) 0 var(--s10);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: var(--s9);
  align-items: center;
}

@media (max-width: 940px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--s8);
  }
}

.hero h1 {
  max-width: 15ch;
}

.hero h1 .hero__turn {
  display: block;
  color: var(--muted);
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  margin: var(--s6) 0 0;
  padding: var(--s4) 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.hero__facts li {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.hero__facts li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* device frame — hairline + band offset, never a shadow (identity rule) */
.device {
  position: relative;
  justify-self: center;
  width: min(340px, 100%);
}

.device::before {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  background: var(--surface-alt);
  border-radius: var(--r-card);
  z-index: 0;
}

.device__frame {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--bg);
}

.device__frame img {
  width: 100%;
  height: auto;
}

.device__caption {
  position: relative;
  z-index: 1;
  margin: var(--s4) 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.device--flat::before {
  display: none;
}

/* --------------------------------------------------------------- section --- */

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--s7);
  align-items: end;
  margin-bottom: var(--s8);
}

@media (max-width: 860px) {
  .section__head {
    grid-template-columns: 1fr;
    gap: var(--s4);
  }
}

.section__head p {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

/* --------------------------------------------------------------- steps --- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

/* the wire: one continuous hairline through the step nodes */
.steps::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--border-strong);
}

.step {
  position: relative;
  padding: 0 0 var(--s8) var(--s7);
}

.step:last-child {
  padding-bottom: 0;
}

.step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
}

.step:first-child::before {
  background: var(--accent);
  border-color: var(--accent);
}

.step__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  margin-bottom: var(--s2);
  font-variant-numeric: tabular-nums;
}

.step h3 {
  margin-bottom: var(--s2);
}

.step p {
  margin: 0;
  color: var(--muted);
  max-width: 56ch;
}

.steps-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: var(--s9);
  align-items: start;
}

@media (max-width: 940px) {
  .steps-layout {
    grid-template-columns: 1fr;
    gap: var(--s8);
  }
}

.steps-shots {
  display: grid;
  gap: var(--s5);
  grid-template-columns: 1fr 1fr;
}

.steps-shots .device {
  width: 100%;
}

@media (max-width: 560px) {
  .steps-shots {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------- tab cards --- */

.tabs-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s4);
}

.tabcard {
  grid-column: span 6;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.tabcard--wide {
  grid-column: span 7;
}

.tabcard--narrow {
  grid-column: span 5;
}

.tabcard__top {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.tabcard__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  flex: none;
}

.tabcard__icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--fg);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabcard__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.tabcard h3 {
  margin: 0;
}

.tabcard p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .tabcard,
  .tabcard--wide,
  .tabcard--narrow {
    grid-column: span 12;
  }
}

/* -------------------------------------------------------------- honesty --- */

.honesty-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: var(--s9);
  align-items: start;
}

@media (max-width: 940px) {
  .honesty-grid {
    grid-template-columns: 1fr;
  }
}

.pledges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s5);
}

.pledge {
  padding: 0 0 var(--s5);
  border-bottom: 1px solid var(--border);
}

.pledge:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pledge h3 {
  margin-bottom: var(--s2);
}

.pledge p {
  margin: 0;
  color: var(--muted);
}

.quote-line {
  margin: 0 0 var(--s6);
  padding: var(--s5) var(--s6);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  font-size: 1rem;
  color: var(--fg);
}

.quote-line span {
  display: block;
  margin-top: var(--s2);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ FAQ --- */

.faq {
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s5);
  padding: var(--s5) 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  flex: none;
  transition: transform var(--fast) var(--ease);
}

.faq details[open] summary::after {
  content: "−";
}

.faq summary:hover {
  color: var(--accent-text);
}

.faq__answer {
  padding: 0 var(--s7) var(--s6) 0;
  color: var(--muted);
  max-width: 68ch;
}

.faq__answer p {
  margin: 0 0 var(--s3);
}

.faq__answer p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------- final CTA --- */

.final-cta {
  padding: var(--s10) 0;
}

.final-cta h2 {
  max-width: 22ch;
}

.final-cta .meta {
  margin: var(--s4) 0 0;
  max-width: 60ch;
}

/* ---------------------------------------------------------------- footer --- */

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: var(--s9) 0 var(--s7);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 0.85fr));
  gap: var(--s7);
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s6);
  }
}

.footer-brand p {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 40ch;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s3);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s2);
}

.footer-col a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9375rem;
}

.footer-col a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s5);
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer-bottom p {
  margin: 0;
}

.bsa-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-chip);
  padding: 6px 14px;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.bsa-link:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.bsa-link svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.disclosure {
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 80ch;
  margin: var(--s4) 0 0;
}

/* -------------------------------------------------------------- legal doc --- */

.doc {
  padding: var(--s9) 0 var(--s10);
}

.doc__head {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--s6);
  margin-bottom: var(--s7);
}

.doc__head h1 {
  font-size: clamp(2.1rem, 4.4vw, 3rem);
  margin-bottom: var(--s3);
}

.doc__body {
  max-width: 74ch;
}

.doc__body h2 {
  font-size: 1.28rem;
  letter-spacing: -0.012em;
  margin: var(--s7) 0 var(--s3);
}

.doc__body ul {
  margin: 0 0 var(--s4);
  padding-left: 1.25rem;
  color: var(--muted);
}

.doc__body li {
  margin-bottom: var(--s2);
}

.doc__body p {
  color: var(--muted);
}

.doc__body strong {
  color: var(--fg);
}

.doc__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--fg);
}

.doc__summary {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--s5) var(--s6);
  margin-bottom: var(--s6);
}

.doc__summary dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s2) var(--s5);
  font-size: 0.9375rem;
}

.doc__summary dt {
  color: var(--muted);
}

.doc__summary dd {
  margin: 0;
  color: var(--fg);
  font-weight: 500;
}

.doc__nav {
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3) var(--s5);
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------- motion --- */

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

.rise {
  animation: rise 520ms var(--ease) both;
}

.rise--1 { animation-delay: 40ms; }
.rise--2 { animation-delay: 120ms; }
.rise--3 { animation-delay: 200ms; }
.rise--4 { animation-delay: 280ms; }

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

/* ------------------------------------------------------------ utilities --- */

/* spacing helpers (kept as classes so no page needs an inline style,
   which lets the site ship a strict style-src Content-Security-Policy) */
.figure-flush {
  margin: 0;
}

.footer-bottom--bare {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.u-mb4 { margin-bottom: var(--s4); }
.u-mt4 { margin-top: var(--s4); }
.u-mt5 { margin-top: var(--s5); }
.u-mt6 { margin-top: var(--s6); }
.u-mt7 { margin-top: var(--s7); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  .site-header,
  .final-cta,
  .nav,
  .cta-row {
    display: none;
  }
}
