/* TyreVault design tokens — the CMS Colours and Fonts tabs map onto these custom properties.
   Black + crimson auto-parts retail look: pure black pages, red panels and
   chevrons, white type. Every component reads these variables. */
:root {
  /* brand colours — the CMS Colours tab gives every --color-* a picker */
  --color-primary: #e8192c;
  --color-primary-dark: #9e0e1c;
  --color-primary-light: #ff4655;
  --color-secondary: #111113;
  --color-surface: #18181b;
  --color-surface-soft: #0d0d0f;
  --color-default: #c3c3c9;
  --color-muted: #8a8a93;
  --color-line: #2b2b30;
  --color-heading: #ffffff;
  --color-white: #ffffff;
  --color-dark: #000000;
  /* the white panels (category list, dropdown) and the ink on them */
  --color-paper: #ffffff;
  --color-paper-line: #e7e7ea;
  --color-ink: #141416;
  /* fonts — the CMS Fonts tab overrides these */
  --font-default: 'Inter', system-ui, sans-serif;
  --font-primary: var(--font-default);
  --font-heading: 'Poppins', system-ui, sans-serif;
  --font-display: 'Poppins', system-ui, sans-serif;
  /* the number-plate face */
  --font-plate: 'Poppins', 'Arial Black', Arial, sans-serif;
  /* meaning-carrying fixed colours (not brand): UK plate yellow + GB band blue,
     success / error, rating stars */
  --plate-yellow: #ffd307;
  --plate-blue: #003399;
  --plate-ink: #111111;
  --state-ok: #2fbf6b;
  --state-bad: #ff5a5f;
  --star: #f7b500;
  --radius: 6px;
  --radius-sm: 4px;
  --section-max-width: 78rem;
  --header-h: 78px;
  --section-pad-y: 92px;
  --base-size: 16px;
  --ease: cubic-bezier(.2, .75, .25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: var(--base-size); scroll-behavior: smooth; background: var(--color-dark); color-scheme: dark; }
body { font-family: var(--font-default); color: var(--color-default); line-height: 1.65; background: var(--color-dark); -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, h4, h5 { font-family: var(--font-heading); color: var(--color-heading); font-weight: 800; line-height: 1.1; letter-spacing: -.015em; }
a { color: inherit; text-decoration: none; transition: color .25s ease; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
::selection { background: var(--color-primary); color: var(--color-white); }

.container { max-width: var(--section-max-width); margin: 0 auto; padding: 0 24px; }
section { padding: var(--section-pad-y) 0; position: relative; }
section, footer { overflow-x: clip; }
section.soft { background: var(--color-surface-soft); }
section.dark { background: var(--color-secondary); color: color-mix(in srgb, var(--color-white) 78%, transparent); }
section.dark h2, section.dark h3 { color: var(--color-white); }

/* the accent word in a headline */
.hl { color: var(--color-primary); }
.display { font-family: var(--font-display); font-weight: 900; letter-spacing: -.02em; }

/* ── Buttons: square-cornered, heavy, uppercase; the knob is a red chevron tile ── */
.btn {
  display: inline-flex; align-items: center; gap: .8rem; padding: .45rem .45rem .45rem 1.3rem; border-radius: var(--radius-sm); border: 0; cursor: pointer;
  background: var(--color-surface); color: var(--color-white); box-shadow: inset 0 0 0 1.5px var(--color-primary);
  font: 700 .86rem var(--font-heading); text-transform: uppercase; letter-spacing: .05em; line-height: 1; white-space: nowrap;
  transition: background .25s ease, color .25s ease, transform .25s var(--ease), box-shadow .25s ease;
}
.btn .knob { width: 38px; height: 38px; flex: none; border-radius: 3px; display: grid; place-items: center; background: var(--color-primary); color: var(--color-white); transition: transform .3s var(--ease); }
.btn .knob svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); background: var(--color-primary-dark); }
.btn:hover .knob { transform: translateX(3px); }
.btn.light { background: var(--color-paper); color: var(--color-ink); box-shadow: none; }
.btn.light:hover { background: var(--color-white); color: var(--color-primary); }
.btn.accent { background: var(--color-primary); color: var(--color-white); padding: 1rem 1.7rem; justify-content: center; box-shadow: 0 6px 0 -2px var(--color-primary-dark); }
.btn.accent:hover { background: var(--color-primary-dark); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--color-primary) 80%, transparent); }
.btn.plain { padding: 1rem 1.6rem; }
.btn.ghost { background: transparent; color: var(--color-white); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-white) 35%, transparent); padding: .95rem 1.5rem; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--color-primary); color: var(--color-primary); background: transparent; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.arrow-link { display: inline-flex; align-items: center; gap: .7rem; font-weight: 600; color: var(--color-white); }
.arrow-link svg { width: 30px; height: 18px; transition: transform .3s var(--ease); }
.arrow-link:hover svg { transform: translateX(5px); }
.arrow-link:hover { color: var(--color-primary); }

