/* Treadmark design tokens — the CMS Colours and Fonts tabs map onto these custom properties.
   Black and warm gold on dark, a light grey content band, thin wide-tracked
   uppercase headings and a serif display face. Hexagons are the motif. */
:root {
  /* brand colours — the CMS Colours tab gives every --color-* a picker */
  --color-primary: #f2b01e;
  --color-primary-dark: #b47a06;
  --color-primary-light: #ffd36b;
  --color-on-primary: #141414;
  --color-secondary: #161616;
  --color-surface: #f0f0f0;
  --color-surface-soft: #f6f6f6;
  --color-default: #3f3f3f;
  --color-muted: #727272;
  --color-line: #dadada;
  --color-white: #ffffff;
  --color-dark: #0b0b0b;
  --color-panel: #1d1d1d;
  --color-nav: #2c2c2c;
  --color-nav-hover: #3a3a3a;
  /* fonts — the CMS Fonts tab overrides these */
  --font-default: 'Open Sans', system-ui, sans-serif;
  --font-primary: var(--font-default);
  --font-heading: 'Raleway', 'Open Sans', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  /* the number-plate face (bold, condensed-ish; UK plates use Charles Wright) */
  --font-plate: 'Arial Black', 'Helvetica Neue', 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: #23854f;
  --state-bad: #b3261e;
  --star: #f5b400;
  --radius: 4px;
  --radius-sm: 3px;
  --section-max-width: 72rem;
  --header-h: 64px;
  --section-pad-y: 96px;
  --base-size: 16px;
  --ease: cubic-bezier(.2, .75, .25, 1);
  /* the hexagon motif: a pointy-top hexagon, an elongated card and a chamfered panel */
  --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  --hex-card: polygon(50% 0, 100% 54px, 100% calc(100% - 54px), 50% 100%, 0 calc(100% - 54px), 0 54px);
  --hex-panel: polygon(28px 0, calc(100% - 28px) 0, 100% 28px, 100% calc(100% - 28px), calc(100% - 28px) 100%, 28px 100%, 0 calc(100% - 28px), 0 28px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: var(--base-size); scroll-behavior: smooth; }
body { font-family: var(--font-default); color: var(--color-default); line-height: 1.7; background: var(--color-surface); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4, h5 { font-family: var(--font-heading); color: var(--color-secondary); font-weight: 300; line-height: 1.15; letter-spacing: .05em; text-transform: uppercase; }
h3, h4, h5 { font-weight: 600; letter-spacing: .06em; }
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-on-primary); }

.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-white); }
section.dark { background: var(--color-dark); color: color-mix(in srgb, var(--color-white) 75%, transparent); }
section.dark h2, section.dark h3 { color: var(--color-white); }

/* the accent word in a headline */
.hl { color: var(--color-primary); }
/* the serif display face, for the wordmark and big numbers */
.display { font-family: var(--font-heading); font-weight: 300; }

/* ── Buttons: square-cut, uppercase, tracked; the knob is a small hexagon ── */
.btn {
  display: inline-flex; align-items: center; gap: .8rem; padding: .45rem .45rem .45rem 1.4rem; border-radius: 0; border: 0; cursor: pointer;
  background: var(--color-secondary); color: var(--color-white); font-weight: 600; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; line-height: 1; white-space: nowrap;
  transition: background .3s ease, color .3s ease, transform .3s var(--ease), box-shadow .3s ease;
}
.btn .knob { width: 38px; height: 42px; flex: none; display: grid; place-items: center; background: var(--color-primary); color: var(--color-on-primary);
  clip-path: var(--hex); transition: transform .35s var(--ease); }
.btn .knob svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -16px color-mix(in srgb, var(--color-dark) 80%, transparent); }
.btn:hover .knob { transform: rotate(60deg); }
.btn:hover .knob svg { transform: rotate(-60deg); }
.btn.light { background: var(--color-white); color: var(--color-secondary); }
.btn.accent { background: var(--color-primary); color: var(--color-on-primary); padding: 1.05rem 1.8rem; justify-content: center; }
.btn.accent:hover { background: var(--color-primary-light); box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--color-primary) 80%, transparent); }
.btn.plain { padding: 1rem 1.7rem; }
.btn.ghost { background: transparent; color: var(--color-secondary); box-shadow: inset 0 0 0 1px var(--color-secondary); padding: 1rem 1.6rem; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--color-primary); color: var(--color-primary-dark); }
.btn[disabled] { opacity: .8; pointer-events: none; }
.arrow-link { display: inline-flex; align-items: center; gap: .7rem; font-weight: 600; color: var(--color-secondary); text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; }
.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-dark); }

