/* Drive AR — legal & support pages.
   Colours mirror the game's GarageStudio palette; Lilita One is the game's display face. */

@font-face {
  font-family: "Lilita One";
  src: url("fonts/LilitaOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --asphalt: #0e1a26;      /* GarageStudio.midnight */
  --bay: #132433;          /* GarageStudio.deepIndigo */
  --panel: #1c3345;        /* GarageStudio.indigo */
  --panel-edge: #284a62;
  --drop: #070f17;         /* short directional shadow */
  --paper: #f5f0db;        /* GarageStudio.paper */
  --muted: #a3bdc7;        /* GarageStudio.muted */
  --yellow: #ffc729;       /* GarageStudio.amberTop */
  --yellow-deep: #c26e0a;  /* GarageStudio.amberBottom */
  --cyan: #42cce0;         /* GarageStudio.neon */
  --cyan-deep: #1d8898;
  --cyan-ink: #0f4f5a;
  --green: #5cc26e;        /* GarageStudio.success */

  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  --dock-h: 78px;
  --gutter: 16px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--paper);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--dock-h) + 40px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

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

a {
  color: var(--cyan);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--paper);
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

strong {
  color: var(--paper);
  font-weight: 700;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 50;
  background: var(--yellow);
  color: var(--asphalt);
  font-weight: 700;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 600px) {
  :root {
    --gutter: 24px;
  }
}

/* ---------- Header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: calc(18px + env(safe-area-inset-top));
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--drop);
}

.brand {
  min-width: 0;
}

.brand span {
  font-family: var(--display);
  /* The App Store name is long: it shrinks on phones and may wrap rather than overflow. */
  font-size: clamp(18px, 4.8vw, 28px);
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.brand img {
  flex: none;
}

.top-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--panel);
  color: var(--paper);
  box-shadow: 0 4px 0 var(--drop);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.top-btn:hover {
  color: var(--cyan);
}

.top-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--drop);
}

.top-btn svg {
  width: 24px;
  height: 24px;
}

/* ---------- Stage (hero) — echoes the garage turntable card ---------- */

.stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--cyan);
  color: var(--asphalt);
  box-shadow: 0 6px 0 var(--drop);
  isolation: isolate;
}

.stage::before {
  /* the faint wall lines in the garage bay */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 62px,
    rgba(14, 26, 38, 0.09) 62px 64px
  );
}

.stage-body {
  padding: 22px 22px 0;
  text-align: center;
}

.pit-label {
  margin: 0;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan-ink);
}

.stage h1 {
  margin: 14px 0 6px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 11vw, 68px);
  line-height: 0.98;
  color: var(--asphalt);
}

.stage h1.name-title {
  font-size: clamp(36px, 10vw, 64px);
  text-wrap: balance;
}

.nowrap {
  white-space: nowrap;
}

.stage .lede {
  max-width: 34ch;
  margin: 10px auto 0;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
  color: #0b2f37;
}

.road {
  position: relative;
  margin-top: 26px;
  height: 120px;
}

.road > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.road-foot {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.road-foot > span:first-child {
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-align: right;
}

.badge svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- Big numbers (like EST. TOP SPEED) ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 28px 0 8px;
}

.stat {
  padding: 14px 12px;
  border-radius: var(--r-md);
  background: var(--bay);
  border: 2px solid var(--panel);
}

.stat b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 330px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

/* ---------- Meta strip ---------- */

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
}

.meta b {
  color: var(--paper);
  font-weight: 700;
}

/* ---------- Contents panel ---------- */

.toc {
  margin: 30px 0 10px;
  padding: 18px 18px 8px;
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: 0 4px 0 var(--drop);
}

.toc h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2 220px;
  column-gap: 20px;
}

.toc li {
  break-inside: avoid;
}

.toc a {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.35;
}

.toc a:hover {
  color: var(--cyan);
}

.toc a span {
  flex: none;
  min-width: 26px;
  font-weight: 800;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

/* ---------- Document sections ---------- */

.doc section {
  padding-top: 34px;
}

.doc h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 6vw, 32px);
  line-height: 1.1;
}

.num {
  /* garage-bay number plate */
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--cyan);
  font-family: var(--text);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 0 var(--drop);
}

.doc h3 {
  margin: 22px 0 6px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--paper);
}

.doc p,
.doc li {
  color: #dde3dc;
}

.doc p {
  margin: 0 0 14px;
}

.doc ul,
.doc ol.plain {
  margin: 0 0 14px;
  padding-left: 22px;
}

.doc li {
  margin: 6px 0;
}

.doc li::marker {
  color: var(--cyan);
}

.small {
  font-size: 15px;
  color: var(--muted) !important;
}

/* Callout panel */
.note {
  margin: 4px 0 16px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--bay);
  border: 2px solid var(--panel-edge);
}

.note p:last-child,
.note ul:last-child {
  margin-bottom: 0;
}

.note.go {
  border-color: var(--green);
}

.note.go .note-title {
  color: var(--green);
}

.note.warn {
  border-color: var(--yellow);
}

.note.warn .note-title {
  color: var(--yellow);
}

.note-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.note-title svg {
  width: 18px;
  height: 18px;
}

/* ---------- Rows (mission-row style) ---------- */

.doc .rows {
  display: grid;
  gap: 10px;
  margin: 6px 0 16px;
  padding: 0;
  list-style: none;
}

.row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 0 !important;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: 0 4px 0 var(--drop);
}

.row-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bay);
  color: var(--cyan);
}

.row-icon svg {
  width: 26px;
  height: 26px;
}

.row-text b {
  display: block;
  font-size: 17px;
  line-height: 1.3;
  color: var(--paper);
}

.row-text span {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  color: var(--green);
}

