/* Self-hosted fonts (SIL Open Font License 1.1, see /assets/fonts/OFL-*.txt) */
@font-face { font-family: "Bebas Neue"; src: url("/assets/fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/assets/fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #0a0a0a;
  --bg-2: #121212;
  --line: #222;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --red: #e53935;
  --red-dark: #b71c1c;
  --max: 1120px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --glow: 0 10px 30px -12px rgba(229,57,53,.45);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 "Barlow", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: "Bebas Neue", Impact, sans-serif; font-weight: 400; letter-spacing: 1px; line-height: 1.05; margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.eyebrow { color: var(--red); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600; margin: 0 0 12px; }
.btn {
  display: inline-block; padding: 14px 28px; font-size: 14px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--red); transition: background .2s, color .2s;
}
.btn-solid { background: var(--red); color: #fff; }
.btn-solid:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ghost { color: var(--red); }
.btn-ghost:hover { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* Header + CSS-only mobile menu */
header { position: sticky; top: 0; z-index: 10; background: rgba(10,10,10,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-family: "Bebas Neue", sans-serif; font-size: 26px; letter-spacing: 1px; color: var(--red); text-decoration: none; white-space: nowrap; }
.menu { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.menu a { text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.menu a:hover { color: var(--red); }
#nav-toggle, .burger { display: none; }

@media (max-width: 1100px) {
  .burger { display: block; cursor: pointer; padding: 10px; margin-right: -10px; }
  .burger span, .burger span::before, .burger span::after {
    display: block; width: 24px; height: 2px; background: var(--text); position: relative; content: "";
  }
  .burger span::before { position: absolute; top: -7px; }
  .burger span::after  { position: absolute; top: 7px; }
  .menu {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .menu a { display: block; padding: 16px 24px; border-top: 1px solid var(--line); }
  #nav-toggle:checked ~ .menu { display: flex; }
}

/* Hero */
.hero { position: relative; overflow: hidden; padding: 120px 0 110px; background: radial-gradient(ellipse at 80% 100%, rgba(229,57,53,.18), transparent 60%); }
.hero::after {
  content: "DRIFT"; position: absolute; right: -40px; bottom: -40px;
  font: 400 clamp(140px, 24vw, 320px)/1 "Bebas Neue", sans-serif; color: rgba(229,57,53,.06); pointer-events: none;
}
.hero h1 { font-size: clamp(48px, 8vw, 92px); max-width: 12ch; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero p.lead { color: var(--muted); max-width: 520px; margin: 24px 0 36px; font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Sections */
section { padding: 96px 0; border-top: 1px solid var(--line); }
section h2 { font-size: clamp(38px, 5vw, 56px); margin-bottom: 20px; }
.muted { color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 40px; }
.card { background: var(--bg-2); border: 1px solid var(--line); padding: 28px; }
.card h3 { font-size: 26px; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 40px; }
.card { display: flex; flex-direction: column; }
.card .date { color: var(--red); font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; margin: 0 0 10px; }
.card p + p { margin-top: 12px; }
.card .next { color: var(--text); font-weight: 500; }
.card .src { margin-top: auto; padding-top: 18px; font-size: 13px; color: var(--muted); }
.card .src:hover { color: var(--red); }
.notice { margin-top: 40px; padding: 24px 28px; border-left: 3px solid var(--red); background: var(--bg-2); }
.notice p { margin: 0; }

/* Domain sale */
#domain-sale { text-align: center; background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 2px solid var(--red); }
#domain-sale .domain { font-size: clamp(54px, 10vw, 110px); margin: 8px 0 16px; }
#domain-sale .owner { font-size: 20px; font-weight: 600; margin: 28px 0 4px; }
#domain-sale .email { color: var(--muted); margin: 0 0 28px; }

footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* Legends page */
.page-hero { padding: 96px 0 64px; background: radial-gradient(ellipse at 80% 100%, rgba(229,57,53,.15), transparent 60%); }
.page-hero h1 { font-size: clamp(48px, 8vw, 88px); }
.page-hero p { color: var(--muted); max-width: 640px; margin: 20px 0 0; font-size: 18px; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.jump a { padding: 8px 14px; border: 1px solid var(--line); text-decoration: none; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; }
.jump a:hover { border-color: var(--red); color: var(--red); }
.car { scroll-margin-top: 80px; }
.car .chassis { color: var(--red); font-weight: 600; letter-spacing: 2px; font-size: 13px; text-transform: uppercase; }
.car .story { max-width: 720px; color: var(--muted); }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 32px 0; }
.specs div { background: var(--bg-2); padding: 18px 20px; }
.specs dt { color: var(--muted); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.specs dd { margin: 4px 0 0; font-family: "Bebas Neue", sans-serif; font-size: 28px; letter-spacing: .5px; }
.specs dd small { font-family: "Barlow", sans-serif; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); }
table.torque { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
table.torque th, table.torque td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.torque th { background: var(--bg-2); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
table.torque td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.torque td.angle { color: var(--red); font-weight: 600; white-space: nowrap; }
table.torque tr:last-child td { border-bottom: 0; }
.caption { font-size: 13px; color: var(--muted); }
.warn { border-left: 3px solid #f9a825; background: rgba(249,168,37,.07); padding: 18px 22px; margin: 28px 0; font-size: 15px; }
.warn strong { color: #f9a825; }
.pending { border: 1px dashed var(--line); padding: 18px 22px; color: var(--muted); font-size: 15px; margin: 24px 0; }
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.parts a { display: block; padding: 20px; background: var(--bg-2); border: 1px solid var(--line); text-decoration: none; }
.parts a:hover { border-color: var(--red); }
.parts strong { display: block; font-size: 17px; }
.parts span { color: var(--muted); font-size: 14px; }
h3.sub { font-size: 30px; margin-top: 40px; }

/* Gear guides */
.tier { scroll-margin-top: 80px; }
.tier-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.tier-budget { color: var(--muted); font-size: 15px; }
.gear { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 32px; }
.item { background: var(--bg-2); border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.item.mine { border-color: var(--red); }
.item .kind { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.item h3 { font-size: 24px; }
.item .spec { font-size: 14px; color: var(--text); font-weight: 600; }
.item p { margin: 0; color: var(--muted); font-size: 15px; }
.item .price { margin-top: auto; padding-top: 8px; font-size: 14px; color: var(--red); font-weight: 600; }
.mine-badge { display: inline-block; background: var(--red); color: #fff; font-size: 11px; letter-spacing: 1.5px; padding: 3px 8px; text-transform: uppercase; font-weight: 600; align-self: flex-start; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }
.tips div { border-top: 2px solid var(--red); padding-top: 14px; }
.tips strong { display: block; margin-bottom: 6px; }
.tips p { margin: 0; color: var(--muted); font-size: 15px; }
.sources { font-size: 13px; color: var(--muted); }
.sources a { color: var(--muted); }

/* Photos and blueprints */
.car-media { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin: 32px 0 8px; }
@media (max-width: 820px) { .car-media { grid-template-columns: 1fr; } }
.car-photo, .blueprint { margin: 0; background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.car-photo .frame { overflow: hidden; aspect-ratio: 16 / 10; background: #151515; }
.car-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.car-photo figcaption, .blueprint figcaption { padding: 10px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.car-photo figcaption a { color: var(--muted); }
.blueprint svg { display: block; width: 100%; height: auto; flex: 1; }

/* Home page previews */
.previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 40px; }
.preview { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 30px 28px; background: var(--bg-2); border: 1px solid var(--line); text-decoration: none; overflow: hidden; }
.preview .num { font: 400 64px/1 "Bebas Neue", sans-serif; color: rgba(229,57,53,.14); position: absolute; right: 18px; top: 10px; }
.preview h3 { font-size: 30px; }
.preview p { margin: 0; color: var(--muted); }
.preview .go { margin-top: auto; padding-top: 14px; color: var(--red); font-size: 13px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }

/* ---------- Motion: subtle hover effects ---------- */

/* Nav: red underline slides in from the left */
.menu a { position: relative; transition: color .2s var(--ease); }
.menu a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.menu a:hover::after, .menu a:focus-visible::after, .menu a[aria-current="page"]::after { transform: scaleX(1); }
@media (max-width: 1100px) { .menu a::after { display: none; } .menu a:hover { background: var(--bg-2); } }
.logo { transition: letter-spacing .3s var(--ease), color .2s; }
.logo:hover { letter-spacing: 2px; }

/* Buttons: small lift and glow */
.btn { transition: background .2s var(--ease), color .2s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s; }
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: var(--glow); }
.btn:active { transform: translateY(0); box-shadow: none; }

/* Cards: lift, red border, red accent bar wipes across the top */
.card, .item, .preview, .parts a, .car-photo, .blueprint, .tips div, .notice {
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease);
}
.card, .item, .preview, .parts a { position: relative; }
.card::before, .item::before, .preview::before, .parts a::before {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.card:hover, .item:hover, .preview:hover, .parts a:hover,
.card:focus-within, .item:focus-within, .preview:focus-visible, .parts a:focus-visible {
  transform: translateY(-4px); border-color: rgba(229,57,53,.55); box-shadow: var(--glow);
}
.card:hover::before, .item:hover::before, .preview:hover::before, .parts a:hover::before,
.preview:focus-visible::before, .parts a:focus-visible::before { transform: scaleX(1); }
.item.mine::before { transform: scaleX(1); }
.preview .go { transition: letter-spacing .3s var(--ease); }
.preview:hover .go { letter-spacing: 3px; }
.preview .num { transition: color .3s var(--ease), transform .4s var(--ease); }
.preview:hover .num { color: rgba(229,57,53,.3); transform: translateY(-3px); }

/* Photos: slow zoom inside the frame */
.car-photo img { transition: transform .8s var(--ease), filter .5s var(--ease); filter: saturate(.92); }
.car-photo:hover img { transform: scale(1.04); filter: saturate(1.05); }
.car-photo:hover, .blueprint:hover { border-color: rgba(229,57,53,.45); }

/* Blueprint: dimension lines brighten on hover */
.blueprint .dim { transition: stroke .3s var(--ease), opacity .3s var(--ease); opacity: .7; }
.blueprint:hover .dim { stroke: #ff6f60; opacity: 1; }
.blueprint .bore { transition: fill .3s var(--ease); }
.blueprint:hover .bore { fill: rgba(229,57,53,.12); }

/* Spec grid and tables */
.specs div { transition: background-color .25s var(--ease); }
.specs div:hover { background: #181818; }
.specs dd { transition: color .25s var(--ease); }
.specs div:hover dd { color: #fff; }
table.torque tbody tr { transition: background-color .2s var(--ease); }
table.torque tbody tr:hover { background: rgba(229,57,53,.07); }

/* Jump chips and tip blocks */
.jump a { transition: color .2s, border-color .2s, background-color .2s, transform .25s var(--ease); }
.jump a:hover { transform: translateY(-2px); background: rgba(229,57,53,.08); }
.tips div:hover { border-top-color: #ff6f60; }

/* Gentle fade-up for page heroes on load */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero .wrap > *, .page-hero .wrap > * { animation: rise .7s var(--ease) both; }
.hero .wrap > *:nth-child(2), .page-hero .wrap > *:nth-child(2) { animation-delay: .08s; }
.hero .wrap > *:nth-child(3), .page-hero .wrap > *:nth-child(3) { animation-delay: .16s; }
.hero .wrap > *:nth-child(4), .page-hero .wrap > *:nth-child(4) { animation-delay: .24s; }

/* Respect people who turn off motion in their OS settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card:hover, .item:hover, .preview:hover, .parts a:hover, .btn:hover, .jump a:hover { transform: none; }
  .car-photo:hover img { transform: none; }
}
