/* ==========================================================
   COVEX — landing page

   COLOR SYSTEM (fixed — nothing outside this)
   Primary   60%  #050609  carbon noir — all backgrounds, primary surfaces
   Secondary 30%  #16181C  gunmetal graphite — cards, nav background, dividers ONLY
   Accent    10%  #0066FF  electric blue — CTAs, active states, key callouts ONLY
   Text            #F4F5F7 / #9AA0A8 — legibility only, never decoration

   TYPE
   Clash Display 700 — headings only, wide tracking, H1 floor 72px
   IBM Plex Mono     — body + every UI element, nothing else
   Body 16px / 1.7, measure capped at 70ch

   No gradients. No shadows. No radii. No ornament.
   ========================================================== */

:root {
  --primary: #050609;
  --secondary: #16181c;
  --accent: #0066ff;

  --ink: #f4f5f7;
  --ink-muted: #9aa0a8;

  --font-display: "Clash Display", "Arial Black", Impact, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --shell: 1240px;
  --gutter: 28px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--primary);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

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

/* ===== Type scale =====
   H1 anchors the page: 700 weight, 72px floor, wide tracking.
   Body holds at 16px/400 — the gap between them is the hierarchy. */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.94;
  letter-spacing: 0.035em;
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(72px, 5.2vw, 86px);
}

h2 {
  font-size: clamp(42px, 5.4vw, 76px);
  max-width: 18ch;
}

h3 {
  font-size: clamp(22px, 2.2vw, 27px);
  letter-spacing: 0.045em;
}

p {
  max-width: 70ch;
}

.label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.lead {
  font-size: 18px;
  line-height: 1.7;
  max-width: 70ch;
  color: var(--ink);
}

.body-text {
  line-height: 1.7;
  max-width: 70ch;
  color: var(--ink-muted);
}

/* ===== Preloader =====
   Covers the Clash Display font swap. Only exists when JS is running,
   and script.js hard-caps it at 2.5s so it can never trap a visitor. */
.preloader {
  display: none;
}

.js .preloader {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--primary);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}

html.is-loading,
html.is-loading body {
  overflow: hidden;
}

.preloader-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 72px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  /* tracking is applied to the right of the last glyph — pull it back to stay optically centered */
  margin-right: -0.16em;
  margin-bottom: 26px;
}

/* The bar fills left to right with a 2×2 twill weave as the page loads.
   Tile is a 16px SVG: 4px units, each row stepped one unit across, which is
   how a 2×2 twill is actually structured. Threads are --ink at 30% over
   --secondary, so no colour enters the system that isn't already in it. */
.preloader-bar {
  position: relative;
  width: min(440px, 68vw);
  height: 56px;
  background: var(--primary);
  border: 2px solid var(--secondary);
  overflow: hidden;
  margin-bottom: 24px;
}

.preloader-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='16' height='16' fill='%2316181c'/%3E%3Cg fill='%23f4f5f7' fill-opacity='0.3'%3E%3Crect x='0' y='0' width='8' height='4'/%3E%3Crect x='4' y='4' width='8' height='4'/%3E%3Crect x='8' y='8' width='8' height='4'/%3E%3Crect x='12' y='12' width='4' height='4'/%3E%3Crect x='0' y='12' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 16px 16px;
  background-repeat: repeat;
  /* anchor tiles to the left edge so the weave is revealed, not slid */
  background-position: left top;
}

.preloader-count {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
}

@media (prefers-reduced-motion: reduce) {
  .js .preloader {
    transition-duration: 0.01ms;
  }
}

/* ===== Masthead — secondary surface ===== */
/* Wordmark and nav stay visible at all times. At the very top the bar sits
   directly on the hero with no surface; once scrolled, the secondary surface
   blurs in behind the type. Fixed so it reserves no space in flow. */
.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: transparent;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease,
    -webkit-backdrop-filter 0.3s ease;
}

.masthead.is-veiled {
  /* --secondary at 72% so the blur has something to work through */
  background-color: rgba(22, 24, 28, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

@media (prefers-reduced-motion: reduce) {
  .masthead {
    transition-duration: 0.01ms;
  }
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

/* the CX mark is 2.92:1 — size by height so the header rhythm holds */
.wordmark {
  display: block;
  line-height: 0;
}

.wordmark img {
  display: block;
  height: 24px;
  width: auto;
}

.wordmark-sm img {
  height: 20px;
}

.nav {
  display: flex;
  gap: 30px;
}

.nav a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

/* accent = active state only */
.nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ===== Buttons — accent reserved for CTAs ===== */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 18px 34px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.12s linear, color 0.12s linear;
}

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

.btn-accent:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--primary);
}

.btn-block {
  width: 100%;
}