.chip svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 520px) {
  .row {
    grid-template-columns: 44px 1fr;
    align-items: start;
  }

  .row-icon {
    width: 44px;
    height: 44px;
  }

  .chip {
    grid-column: 2;
    margin-top: -6px;
  }
}

/* ---------- Law cards ---------- */

.laws {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 8px 0 18px;
}

.law {
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: 0 4px 0 var(--drop);
}

.law-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--cyan);
  color: var(--asphalt);
}

.law-head b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.05;
}

.law-head span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan-ink);
  text-align: right;
}

.law-body {
  padding: 12px 16px 16px;
}

.law-body p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.5;
}

.law-body p:last-child {
  margin-bottom: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60px;
  padding: 14px 26px;
  border: 0;
  border-radius: var(--r-md);
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.12s ease;
}

.btn svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.btn-drive {
  background: var(--yellow);
  color: var(--asphalt);
  box-shadow: 0 6px 0 var(--yellow-deep);
}

.btn-drive:hover {
  color: var(--asphalt);
  filter: brightness(1.05);
}

.btn-drive:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--yellow-deep);
}

.btn-panel {
  background: var(--panel);
  color: var(--paper);
  box-shadow: 0 5px 0 var(--drop);
  font-size: 20px;
  min-height: 52px;
}

.btn-panel:hover {
  color: var(--cyan);
}

.btn-panel:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--drop);
}

.btn-block {
  width: 100%;
}

/* ---------- Support: contact ---------- */

.contact {
  margin-top: 28px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: 0 5px 0 var(--drop);
}

.contact h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
}

.contact > p {
  margin: 0 0 18px;
  color: var(--muted);
}

.email-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--r-md);
  background: var(--bay);
  border: 2px solid var(--panel-edge);
}

.email-line code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--text);
  font-size: clamp(15px, 4.3vw, 17px);
  font-weight: 700;
  color: var(--paper);
}

.copy {
  flex: none;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--paper);
  font: 800 14px/1 var(--text);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--drop);
}

.copy:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--drop);
}

.copy.done {
  color: var(--green);
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: #dde3dc;
}

.checklist svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 2px;
  color: var(--cyan);
}

/* ---------- FAQ (expandable mission rows) ---------- */

.faq {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
}

.faq details {
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: 0 4px 0 var(--drop);
}

.faq summary {
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  align-items: center;
  gap: 14px;
  padding: 14px;
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  color: var(--paper);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary .row-icon {
  width: 44px;
  height: 44px;
}

.faq summary .chev {
  width: 24px;
  height: 24px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.faq details[open] {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.faq details[open] .chev {
  transform: rotate(180deg);
  color: var(--cyan);
}

.faq .answer {
  padding: 0 18px 16px 72px;
}

.faq .answer p,
.faq .answer li {
  font-size: 16px;
}

.faq .answer ol,
.faq .answer ul {
  padding-left: 20px;
}

@media (max-width: 520px) {
  .faq .answer {
    padding-left: 18px;
  }
}

.path {
  display: inline;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bay);
  color: var(--paper);
  font-weight: 700;
  white-space: normal;
}

/* ---------- Index tiles (collection style) ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--paper);
  text-decoration: none;
  box-shadow: 0 5px 0 var(--drop);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.tile:hover {
  color: var(--paper);
}

.tile:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--drop);
}

.tile-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 120px;
  background: var(--cyan);
  color: var(--asphalt);
}

.tile-art.yellow {
  background: var(--yellow);
}

.tile-art.paper {
  background: #c8c9b8;
}

.tile-art svg {
  width: 56px;
  height: 56px;
}

.tile-art i {
  position: absolute;
  left: 14px;
  top: 10px;
  font-style: normal;
  font-weight: 800;
  font-size: 16px;
  color: rgba(14, 26, 38, 0.7);
  font-variant-numeric: tabular-nums;
}

.tile-body {
  padding: 14px 16px 16px;
}

.tile-body b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
}

.tile-body span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

/* ---------- Footer ---------- */

.foot {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 2px solid var(--panel);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.finish {
  /* small checkered finish marker */
  width: 36px;
  height: 12px;
  margin-bottom: 14px;
  border-radius: 2px;
  background: repeating-conic-gradient(var(--paper) 0 25%, var(--asphalt) 0 50%) 0 0 / 12px 12px;
  box-shadow: 0 0 0 2px var(--paper);
}

.foot p {
  margin: 0 0 6px;
}

.foot a {
  color: var(--muted);
}

.foot a:hover {
  color: var(--paper);
}

/* ---------- Bottom dock — the game's Garage / Missions / Collection bar ---------- */

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
  width: calc(100% - 20px);
  max-width: 560px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: var(--dock-h);
  overflow: hidden;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 6px 0 var(--drop), 0 0 0 1px rgba(14, 26, 38, 0.6);
}

.dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
}

.dock a svg {
  width: 30px;
  height: 30px;
}

.dock a:hover {
  color: var(--paper);
}

.dock a[aria-current="page"] {
  background: var(--cyan);
  color: var(--asphalt);
}

.dock a:focus-visible {
  outline-offset: -4px;
  border-radius: 20px;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
    padding-bottom: 0;
  }

  .dock,
  .skip,
  .top-btn,
  .road,
  .toc {
    display: none !important;
  }

  .stage,
  .note,
  .row,
  .law,
  .stat {
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #999 !important;
  }

  .doc p,
  .doc li,
  .row-text span,
  .stat span,
  .stat b,
  strong {
    color: #000 !important;
  }
}

/* Icon cut-outs take the colour of whatever sits behind them */
.dock svg {
  --dock-cut: var(--panel);
}

.dock a[aria-current="page"] svg {
  --dock-cut: var(--cyan);
}
