/* ============================================================
   Loose Take — promo
   Instrument-grade spec sheet. Rack-panel grammar: micro-labels,
   hairline rules, app chips. One signature (the verdict), quiet
   everywhere else. Tokens are pinned — do not invent hues.
   ============================================================ */

/* ---- Self-hosted type (identical faces to the app) ---- */
@font-face {
  font-family: "Saira Condensed";
  src: url("../fonts/SairaCondensed-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Saira Condensed";
  src: url("../fonts/SairaCondensed-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/HankenGrotesk-Variable.ttf") format("truetype");
  font-weight: 300 800;
  font-display: swap;
}

/* ---- Tokens (pinned, sampled from the app) ---- */
:root {
  --bg: #0a1421;
  --panel: #0f1b2b;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef3f6;
  --muted: #8b9aa8;
  --accent: #13cab8;
  --accent-bright: #49e6d7;

  --font-display: "Saira Condensed", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;

  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 72px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-fluid: cubic-bezier(0.32, 0.72, 0, 1);

  --shell: min(1100px, 92vw);
  --phone-w: clamp(260px, 30vw, 320px);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* visible focus — accent ring, never removed */
a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

/* skip link */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
}
.skip:focus {
  left: 16px;
  top: 16px;
}

/* ============================================================
   Rack-panel grammar — micro-labels, hairline rules, chips
   ============================================================ */
.lbl {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.lbl--accent {
  color: var(--accent);
}

/* section header: label sitting on a hairline, not a floating eyebrow */
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* app chip: rounded-rect, hairline, tracked caps */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.chip--accent {
  border-color: rgba(19, 202, 184, 0.45);
  color: var(--accent-bright);
  background: rgba(19, 202, 184, 0.06);
}
.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---- button — app-style rounded rect, not a pill ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  padding: 15px 22px 15px 26px;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--accent);
  color: #04110f;
  transition:
    transform 0.5s var(--ease-fluid),
    background 0.35s var(--ease-fluid);
  will-change: transform;
}
.btn:hover {
  background: var(--accent-bright);
}
.btn:active {
  transform: scale(0.98);
}
.btn .btn__icon {
  display: inline-flex;
}
.btn .btn__icon svg {
  width: 16px;
  height: 16px;
  transition: transform 0.5s var(--ease-fluid);
}
.btn:hover .btn__icon svg {
  transform: translateX(3px);
}

/* ---- waveform-envelope divider (static, echoes the app card) ---- */
/* Standalone section break: centered, not bound to either section's grid. */
.wave {
  display: flex;
  justify-content: center;
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(56px, 7vw, 72px) clamp(20px, 5vw, 40px);
}
.wave svg {
  display: block;
  height: 24px;
  width: auto;
  max-width: 100%;
}
.wb-hi {
  fill: var(--accent);
}
.wb-lo {
  fill: var(--muted);
  opacity: 0.32;
}

/* ============================================================
   HERO — the verdict
   ============================================================ */
.hero {
  position: relative;
  isolation: isolate; /* keeps the notes art stacked inside the hero */
  overflow: hidden; /* art bleeds off the edges without causing scroll */
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(20px, 4vh, 40px) clamp(20px, 5vw, 40px) clamp(40px, 7vh, 72px);
}

/* decorative notes-wave watermark — desktop only, behind all hero content */
@media (min-width: 900px) {
  .hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    top: 375px; /* right-side zone beside the paragraphs, below the H1/badge */
    right: -40px;
    width: 500px;
    aspect-ratio: 1067 / 456;
    background: url("../img/notes-wave.png") center / contain no-repeat;
    opacity: 0.5;
    /* dissolve all four edges; the right fade completes at 92% so it
       finishes before the hero overflow clip line (box bleeds 40px past) */
    -webkit-mask-image:
      linear-gradient(
        90deg,
        transparent 0,
        #000 14%,
        #000 78%,
        transparent 92%
      ),
      linear-gradient(
        180deg,
        transparent 0,
        #000 14%,
        #000 86%,
        transparent 100%
      );
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(
        90deg,
        transparent 0,
        #000 14%,
        #000 78%,
        transparent 92%
      ),
      linear-gradient(
        180deg,
        transparent 0,
        #000 14%,
        #000 86%,
        transparent 100%
      );
    mask-composite: intersect;
  }
}

