/* ==========================================================================
   eSpeedZone — design system
   Dark-first, photo-forward. The photographs are the design; everything else
   gets out of their way. Deliberately avoids motorsport cliché: no carbon-fibre
   textures, no checkered flags, no italic racing fonts on body copy.
   ========================================================================== */

:root {
  /* Base */
  --bg:             #0B0D10;
  --surface:        #14171D;
  --surface-raised: #1C2028;
  --border:         #282D37;
  --border-bright:  #39404D;

  /* Text */
  --text:           #F4F6F8;
  --text-muted:     #98A1AE;
  --text-dim:       #6B7280;

  /* One accent, used sparingly so it still means something */
  --accent:         #FF4D1C;
  --accent-hover:   #FF6B41;
  --accent-dim:     rgba(255, 77, 28, 0.12);

  /* Semantic */
  --ok:             #34D399;
  --no:             #F87171;
  --warn:           #FBBF24;
  --info:           #60A5FA;

  /* Budget tiers */
  --tier-1:         #60A5FA;
  --tier-2:         #34D399;
  --tier-3:         #FBBF24;
  --tier-4:         #F87171;

  /* Type */
  --font-head: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Space */
  --gap:   clamp(1rem, 2.5vw, 1.75rem);
  --shell: 1180px;
  --radius: 14px;
  --radius-sm: 9px;

  --shadow:    0 4px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
}

/* Light theme for the minority who want it. Dark is the design intent. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FFFFFF; --surface: #F5F7FA; --surface-raised: #FFFFFF;
    --border: #E3E8EF; --border-bright: #CBD5E1;
    --text: #0F1419; --text-muted: #4A5568; --text-dim: #718096;
    --shadow: 0 4px 20px rgba(15,20,25,.08);
    --shadow-lg: 0 18px 44px rgba(15,20,25,.12);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.35rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.45rem); }

p { margin: 0 0 1.15em; }
p.lede { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--text-muted); max-width: 62ch; }

.shell { width: min(100% - 2.5rem, var(--shell)); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-tight { padding: clamp(2rem, 4vw, 3rem) 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono);
  font-size: .74rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9rem;
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .8rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-head); font-weight: 800; font-size: 1.22rem;
  letter-spacing: -.02em; color: var(--text); text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--accent), #FF8A5B);
  display: grid; place-items: center;
  font-size: .95rem; color: #fff; font-weight: 800;
}
.brand span.e { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: .93rem; font-weight: 500;
  padding: .5rem .8rem; border-radius: 8px;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface); }

.nav-toggle {
  display: none; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: 9px; padding: .55rem .7rem; cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 61px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: .6rem 1.25rem 1.25rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .85rem .6rem; font-size: 1.02rem; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; min-height: 46px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .96rem; text-decoration: none;
  cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface-raised); color: var(--text); border-color: var(--border-bright); }
.btn-secondary:hover { color: var(--text); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }

.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .34; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(1100px 520px at 18% 8%, rgba(255,77,28,.20), transparent 60%),
    linear-gradient(180deg, rgba(11,13,16,.55) 0%, rgba(11,13,16,.90) 72%, var(--bg) 100%);
}
.hero-inner { position: relative; z-index: 2; padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 6vw, 4.5rem); }
.hero h1 { max-width: 17ch; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), #FFB088);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------------------------------------------------------------- cards */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--border-bright); }
.card h3 { margin-bottom: .45rem; }
.card p { color: var(--text-muted); margin-bottom: 0; font-size: .95rem; }

a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { transform: translateY(-3px); border-color: var(--accent); color: inherit; }

.card-media {
  margin: -1.5rem -1.5rem 1.15rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-raised);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
a.card:hover .card-media img { transform: scale(1.04); }

/* ---------------------------------------------------------------- tier cards */
.tier {
  position: relative; overflow: hidden;
  border-top: 3px solid var(--tier);
}
.tier .price {
  font-family: var(--font-mono); font-size: 1.75rem; font-weight: 700;
  color: var(--tier); letter-spacing: -.02em; line-height: 1;
  margin: .2rem 0 .6rem;
}
.tier .tier-name { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }
.tier-1 { --tier: var(--tier-1); } .tier-2 { --tier: var(--tier-2); }
.tier-3 { --tier: var(--tier-3); } .tier-4 { --tier: var(--tier-4); }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  padding: .3rem .62rem; border-radius: 999px;
  border: 1px solid var(--border-bright); color: var(--text-muted);
  background: var(--surface-raised);
}
.badge-ok  { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 42%, transparent); }
.badge-no  { color: var(--no);   border-color: color-mix(in srgb, var(--no) 42%, transparent); }
.badge-warn{ color: var(--warn); border-color: color-mix(in srgb, var(--warn) 42%, transparent); }

/* Never rely on colour alone — red/green is the commonest colour blindness. */
.badge-ok::before { content: "✓"; font-weight: 700; }
.badge-no::before { content: "✕"; font-weight: 700; }

/* ---------------------------------------------------------------- callouts */
.callout {
  border: 1px solid var(--border-bright);
  border-left: 4px solid var(--info);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin: 1.6rem 0;
  font-size: .96rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--text); }
.callout-warn   { border-left-color: var(--warn); }
.callout-danger { border-left-color: var(--no); }
.callout-ok     { border-left-color: var(--ok); }
.callout-title {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
  margin-bottom: .4rem; color: var(--text);
}

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 560px; }
thead th {
  text-align: left; background: var(--surface-raised);
  font-family: var(--font-mono); font-size: .74rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface); }