/* ===== Hero ===== */
.hero {
  /* the bar is out of flow now, so the hero carries its own top space */
  padding: clamp(88px, 12vh, 132px) 0 clamp(64px, 9vh, 96px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.hero h1 {
  margin-bottom: 28px;
}

.hero .lead {
  margin-bottom: 32px;
}

.hero .btn {
  margin-bottom: 32px;
}

/* single trust signal */
.trust {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 60ch;
  border-top: 1px solid var(--secondary);
  padding-top: 24px;
}

/* accent = key callout */
.trust-figure {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* product visual slot */
.hero-visual {
  margin: 0;
}

.visual-frame {
  position: relative;
  background: var(--secondary);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.visual-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-visual figcaption {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-top: 16px;
}

/* ===== Section frame ===== */
.section {
  padding: clamp(72px, 10vh, 118px) 0;
  border-top: 1px solid var(--secondary);
  /* keep anchored headings clear of the fixed bar */
  scroll-margin-top: 90px;
}

.section-head {
  margin-bottom: 64px;
}

.section-head .label {
  margin-bottom: 26px;
}

.section-head h2 {
  margin-bottom: 26px;
}

/* ===== Parts cards — secondary surface ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.card {
  background: var(--secondary);
  padding: 38px 32px;
}

.card h3 {
  margin-bottom: 18px;
}

.card-text {
  color: var(--ink-muted);
  line-height: 1.7;
}

/* ===== Select work ===== */
.work-list {
  list-style: none;
  border-top: 1px solid var(--secondary);
}

/* Each row links to its build on the lookbook page. */
.work-row {
  display: grid;
  grid-template-columns: 86px 1.2fr 1fr 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 26px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--secondary);
  transition: background-color 0.12s linear;
}

.work-row:hover {
  background-color: var(--secondary);
}

.work-row:hover .work-index,
.work-row:hover .work-part,
.work-row:hover .work-spec {
  color: var(--ink);
}

/* visible affordance on touch, where there is no hover */
.work-car::after {
  content: " \2192";
  color: var(--ink-muted);
}

.work-row:hover .work-car::after {
  color: var(--accent);
}

.work-index {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
}

.work-car {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.work-part {
  font-size: 15px;
  color: var(--ink-muted);
}

.work-spec {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: right;
}

/* ===== Pricing ===== */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  align-items: stretch;
}

.tier {
  position: relative;
  background: var(--secondary);
  /* top padding reserves the flag row so all three headings align */
  padding: 62px 34px 40px;
  display: flex;
  flex-direction: column;
}

.tier-flag {
  position: absolute;
  top: 26px;
  left: 34px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.tier h3 {
  margin-bottom: 20px;
}

.tier-price {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin-bottom: 10px;
}

.tier-note {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

/* the two-word distinction between tiers carries the most weight */
.tier-note strong {
  color: var(--ink);
  font-weight: 600;
}

.tier-list {
  list-style: none;
  margin-bottom: 36px;
  flex: 1;
}

.tier-list li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  padding: 10px 0 10px 22px;
  position: relative;
  border-top: 1px solid var(--primary);
}

.tier-list li::before {
  content: "/";
  position: absolute;
  left: 0;
  color: var(--ink-muted);
}

.tier .btn {
  align-self: stretch;
  text-align: center;
}

.work-more {
  margin-top: 36px;
}

.text-link {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 3px;
}

.text-link:hover {
  border-bottom-color: var(--accent);
}

/* ===== Lookbook ===== */
.page-head {
  padding: clamp(88px, 12vh, 132px) 0 clamp(56px, 8vh, 88px);
}

.page-head .label {
  margin-bottom: 26px;
}

.page-head h1 {
  margin-bottom: 28px;
}

.page-head .lead + .body-text,
.page-head .body-text + .body-text {
  margin-top: 20px;
}

.page-head .policy-updated {
  margin: 0 0 26px;
}

.project {
  padding: clamp(64px, 9vh, 104px) 0;
  border-top: 1px solid var(--secondary);
  scroll-margin-top: 90px;
}

.project-head {
  margin-bottom: 48px;
}

.project-head .label {
  margin-bottom: 20px;
}

/* smaller than a section h2 — these repeat five times down the page */
.project-head h2 {
  font-size: clamp(34px, 4vw, 56px);
  max-width: 20ch;
  margin-bottom: 16px;
}

.project-meta {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 26px;
}

/* Photo album: lead shot across the top, detail shots beneath.
   Frames hold their aspect whether or not a photo has been added yet. */
.album {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.shot {
  margin: 0;
}

.shot-lead {
  grid-column: 1 / -1;
}

.frame {
  position: relative;
  background: var(--secondary);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

/* Sits behind the photo, so it only shows while a frame is still empty.
   script.js removes any image that fails to load, revealing this. */
.frame-pending,
.visual-frame .frame-pending {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  pointer-events: none;
}

.frame img,
.visual-frame img {
  position: relative;
  z-index: 1;
}

.shot-lead .frame {
  aspect-ratio: 16 / 9;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot figcaption {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-top: 12px;
}

/* ===== Policies ===== */
.policy {
  padding: clamp(48px, 7vh, 72px) 0;
  border-top: 1px solid var(--secondary);
  scroll-margin-top: 90px;
}

.policy h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  max-width: 20ch;
  margin-bottom: 26px;
}

.policy .body-text + .body-text {
  margin-top: 18px;
}

/* section heading inside a policy page — the page h1 is the policy name,
   so these sit below it rather than at full section-title scale */
.policy h2 {
  font-size: clamp(26px, 3vw, 38px);
  max-width: 22ch;
  margin-bottom: 18px;
}

.policy p + h2,
.policy ul + h2 {
  margin-top: 54px;
}

.policy h3 {
  font-size: clamp(19px, 1.9vw, 23px);
  margin: 44px 0 18px;
}

/* fourth level — used for the warranty coverage tiers */
.policy h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 34px 0 14px;
}

.policy-list {
  list-style: none;
  max-width: 70ch;
  margin: 18px 0;
}

.policy-list li {
  position: relative;
  color: var(--ink-muted);
  line-height: 1.7;
  padding: 9px 0 9px 22px;
  border-top: 1px solid var(--secondary);
}

.policy-list li::before {
  content: "/";
  position: absolute;
  left: 0;
  color: var(--ink-muted);
}

.policy-updated {
  margin-top: 26px;
}

.inline-link {
  border-bottom: 1px solid var(--ink-muted);
  padding-bottom: 1px;
}

.inline-link:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.policy-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  max-width: 760px;
  margin-top: 36px;
}

.policy-index a {
  background: var(--secondary);
  padding: 14px 18px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.12s linear;
}

.policy-index a:hover {
  color: var(--ink);
}

@media (max-width: 680px) {
  .policy-index {
    grid-template-columns: 1fr;
  }

  .policy {
    scroll-margin-top: 132px;
  }
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 72px;
  align-items: start;
}

.contact-direct .label {
  margin-bottom: 18px;
}

.email-link {
  display: inline-block;
  font-size: clamp(17px, 1.7vw, 21px);
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 4px;
  margin-bottom: 30px;
  overflow-wrap: break-word;
}

.email-link:hover {
  border-bottom-color: var(--accent);
}

.contact-form {
  background: var(--secondary);
  padding: 40px 36px;
}

.field {
  margin-bottom: 26px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--primary);
  border: none;
  padding: 14px 16px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  border-radius: 0;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-muted);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

/* accent = active state */
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.gotcha {
  display: none;
}

/* records agreement to the terms with the enquiry */
.field-consent {
  margin-bottom: 24px;
}

/* reads as a sentence, not a field label — override .field label */
.field label.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 0;
}

.consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}

.consent span {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-muted);
}

