/* ==========================================================================
   McLaren W1 · Base Typography, Dual-Polarity Top Bar, Menu & Lightbox (V2)
   ========================================================================== */

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

html,
body {
  overflow-x: clip;
  overflow-anchor: none;
  background: var(--bg-dark);
  color: var(--ink-light);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: clamp(15.5px, 1.05vw, 17px);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--papaya);
  color: #08090B;
}

[hidden] {
  display: none !important;
}

img,
video,
svg,
canvas {
  display: block;
  max-width: 100%;
}

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

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* Unit Isolation: keep units in body font with lowercase precision */
.tnum em,
.triad-item b em,
.hud-val em,
.perf-metric b em,
.chassis-stat b em,
.craft-stat b em,
.pb-stat b em,
.am-item b em {
  font-family: var(--font-body);
  font-style: normal;
  text-transform: none;
  font-size: 0.38em;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-left: 5px;
  color: var(--accent);
}

.wrap {
  width: min(var(--wrap-max), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 24px;
  z-index: 200;
  background: #FFFFFF;
  color: #08090B;
  padding: 8px 16px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skip-link:focus {
  top: 16px;
}

/* Architectural Display Hierarchy (Light Weight, Balanced Lines, Zero Orphans) */
.sec-heading {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.85rem, 3.35vw, 3.15rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-wrap: balance;
  color: var(--ink);
}

html[lang="en"] .sec-heading {
  letter-spacing: 0.03em;
  line-height: 1.08;
}

.sec-sub {
  margin-top: 14px;
  font-size: clamp(0.95rem, 1.08vw, 1.06rem);
  line-height: 1.78;
  color: var(--ink-dim);
  max-width: 42em;
}

.quote-clean {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}

.quote-clean p {
  font-size: clamp(1.14rem, 1.95vw, 1.62rem);
  line-height: 1.64;
  font-weight: 300;
  color: var(--ink);
}

.quote-clean cite {
  display: block;
  margin-top: 20px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* --------------------------------------------------------------------------
   Minimal Entrance Preloader (1px Silk-Papaya Spine Sweep)
   -------------------------------------------------------------------------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #08090B;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.55s var(--ease-smooth), transform 0.65s var(--ease-smooth);
  cursor: pointer;
}

.preloader.is-done {
  opacity: 0;
  transform: translateY(-4%);
  pointer-events: none;
}

.preloader__spine {
  width: 1px;
  height: 60px;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  overflow: hidden;
}

.preloader__fill {
  position: absolute;
  inset: 0;
  background: var(--papaya);
  transform: translateY(-100%);
  transition: transform 0.46s var(--ease-cinema);
}

.preloader.is-sweeping .preloader__fill {
  transform: translateY(0%);
}

/* --------------------------------------------------------------------------
   Dual-Polarity Floating Top Bar (Menu · Centered McLaren Wordmark · Lang)
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  color: #FFFFFF;
  background: linear-gradient(180deg, rgba(8, 9, 11, 0.62) 0%, rgba(8, 9, 11, 0) 100%);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}

.site-header.is-scrolled {
  background: rgba(8, 9, 11, 0.80);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.site-header.is-scrolled.is-light-bar {
  background: rgba(255, 255, 255, 0.90);
  color: var(--ink-dark);
  border-bottom-color: rgba(11, 13, 17, 0.10);
}

.site-header__inner {
  width: min(1440px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.menu-trigger {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: currentColor;
  opacity: 0.88;
  transition: opacity 0.25s ease;
}

.menu-trigger:hover {
  opacity: 1;
}

.menu-lines {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}

.menu-lines i {
  display: block;
  height: 1px;
  background: currentColor;
}

.brand-center {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: currentColor;
}

.brand-center svg {
  height: 13px;
  width: auto;
}

.brand-center__model {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--papaya);
}

.site-header.is-scrolled.is-light-bar .brand-center__model {
  color: var(--papaya-deep);
}

.lang-link {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: currentColor;
  opacity: 0.84;
  transition: opacity 0.25s ease;
}

.lang-link:hover {
  opacity: 1;
}

/* Fullscreen Navigation Overlay (10 Chapters) */
.index-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 9, 11, 0.96);
  color: #FFFFFF;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 60px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-cinema);
}

.index-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.index-overlay__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.index-overlay__brand {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0.18em;
  font-size: 13px;
}

.close-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  padding: 8px 0;
}

.index-overlay__nav {
  margin-block: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 64px;
  max-width: 1080px;
}

.index-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  transition: border-color 0.25s ease, transform 0.25s var(--ease-cinema);
}

.index-link:hover {
  border-bottom-color: var(--papaya);
  transform: translateX(8px);
}

.index-link__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.12rem, 2vw, 1.6rem);
  color: #FFFFFF;
}

.index-link__en {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.42);
}

.index-overlay__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.52);
}

.index-overlay__portal {
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 2px;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 9, 11, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__close {
  position: absolute;
  top: 24px;
  right: var(--gutter);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #FFFFFF;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.lightbox__img {
  max-width: min(1240px, 92vw);
  max-height: 78vh;
  object-fit: contain;
  background: #08090B;
}

.lightbox__cap {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.76);
  text-align: center;
  max-width: 68ch;
}

/* Smooth GPU Reveals & Clamped Parallax */
.reveal-fade {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.7s var(--ease-cinema), transform 0.7s var(--ease-cinema);
}

.reveal-fade.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal-curtain {
  clip-path: inset(4% 0 4% 0);
  transform: scale(1.02);
  transition: clip-path 1s var(--ease-cinema), transform 1.2s var(--ease-cinema);
}

.reveal-curtain.is-in {
  clip-path: inset(0 0 0 0);
  transform: scale(1);
}

[data-parallax] {
  will-change: transform;
  transform: translate3d(0, var(--px-y, 0px), 0) scale(1.08);
}

@media (max-width: 760px) {
  .index-overlay__nav {
    grid-template-columns: 1fr;
  }
  .brand-center svg {
    height: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .preloader {
    display: none !important;
  }
  .reveal-fade,
  .reveal-curtain {
    opacity: 1 !important;
    clip-path: none !important;
    transform: none !important;
    transition: none !important;
  }
  [data-parallax] {
    transform: none !important;
    will-change: auto;
  }
}

/* hc:typography-wrap */
p, figcaption, .sec-sub, .sec-lead {
  text-wrap: pretty;
}
h1, h2, h3,
blockquote,
blockquote p,
.manifesto__statement,
.quote-clean,
.quote-clean p,
.quote,
.quote p,
.curtain__lead,
.hero__sub,
.hero__desc,
.story__lead--center {
  text-wrap: balance;
}
