/* Porsche Next — self-hosted WOFF2 (personal app, not for redistribution) */
@font-face {
  font-family: "Porsche Next";
  src: url("assets/fonts/porsche-next-latin-regular.b8f1c20.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Porsche Next";
  src: url("assets/fonts/porsche-next-latin-semi-bold.b5f6fca.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Porsche Next";
  src: url("assets/fonts/porsche-next-latin-bold.0fbdc6d.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Porsche LIGHT palette — matches porsche.com mobile (Cayenne/911 product pages) */
:root {
  --bg: #ffffff;
  --bg-2: #f5f5f5;
  --glass: rgba(0, 0, 0, 0.03);
  --glass-strong: rgba(0, 0, 0, 0.06);
  --border: #d8d8db;
  --border-soft: rgba(0, 0, 0, 0.08);
  --text: #0e0e12;
  --text-strong: #000000;
  --muted: #6b6d70;
  --muted-2: #949598;
  --accent: #000000;
  --accent-soft: rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Porsche Next", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* TOP BAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
}
/* TOPBAR — burger / wordmark / profile (Porsche.com mobile pattern) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-strong);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: var(--glass); }
.icon-btn svg { width: 22px; height: 22px; }
.wordmark {
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 14px;
  color: var(--text-strong);
  text-decoration: none;
}

/* Slide-down menu */
.menu-panel {
  position: sticky;
  top: 56px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.2s ease;
}
.menu-panel[hidden] { display: none; }
.menu-link {
  padding: 18px 22px;
  font-size: 16px;
  color: var(--text-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.menu-link:last-child { border-bottom: none; }
.menu-link.active { font-weight: 700; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Profile sheet (modal-ish overlay) */
.profile-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.profile-sheet[hidden] { display: none; }
.profile-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 32px 28px 36px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
  animation: slideUp 0.25s ease;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
}
.profile-avatar svg { width: 40px; height: 40px; }
.profile-name {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-strong);
}
.profile-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.profile-grid { display: flex; flex-direction: column; }
.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .k { color: var(--muted); }
.profile-row .v.muted { color: var(--muted-2); }
.profile-note {
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.profile-close {
  display: block;
  margin: 22px auto 0;
  padding: 10px 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-strong);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* MAIN */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 22px 80px;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 36px 0 14px;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 4px;
  font-size: 14px;
}
.tag {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}
.title-block { margin: 22px 0 28px; text-align: center; }

/* HERO COUNTERS — Porsche.com vertical stack format */
.hero-counters {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0 0 56px;
  padding: 24px 0;
  text-align: center;
}
.counter-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.counter-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  color: var(--text-strong);
  line-height: 1;
}
.counter {
  font-size: 56px;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}
.counter-unit-inline {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-strong);
  margin-left: 4px;
}
.counter-sep {
  font-size: 36px;
  font-weight: 300;
  color: var(--muted);
  margin: 0 8px;
}
.counter-desc {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
@media (max-width: 520px) {
  .counter { font-size: 48px; }
  .counter-sep { font-size: 30px; }
  .counter-unit-inline { font-size: 16px; }
  .counter-desc { font-size: 13px; }
  .hero-counters { gap: 24px; }
}

/* HERO / CAR STAGE — full-bleed Porsche style */
.hero {
  /* break out of the centred main column — edge-to-edge */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0;
  margin-top: -28px;
  margin-bottom: 28px;
}
.car-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 0;
  background: var(--bg);
  border: none;
  overflow: hidden;
  /* Soft bleed: bottom only — gentler taper so it doesn't bite into the car */
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, black 90%, transparent 100%);
}
/* CAROUSEL — slow crossfade studio renders */
.carousel-stage {
  position: relative;
  isolation: isolate;
}
.carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
  -webkit-user-drag: none;
}
.carousel-slide.is-active { opacity: 1; }

/* TURNTABLE */
.turntable-loading {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.turntable-mount {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.turntable-mount.is-ready { opacity: 1; }
.turntable-mount.is-dragging { cursor: grabbing; }
.turntable-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.turntable-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.06s linear;
  pointer-events: none;
  -webkit-user-drag: none;
}
.turntable-frame.is-active { opacity: 1; }
.turntable-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(10, 10, 12, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  transition: opacity 0.4s ease;
}
.turntable-hint.is-faded { opacity: 0; }

.placeholder-plate {
  display: flex;
  align-items: stretch;
  background: #f5d000;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  font-family: "Charles Wright", "UK Number Plate", monospace;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 28px rgba(245, 208, 0, 0.2);
}
.placeholder-plate .gb {
  background: #003399;
  color: #ffcc00;
  padding: 8px 8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  border-right: 2px solid #1a1a1a;
}
.placeholder-plate .reg {
  color: #1a1a1a;
  font-size: 38px;
  padding: 6px 18px;
}
.placeholder-note {
  margin-top: 18px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* SPEC GRID — Porsche style: borderless rows divided by hairlines only */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
.spec {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px;
  background: transparent;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.spec .k { color: var(--muted); }
.spec .v { color: var(--text-strong); font-weight: 600; }

/* HISTORY TIMELINE */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 8px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}
.t-event {
  display: flex;
  gap: 18px;
  padding: 14px 0;
  position: relative;
}
.t-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--muted);
  margin-top: 4px;
  flex-shrink: 0;
  z-index: 1;
}
.t-event.highlight .t-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.spec-grid, .timeline, .card, .tile { border-color: var(--border-soft); }
.t-year {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.t-text { font-size: 15px; }

/* CARDS */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  backdrop-filter: blur(20px);
}
.placeholder-card p { margin: 0 0 8px; font-size: 14px; }
.placeholder-card p.muted { color: var(--muted); font-size: 13px; }
code {
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.btn-ghost {
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  opacity: 0.5;
}

/* WALLET */
.tile-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tile {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 14px;
  backdrop-filter: blur(16px);
}
.tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.tile-value {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}
.tile-sub { font-size: 11px; color: var(--muted); }

.kv {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.kv:last-child { border-bottom: none; }
.kv span:first-child { color: var(--muted); }
.mono { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12px; }

.foot {
  text-align: center;
  padding: 24px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  h1 { font-size: 26px; }
  .car-stage { height: 220px; }
  .placeholder-plate .reg { font-size: 28px; padding: 4px 12px; }
  .spec-grid { grid-template-columns: 1fr; }
  .tile-row { grid-template-columns: 1fr; }
  .tabs { gap: 2px; }
  .tab { padding: 6px 12px; font-size: 12px; }
}
