/* GC-353: the one stylesheet every page of the K Motors site loads.
   Colour, type, spacing, and the card/button/field styles the rest of the
   project reuses. Change a colour here and every page changes. */

/* ── self-hosted type ─────────────────────────────────────────────── */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-700.woff2") format("woff2");
}

/* ── tokens ───────────────────────────────────────────────────────── */

:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #fafafa;

  --ink: #0c0c0d;
  --ink-2: #26262a;
  --text: #4a4a52;
  --muted: #6e6e78;

  --border: #e4e4e8;
  --field-border: #d9d9e0;

  --accent: #c8102e;
  --accent-ink: #9d0c24;
  --accent-soft: #fdecee;

  --on-dark: #ffffff;
  --on-dark-muted: rgba(255, 255, 255, 0.66);
  --on-dark-border: rgba(255, 255, 255, 0.16);

  --radius-panel: 20px;
  --radius-card: 16px;
  --radius-control: 10px;

  --shadow-card: 0 1px 2px rgba(12, 12, 13, 0.05), 0 10px 28px rgba(12, 12, 13, 0.05);
  --shadow-raised: 0 1px 2px rgba(12, 12, 13, 0.14);

  --wrap: 1160px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-gap: clamp(3rem, 7vw, 5.5rem);
}

/* ── reset ────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

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

ul,
ol {
  padding-left: 1.25rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── type scale ───────────────────────────────────────────────────── */

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.028em;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5.4vw, 3.25rem);
}

h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.125rem);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  color: var(--text);
  max-width: 46ch;
}

.meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── layout ───────────────────────────────────────────────────────── */

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

main {
  flex: 1 0 auto;
  padding-bottom: var(--section-gap);
}

.section {
  margin-top: var(--section-gap);
}

.section__head {
  max-width: 52ch;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

/* Runs the full content width instead of the reading column. */
.section__head--wide {
  max-width: none;
}

.section__head--wide p {
  max-width: 92ch;
}

.section__head h2 {
  margin-top: 0.5rem;
}

.section__head p {
  margin-top: 0.75rem;
  color: var(--text);
}

/* ── skip link ────────────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--on-dark);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
  color: var(--on-dark);
}

/* ── brand ────────────────────────────────────────────────────────── */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
}

.brand__logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* The badge is a black disc, so on the near-black footer it needs an edge to
   sit against or it reads as the K floating on nothing. */
.brand--invert .brand__logo {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand--invert,
.brand--invert:hover {
  color: var(--on-dark);
}

/* ── header ───────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

/* ── buttons ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn--accent {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-raised);
}

.btn--accent:hover {
  background: var(--accent-ink);
  color: #ffffff;
}

.btn--quiet {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--field-border);
}

.btn--quiet:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn--on-dark {
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-dark);
  border-color: var(--on-dark-border);
}

.btn--on-dark:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--on-dark);
}

.btn--on-dark:focus-visible {
  outline-color: #ffffff;
}

.btn--sm {
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
}

.btn--block {
  width: 100%;
}

.btn__short {
  display: none;
}

/* ── cards ────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: clamp(1.25rem, 2.6vw, 1.75rem);
}

.card__title {
  margin-bottom: 0.5rem;
}

.card__text {
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(1rem, 2vw, 1.25rem);
}

/* ── form fields (used by the request form in GC-357) ─────────────── */

.field + .field {
  margin-top: 1rem;
}

.field__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.field__input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.field__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field__error {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-ink);
}

.consent {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ── hero ─────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  margin-top: clamp(1rem, 2.5vw, 1.75rem);
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.4rem, 5vw, 4rem);
  border-radius: var(--radius-panel);
  background: var(--ink);
  color: var(--on-dark);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 80% at 88% 12%, rgba(200, 16, 46, 0.5), transparent 62%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 44rem;
}

.hero h1 {
  margin-top: 0.75rem;
  color: var(--on-dark);
}

.hero__lede {
  margin-top: 1rem;
  max-width: 44ch;
  font-size: clamp(1rem, 1.7vw, 1.1875rem);
  color: var(--on-dark-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.5rem, 3vw, 2rem);
}

/* ── numbered steps ───────────────────────────────────────────────── */

.step__number {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.9375rem;
  font-weight: 700;
}

/* ── contact ──────────────────────────────────────────────────────── */

/* ── long-form legal pages ────────────────────────────────────────── */

.page-head {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  max-width: 58ch;
}

.page-head h1 {
  margin-top: 0.75rem;
}

.page-head .meta {
  margin-top: 0.9rem;
}

.prose {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding: clamp(1.5rem, 4vw, 3rem);
  max-width: 74ch;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  margin-top: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

.prose li {
  margin-top: 0.5rem;
}

.prose ul {
  margin-top: 0.9rem;
}

.prose strong {
  color: var(--ink-2);
}

/* ── footer ───────────────────────────────────────────────────────── */

.site-footer {
  flex-shrink: 0;
  background: var(--ink);
  color: var(--on-dark-muted);
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
}

.site-footer__note {
  margin-top: 0.9rem;
  max-width: 30ch;
  font-size: 0.9375rem;
}

.site-footer__heading {
  margin-bottom: 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--on-dark);
}

