/* ==========================================================================
   Tubeneur — base.css
   Shared design tokens, reset, typography, header, footer, buttons.
   Loaded by every page. Page-specific rules live in their own stylesheet.
   Token values come from docs/BRAND_FOUNDATION.md — change them there first.
   ========================================================================== */

/* --- Fonts (self-hosted) ---------------------------------------------------
   Served from this domain instead of Google Fonts / Fontshare, so first paint
   never waits on a cross-origin stylesheet. Inter is one variable file per
   unicode subset (latin loads always, latin-ext only when a page needs it).
   Clash Display: Fontshare free licence. Inter: SIL OFL 1.1. */

@font-face {
  font-family: "Clash Display";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ClashDisplay-500.woff2") format("woff2");
}
@font-face {
  font-family: "Clash Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/ClashDisplay-600.woff2") format("woff2");
}
@font-face {
  font-family: "Clash Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/ClashDisplay-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/Inter-Variable-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Base palette */
  --void: #0A0A0C;
  --graphite: #17171B;
  --graphite-light: #1F1F24;
  --border: #2A2A30;
  --text: #F5F5F7;
  --text-dim: #9A9AA2;

  /* Chrome — brand metal. Logo, one headline phrase, dividers only. */
  --chrome: linear-gradient(135deg, #F2F3F5 0%, #C7C9CE 25%, #86888F 50%, #C7C9CE 75%, #F2F3F5 100%);
  --chrome-flat: #B8BAC0;

  /* Signal accent */
  --gold: #E3B23C;
  --gold-hover: #F2C55C;
  --gold-soft: rgba(227, 178, 60, 0.12);
  --gold-line: rgba(227, 178, 60, 0.28);

  /* Semantic */
  --success: #3DDC84;
  --warning: #F2B705;
  --error: #FF4D4D;

  /* Spacing scale — 4 / 8 / 16 / 24 / 32 / 48 / 64 */
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;
  --s7: 64px;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* Shadows — always black, never coloured */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);

  /* Layout */
  --wrap: 1180px;
  --gutter: 24px;
  --header-h: 72px;

  /* Type */
  --font-display: "Clash Display", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* --- Reset ---------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg,
video { display: block; max-width: 100%; }

img { height: auto; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }

button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--gold);
  color: var(--void);
}

/* Anchored sections must clear the sticky header */
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

/* --- Layout helpers ------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: 96px; }
.section--tight { padding-block: 64px; }
.section--flush-top { padding-top: 0; }

.section-head {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: var(--s6);
}

.section-head__sub { margin-top: var(--s3); }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--s3);
}

h1 { font-size: clamp(38px, 5.4vw, 60px); font-weight: 700; }
h2 { font-size: clamp(28px, 3.6vw, 40px); }
h3 { font-size: clamp(20px, 2.2vw, 26px); }

.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-dim);
}

.muted { color: var(--text-dim); }
.small { font-size: 14px; }

/* Chrome text — reserved for brand moments (logo, one headline phrase) */
.chrome-text {
  background: var(--chrome);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  /* Keep the gradient consistent when the phrase wraps across lines */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Chrome hairline divider */
.chrome-rule {
  height: 1px;
  border: 0;
  background: var(--chrome);
  opacity: 0.4;
  margin: 0;
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 14px 24px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn svg { width: 16px; height: 16px; flex: none; }

/* Primary — Signal Gold fill, Void Black text, gold glow on hover */
.btn--primary {
  background: var(--gold);
  color: var(--void);
}
.btn--primary:hover {
  background: var(--gold-hover);
  color: var(--void);
  box-shadow: 0 0 0 1px var(--gold-line), 0 8px 28px rgba(227, 178, 60, 0.28);
}

/* Secondary — outline */
.btn--secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--secondary:hover {
  background: var(--graphite-light);
  border-color: var(--chrome-flat);
  color: var(--text);
}

.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--block { width: 100%; }

/* --- Cards ---------------------------------------------------------------- */

.card {
  background: var(--graphite);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 12, 0.94);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: var(--header-h);
}

/* Logo lockup — icon + wordmark */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo:hover { color: var(--text); }
/* The master logo file has a pure-black backdrop; `lighten` lets whichever
   dark surface it sits on (Void Black header, Graphite footer) show through. */
.logo__mark {
  height: 32px;
  width: auto;
  flex: none;
  mix-blend-mode: lighten;
}
.logo__sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-left: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s5);
  margin-inline: auto;
}

.nav a {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.16s ease;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: var(--s2); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px;
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  background: var(--graphite);
  border-top: 1px solid var(--border);
  padding-block: var(--s7) var(--s5);
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: var(--s6) var(--s4);
}

.footer-brand .logo { margin-bottom: var(--s3); }

.footer-motto {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-dim);
}

.footer-col h3,
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--s3);
}

.footer-col li { margin-bottom: 10px; }

.footer-col a {
  color: var(--text);
  font-size: 15px;
  transition: color 0.16s ease;
}
.footer-col a:hover { color: var(--gold); }

.social-row { display: flex; flex-wrap: wrap; gap: 12px; }

.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.social-row a:hover {
  color: var(--gold);
  border-color: var(--gold-line);
  background: var(--graphite-light);
}
.social-row svg { width: 17px; height: 17px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: var(--s6);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-dim);
}

/* --- Sticky buy bar ------------------------------------------------------- */

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px));
  z-index: 55;
  display: flex;
  justify-content: center;
  padding-inline: var(--s3);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.sticky-cta.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.sticky-cta__btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: var(--gold);
  color: var(--void);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
  box-shadow: 0 0 0 1px var(--gold-line), 0 10px 32px rgba(0, 0, 0, 0.55), 0 0 32px rgba(227, 178, 60, 0.28);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}
.sticky-cta__btn:hover {
  background: var(--gold-hover);
  color: var(--void);
  box-shadow: 0 0 0 1px var(--gold-line), 0 10px 32px rgba(0, 0, 0, 0.55), 0 0 40px rgba(227, 178, 60, 0.4);
}
.sticky-cta__btn svg { width: 16px; height: 16px; flex: none; }
.sticky-cta__text { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.sticky-cta__title { font-size: 16px; font-weight: 700; }
.sticky-cta__sub { font-size: 12px; font-weight: 600; opacity: 0.78; }

@media (max-width: 420px) {
  .sticky-cta__btn { gap: 10px; padding: 11px 18px; }
  .sticky-cta__title { font-size: 15px; }
  .sticky-cta__sub { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-cta { transition: none; }
}

/* --- Reveal on scroll ----------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --- Accessibility -------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--gold);
  color: var(--void);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
}
.skip-link:focus { left: 16px; }

/* Icon sprite holder */
.sprite { display: none; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; }

  .nav-toggle { display: inline-flex; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: var(--s3) var(--gutter) var(--s4);
    background: var(--graphite);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lift);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav a {
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav a:last-child { border-bottom: 0; }

  .header-actions .btn { padding: 10px 16px; font-size: 14px; }

  .section { padding-block: 64px; }
  .section--tight { padding-block: 48px; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .logo { font-size: 17px; }
  .header-actions .btn span.btn__long { display: none; }
}

/* --- Motion preferences --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
