/* G-Class concept: tokens */
:root {
  --asphalt: #1b1e21;      /* page */
  --asphalt-2: #24282c;    /* raised surfaces */
  --line: #3a3f45;         /* rules and borders */
  --fog: #a9afb5;          /* secondary text */
  --bone: #ecebe6;         /* primary text */
  --agave: #a3b184;        /* accent: the 500,000th G's agave green */
  --agave-ink: #1b1e21;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1320px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(88px, 12vw, 168px);
  --header-h: 68px;
  --radius: 2px;

  color-scheme: dark;
}

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

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--bone);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  font-stretch: 125%;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h2, .page-title { font-size: clamp(2rem, 4.6vw, 3.75rem); }
h3 { font-size: 1.375rem; font-stretch: 112%; line-height: 1.15; }

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--agave);
  outline-offset: 3px;
}

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

.section { padding-block: var(--section); }

/* Separate pages: inner pages start below the fixed header */
.is-inner .page-main { padding-top: var(--header-h); }
.is-inner .page-main > .section:first-child { padding-top: clamp(56px, 8vw, 112px); }

/* Soft cross-fade between pages in browsers that support it */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* Link to the next page, at the bottom of each inner page */
.next-page { padding-block: 8px clamp(48px, 7vw, 96px); }
.next-page a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.next-page__label { color: var(--fog); font-size: 0.9375rem; }
.next-page__title {
  font-size: clamp(1.75rem, 4.4vw, 3.5rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: right;
}
.next-page a:hover .next-page__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }

.section-head {
  display: grid;
  gap: 20px;
  max-width: 62ch;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-head p { color: var(--fog); font-size: 1.125rem; max-width: 52ch; }

.footnote {
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--fog);
  max-width: 70ch;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--bone);
  color: var(--asphalt);
  border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

/* Buttons: squared off, like the car */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  font-stretch: 110%;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn--primary { background: var(--bone); color: var(--asphalt); }
.btn--primary:hover { background: #fff; }
.btn--ghost { border-color: rgba(236, 235, 230, .45); color: var(--bone); background: transparent; }
.btn--ghost:hover { border-color: var(--bone); background: rgba(236, 235, 230, .06); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 0.875rem; }

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  transition: background-color .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  background: rgba(27, 30, 33, .92);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wordmark {
  font-size: 1.25rem;
  font-weight: 800;
  font-stretch: 125%;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  font-size: 0.9375rem;
  color: var(--bone);
  text-decoration: none;
  opacity: .82;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.site-nav a[aria-current="page"] { text-decoration-color: var(--agave); text-decoration-thickness: 2px; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bone);
  cursor: pointer;
}
.menu-toggle__bars,
.menu-toggle__bars::before {
  display: block;
  width: 22px; height: 2px;
  margin: auto;
  background: currentColor;
  transition: transform .25s ease;
}
.menu-toggle__bars { position: relative; transform: translateY(-4px); }
.menu-toggle__bars::before { content: ""; position: absolute; left: 0; top: 8px; }
.menu-open .menu-toggle__bars { transform: translateY(0) rotate(45deg); }
.menu-open .menu-toggle__bars::before { transform: translateY(-8px) rotate(-90deg); }

@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .site-header__cta { margin-left: auto; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    margin: 0;
    padding: 32px var(--gutter);
    background: var(--asphalt);
    border-top: 1px solid var(--line);
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease, visibility 0s linear .25s;
  }
  .menu-open .site-nav { visibility: visible; opacity: 1; transition: opacity .25s ease; }
  /* backdrop-filter would make the header the containing block of the fixed menu panel */
  .menu-open .site-header { background: var(--asphalt); border-bottom-color: var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--line); }
  .site-nav a {
    display: block;
    padding: 18px 0;
    font-size: 1.75rem;
    font-weight: 700;
    font-stretch: 120%;
    opacity: 1;
  }
  .site-nav a[aria-current="page"] { color: var(--agave); text-decoration: none; }
}
@media (max-width: 420px) {
  .site-header__cta { padding: 0 12px; }
  .site-header__inner { gap: 16px; }
}

/* Hero: a wide photo band, the headline overlapping its bottom edge */
.hero {
  position: relative;
  padding-bottom: clamp(56px, 7vw, 96px);
  overflow: clip;
}
.hero__media {
  position: relative;
  height: clamp(440px, 76svh, 880px);
}
.hero__media picture { display: contents; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}
/* scrims: one keeps the header readable over the bright sky, one fades the photo into the page */
.hero__media::before,
.hero__media::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.hero__media::before { background: linear-gradient(to bottom, rgba(27,30,33,.6), rgba(27,30,33,0) 20%); }
.hero__media::after { background: linear-gradient(to top, var(--asphalt) 0%, rgba(27,30,33,0) 26%); }

.hero {
  --hero-fs: clamp(3.25rem, 8.2vw, 8.25rem);
}
.hero__content {
  position: relative;
  z-index: 2;
  margin-top: calc(var(--hero-fs) * -0.36);
  display: grid;
  grid-template-columns: auto minmax(18rem, 27rem);
  justify-content: space-between;
  align-items: end;
  gap: 24px clamp(32px, 5vw, 80px);
}

