/* TuneHaven — tunehaven.bytehavenstudios.com
   One stylesheet for every page. Brand tokens come from the app itself
   (branding/launchkit/launchkit.yml → app theme Color.kt) — never invent colours.
   No JavaScript anywhere on this host (CSP script-src 'none'); everything below is CSS-only. */

/* ---------- fonts (self-hosted, OFL — same Geist set as the studio site) ---------- */
@font-face { font-family: "Geist"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/assets/fonts/Geist-Regular.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/assets/fonts/Geist-Medium.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/assets/fonts/Geist-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/assets/fonts/GeistMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/assets/fonts/GeistMono-Medium.woff2") format("woff2"); }

/* ---------- tokens ---------- */
:root {
  --bg: #12161D;          /* TtBackgroundTop */
  --bg2: #0A0D12;         /* TtBackground (gradient bottom) */
  --surface: #1B212B;     /* TtSurfaceVariant */
  --green: #3DDC97;       /* TtInTune */
  --amber: #F0B44B;       /* TtOff */
  --text: #E9EDF3;        /* TtOnSurface */
  --muted: #A3AEBE;       /* TtOnSurfaceVariant */
  --line: #232B37;        /* hairlines derived from surface */
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --w: 68rem;             /* page column */
  --w-text: 46rem;        /* long-form column */
  color-scheme: dark;     /* this brand is the instrument panel — dark on purpose, both schemes */
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--sans);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%) fixed, var(--bg2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0 0 0.6em; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #6ae8b4; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 600; color: var(--text); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: -999px; top: 0; z-index: 99;
  background: var(--surface); color: var(--text); padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */
.site-head {
  max-width: var(--w); margin: 0 auto; padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
}
.site-head .brand {
  display: flex; align-items: center; gap: 0.65rem;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em;
}
.site-head .brand img { width: 34px; height: 34px; border-radius: 8px; }
.site-head nav { margin-left: auto; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-head nav a {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--green); }

/* ---------- tick ruler (the recurring instrument motif) ---------- */
.ruler {
  height: 14px;
  background:
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  margin: 0 auto; max-width: var(--w);
}

/* ---------- hero ---------- */
.hero {
  max-width: var(--w); margin: 0 auto; padding: 3.5rem 1.25rem 4rem;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 3rem; align-items: center;
}
.hero .kicker {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 1.1rem;
}
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 3.6rem); margin-bottom: 1rem; }
.hero h1 .accent { color: var(--green); }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero .shot { justify-self: center; position: relative; }
.hero .shot img {
  width: min(310px, 72vw); border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.55), 0 0 0 1px var(--line);
}

/* the cents dial — needle settles on 0 (CSS only) */
.dial { margin: 2.2rem 0 0; max-width: 30rem; }
.dial .scale {
  position: relative; height: 46px; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, var(--line) 0 2px, transparent 2px 10%) 0 100% / 100% 18px no-repeat,
    repeating-linear-gradient(90deg, #2E3743 0 1px, transparent 1px 2%) 0 100% / 100% 10px no-repeat;
}
.dial .needle {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: var(--green);
  box-shadow: 0 0 10px rgba(61,220,151,0.9), 0 0 26px rgba(61,220,151,0.45);
  animation: settle 2.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.dial .labels {
  display: flex; justify-content: space-between; margin-top: 0.45rem;
  font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em;
}
.dial .labels .zero { color: var(--green); }
.dial .readout {
  margin-top: 0.5rem; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.1em;
  color: var(--green); text-transform: uppercase;
}
@keyframes settle {
  0%   { transform: translateX(-9.2rem); background: var(--amber);
         box-shadow: 0 0 10px rgba(240,180,75,0.9), 0 0 26px rgba(240,180,75,0.45); }
  38%  { transform: translateX(3.1rem); }
  62%  { transform: translateX(-1.2rem); background: var(--amber);
         box-shadow: 0 0 10px rgba(240,180,75,0.9), 0 0 26px rgba(240,180,75,0.45); }
  82%  { transform: translateX(0.35rem); }
  100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dial .needle { animation: none; }
}

/* ---------- shared section scaffolding ---------- */
.section { max-width: var(--w); margin: 0 auto; padding: 3.5rem 1.25rem; }
.section > h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin-bottom: 0.4em; }
.section .sub { color: var(--muted); max-width: 40em; margin-bottom: 2rem; }
.eyebrow {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--green); margin: 0 0 0.9rem;
}

