/* MXS Reborn — design tokens and styles. Spec: website-design-research.md (shared notes). */

@font-face { font-family: "Titillium Web"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/titillium-web-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/titillium-web-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); }

:root {
  /* surfaces */
  --bg: #0e0d0a;
  --surface-0: #13120e;
  --surface-1: #1a1813;
  --surface-2: #22201a;
  --surface-3: #2b2921;
  --hairline: #2f2c24;
  --border: #2f2c24;
  --border-ui: #6e695c;

  /* text */
  --text: #f2eee3;
  --text-2: #c4beaf;
  --text-3: #9b9585;

  /* accent: "Open Class" number-plate yellow; actions, prices, active states only */
  --accent: #f2c230;
  --accent-hover: #f7d257;
  --accent-press: #d6a91a;
  --accent-300: #f6d77a;
  --accent-ink: #16140c;
  --accent-soft: rgba(242, 194, 48, .12);
  --focus: #f6d77a;

  --ok: #86c47a;
  --warn: #e8a64a;
  --err: #f0705f;

  /* type */
  --font-display: "Titillium Web", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: clamp(1.75rem, 1.35rem + 1.6vw, 2.5rem);
  --fs-xl: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);
  --fs-price: clamp(3rem, 2.4rem + 2.5vw, 4rem);
  --lh-tight: 1.05;
  --lh-head: 1.15;
  --lh-body: 1.6;
  --measure: 64ch;

  /* space */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --section-y: clamp(64px, 9vw, 128px);
  --container: 1200px;
  --container-text: 760px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: var(--lh-head); letter-spacing: -.01em; margin: 0; }
h1 { font-size: var(--fs-xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); font-weight: 600; }
p { margin: 0 0 var(--space-4); max-width: var(--measure); }

a { color: var(--accent-300); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--radius-md); font-weight: 600; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--container-text); }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 13, 10, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--hairline); }
.site-header .wrap { display: flex; align-items: center; gap: var(--space-5); height: 64px; transition: height .2s; }
.site-header.scrolled .wrap { height: 56px; }
.logo { display: block; margin-right: auto; line-height: 0; }
.logo img { height: 24px; width: auto; }
.site-nav { display: flex; gap: var(--space-5); }
.site-nav a { color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.site-nav a:hover { color: var(--text); }
@media (max-width: 719px) { .site-nav { display: none; } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 22px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  border: 0; border-radius: var(--radius-md);
  background: var(--accent); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 8px 24px -10px rgba(242, 194, 48, .35);
  text-decoration: none; cursor: pointer;
  transition: background .15s ease-out, transform .15s ease-out;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); text-decoration: none; }
.btn:active { background: var(--accent-press); transform: none; }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: default; transform: none; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: var(--fs-sm); }
.btn.large { min-height: 56px; font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; padding: 0 28px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border-ui); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.block { width: 100%; }

/* ---- Sections ---- */
section { padding: var(--section-y) 0; }
.band { background: var(--surface-0); }
.eyebrow {
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: .14em; color: var(--accent-300);
  margin: 0 0 var(--space-3);
}
.section-head { margin-bottom: var(--space-7); }
.section-head h2 + p { margin-top: var(--space-4); color: var(--text-2); }
.lead { font-size: var(--fs-md); color: var(--text-2); }
.fine { color: var(--text-3); font-size: var(--fs-xs); }

/* ---- Hero ---- */
.hero {
  padding: clamp(48px, 7vw, 96px) 0 var(--section-y);
  background: radial-gradient(60% 50% at 50% 0%, rgba(242, 194, 48, .09), transparent 70%);
}
.hero-text { text-align: center; max-width: var(--container-text); margin: 0 auto var(--space-7); }
.hero-text p { margin-left: auto; margin-right: auto; }
.hero-sub { font-size: var(--fs-md); color: var(--text-2); margin-top: var(--space-5); }
@media (min-width: 1024px) { .hero-sub { font-size: 1.375rem; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-5); justify-content: center; align-items: center; margin-top: var(--space-6); }
.hero-micro { color: var(--text-3); font-size: var(--fs-sm); margin-top: var(--space-4); }
@media (max-width: 719px) {
  .hero-text { text-align: left; }
  .hero-cta { justify-content: flex-start; }
  .hero-cta .btn { width: 100%; }
  .hero-cta .see-link { display: none; }
}

/* ---- Before/after slider ---- */
.compare {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-lg); border: 1px solid var(--hairline);
  background: var(--surface-1);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  user-select: none; touch-action: pan-y;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 8px rgba(0, 0, 0, .6); pointer-events: none; }