/* ── Section heads: a red tag with a chevron, a heavy headline ── */
.chip { display: inline-flex; align-items: center; gap: .55rem; padding: .3rem .8rem .3rem .65rem; border-radius: 2px;
  font: 700 .72rem var(--font-heading); letter-spacing: .14em; text-transform: uppercase; color: var(--color-white); background: var(--color-primary);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); padding-right: 1.3rem; }
section.dark .chip { background: var(--color-primary); color: var(--color-white); }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin-top: .9rem; text-transform: none; }
.section-head p { margin-top: 1rem; font-size: 1.04rem; max-width: 60ch; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center p { margin-left: auto; margin-right: auto; }
.section-head.split { max-width: none; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: end; }
.section-head.split p { margin-top: 0; }

/* ── Forms: dark fields, red focus ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-weight: 600; font-size: .8rem; color: var(--color-heading); margin-bottom: .35rem; letter-spacing: .02em; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; background: var(--color-surface-soft); border: 1.5px solid var(--color-line); border-radius: var(--radius-sm); padding: .8rem 1rem; color: var(--color-heading);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.form-grid select option { background: var(--color-surface); color: var(--color-heading); }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 25%, transparent); }
.form-grid ::placeholder { color: var(--color-muted); }
.field-err { color: var(--state-bad); font-size: .82rem; margin-top: .35rem; }
.form-note { font-size: .82rem; color: var(--color-muted); }
.form-ok { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--state-ok) 14%, transparent); color: var(--state-ok); border: 1px solid color-mix(in srgb, var(--state-ok) 40%, transparent); }
.form-ok svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.form-bad { padding: 12px 16px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--state-bad) 14%, transparent); color: var(--state-bad); font-size: .9rem; }

/* a tick list, the tick drawn in CSS so it follows the theme colours */
.tick-list { list-style: none; display: grid; gap: .65rem; }
.tick-list li { position: relative; padding-left: 1.9rem; }
.tick-list li::before { content: ''; position: absolute; left: 0; top: .2em; width: 1.2rem; height: 1.2rem; border-radius: 2px; background: var(--color-primary); }
.tick-list li::after { content: ''; position: absolute; left: .42rem; top: .42em; width: .32rem; height: .58rem; border: solid var(--color-white); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* rating stars */
.stars { display: inline-flex; gap: 2px; color: var(--star); }
.stars svg { width: 15px; height: 15px; }

/* ── Logo ── */
.logo { display: inline-flex; align-items: center; gap: .6rem; font: 900 1.4rem var(--font-heading); color: var(--color-white); letter-spacing: -.02em; text-transform: uppercase; }
.logo img { max-height: 44px; width: auto; }
.logo .mark { width: 40px; height: 40px; border-radius: 3px; display: grid; place-items: center; color: var(--color-white); background: var(--color-primary);
  clip-path: polygon(0 0, 80% 0, 100% 50%, 80% 100%, 0 100%); }
.logo .mark svg { width: 22px; height: 22px; color: var(--color-white); margin-right: 4px; }
.logo .wordmark { display: inline-flex; flex-direction: column; justify-content: center; line-height: 1.02; min-width: 0; }
.logo .wl { display: block; }
.logo .sub { display: block; margin-top: .35em; font: 600 .45em var(--font-default); letter-spacing: .12em; color: var(--color-muted); }
.logo { min-width: 0; }
.logo img { max-width: min(46vw, 240px); object-fit: contain; }

/* ══ Motion: section-enter animations (plugins/motion.client.ts) ══
   Hidden states apply only while html.hg-motion is set and the section has not
   entered the frame yet; --i staggers siblings, --d adds a fixed delay. */
.hg-motion [data-anim] {
  transition:
    opacity .8s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)),
    transform 1s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)),
    filter .9s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)),
    clip-path 1.1s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms));
}
.hg-motion section:not(.hg-inview) [data-anim], .hg-motion footer:not(.hg-inview) [data-anim] { opacity: 0; }
.hg-motion section:not(.hg-inview) [data-anim="up"], .hg-motion footer:not(.hg-inview) [data-anim="up"] { transform: translateY(42px); }
.hg-motion section:not(.hg-inview) [data-anim="down"] { transform: translateY(-34px); }
.hg-motion section:not(.hg-inview) [data-anim="left"] { transform: translateX(60px); }
.hg-motion section:not(.hg-inview) [data-anim="right"] { transform: translateX(-60px); }
.hg-motion section:not(.hg-inview) [data-anim="zoom"] { transform: scale(.88); }
.hg-motion section:not(.hg-inview) [data-anim="blur"] { filter: blur(14px); transform: scale(1.04); }
.hg-motion section:not(.hg-inview) [data-anim="pop"] { transform: translateY(18px) scale(.8); }
/* headings rise out of a mask */
.hg-motion section:not(.hg-inview) [data-anim="rise"] { clip-path: inset(0 0 100% 0); transform: translateY(40%); }
.hg-motion section.hg-inview [data-anim="rise"] { clip-path: inset(-10% -5% -20% -5%); }
/* photos unveil with a wipe while settling from a slight zoom */
.hg-motion section:not(.hg-inview) [data-anim="clip"] { opacity: 1; clip-path: inset(0 0 100% 0 round var(--radius-sm)); }
.hg-motion section.hg-inview [data-anim="clip"] { clip-path: inset(0 0 0 0 round var(--radius-sm)); }
.hg-motion [data-anim="clip"] img { transition: transform 1.6s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0ms)); }
.hg-motion section:not(.hg-inview) [data-anim="clip"] img { transform: scale(1.18); }
/* lines draw from left to right */
.hg-motion section:not(.hg-inview) [data-anim="draw"] { opacity: 1; transform: scaleX(0); transform-origin: left; }
.hg-motion [data-anim="draw"] { transition-duration: 1.4s; }

@keyframes tl-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.float { animation: tl-float 6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float { animation: none; }
}
@media (max-width: 900px) {
  .section-head.split { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 640px) {
  :root { --section-pad-y: 68px; }
  .container { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .section-head { margin-bottom: 32px; }
}

/* ── Shared bits used by several blocks ── */
.stars svg { fill: currentColor; }
.card-box { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius); }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 2px; font: 700 .7rem var(--font-heading); letter-spacing: .08em; text-transform: uppercase;
  background: var(--color-primary); color: var(--color-white); }
.empty-note { color: var(--color-muted); }
/* the red-outlined "deal box": a frame with a title notched into its top edge */
.deal-box { position: relative; border: 1.5px solid var(--color-primary); border-radius: var(--radius-sm); padding: 44px 28px 30px; }
.deal-box > .deal-title { position: absolute; top: 0; left: 40px; transform: translateY(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0 16px; background: var(--color-dark); }
@media (max-width: 640px) { .deal-box { padding: 40px 16px 22px; } .deal-box > .deal-title { left: 12px; padding: 0 10px; } }