.topbar {
  display: flex;
  flex-wrap: wrap; /* chips drop to a second row before ever colliding */
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(48px, 9vh, 96px);
}
.topbar__mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.topbar__mark img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: block;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.topbar__chips {
  display: flex;
  gap: var(--space-xs);
  margin-left: auto;
}

/* the verdict — set exactly like the app renders it */
.verdict {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 6.8rem);
  line-height: 0.98;
  letter-spacing: -0.005em;
  color: var(--text);
}
.verdict .ax {
  color: var(--accent);
  white-space: nowrap; /* the verdict token "A minor." never splits */
}
.badge-high {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  vertical-align: 0.55em;
  margin-left: clamp(10px, 1.5vw, 18px);
  padding: 6px 12px;
  border: 1px solid rgba(19, 202, 184, 0.55);
  border-radius: 10px;
  background: rgba(19, 202, 184, 0.06);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.14em;
  color: var(--accent-bright);
  white-space: nowrap;
}
.badge-high svg {
  width: 12px;
  height: 12px;
  display: block;
}

.tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  line-height: 1.05;
  letter-spacing: 0.005em;
  color: var(--text);
  margin-top: clamp(20px, 3vh, 32px);
}

.hero__lines {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 56ch;
  margin-top: clamp(20px, 3vh, 32px);
}
.hero__lines p {
  font-size: clamp(1rem, 1.4vw, 1.08rem);
  line-height: 1.55;
  color: var(--muted);
}

.hero__cta {
  margin-top: clamp(24px, 4vh, 40px);
}
/* CTAs center on narrow screens; the 720 breakpoint resets them left */
.hero__cta,
.status__cta {
  text-align: center;
}
.status__cta {
  align-self: stretch; /* status body is a start-aligned flex column */
}

/* ============================================================
   Section scaffolding
   ============================================================ */
.section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(40px, 8vh, 88px) clamp(20px, 5vw, 40px);
}

/* ============================================================
   WALKTHROUGH — signal chain on a spine
   ============================================================ */
.walk {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 8vh, 88px);
}
/* the spine: continuous 1px hairline connecting the chain */
.walk::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: var(--line);
}
.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
  padding-left: 32px;
}
/* patch point: node on the spine at each step */
.step::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.patch {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 2px solid rgba(19, 202, 184, 0.55);
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 4px;
  padding: 4px 12px;
  transform: rotate(-1.5deg);
}
.step__media {
  flex-shrink: 0;
  margin-left: -14px; /* phone sits toward the spine */
}
.phone {
  width: min(78vw, 320px);
  padding: 8px;
  border-radius: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow:
    0 40px 80px -34px rgba(2, 8, 15, 0.9),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
}
.phone img {
  display: block;
  width: 100%;
  height: auto; /* beat the intrinsic height attribute once CSS scales width */
  border-radius: 32px;
}
.step__text {
  max-width: 42ch;
}
.step__text h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: var(--space-sm) 0 var(--space-md);
}
.step__text p {
  font-size: clamp(0.98rem, 1.3vw, 1.06rem);
  line-height: 1.6;
  color: var(--muted);
}
.step__text p + p {
  margin-top: var(--space-sm);
}
.step__text .verbatim {
  color: var(--text);
}
.step__text .accent {
  color: var(--accent-bright);
}

/* ============================================================
   VERDICT-SCALE STATEMENT
   ============================================================ */
.shout {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 10vw, 8.2rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text);
}
.shout .ax {
  color: var(--accent);
}
.shout__sub {
  margin-top: var(--space-md);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--muted);
  max-width: 52ch;
}

/* ============================================================
   SPEC TABLE — does / won't
   ============================================================ */
.spec {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 64px);
}
.spec__col .lbl {
  display: block;
  padding-bottom: var(--space-sm);
}
.spec__col ul {
  list-style: none;
}
.spec__col li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  line-height: 1.5;
  color: var(--text);
}
.spec__col li:last-child {
  border-bottom: 1px solid var(--line);
}
.spec__col .accent {
  color: var(--accent-bright);
}
.spec--wont li {
  color: var(--muted);
}

/* ============================================================
   STATUS
   ============================================================ */