/* ── Section heads: a small gold label between hairlines, a thin uppercase headline ── */
.chip { display: inline-flex; align-items: center; gap: .7rem; font-size: .74rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--color-primary-dark); }
.chip::before { content: ''; width: 28px; height: 1px; background: currentColor; }
section.dark .chip { color: var(--color-primary); }
.section-head { max-width: 780px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); margin-top: .9rem; letter-spacing: .06em; }
.section-head h2 .hl { color: var(--color-primary-dark); font-weight: 400; }
section.dark .section-head h2 .hl { color: var(--color-primary); }
.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 .chip::after { content: ''; width: 28px; height: 1px; background: currentColor; }
.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 ── */
.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: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-secondary); margin-bottom: .4rem; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; background: var(--color-white); border: 1px solid var(--color-line); border-radius: 0; padding: .8rem 1rem; color: var(--color-secondary);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.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: color-mix(in srgb, var(--color-muted) 75%, var(--color-white)); }
.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; background: color-mix(in srgb, var(--state-ok) 12%, var(--color-white)); color: var(--state-ok); }
.form-ok svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.form-bad { padding: 12px 16px; background: color-mix(in srgb, var(--state-bad) 10%, var(--color-white)); color: var(--state-bad); font-size: .9rem; }

/* a tick list: a small gold hexagon with a tick drawn in CSS */
.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: .15em; width: 1.15rem; height: 1.3rem; clip-path: var(--hex); background: var(--color-primary); }
.tick-list li::after { content: ''; position: absolute; left: .42rem; top: .45em; width: .3rem; height: .55rem; border: solid var(--color-on-primary); 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: a serif wordmark over a thin uppercase line ── */
.logo { display: inline-flex; align-items: center; gap: .7rem; font: 700 1.7rem var(--font-display); color: var(--color-primary); letter-spacing: 0; }
.logo img { max-height: 54px; width: auto; }
.logo .mark { width: 40px; height: 46px; display: grid; place-items: center; clip-path: var(--hex); color: var(--color-on-primary); background: var(--color-primary); }
.logo .mark svg { width: 22px; height: 22px; }
.logo .wordmark { display: inline-flex; flex-direction: column; justify-content: center; line-height: 1.05; min-width: 0; }
.logo .wl { display: block; }
.logo .sub { display: block; margin-top: .45em; padding-top: .35em; border-top: 1px solid currentColor; font: 400 .38em var(--font-heading); letter-spacing: .22em; text-transform: uppercase; color: var(--color-white); }
.logo { min-width: 0; }
.logo img { max-width: min(46vw, 240px); object-fit: contain; }

/* the gold hexagon icon used by cards */
.hex-ic { display: grid; place-items: center; width: 52px; height: 60px; clip-path: var(--hex); background: var(--color-primary); color: var(--color-on-primary); flex: none; }
.hex-ic svg { width: 24px; height: 24px; }
/* a chamfered (hexagon-cornered) dark panel */
.hex-panel { clip-path: var(--hex-panel); background: var(--color-panel); color: color-mix(in srgb, var(--color-white) 80%, transparent); }

/* ══ 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)); }
.hg-motion section.hg-inview [data-anim="clip"] { clip-path: inset(0 0 0 0 round var(--radius)); }
.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; }
  .form-grid { grid-template-columns: 1fr; }
  .section-head { margin-bottom: 36px; }
}

/* ── Shared bits used by several blocks ── */
.stars svg { fill: currentColor; }
.card-box { background: var(--color-white); border: 1px solid var(--color-line); }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .75rem; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: var(--color-primary); color: var(--color-on-primary); }
.empty-note { color: var(--color-muted); }
@media (max-width: 480px) {
  .chip { letter-spacing: .18em; }
  .section-head.center .chip::before, .section-head.center .chip::after { width: 16px; }
}
