/* ══════════════════════════════════════════════
   SHARED STYLES — Nav, Footer, Marquee, Base
   Loaded by all pages via <link>
   ══════════════════════════════════════════════ */

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

/* ── VARIABLES ── */
:root {
  --color-bg: #1e1f22;
  --color-bg-elevated: #272829;
  --color-dark: #000;
  --color-surface: #f0f1f2;
  --color-surface-dim: #e4e5e7;
  --color-text: #ecedef;
  --color-text-muted: #878a8e;
  --color-text-dim: #555759;
  --color-border: rgba(236, 237, 239, 0.08);
  --color-border-light: rgba(30, 31, 34, 0.1);
  --color-active: #878a8e;
  --font-body: "roma", sans-serif;
  --font-display: "roma-shaded", sans-serif;
  --font-display-fill: "roma-solid", sans-serif;
  --font-display-outline: "roma-outline", sans-serif;
  --nav-height: 80px;
}

/* ── BASE ── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "lnum" 1;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures contextual;
  hanging-punctuation: first last;
  overflow-x: hidden;
}

p, li, blockquote, td, .pull-quote-text, .wheel-detail-desc, .footer-brand-sub, .arc-step-desc, .stat-label {
  text-wrap: pretty;
}

h1, h2, h3, .wheel-detail-name, .dim-hero-title {
  text-wrap: balance;
}

::selection {
  background: rgba(236, 237, 239, 0.2);
  color: var(--color-text);
}

/* ── LAYERED TEXT ── */
.text-layered {
  position: relative;
  font-family: "roma-inscribed", sans-serif;
  color: var(--color-text);
  transition: color 0.6s ease;
}

.text-layered::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  font-family: "roma-outline", sans-serif;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-transform: inherit;
  text-align: inherit;
  color: var(--color-active);
  pointer-events: none;
}

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: all 0.35s ease;
}

.nav.nav-dim {
  background: rgba(30, 31, 34, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav.scrolled {
  height: 60px;
  background: rgba(30, 31, 34, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--color-border);
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  height: 40px;
  overflow: hidden;
  position: relative;
}

.nav-logo-full {
  height: 28px;
  width: auto;
  transition: opacity 0.35s ease;
}

.nav-logo-icon {
  height: 28px;
  width: auto;
  position: absolute;
  left: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.nav.scrolled .nav-logo-full { opacity: 0; }
.nav.scrolled .nav-logo-icon { opacity: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--color-active-on-dark, var(--color-active)); }

.nav-tagline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-active-on-dark, var(--color-active));
  transition: color 0.6s ease;
  text-align: center;
  line-height: 1.6;
}

/* ── DIMENSION MARQUEE ── */
.dim-marquee {
  overflow: hidden;
  padding: 3rem 0;
  background: var(--color-dark);
}

.dim-marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 30s linear infinite;
}

.dim-marquee-track:hover {
  animation-play-state: paused;
}

.dim-marquee-track a {
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 400;
  color: var(--color-text-dim);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0 2.5rem;
  transition: color 0.3s;
}

.dim-marquee-track a:hover {
  color: var(--dim-color);
}

.dim-marquee-track .marquee-sep {
  color: var(--color-text-dim);
  opacity: 0.3;
  padding: 0;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── FOOTER ── */
.footer {
  background: var(--color-bg);
  padding: 3.5rem 2.5rem 2rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-brand-logo {
  height: 1.1rem;
  width: auto;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}

.footer-brand-sub {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--color-text-dim);
  line-height: 1.8;
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: 1.25rem;
}

.footer-col a {
  display: block;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--color-active); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-dim);
}

/* ── HAMBURGER ── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 24px;
  position: relative;
  z-index: 110;
  padding: 0;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.nav-hamburger span:nth-child(1) { top: 2px; }
.nav-hamburger span:nth-child(2) { top: 11px; }
.nav-hamburger span:nth-child(3) { top: 20px; }

.nav-hamburger.is-open span:nth-child(1) {
  top: 11px;
  transform: rotate(45deg);
}

.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }

.nav-hamburger.is-open span:nth-child(3) {
  top: 11px;
  transform: rotate(-45deg);
}

/* ── MOBILE MENU ── */
.nav-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 10, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 105;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.nav-mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile-inner {
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-height) + 2rem) 2.5rem 3rem;
  gap: 0;
}

.nav-mobile-inner a {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
  transition: color 0.2s;
}

.nav-mobile-inner a:first-child { border-top: 1px solid var(--color-border); }
.nav-mobile-inner a:hover { color: var(--dim-color, var(--color-text)); }

.nav-mobile-divider {
  height: 0;
  margin: 0.5rem 0;
}

/* ── QUOTE BAND (interior dimension pages) ── */
.quote-band {
  background: var(--color-surface);
  padding: 0 2rem;
  text-align: center;
}

.quote-band-inner {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--color-border-light);
  padding: 4rem 0;
}

.quote-band-content {
  max-width: 800px;
  margin: 0 auto;
}

.quote-band-mark {
  font-family: var(--font-body);
  font-size: clamp(3rem, 6vw, 4.5rem);
  color: var(--color-active);
  line-height: 0.5;
  display: block;
  margin-bottom: 1rem;
}

.quote-band-text {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--color-bg);
  margin-bottom: 1.5rem;
}

.quote-band-attr {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

/* ── HERO ARROWS ── */
.dim-hero-nav {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: rgba(30, 31, 34, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  text-decoration: none;
}

.dim-hero-nav:hover {
  border-color: var(--color-active);
  color: var(--color-text);
  background: rgba(30, 31, 34, 0.85);
}

.dim-hero-nav svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.dim-hero-prev { left: 2rem; }
.dim-hero-next { right: 2rem; }

/* ── PREV / NEXT NAV ── */
.dim-nav-band {
  background: var(--color-surface);
  padding: 0 2rem;
}

.dim-nav {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--color-border-light);
  padding: 2.5rem 0;
  display: flex;
  justify-content: space-between;
}

.dim-nav-link {
  text-decoration: none;
  color: var(--color-text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: color 0.3s;
}

.dim-nav-link:last-child { text-align: right; }
.dim-nav-link:hover { color: var(--color-bg); }

.dim-nav-dir {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-active-on-light, var(--color-active));
}

.dim-nav-name {
  font-family: "roma-inscribed", sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── SHARED RESPONSIVE ── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-tagline { display: none; }
  .nav-hamburger { display: block; }
  .nav-mobile-menu { display: block; }
  .dim-marquee { padding: 2rem 0; }
  .footer { padding: 2.5rem 1.5rem 1.5rem; }
  .dim-nav { padding: 2rem 0; }
  .dim-nav-link:last-child { text-align: left; }
  .dim-hero-nav { width: 40px; height: 40px; }
  .dim-hero-prev { left: 1rem; }
  .dim-hero-next { right: 1rem; }
}

@media (max-width: 480px) {
  .nav { padding: 0 1.25rem; }
  .footer { padding: 2rem 1rem 1rem; }
  .quote-band { padding: 2.5rem 1rem; }
  .dim-nav-band { padding: 0 1rem; }
  .dim-nav { flex-direction: column; gap: 1.5rem; padding: 1.5rem 0; }
  .dim-hero-nav { width: 36px; height: 36px; }
  .dim-hero-nav svg { width: 14px; height: 14px; }
  .dim-hero-prev { left: 0.5rem; }
  .dim-hero-next { right: 0.5rem; }
}

/* iOS ignores background-attachment:fixed — disable on touch devices */
@media (pointer: coarse) {
  .dim-hero-bg,
  .pull-quote-bg {
    background-attachment: scroll !important;
  }
}