.compare-knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.compare:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.pill { position: absolute; top: var(--space-3); padding: 4px 10px; border-radius: var(--radius-sm); font-size: var(--fs-xs); font-weight: 600; pointer-events: none; }
.pill.left { left: var(--space-3); background: rgba(0, 0, 0, .6); color: #fff; }
.pill.right { right: var(--space-3); background: var(--accent); color: var(--accent-ink); }
.compare-hint { position: absolute; bottom: var(--space-3); left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .6); color: #fff; font-size: var(--fs-xs); padding: 4px 10px; border-radius: 999px; pointer-events: none; transition: opacity .3s; }
.compare.touched .compare-hint { opacity: 0; }
.compare-caption { color: var(--text-3); font-size: var(--fs-sm); margin: var(--space-3) 0 0; text-align: center; max-width: none; }

.tabs { display: flex; justify-content: center; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; }
.tabs[hidden] { display: none; }
.tab { min-height: 44px; padding: 0 18px; border-radius: var(--radius-md); border: 1px solid var(--hairline); background: var(--surface-1); color: var(--text-2); font: 600 var(--fs-sm) var(--font-body); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-300); border-color: transparent; }

/* ---- Reassurance strip ---- */
.strip { padding: var(--space-7) 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); background-color: var(--surface-0); background-image: url("/img/tread.svg"); background-size: 64px 64px; }
.strip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5); grid-template-columns: repeat(4, 1fr); }
.strip li { display: flex; gap: var(--space-3); align-items: center; color: var(--text); font-weight: 500; font-size: var(--fs-sm); }
.strip svg { flex: none; color: var(--text-2); }
@media (max-width: 899px) { .strip ul { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px) { .strip ul { grid-template-columns: 1fr; } }

/* ---- Features ---- */
.feature { display: grid; grid-template-columns: 7fr 5fr; gap: var(--space-7); align-items: center; margin-bottom: var(--space-8); }
.feature:nth-of-type(even) .feature-media { order: 2; }
.feature-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--hairline); }
.feature h3 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--space-4); }
.feature p { color: var(--text-2); }
@media (max-width: 799px) {
  .feature { grid-template-columns: 1fr; gap: var(--space-5); margin-bottom: var(--space-7); }
  .feature:nth-of-type(even) .feature-media { order: 0; }
}

.cards { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-lg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); overflow: hidden; }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: var(--space-5); }
.card h3 { margin-bottom: var(--space-2); }
.card p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }

/* ---- Gallery ---- */
.gallery { display: grid; gap: var(--space-4); grid-template-columns: repeat(3, 1fr); }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius-lg); overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--hairline); transition: transform .25s ease-out; }
.gallery button:hover img { transform: scale(1.02); }
.gallery button:first-child { grid-column: span 2; grid-row: span 2; }
.gallery button:first-child img { height: 100%; }
@media (max-width: 719px) {
  .gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: var(--space-3); padding-bottom: var(--space-2); }
  .gallery button { flex: 0 0 85%; scroll-snap-align: start; }
  .gallery button:first-child img { height: auto; }
}
.lightbox { padding: 0; border: 0; background: transparent; max-width: min(1600px, 94vw); width: 100%; }
.lightbox::backdrop { background: rgba(5, 6, 8, .92); }
.lightbox img { width: 100%; border-radius: var(--radius-md); }
.lightbox-bar { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); color: var(--text-2); font-size: var(--fs-sm); }
.lightbox-bar span { margin-right: auto; }
.icon-btn { min-width: 44px; min-height: 44px; border-radius: var(--radius-md); border: 1px solid var(--border-ui); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 1.1rem; }

/* ---- Install + requirements ---- */
.split { display: grid; grid-template-columns: 3fr 2fr; gap: var(--space-8); }
@media (max-width: 899px) { .split { grid-template-columns: 1fr; gap: var(--space-7); } }
.steps-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps-list li { counter-increment: step; display: grid; grid-template-columns: 72px 1fr; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--hairline); }
.steps-list li:last-child { border-bottom: 0; }
.steps-list li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-display); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--accent); opacity: .9; }
.steps-list h3 { margin-bottom: var(--space-1); }
.steps-list p { margin: 0; color: var(--text-2); }
.panel { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: var(--space-6); }
.panel h3 { margin-bottom: var(--space-4); }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { position: relative; padding-left: 30px; margin-bottom: var(--space-3); color: var(--text-2); }
.check-list li strong { color: var(--text); }
.check-list li::before { content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; background: var(--ok); -webkit-mask: url("/img/check.svg") center / contain no-repeat; mask: url("/img/check.svg") center / contain no-repeat; }

/* ---- Maker ---- */
.maker { display: grid; grid-template-columns: auto 1fr; gap: var(--space-6); align-items: start; }
.maker-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--hairline); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: var(--accent); font-size: 1.4rem; }
.maker p { color: var(--text-2); }
.maker .links { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (max-width: 559px) { .maker { grid-template-columns: 1fr; } }

/* ---- Buy card ---- */
.buy { display: grid; place-items: center; }
.buy-card { width: 100%; max-width: 480px; background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 30px 80px -40px rgba(0, 0, 0, .8); }
.price { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-price); line-height: 1; margin: var(--space-2) 0 var(--space-2); }
.price small { font-family: var(--font-body); font-weight: 500; font-size: var(--fs-base); color: var(--text-3); margin-left: var(--space-2); }
.buy-card .check-list { margin: var(--space-5) 0; }
.secure { display: flex; align-items: center; justify-content: center; gap: var(--space-2); color: var(--text-3); font-size: var(--fs-xs); margin: var(--space-3) 0 var(--space-4); }
.buy-card .fine { text-align: center; margin: var(--space-2) auto 0; }