.hero__title {
  font-size: var(--hero-fs);
  white-space: nowrap;
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.035em;
}
.hero__line { display: block; overflow: clip; padding-bottom: 0.04em; }
.hero__line > span { display: block; }

.hero__aside { padding-bottom: 0.4rem; }
.hero__sub {
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  color: #d6d8d9;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

@media (max-width: 1200px) {
  .hero__content { grid-template-columns: minmax(0, 1fr); }
  .hero__aside { max-width: 46ch; }
}

/* Phones: the portrait underpass photo fills the screen, text sits on the dark road */
@media (max-width: 700px) {
  .hero {
    display: flex;
    align-items: flex-end;
    min-height: 100svh;
    padding-bottom: 40px;
  }
  .hero__media { position: absolute; inset: 0; height: auto; }
  .hero__media img { object-position: 50% 40%; }
  .hero__media::after { background: linear-gradient(to top, rgba(27,30,33,.95) 8%, rgba(27,30,33,.6) 38%, rgba(27,30,33,0) 58%); }
  .hero { --hero-fs: clamp(2.5rem, 13vw, 5rem); }
  .hero__content { gap: 20px; margin-top: 0; }
}

/* intro starting states, cleared by main.js */
.intro .hero__line > span { transform: translateY(105%); }
.intro .hero__media img { transform: scale(1.06); }
.intro .hero__sub, .intro .hero__actions { opacity: 0; }

/* Models */
.models__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.model {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 20px;
  padding: 32px 32px 36px 0;
}
.model + .model { padding-left: 32px; border-left: 1px solid var(--line); }
.model__name { font-size: clamp(1.75rem, 2.6vw, 2.375rem); font-stretch: 125%; }
.model__name span { display: block; margin-top: 6px; font-size: 1rem; font-weight: 500; font-stretch: 100%; color: var(--fog); letter-spacing: 0; }
.model__desc { color: var(--fog); max-width: 38ch; }
.model--featured .model__name { color: var(--agave); }
.model__specs { margin: 0; }
.model__specs div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.model__specs div:first-child { border-top: 1px solid var(--line); }
.model__specs dt { color: var(--fog); }
.model__specs dd {
  margin: 0;
  font-weight: 600;
  font-stretch: 112%;
  font-variant-numeric: tabular-nums;
}
.model__cta { justify-self: start; margin-top: 8px; }

@media (max-width: 900px) {
  .models__grid { grid-template-columns: 1fr; }
  .model, .model + .model { padding: 32px 0 40px; border-left: 0; }
  .model + .model { border-top: 1px solid var(--line); }
}

/* Details */
.details { background: var(--asphalt-2); }
.details__layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}
.details__media { margin: 0; position: sticky; top: calc(var(--header-h) + 24px); }
.details__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 45%; }
.details__intro { margin-top: 24px; color: var(--fog); font-size: 1.125rem; max-width: 48ch; }
.detail-list { margin: 48px 0 0; }
.detail-list div {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.detail-list div:last-child { border-bottom: 1px solid var(--line); }
.detail-list dt { font-weight: 650; font-stretch: 112%; font-size: 1.0625rem; line-height: 1.35; }
.detail-list dd { margin: 0; color: var(--fog); }

@media (max-width: 960px) {
  .details__layout { grid-template-columns: 1fr; }
  .details__media { position: static; }
  .details__media img { aspect-ratio: 4 / 3; }
}
@media (max-width: 560px) {
  .detail-list div { grid-template-columns: 1fr; gap: 6px; }
}

/* G-TURN: the one scroll-driven moment. Sticky does the pinning. */
.gturn { position: relative; height: 320vh; }
.gturn__sticky {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-block: calc(var(--header-h) + 16px) 32px;
}
.gturn__layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.gturn__text > p:first-of-type { margin-top: 24px; color: var(--fog); font-size: 1.125rem; max-width: 46ch; }
.gturn__readout {
  margin-top: 32px;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--agave);
}
.gturn__of { font-size: 1rem; font-weight: 500; font-stretch: 100%; color: var(--fog); }
.gturn__hint { margin-top: 8px; font-size: 0.875rem; color: var(--fog); }
.reduce-motion .gturn__hint { display: none; }
.offroad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 32px 0 0;
  border-top: 1px solid var(--line);
}
.offroad div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.offroad div:nth-child(odd) { padding-right: 16px; }
.offroad div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.offroad dt { font-size: 0.875rem; color: var(--fog); }
.offroad dd { margin: 2px 0 0; font-size: 1.375rem; font-weight: 700; font-stretch: 118%; font-variant-numeric: tabular-nums; }