.form-status {
  font-size: 14px;
  line-height: 1.7;
  margin-top: 18px;
  display: none;
  color: var(--ink);
}

.form-status.is-visible {
  display: block;
}

/* ===== Footer ===== */
.footer {
  background: var(--secondary);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.footer-heading {
  color: var(--ink);
  margin-bottom: 4px;
}

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

/* ===== Policies hub ===== */
.policy-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.policy-card {
  display: flex;
  flex-direction: column;
  background: var(--secondary);
  padding: 36px 32px;
  transition: background 0.12s linear, color 0.12s linear;
}

.policy-card h2 {
  font-size: clamp(21px, 2.1vw, 26px);
  max-width: none;
  margin-bottom: 14px;
}

.policy-card .card-text {
  flex: 1;
  margin-bottom: 22px;
}

.policy-card-cta {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.policy-card:hover {
  background: var(--ink);
  color: var(--primary);
}

.policy-card:hover .card-text,
.policy-card:hover .policy-card-cta {
  color: var(--primary);
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .policy-cards {
    grid-template-columns: 1fr;
  }
}

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

.footer a.label:hover {
  color: var(--ink);
}

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .cards,
  .tiers {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .work-row {
    grid-template-columns: 60px 1fr 1fr;
  }

  .work-spec {
    display: none;
  }
}

@media (max-width: 680px) {
  :root {
    --gutter: 20px;
  }

  /* Five nav items don't fit beside the wordmark at phone widths, so the bar
     wraps: wordmark on top, nav spread across its own row beneath. */
  .masthead-inner {
    height: auto;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .nav a {
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .wordmark {
    font-size: 20px;
  }

  /* clear the taller wrapped bar */
  .hero,
  .page-head {
    padding-top: 132px;
  }

  .cards,
  .tiers {
    grid-template-columns: 1fr;
  }

  .hero .btn,
  .tier .btn {
    width: 100%;
    text-align: center;
  }

  .work-row {
    grid-template-columns: 46px 1fr;
    gap: 10px;
  }

  /* clear the taller wrapped bar when jumping to a build */
  .project {
    scroll-margin-top: 132px;
  }

  .album {
    grid-template-columns: 1fr;
  }

  .work-part {
    grid-column: 2;
  }

  .contact-form {
    padding: 30px 22px;
  }
}
