/* Trax landing page. Tokens mirror TraxApp/Design/Theme.swift: white, greys and black,
   hairline borders, squared corners. Colour only where the app has it: TuneTrainer yellow,
   the rust of Perform, the meters' green, and the six stem colours of the icon. */
:root {
  --bg: #fff;
  --surface: #F5F5F4;
  --surface-hover: #ECEBEA;
  --border: #E7E5E4;
  --border-strong: #D6D3D1;
  --text: #0C0A09;
  --text-2: #78716C;
  --text-3: #A8A29E;
  --wave: #292524;
  --yellow: #F5C518;
  --rust: #B7410E;
  --rust-hover: #A33A0C;
  --green: #3FB27F;
  --amber: #E8B21C;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* ── Type ── */
h1 {
  font-size: clamp(32px, 5.9vw, 72px); line-height: 1.02; letter-spacing: -.04em; font-weight: 650;
  text-wrap: balance;
}
h2 {
  font-size: clamp(30px, 4.6vw, 56px); line-height: 1.04; letter-spacing: -.035em; font-weight: 640;
  text-wrap: balance;
}
.h2s { font-size: clamp(26px, 3.4vw, 40px); }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.label, .lbl {
  font: 500 11px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--text-2);
}
.label { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.label em { font-style: normal; color: var(--text); padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 3px; }
.label .dot { width: 8px; height: 8px; background: var(--yellow); border-radius: 1px; }
.lede { font-size: clamp(17px, 1.7vw, 21px); line-height: 1.45; color: var(--text-2); max-width: 40em; text-wrap: pretty; }
.body { font-size: 17px; color: var(--text-2); max-width: 36em; text-wrap: pretty; }
.micro, .foot, .caption { font: 11px/1.6 var(--mono); color: var(--text-2); letter-spacing: .02em; }
.foot sup, .proof sup { font-size: .8em; }
kbd {
  display: inline-block; min-width: 22px; padding: 2px 6px; margin: 0 1px; text-align: center;
  font: 500 11px/1.5 var(--mono); color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 3px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  background: var(--text); color: #fff; text-decoration: none; font-weight: 550;
  border: 1px solid var(--text); border-radius: 3px; transition: transform .12s, background .12s, box-shadow .12s;
}
.btn:hover { background: #292524; box-shadow: 4px 4px 0 var(--yellow); transform: translate(-2px, -2px); }
.btn:active { transform: none; box-shadow: none; }
.btn-s { font-size: 13px; padding: 8px 14px; }
.btn-l { font-size: 16px; padding: 15px 24px; }
.btn-inv { background: #fff; color: var(--text); border-color: #fff; }
.btn-inv:hover { background: #fff; }
.btn-y { background: var(--yellow); color: var(--text); border-color: var(--yellow); }
.btn-y:hover { background: var(--yellow); box-shadow: 4px 4px 0 #fff; }
.cta-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta-row.center { justify-content: center; }

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-in { display: flex; align-items: center; height: 56px; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 17px; letter-spacing: -.02em; }
.brand img { border-radius: 6px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; color: var(--text-2); padding: 6px 0; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 760px) { .nav-links { display: none; } .nav-in .btn { margin-left: auto; } }

/* ── Window frame (screenshots and the demo) ── */
.window {
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(12,10,9,.03), 0 24px 60px -24px rgba(12,10,9,.22), 0 60px 120px -60px rgba(12,10,9,.18);
}
.window img { width: 100%; }
.window.narrow { max-width: 520px; width: 100%; }
figcaption { padding: 14px 18px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
figcaption b { color: var(--text); font-weight: 600; }

/* ── Hero ── */
.hero { padding-top: clamp(48px, 8vw, 104px); padding-bottom: 28px; }
.hero .lede { margin-top: 28px; }
.hero .cta-row { margin-top: 32px; }
.demo { margin-top: clamp(40px, 6vw, 72px); }
.caption { margin-top: 14px; text-align: center; }
.caption.dark { color: #A8A29E; }

.demo-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tbtn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; cursor: pointer; flex: none;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 3px;
}
.tbtn-play { background: var(--text); color: #fff; border-color: var(--text); }
.tbtn-play .i-pause, .demo.playing .tbtn-play .i-play { display: none; }
.demo.playing .tbtn-play .i-pause { display: block; }
.demo:not(.heard) .tbtn-play { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(245,197,24,0); } 35% { box-shadow: 0 0 0 6px rgba(245,197,24,.55); } }
.demo-title { font-weight: 600; font-size: 15px; margin: 0 6px; white-space: nowrap; }
.demo-hint { font: 11px/1.3 var(--mono); color: var(--text-2); margin-right: auto; }
.readout { font: 500 12px/1 var(--mono); color: var(--text-2); }
.readout b { color: var(--text); font-size: 13px; font-weight: 500; }
.chipr { padding: 10px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 3px; white-space: nowrap; }
.chipr.time { color: var(--text); min-width: 138px; text-align: center; }

.demo-body { padding: 14px; display: grid; gap: 6px; }
#demo-lanes { display: grid; gap: 6px; }
.lane, .chordrow { display: grid; grid-template-columns: 212px 1fr; gap: 10px; }
.lane-head {
  display: grid; grid-template-columns: 1fr auto 6px; align-items: center; gap: 10px; height: 54px; padding: 0 10px 0 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px; cursor: default;
}
.lane-head .lbl { color: var(--text); display: flex; align-items: center; gap: 8px; }
.lane-head .lbl::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--c, transparent); }
.lane-head-plain { border-color: transparent; height: 28px; grid-template-columns: 1fr; }
.lane-head-plain .lbl { color: var(--text-2); }
.lane-head-plain .lbl::before { display: none; }
.ms { display: inline-flex; gap: 4px; }
.ms button, .ms i {
  width: 24px; height: 22px; display: grid; place-items: center; cursor: pointer; padding: 0;
  font: 500 10px/1 var(--mono); font-style: normal; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 3px;
}
.ms i { cursor: default; opacity: .6; }
.ms button:hover { background: var(--surface-hover); }
.ms button[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.meter { width: 6px; height: 38px; background: var(--surface); border-radius: 1px; position: relative; overflow: hidden; }
.meter i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--green); }
.lane canvas { width: 100%; height: 54px; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.lane.muted .lane-head .lbl { color: var(--text-3); }
.chords { display: grid; grid-template-columns: repeat(4, 1fr); height: 28px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.chords span { display: flex; align-items: center; padding-left: 8px; font-weight: 650; font-size: 13px; border-left: 1px solid var(--border); }
.chords span:first-child { border-left: 0; }
.chords span.on { background: var(--text); color: #fff; }
.lane-input { margin-top: 10px; }
.lane-input .lane-head { border-style: dashed; border-color: var(--border-strong); grid-template-columns: 1fr auto; }
.lane-plug {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px; min-height: 54px; color: var(--text-2);
  font: 11px/1.4 var(--mono); border: 1px dashed var(--border-strong); border-radius: 4px;
}
.lane-plug svg { flex: none; color: var(--text); }
@media (max-width: 860px) {
  .demo-hint, .chipr:not(.time) { display: none; }
  .chipr.time { margin-left: auto; }
  .lane, .chordrow { grid-template-columns: 124px 1fr; gap: 6px; }
  .lane-head { padding: 0 6px 0 8px; gap: 6px; grid-template-columns: 1fr 6px; grid-template-rows: auto auto; align-content: center; row-gap: 5px; }
  .lane-head .lbl { font-size: 9.5px; grid-column: 1 / -1; }
  .lane-head .meter { height: 22px; }
  .lane-input .lane-head .ms { display: none; }
  .demo-body { padding: 8px; }
}

/* ── Proof strip ── */
.proof { margin-top: clamp(48px, 7vw, 88px); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); padding-bottom: 14px; }
.proof-in { display: grid; grid-template-columns: repeat(4, 1fr); }
.proof-in > div { padding: 30px 24px 22px; border-left: 1px solid var(--border); }
.proof-in > div:first-child { border-left: 0; padding-left: 0; }
.proof b { display: block; font: 500 clamp(36px, 5vw, 60px)/1 var(--mono); letter-spacing: -.04em; }
.proof b small { font-size: .38em; letter-spacing: 0; margin-left: 4px; color: var(--text-2); font-weight: 500; }
.proof span { display: block; margin-top: 10px; font-size: 14px; color: var(--text-2); }
.proof .foot { padding-top: 2px; }
@media (max-width: 760px) {
  .proof-in { grid-template-columns: 1fr 1fr; }
  .proof-in > div { padding: 22px 16px 16px; }
  .proof-in > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .proof-in > div:nth-child(n+3) { border-top: 1px solid var(--border); }
}

/* ── Sections ── */
.shot-hero { padding-top: clamp(56px, 8vw, 104px); }
.who { margin-top: 28px; text-align: center; font-size: 17px; color: var(--text-2); text-wrap: balance; }
.feature { display: grid; grid-template-columns: 1fr minmax(0, 520px); gap: clamp(32px, 6vw, 88px); align-items: center; padding-top: clamp(72px, 10vw, 144px); padding-bottom: clamp(72px, 10vw, 144px); }
.feature.flip { grid-template-columns: minmax(0, 520px) 1fr; padding: clamp(56px, 8vw, 104px) 0 0; }
.feature-text .body { margin-top: 20px; }
.ticks { margin-top: 26px; display: grid; gap: 0; border-top: 1px solid var(--border); }
.ticks li { padding: 13px 0 13px 26px; border-bottom: 1px solid var(--border); position: relative; font-size: 15px; color: var(--text-2); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 20px; width: 8px; height: 8px; background: var(--yellow); border-radius: 1px; }
.ticks b { color: var(--text); font-weight: 600; }
@media (max-width: 860px) {
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip .window { order: 2; }
  .window.narrow { max-width: none; }
}

.band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: clamp(72px, 10vw, 136px) 0; }
.stack { padding-top: clamp(72px, 10vw, 136px); padding-bottom: clamp(72px, 10vw, 136px); }
.split-head { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: end; margin-bottom: clamp(36px, 5vw, 64px); }
@media (max-width: 860px) { .split-head { grid-template-columns: 1fr; align-items: start; } }

.cols3, .grid6 { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 4px; background: var(--bg); margin-top: clamp(28px, 4vw, 48px); overflow: hidden; }
.cell { padding: 24px; border-left: 1px solid var(--border); }
.cell h3 { margin-bottom: 8px; }
.cell p { font-size: 14.5px; color: var(--text-2); }
.cols3 .cell:first-child, .grid6 .cell:nth-child(3n+1) { border-left: 0; }
.grid6 .cell:nth-child(n+4) { border-top: 1px solid var(--border); }
.cell-img { padding: 0; display: grid; place-items: center; background: #F1F0EF; }
.cell-img img { width: min(100%, 260px); }
.keys { line-height: 2.1; }
.keys span { white-space: nowrap; margin-right: 8px; }
@media (max-width: 860px) {
  .cols3, .grid6 { grid-template-columns: 1fr; }
  .cell { border-left: 0; border-top: 1px solid var(--border); }
  .cols3 .cell:first-child, .grid6 .cell:first-child { border-top: 0; }
}

/* ── Latency, drawn to scale ── */
.latency { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: clamp(20px, 3vw, 36px); }
.lat-row, .lat-scale { display: grid; grid-template-columns: minmax(150px, 290px) 1fr 76px; gap: 18px; align-items: center; }
.lat-row { padding: 9px 0; }
.lat-name { font: 500 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.lat-row:first-child .lat-name { color: var(--text); }
.lat-track { height: 22px; border-left: 1px solid var(--text); position: relative; }
.lat-bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--border-strong); transform-origin: left; transition: transform 1s cubic-bezier(.2,.7,.2,1); }
.lat-bar.y { background: var(--yellow); }
.lat-bar.h { background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, transparent 2px 6px); border: 1px solid var(--border-strong); border-left: 0; }
.reveal:not(.in) .lat-bar { transform: scaleX(0); }
.lat-row:nth-child(2) .lat-bar { transition-delay: .15s; }
.lat-row:nth-child(3) .lat-bar { transition-delay: .3s; }
.lat-val { font: 500 15px/1 var(--mono); text-align: right; white-space: nowrap; }
.lat-ticks { display: flex; justify-content: space-between; border-top: 1px solid var(--border-strong); padding-top: 6px; }
.lat-ticks i { font: normal 10px/1 var(--mono); color: var(--text-3); width: 0; white-space: nowrap; display: flex; justify-content: center; }
.lat-ticks i:first-child { justify-content: flex-start; }
.lat-ticks i:last-child { justify-content: flex-end; }
.latency .foot { margin-top: 22px; max-width: 76ch; }
@media (max-width: 700px) {
  .lat-row, .lat-scale { grid-template-columns: 1fr 64px; gap: 6px 12px; }
  .lat-name { grid-column: 1 / -1; }
  .lat-scale span:first-child { display: none; }
}

/* ── Mid CTA ── */
.midcta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 44px; padding-bottom: 44px; border-top: 1px solid var(--border); }
.midcta > p { font-size: clamp(22px, 2.6vw, 30px); font-weight: 620; letter-spacing: -.025em; }

/* ── Mixer ── */
.duo { display: grid; grid-template-columns: 1.09fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }
.tablewrap { margin-top: clamp(32px, 5vw, 56px); overflow-x: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; }
.cmp { width: 100%; min-width: 660px; border-collapse: collapse; font-size: 14.5px; }
.cmp th, .cmp td { text-align: left; padding: 14px 18px; border-top: 1px solid var(--border); font-weight: 400; color: var(--text-2); }
.cmp thead th { border-top: 0; font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.cmp tbody th { color: var(--text); font-weight: 550; }
.cmp .us { color: var(--text); font-weight: 600; background: #FEF9E3; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.cmp thead .us { box-shadow: inset 0 3px 0 var(--yellow); }
.band > .wrap > .foot { margin-top: 18px; }

/* ── Perform: the one inversion ── */
.stage { background: var(--text); color: #fff; padding: clamp(72px, 10vw, 136px) 0; }
.stage .label, .stage .lbl { color: #A8A29E; }
.stage .label em { color: #fff; border-color: #44403C; }
.stage .body { color: #A8A29E; }
.stageview { border: 1px solid #292524; border-radius: 10px; padding: clamp(20px, 4vw, 48px); display: grid; gap: clamp(28px, 6vw, 72px); background: #0C0A09; }
.st-top, .st-bot, .st-times { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.st-bot { align-items: flex-end; }
.st-count { font: 500 clamp(16px, 2vw, 22px)/1 var(--mono); color: #A8A29E; }
.st-mid { position: relative; }
.st-title { font-size: clamp(44px, 10vw, 128px); line-height: .95; letter-spacing: -.05em; font-weight: 650; transition: opacity .25s; }
.st-meta { margin-top: 18px; font: clamp(15px, 2.2vw, 26px)/1 var(--mono); color: #A8A29E; transition: opacity .25s; }
.stageview.counting .st-title, .stageview.counting .st-meta { opacity: .28; }
.st-seek { margin-top: clamp(24px, 4vw, 48px); height: 8px; background: #292524; border-radius: 2px; overflow: hidden; }
.st-seek i { display: block; height: 100%; width: 0; background: var(--yellow); }
.st-times { margin-top: 12px; font: 500 clamp(20px, 3.4vw, 40px)/1 var(--mono); }
.st-times span:last-child { color: #78716C; }
.st-next { font-size: clamp(20px, 3vw, 34px); font-weight: 640; letter-spacing: -.03em; margin-top: 8px; }
.st-clicks { position: absolute; right: 0; top: 6px; display: flex; gap: 8px; }
.st-clicks i { width: 12px; height: 12px; border: 1px solid #57534E; border-radius: 1px; }
.st-clicks i.on { background: var(--yellow); border-color: var(--yellow); }
.btn-perform {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; white-space: nowrap;
  background: var(--rust); color: #fff; border: 0; border-radius: 3px; padding: 12px 18px; font-weight: 600; font-size: 15px;
}
.btn-perform:hover { background: var(--rust-hover); }
.cols3.dark { background: transparent; border-color: #292524; }
.cols3.dark .cell { border-color: #292524; }
.cols3.dark .cell p { color: #A8A29E; }
.cols3.dark kbd { background: transparent; color: #fff; border-color: #57534E; }
.stage .window { margin-top: clamp(28px, 4vw, 48px); border-color: #292524; box-shadow: none; }
.stage .cta-row { margin-top: clamp(40px, 6vw, 72px); }
.stage .micro { color: #A8A29E; }

/* ── FAQ ── */
.faq { display: grid; grid-template-columns: 1fr 1.7fr; gap: clamp(24px, 6vw, 88px); padding-top: clamp(72px, 10vw, 136px); padding-bottom: clamp(72px, 10vw, 136px); }
@media (max-width: 860px) { .faq { grid-template-columns: 1fr; } }
.faq-list { border-top: 1px solid var(--border-strong); }
details { border-bottom: 1px solid var(--border); }
summary { cursor: pointer; list-style: none; padding: 20px 36px 20px 0; font-weight: 600; font-size: 17px; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font: 400 22px/1 var(--mono); color: var(--text-2); }
details[open] summary::after { content: "−"; }
details p { padding: 0 36px 22px 0; color: var(--text-2); max-width: 62ch; }

/* ── Final CTA ── */
.final { background: var(--text); color: #fff; padding: clamp(80px, 12vw, 160px) 0; border-top: 1px solid #292524; position: relative; overflow: hidden; }
.final::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 120px; opacity: .5;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 3px, transparent 3px 14px);
  -webkit-mask: linear-gradient(to top, #000, transparent); mask: linear-gradient(to top, #000, transparent);
  clip-path: polygon(0 100%, 0 78%, 8% 40%, 16% 66%, 24% 22%, 33% 58%, 41% 34%, 50% 6%, 59% 44%, 67% 26%, 76% 62%, 84% 36%, 92% 70%, 100% 48%, 100% 100%);
}
.final-in { display: grid; justify-items: center; text-align: center; gap: 22px; position: relative; }
.final-in img { border-radius: 22px; box-shadow: 0 0 0 1px #292524; }
.final .body { color: #A8A29E; }
.final .micro { color: #A8A29E; }

/* ── Footer ── */
.footer { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 36px; font-size: 14px; color: var(--text-2); }
.footer .brand { font-size: 15px; color: var(--text); }
.footer .foot { margin-left: auto; }

/* ── Toast and reveal ── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 40;
  background: var(--text); color: #fff; padding: 12px 16px; border-radius: 3px; font-size: 14px; max-width: calc(100vw - 32px);
  box-shadow: 4px 4px 0 var(--yellow); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .lat-bar { transition: none; }
  .demo:not(.heard) .tbtn-play { animation: none; }
}
