/* ==========================================================================
   Porsche 919 Hybrid Evo · Base Typography, Dual-Polarity Top Bar & Overlays
   ========================================================================== */

*,
*::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.78;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--porsche-red);
  color: #FFFFFF;
}

[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 lowercase in body font */
.tnum em,
.triad-item b em,
.hud-val em,
.perf-metric b em,
.aero-stat b em,
.pb-stat b em,
.scale-card__time em,
.spa-stat b em {
  font-family: var(--font-body);
  font-style: normal;
  text-transform: none;
  font-size: 0.38em;
  font-weight: 500;
  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: #07080A;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

/* Architectural Display Hierarchy (Calm Weight & Zero Orphans) */
.sec-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.2vw, 3.0rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--ink);
}

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

.sec-sub {
  margin-top: 16px;
  font-size: clamp(0.95rem, 1.05vw, 1.04rem);
  line-height: 1.82;
  text-wrap: pretty;
  color: var(--ink-dim);
  max-width: 38em;
}

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

.quote-clean p {
  font-size: clamp(1.12rem, 1.8vw, 1.54rem);
  line-height: 1.68;
  font-weight: 400;
  text-wrap: pretty;
  color: var(--ink);
}

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

/* --------------------------------------------------------------------------
   Minimal Entrance Preloader (1px Weissach Crimson Spine)
   -------------------------------------------------------------------------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #07080A;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.52s var(--ease-smooth), transform 0.6s var(--ease-smooth);
  cursor: pointer;
}

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

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

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

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

/* --------------------------------------------------------------------------
   Dual-Polarity Floating Top Bar (Menu · Centered 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: #F7F8FA;
  background: linear-gradient(180deg, rgba(7, 8, 10, 0.64) 0%, rgba(7, 8, 10, 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(7, 8, 10, 0.84);
  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.92);
  color: var(--ink-dark);
  border-bottom-color: rgba(11, 13, 16, 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-family: var(--font-mono);
  font-size: 11.5px;
  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: baseline;
  gap: 10px;
  color: currentColor;
}

.brand-center__make {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
}

.brand-center__model {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--porsche-red);
}

.site-header.is-scrolled.is-light-bar .brand-center__model {
  color: var(--porsche-red-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 (8 Chapters) */
.index-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(7, 8, 10, 0.96);
  color: #F7F8FA;
  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: 600;
  letter-spacing: 0.2em;
  font-size: 13px;
}

.close-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(247, 248, 250, 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: 16px 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(--porsche-red);
  transform: translateX(8px);
}

.index-link__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.1rem, 1.9vw, 1.5rem);
  color: #F7F8FA;
}

.index-link__en {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(247, 248, 250, 0.44);
}

.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.16em;
  color: rgba(247, 248, 250, 0.54);
}

.index-overlay__portal {
  color: #F7F8FA;
  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(7, 8, 10, 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: #F7F8FA;
  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: #07080A;
}

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

/* Smooth GPU Reveals & Clamped Parallax (separated onto parent/child) */
.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__make {
    font-size: 11.5px;
    letter-spacing: 0.24em;
    text-indent: 0.24em;
  }
  .brand-center__model {
    font-size: 10px;
  }
}

@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;
}