.status__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
  max-width: 56ch;
}
.status__line {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.98;
  color: var(--text);
}
.status__sub {
  font-size: clamp(1rem, 1.4vw, 1.08rem);
  line-height: 1.55;
  color: var(--muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  border-top: 1px solid var(--line);
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--space-xl) clamp(20px, 5vw, 40px) var(--space-3xl);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-sm) var(--space-xl);
  font-size: 13px;
  color: var(--muted);
}
.foot a {
  color: var(--text);
  transition: color 0.3s var(--ease-out-expo);
}
.foot a:hover {
  color: var(--accent-bright);
}
.foot__legal {
  font-weight: 700;
}
.foot__license {
  flex-basis: 100%;
  order: 1; /* own centered line under the © / miacodes.com row */
  text-align: center;
  font-size: 11px;
}
.foot__license a {
  color: #5e6b74; /* a step below --muted, same navy family */
}
.foot__license a:hover {
  text-decoration: underline;
}
.foot__by {
  margin-left: auto;
}

/* ============================================================
   Scroll reveal — progressive enhancement only.
   Hidden state is opt-in: it applies only under html.anim, which
   the inline script adds after two rAF ticks prove the animation
   clock is alive. No JS, frozen clocks, throttled webviews =>
   .reveal-up has no opacity/transform rules at all and the page
   is a fully visible static document.
   ============================================================ */
html.anim .reveal-up {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s var(--ease-out-expo),
    transform 0.8s var(--ease-out-expo);
}
html.anim .reveal-up.in {
  opacity: 1;
  transform: none;
}
/* wall-clock failsafe: the settle timer (setTimeout, fires even when the
   animation clock freezes mid-transition) forces the final state. On healthy
   browsers the 0.8s transition is already done — visually a no-op. */
.reveal-up.settled {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html.anim .reveal-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   404
   ============================================================ */
.notfound {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--space-lg);
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(24px, 6vw, 48px);
}
.notfound__logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: var(--space-sm);
}
.notfound h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 12vw, 6rem);
  line-height: 0.92;
  color: var(--text);
}
.notfound p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: 40ch;
}

/* ============================================================
   CREDITS — rack-panel list, hairline rules
   ============================================================ */
.credits {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(20px, 4vh, 40px) clamp(20px, 5vw, 40px) clamp(40px, 7vh, 72px);
}
.credits h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.98;
  color: var(--text);
  margin: clamp(32px, 6vh, 64px) 0 clamp(24px, 4vh, 40px);
}
.credits__row {
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--line);
}
.credits__row:last-child {
  border-bottom: 1px solid var(--line);
}
.credits__row dd {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.08rem);
  line-height: 1.55;
  max-width: 56ch;
}
.credits__row dd a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  transition: color 0.3s var(--ease-out-expo);
}
.credits__row dd a:hover {
  color: var(--accent-bright);
}

/* ============================================================
   Breakpoints — mobile-first, up at ~720 and ~1080
   ============================================================ */
@media (min-width: 720px) {
  /* CTAs return to left alignment beyond mobile */
  .hero__cta,
  .status__cta {
    text-align: left;
  }
  /* credits rows: micro-label column beside the text */
  .credits__row {
    grid-template-columns: 160px 1fr;
    gap: var(--space-md);
  }
  /* spine moves to the centerline; phones straddle it */
  .walk::before {
    left: 50%;
  }
  .step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding-left: 0;
  }
  .step::before {
    display: none; /* the phone itself sits on the spine at this size */
  }
  .step__media {
    margin-left: 0;
  }
  /* odd steps: phone left of spine, centered on it; text right */
  .step:nth-child(odd) .step__media {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    transform: translateX(50%);
  }
  .step:nth-child(odd) .step__text {
    grid-column: 2;
    grid-row: 1;
    padding-left: calc(var(--phone-w) / 2 + clamp(32px, 4vw, 56px));
  }
  /* even steps: mirrored */
  .step:nth-child(even) .step__media {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    transform: translateX(-50%);
  }
  .step:nth-child(even) .step__text {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    padding-right: calc(var(--phone-w) / 2 + clamp(32px, 4vw, 56px));
  }
  .phone {
    width: var(--phone-w);
  }
  .shout {
    white-space: nowrap;
  }
  .spec {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1080px) {
  body {
    font-size: 18px;
  }
}