/* trust strip */
.strip {
  max-width: var(--w); margin: 0 auto; padding: 0 1.25rem 0.5rem;
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  list-style: none;
}
.strip li {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.05em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.9rem;
  background: rgba(27,33,43,0.55);
}
.strip li::before { content: "● "; color: var(--green); font-size: 0.6rem; vertical-align: 2px; }

/* claim cards ("cheap tuners guess") */
.claims { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; padding: 0; margin: 0; list-style: none; }
.claims li {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--green);
  border-radius: 12px; padding: 1.2rem 1.35rem;
}
.claims li h3 { font-size: 1.02rem; margin-bottom: 0.35rem; }
.claims li p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* feature columns */
.features { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.5rem 2rem; }
.features h3 { font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-bottom: 0.5rem; }
.features ul { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 0.95rem; }
.features li { padding: 0.28rem 0 0.28rem 1.1rem; position: relative; }
.features li::before { content: "–"; position: absolute; left: 0; color: var(--green); }

/* screenshots */
.shots { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.shots li { text-align: center; }
.shots img {
  width: min(250px, 80vw); border-radius: 18px; margin: 0 auto;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), 0 0 0 1px var(--line);
}
.shots figcaption {
  margin-top: 0.8rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--muted);
}

/* free-forever banner on landing */
.charter-card {
  background: linear-gradient(135deg, rgba(61,220,151,0.10), rgba(61,220,151,0.02)), var(--surface);
  border: 1px solid rgba(61,220,151,0.35); border-radius: 16px; padding: 2rem;
}
.charter-card p { color: var(--muted); max-width: 42em; }

/* store badges — the app is not live yet; these are deliberately dead */
.badges { display: flex; gap: 1rem; flex-wrap: wrap; padding: 0; margin: 1.4rem 0 0; list-style: none; }
.badges li {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 190px; min-height: 60px; padding: 0.6rem 1.3rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--muted);
}
.badges .store { font-weight: 600; color: var(--text); font-size: 1rem; }
.badges .soon { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }

/* ---------- long-form (privacy / support / charter) ---------- */
.doc { max-width: var(--w-text); margin: 0 auto; padding: 3rem 1.25rem 4.5rem; }
.doc h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.doc .docmeta { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-bottom: 2.2rem; }
.doc h2 { font-size: 1.25rem; margin-top: 2.4rem; }
.doc p, .doc li { color: #C7CFDA; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin: 0.35rem 0; }
.doc .summary {
  background: var(--surface); border: 1px solid rgba(61,220,151,0.35); border-left: 3px solid var(--green);
  border-radius: 12px; padding: 1.1rem 1.4rem; margin: 1.6rem 0;
}
.doc .summary p { margin: 0; }
.lang {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 1.6rem;
}
.lang a { color: var(--muted); }
.lang [aria-current="page"] { color: var(--green); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 2rem; }
.site-foot .inner {
  max-width: var(--w); margin: 0 auto; padding: 2.2rem 1.25rem 3rem;
  display: flex; flex-wrap: wrap; gap: 1.2rem 2.4rem; align-items: baseline;
  font-size: 0.9rem; color: var(--muted);
}
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--green); }
.site-foot .studio { margin-right: auto; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.2rem; gap: 2.4rem; }
  .hero .shot { order: 2; }
  .claims { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
}