/* ---- FAQ ---- */
.faq-group h3 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin: var(--space-6) 0 var(--space-3); }
.faq-group:first-child h3 { margin-top: 0; }
details { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-md); margin-bottom: var(--space-2); }
summary { cursor: pointer; padding: var(--space-4) var(--space-5); min-height: 44px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: var(--space-4); align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform .2s; margin-top: -4px; }
details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
details p, details ul { margin: 0; padding: 0 var(--space-5) var(--space-4); color: var(--text-2); font-size: var(--fs-sm); }
details ul { padding-left: calc(var(--space-5) + 18px); }

/* ---- Final CTA band ---- */
.final {
  text-align: center;
  background-color: var(--surface-0);
  background-image: linear-gradient(rgba(14, 13, 10, .78), rgba(14, 13, 10, .9)), url("/img/tread.svg");
  background-size: auto, 64px 64px;
  border-top: 1px solid var(--hairline);
}
.final h2 { margin-bottom: var(--space-5); }
.final .fine { margin: var(--space-4) auto 0; }

/* ---- Status ---- */
.status { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4) var(--space-5); border-radius: var(--radius-md); border: 1px solid var(--hairline); background: var(--surface-1); margin: var(--space-5) 0; color: var(--text); }
.status[hidden] { display: none; }
.status::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 2px; background: var(--text-3); -webkit-mask: var(--status-icon, url("/img/info.svg")) center / contain no-repeat; mask: var(--status-icon, url("/img/info.svg")) center / contain no-repeat; }
.status.ok { border-color: rgba(134, 196, 122, .45); --status-icon: url("/img/check.svg"); }
.status.ok::before { background: var(--ok); }
.status.err { border-color: rgba(240, 112, 95, .45); --status-icon: url("/img/alert.svg"); }
.status.err::before { background: var(--err); }
.status.busy::before { -webkit-mask: none; mask: none; background: none; border: 2px solid var(--text-3); border-top-color: var(--accent); border-radius: 50%; width: 16px; height: 16px; margin: 4px 2px 0; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Forms ---- */
.inline-form { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-5) 0; }
.inline-form input { flex: 1 1 240px; min-width: 0; min-height: 48px; background: var(--surface-1); color: var(--text); border: 1px solid var(--border-ui); border-radius: var(--radius-md); padding: 0 var(--space-4); font: inherit; font-size: 1rem; }
.inline-form input::placeholder { color: var(--text-3); }

/* ---- Legal / simple pages ---- */
.page { padding: var(--space-8) 0 var(--section-y); }
.legal h1, .page h1 { font-size: var(--fs-lg); margin-bottom: var(--space-3); }
.legal h2 { font-size: var(--fs-md); margin: var(--space-6) 0 var(--space-3); }
.legal p, .legal li { color: var(--text-2); }
.legal ul { padding-left: 1.2rem; }
.updated { color: var(--text-3); font-size: var(--fs-sm); margin-bottom: var(--space-6); }

/* ---- Download page ---- */
.done-head { display: flex; gap: var(--space-4); align-items: center; margin-bottom: var(--space-3); }
.done-icon { flex: none; width: 48px; height: 48px; border-radius: 50%; background: rgba(134, 196, 122, .15); display: grid; place-items: center; }
.done-icon::before { content: ""; width: 24px; height: 24px; background: var(--ok); -webkit-mask: url("/img/check.svg") center / contain no-repeat; mask: url("/img/check.svg") center / contain no-repeat; }
.dl-card { margin-top: var(--space-5); }
.dl-meta { color: var(--text-3); font-size: var(--fs-sm); margin: var(--space-3) 0 0; }
.phone-note[hidden] { display: none; }
.tips { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---- Footer ---- */
footer { padding: var(--space-7) 0 var(--space-8); color: var(--text-3); font-size: var(--fs-sm); border-top: 1px solid var(--hairline); }
footer nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-4); }
footer nav a { color: var(--text-2); text-decoration: none; }
footer nav a:hover { color: var(--text); text-decoration: underline; }
footer p { max-width: none; margin: 0; }
.footer-logo { display: block; height: 56px; width: auto; margin-bottom: var(--space-5); }

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity .3s ease-out, transform .3s ease-out; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Email-dependent wording: site.js adds .emails-on to <html> when download emails are set up. */
.if-email { display: none; }
.emails-on .if-email { display: revert; }
.emails-on .if-no-email { display: none; }

.help-shot { width: 100%; margin-top: var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--hairline); }

/* YouTube facade */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--hairline); background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.video-play img { width: 100%; height: 100%; object-fit: cover; }
.video-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 84px; height: 84px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); transition: transform .15s ease-out; }
.video-icon svg { margin-left: 4px; }
.video-play:hover .video-icon { transform: translate(-50%, -50%) scale(1.06); }

.hero-video { box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); }
.compare-section { padding-top: 0; }