td.num, th.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .8rem; }
.gallery figure { margin: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.gallery img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery figcaption { font-size: .82rem; color: var(--text-muted); padding: .6rem .75rem; }

/* Image credit — small, always present, never hidden. */
.credit { font-size: .76rem; color: var(--text-dim); margin-top: .5rem; }
.credit a { color: var(--text-muted); }

/* ---------------------------------------------------------------- stat bar */
.statbar {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin: 1.5rem 0; background: var(--surface);
}
.statbar div { flex: 1 1 120px; padding: .95rem 1.1rem; border-right: 1px solid var(--border); }
.statbar div:last-child { border-right: none; }
.statbar dt {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: .25rem;
}
.statbar dd { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 1.5rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  font-size: .92rem;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.6fr repeat(auto-fit, minmax(140px, 1fr)); }
.footer-col h4 {
  font-family: var(--font-mono); font-size: .73rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: .8rem;
}
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; padding: .28rem 0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 2.2rem; padding-top: 1.3rem; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: .84rem;
  display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between;
}
.disclaimer { color: var(--text-dim); font-size: .82rem; max-width: 70ch; margin-top: .8rem; }

/* ---------------------------------------------------------------- misc */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

.center { text-align: center; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* ---------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6, 8, 11, .94);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 1rem; padding: clamp(1rem, 4vw, 3rem);
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-height: 88vh; display: flex; flex-direction: column; gap: .8rem; }
.lightbox img {
  max-height: 78vh; width: auto; margin-inline: auto;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.lightbox figcaption { color: var(--text-muted); text-align: center; font-size: .9rem; }
.lightbox button {
  background: var(--surface-raised); color: var(--text);
  border: 1px solid var(--border-bright); border-radius: 999px;
  width: 46px; height: 46px; font-size: 1.5rem; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.lightbox button:hover { border-color: var(--accent); color: var(--accent); }
.lb-close { position: absolute; top: 1rem; right: 1rem; }
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 1fr; }
  .lb-prev, .lb-next { display: none; }
}

/* ==========================================================================
   HONESTY COMPONENTS
   These are structural, not decorative. The site's entire value is that its
   builds are real. Anything that could imply a photo is Ethan's gear when it
   isn't must be impossible to ship by accident.
   ========================================================================== */

/* -- site-wide honesty banner: header, above the fold, EVERY page --------- */
.honesty {
  background: linear-gradient(90deg, var(--accent-dim), transparent 70%);
  border-bottom: 1px solid var(--border);
  font-size: .87rem; color: var(--text-muted);
}
.honesty .shell { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 0; }
.honesty svg { flex: none; margin-top: .15rem; color: var(--accent); }
.honesty strong { color: var(--text); }
.honesty p { margin: 0; max-width: 92ch; }
.honesty .sig { color: var(--text-dim); font-style: italic; }

/* -- photo component: an image WITHOUT a badge should look broken --------- */
figure.photo { margin: 0; position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
figure.photo img { width: 100%; display: block; }
figure.photo figcaption { font-size: .85rem; color: var(--text-muted); padding: .65rem .8rem; }

.photo-badge {
  position: absolute; left: .6rem; bottom: .6rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .03em;
  padding: .3rem .6rem; border-radius: 6px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.16);
}
/* Grey = stock. Green = Ethan's own. There is no third state. */
.photo-badge.stock { background: rgba(18,20,24,.82); color: #C6CDD8; }
.photo-badge.mine  { background: rgba(10,40,28,.85);  color: #6EE7B7; border-color: rgba(110,231,183,.35); }
.photo-badge::before { content: "◉"; font-size: .8em; opacity: .85; }
.photo-badge.mine::before { content: "✓"; }

/* An <img> that isn't inside figure.photo is a bug — make it obvious in dev. */
.content > img:not(figure img) { outline: 3px dashed var(--no); }

/* -- build state chip ---------------------------------------------------- */
.state-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .78rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .5rem .9rem; border-radius: 8px; margin-bottom: 1rem;
}
.state-specced { background: rgba(251,191,36,.13); color: var(--warn); border: 1px solid rgba(251,191,36,.35); }
.state-built   { background: rgba(52,211,153,.13); color: var(--ok);   border: 1px solid rgba(52,211,153,.35); }

/* -- FTC disclosure: above the first affiliate link, never footer-only ---- */
.disclosure {
  background: var(--surface-raised);
  border: 1px solid var(--border-bright);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: .95rem 1.15rem; margin: 1.5rem 0;
  font-size: .9rem; color: var(--text-muted);
}
.disclosure strong { color: var(--text); }
.disclosure p { margin: 0; }

/* -- safety notice ------------------------------------------------------- */
.safety {
  border: 1px solid rgba(248,113,113,.4);
  background: rgba(248,113,113,.07);
  border-radius: var(--radius); padding: 1.25rem 1.4rem; margin: 1.75rem 0;
}
.safety h3 { color: var(--no); font-size: 1.05rem; margin-bottom: .5rem; }
.safety ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.safety li { margin-bottom: .4rem; color: var(--text-muted); }

/* -- prose ---------------------------------------------------------------- */
.content { max-width: 74ch; }
.content h2 { margin-top: 2.4rem; }
.content h3 { margin-top: 1.8rem; }
.content ul, .content ol { padding-left: 1.3rem; color: var(--text-muted); }
.content li { margin-bottom: .5rem; }
.content li strong { color: var(--text); }
.content figure.photo { margin: 1.8rem 0; }

.page-head { border-bottom: 1px solid var(--border); padding: clamp(2rem,5vw,3.2rem) 0 clamp(1.5rem,3vw,2.2rem); }

/* -- verify stamp for anything price/compat related ----------------------- */
.verify-stamp {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: .74rem; color: var(--text-dim);
  border: 1px dashed var(--border-bright); border-radius: 6px;
  padding: .3rem .6rem; margin: .6rem 0;
}