.site-footer p {
  font-size: 0.9375rem;
}

.site-footer p + p {
  margin-top: 0.65rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
}

.site-footer li + li {
  margin-top: 0.65rem;
}

.site-footer a {
  color: var(--on-dark-muted);
  font-size: 0.9375rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.site-footer a:hover {
  color: var(--on-dark);
  text-decoration: underline;
}

.site-footer a:focus-visible {
  outline-color: #ffffff;
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  padding-top: 1.5rem;
  padding-bottom: 1.75rem;
  border-top: 1px solid var(--on-dark-border);
}

.site-footer__bar p {
  font-size: 0.8125rem;
}

/* ── phone ────────────────────────────────────────────────────────── */

@media (max-width: 30rem) {
  .btn__full {
    display: none;
  }

  .btn__short {
    display: inline;
  }

  .hero__actions .btn {
    flex: 1 1 100%;
  }
}

/* ── catalogue (GC-354) ─────────────────────────────────────────────────── */

.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.car-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.car-card:hover,
.car-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(12, 12, 13, 0.06), 0 16px 36px rgba(12, 12, 13, 0.09);
}

.car-card__link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

/* A fixed aspect box keeps every card the same height whatever the photo is. */
.car-card__photo {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  background: var(--surface-2);
}

.car-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem 1.05rem;
}
.car-card__title {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.car-card__meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.car-card__price {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--text);
}
.car-card__price strong {
  font-size: 1.15rem;
  color: var(--ink);
}

/* ── car page (GC-355) ──────────────────────────────────────────────────── */

.crumb {
  padding: clamp(1.25rem, 3vw, 2rem) 0 0.5rem;
  font-size: 0.9rem;
}
.crumb a {
  color: var(--muted);
  text-decoration: none;
}
.crumb a:hover {
  color: var(--accent-ink);
}

.car__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1.25rem;
}
.car__title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.15;
}
.car__meta {
  margin-top: 0.35rem;
  color: var(--muted);
}
.gallery__main {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  border-radius: var(--radius-panel);
  background: var(--surface-2);
}

.gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.gallery__thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-control);
  background: none;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
}
.gallery__thumb img {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
}
.gallery__thumb.is-current {
  border-color: var(--accent);
}
.gallery__thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.car__columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 var(--section-gap);
}

.section-block + .section-block {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}
.section-block__title {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}
.car__description {
  color: var(--text);
  max-width: 62ch;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}
.spec {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}
.spec__label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec__value {
  font-weight: 600;
  color: var(--ink);
}

.feature-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1.25rem;
}
.feature-group__title {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--text);
}
.conditions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.conditions__title {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.car__aside {
  position: sticky;
  top: 1.25rem;
}
.book {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.book__price strong {
  font-size: 1.5rem;
  color: var(--ink);
}
.book__text {
  color: var(--text);
  font-size: 0.92rem;
}
.book__hours {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── GC-357: rental request ───────────────────────────────────────── */

.request__dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: 0.75rem;
  margin-top: 0.4rem;
}

/* The date pair sits side by side, so neither field carries the stacking
   margin the shared field style gives it. */
.request__dates .field + .field {
  margin-top: 0;
}

.request .field {
  margin-top: 0.9rem;
}

.request__total {
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.request__total.is-set {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--ink-2);
}

.request__total strong {
  font-size: 1.125rem;
  color: var(--ink);
}

.request button[type="submit"] {
  margin-top: 1rem;
}

.request__done-title {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.25rem;
}

.request__done p {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: var(--text);
}

.request__done strong {
  color: var(--ink);
}

.book__direct {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.btn--block {
  width: 100%;
  justify-content: center;
}

/* The sidebar becomes a normal block long before the layout would squeeze it. */
@media (max-width: 60rem) {
  .car__columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .car__aside {
    position: static;
  }
}

@media (max-width: 30rem) {
  .gallery__thumbs {
    grid-template-columns: repeat(auto-fit, minmax(3.75rem, 1fr));
  }
  .car__head {
    align-items: flex-start;
  }
}

/* GC-359: on a touch screen every control is a thumb target. The compact
   header button and the gallery thumbnails were both under 40px tall, which
   reads as fiddly rather than broken — and fiddly is what makes a visitor give
   up on a phone. */
@media (max-width: 30rem) {
  /* Two date fields side by side leave about 137px each, and a native date
     input needs more than that before its own text starts clipping. */
  .request__dates {
    grid-template-columns: minmax(0, 1fr);
  }

  .request__dates .field + .field {
    margin-top: 0.75rem;
  }
}

@media (max-width: 48rem) {
  .btn--sm {
    min-height: 2.75rem;
  }

  .gallery__thumb {
    min-height: 2.75rem;
  }

  .gallery__thumb img {
    height: 100%;
    min-height: 2.75rem;
  }
}