.gturn__stage { margin: 0; }
.gturn__svg { display: block; width: 100%; max-width: 540px; margin-inline: auto; overflow: visible; }
.gturn__footprint { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 7; }
.gturn__body { fill: var(--asphalt-2); stroke: var(--bone); stroke-width: 2; }
.gturn__roof { fill: none; stroke: var(--fog); stroke-width: 1.25; }
.gturn__glass { stroke: var(--fog); stroke-width: 3; }
.gturn__wheel { fill: var(--line); }
.gturn__indicator { fill: #d9a441; }
.gturn__lamp { fill: none; stroke: var(--bone); stroke-width: 2; }
.gturn__spare { fill: var(--asphalt); stroke: var(--bone); stroke-width: 2; }
.gturn__arrow { fill: none; stroke: var(--agave); stroke-width: 2.5; stroke-linecap: square; }
.gturn__pivot { fill: var(--agave); }
.gturn__caption { margin-top: 16px; text-align: center; font-size: 0.875rem; color: var(--fog); }

@media (max-width: 900px) {
  .gturn__layout { grid-template-columns: 1fr; gap: 8px; }
  .gturn__stage { order: -1; }
  .gturn__svg { max-width: min(300px, 70vw); }
  .gturn__text > p:first-of-type { margin-top: 16px; font-size: 1rem; }
  .gturn__readout { margin-top: 16px; }
  .offroad, .gturn__text .footnote, .gturn__caption { display: none; }
}
@media (max-width: 900px) and (min-height: 760px) {
  .offroad { display: grid; margin-top: 20px; }
}

@media (min-width: 901px) and (max-height: 760px) {
  .gturn__text .footnote, .gturn__caption { display: none; }
  .gturn__readout, .offroad { margin-top: 20px; }
}

/* reduce-motion is set in the page head from prefers-reduced-motion */
.reduce-motion .gturn { height: auto; }
.reduce-motion .gturn__sticky { position: static; min-height: 0; padding-block: var(--section); }
.reduce-motion .gturn__readout { display: none; }
.reduce-motion #gturn-car { transform: rotate(-24deg); transform-origin: 200px 200px; }
.reduce-motion .gturn__text .footnote,
.reduce-motion .gturn__caption { display: block; }
.reduce-motion .offroad { display: grid; }
@media (prefers-reduced-motion: reduce) {
  .btn, .site-header, .site-nav, .menu-open .site-nav, .menu-toggle__bars, .menu-toggle__bars::before { transition: none; }
}

/* Heritage */
.heritage__layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}
.heritage__head { position: sticky; top: calc(var(--header-h) + 24px); }
.heritage__head > p { margin-top: 20px; color: var(--fog); font-size: 1.125rem; }
.heritage__media { margin: 40px 0 0; }
.heritage__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline__year {
  font-size: 1.75rem;
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.timeline li:nth-child(8) .timeline__year { color: var(--agave); }
.timeline p { color: var(--fog); max-width: 52ch; padding-top: 4px; }

@media (max-width: 960px) {
  .heritage__layout { grid-template-columns: 1fr; }
  .heritage__head { position: static; }
}
@media (max-width: 480px) {
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
}

/* Gallery */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 24px);
  align-items: start;
}
.gallery__item { margin: 0; }
.gallery__item:nth-child(even) { margin-top: clamp(32px, 5vw, 80px); }
.gallery__item img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.gallery__item--cape img { object-position: 50% 100%; }
.gallery figcaption { margin-top: 10px; font-size: 0.875rem; color: var(--fog); }

@media (max-width: 900px) {
  .gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .gallery__grid { grid-template-columns: 1fr; }
  .gallery__item:nth-child(even) { margin-top: 0; }
  .gallery__item img { aspect-ratio: 4 / 5; }
  .gallery__item--desktop { display: none; } /* already the phone hero */
}

/* Booking form */
.booking { background: var(--asphalt-2); }
.booking__layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 112px);
}
.booking__intro p { margin-top: 20px; color: var(--fog); font-size: 1.125rem; max-width: 40ch; }

.form { display: grid; gap: 20px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.9375rem; font-weight: 600; }
.field__hint { font-weight: 400; color: var(--fog); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--asphalt);
  color: var(--bone);
  font: inherit;
  font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 120px; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fog) 50%), linear-gradient(135deg, var(--fog) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.field input[type="date"] { color-scheme: dark; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #565c63; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--agave); }
.field.is-invalid input, .field.is-invalid select { border-color: #e08a6d; }
.field__error { font-size: 0.875rem; color: #f0a58b; }

.form__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 8px; }
.form__status { color: var(--fog); max-width: 46ch; }
.form__status.is-done { color: var(--bone); }

@media (max-width: 900px) {
  .booking__layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .form__row { grid-template-columns: 1fr; }
  .form__footer .btn { width: 100%; }
}

/* Footer */
.site-footer { padding: 72px 0 56px; border-top: 1px solid var(--line); }
.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr);
  gap: 40px;
}
.site-footer__brand p { margin-top: 16px; max-width: 46ch; font-size: 0.875rem; color: var(--fog); }
.site-footer__brand .site-footer__credit { font-size: 0.9375rem; color: var(--bone); }
.site-footer h2 { font-size: 0.9375rem; font-stretch: 110%; letter-spacing: 0; margin-bottom: 14px; }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.site-footer li a { font-size: 0.875rem; color: var(--fog); text-decoration: none; }
.site-footer li a:hover { color: var(--bone); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 900px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}
