/* Proline brake hero — static concept, no build step.
   Palette «Graphite + hot metal» (Dima 11-01): ~75 % dark, 20 % cool neutrals, 5 % orange accent.
   Orange buttons carry dark text. Tokens first, then page order. */

:root {
  --bg: #15181c;           /* graphite: page background */
  --bg-rgb: 21, 24, 28;
  --card: #242a31;         /* service cards, separate sections, labels */
  --card-rgb: 36, 42, 49;
  --text: #f2f4f6;         /* headings and body */
  --muted: #929ca8;        /* steel: captions, icons, dividers */
  --line: rgba(146, 156, 168, .18);
  --accent: #ff7a2f;       /* hot metal: «book» buttons, active states, small accents */
  --accent-rgb: 255, 122, 47;
  --on-accent: #15181c;    /* text on orange (white fails contrast) */

  --f-display: "Tektur", "Arial Narrow", sans-serif;   /* square techno face, kin to the Proline wordmark */
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Iosevka Charon Mono", ui-monospace, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --hdr-h: 76px;
  --heat: 0;               /* 0..1, written by brake3d.js */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--f-body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, p, ol { margin: 0; }
ol { padding: 0; list-style: none; }
em { font-style: normal; color: var(--accent); }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--accent); color: var(--on-accent); padding: 10px 16px; transition: top .2s; }
.skip:focus { top: 16px; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 28px;
  background: var(--accent); color: var(--on-accent);
  font: 600 15px/1 var(--f-body); letter-spacing: .02em;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: background-color .3s var(--ease), translate .3s var(--ease);
}
.btn:hover { background: #ff925a; translate: 0 -2px; }
.btn--ghost { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px rgba(146, 156, 168, .35); }
.btn--ghost:hover { background: #2d343c; }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: 14px; }

/* ---------- Header ---------- */
.hdr { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--hdr-h); }
.hdr::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--bg-rgb), .9), rgba(var(--bg-rgb), 0)); pointer-events: none; }
.hdr__in { position: relative; height: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.hdr__act { display: flex; align-items: center; gap: 14px; }
.motion-toggle {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px;
  background: none; border: 1px solid var(--line); color: var(--muted);
  font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}
.motion-toggle:hover { color: var(--text); border-color: rgba(146, 156, 168, .5); }
.lang { display: inline-flex; height: 42px; border: 1px solid var(--line); }
.lang button {
  min-width: 44px; padding: 0 10px; background: none; border: 0; color: var(--muted); cursor: pointer;
  font: 500 12px/1 var(--f-mono); letter-spacing: .08em;
}
.lang button + button { border-left: 1px solid var(--line); }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--card); color: var(--accent); }
.motion-toggle__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.motion-toggle[aria-pressed="false"] .motion-toggle__dot { background: #555; box-shadow: none; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; isolation: isolate; }
.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 70% at 70% 52%, rgba(var(--accent-rgb), calc(.04 + var(--heat) * .18)), transparent 70%),
    radial-gradient(90% 80% at 72% 50%, #1f242a 0%, var(--bg) 62%);
}
/* fine engineering grid, fades towards the edges */
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 64px;
  opacity: .35;
  mask-image: radial-gradient(70% 70% at 68% 50%, #000 0%, transparent 75%);
}

.hero__stage { position: absolute; z-index: -1; top: calc(var(--hdr-h) * .7); bottom: 96px; right: 0; width: 64%; }
.hero__gl, .hero__poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__poster { object-fit: contain; transition: opacity .6s var(--ease); }
.hero__poster--x { opacity: 0; }
.hero__gl { opacity: 0; transition: opacity .8s var(--ease); }
.has-gl .hero__gl { opacity: 1; }
.has-gl .hero__poster { opacity: 0; }

.hero__grid { height: 100%; display: flex; align-items: center; padding-top: var(--hdr-h); }
.hero__logo { width: clamp(260px, 30vw, 470px); height: auto; margin: 0 0 clamp(22px, 3.4vh, 40px) -1.2%; }
.hero__text { max-width: 640px; transition: opacity .2s linear; }
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font: 600 12px/1 var(--f-body); letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.eyebrow .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .6); } 70%, 100% { box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0); } }
.hero__title {
  margin-top: 26px;
  font: 800 clamp(40px, 5.6vw, 92px)/.95 var(--f-display);
  letter-spacing: -.01em; text-transform: uppercase;
  text-wrap: balance;
}
.hero__lead { margin-top: 24px; max-width: 30ch; font-size: clamp(17px, 1.4vw, 20px); color: var(--muted); }
.hero__cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
/* services: 2 even rows of 4 (equal columns, no orphan chip in any language) */
.svc { margin: 22px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, max-content); gap: 8px; }
.svc li {
  padding: 8px 12px; border: 1px solid var(--line); background: var(--card);
  font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.svc li::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 8px 1px 0; background: var(--accent); vertical-align: middle; }
.parts { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* part callouts: positioned by brake3d.js in stage pixels */
.hero__labels { position: absolute; inset: 0; pointer-events: none; }
.lbl { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; }
.lbl i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25); }
.lbl i::after { content: ""; position: absolute; top: 3px; left: 8px; width: 56px; height: 1px; background: rgba(255, 255, 255, .5); transform-origin: 0 50%; rotate: -24deg; }
.lbl span {
  position: absolute; left: 58px; top: -40px; white-space: nowrap;
  padding: 7px 12px 7px 10px; background: rgba(var(--card-rgb), .88); border: 1px solid var(--line);
  font: 600 14px/1 var(--f-body); letter-spacing: .02em;
  backdrop-filter: blur(6px);
}
.lbl b { margin-right: 8px; font: 500 11px/1 var(--f-mono); color: var(--accent); }
.lbl[data-side="l"] i::after { left: auto; right: 8px; rotate: 24deg; transform-origin: 100% 50%; }
.lbl[data-side="l"] span { left: auto; right: 58px; }
.lbl[data-side="ld"] i::after { left: auto; right: 8px; rotate: -24deg; transform-origin: 100% 50%; }
.lbl[data-side="ld"] span { left: auto; right: 58px; top: 12px; }

/* HUD: step rail + illustrative meters */
.hud {
  position: absolute; z-index: 2; right: var(--gutter); bottom: clamp(20px, 4vh, 40px);
  display: grid; gap: 12px; justify-items: end;
  font: 500 12px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.hud__steps { display: flex; gap: 18px; }
.hud__steps span { opacity: .45; transition: opacity .3s, color .3s; }
.hud__steps span.is-on { opacity: 1; color: var(--text); }
.hud__meters { display: flex; gap: 22px; }
.hud__m { display: grid; gap: 6px; justify-items: end; }
.hud__m small { font-size: 10px; opacity: .7; }
.hud__m b { font: 500 26px/1 var(--f-mono); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.hud__temp { color: color-mix(in srgb, var(--accent) calc(var(--heat) * 100%), var(--text)) !important; }
.hud__bar { width: 100%; min-width: 260px; height: 2px; background: var(--line); }
.hud__bar span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* motion start states (only with JS + motion) */
.js.motion [data-rise] { opacity: 0; translate: 0 28px; }
.js.motion.reveal-all [data-rise] { opacity: 1 !important; translate: none !important; }

/* motion off: static exploded view, no pin, labels shown */
.no-motion .hero__poster--a { opacity: 0; }
.no-motion .hero__poster--x { opacity: 1; }
.no-motion .hud__steps span { opacity: 1; }
.no-motion .hud__meters, .no-motion .hud__bar, .no-gl .hud__meters { display: none; }

/* ---------- Footer ---------- */
.ftr { border-top: 1px solid var(--line); padding-block: 48px 28px; background: var(--bg); }
.ftr__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding-bottom: 36px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.ftr__h { margin: 0 0 12px; font: 500 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.ftr__col p + p { margin-top: 4px; }
.ftr__col a { color: var(--text); transition: color .2s; }
.ftr__col a:hover { color: var(--accent); }
.ftr__who { color: var(--muted); font-size: 14px; }
.ftr__link { display: inline-block; margin-top: 8px; border-bottom: 1px solid rgba(var(--accent-rgb), .5); }
.ftr__in { border-top: 1px solid var(--line); padding-top: 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--muted); }
.credit { display: inline-flex; align-items: center; gap: 10px; opacity: .8; transition: opacity .3s; }
.credit:hover { opacity: 1; }
.credit img { height: 18px; width: auto; }

/* back to top with scroll-progress ring */
.totop {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 48px; height: 48px; padding: 0;
  background: rgba(var(--card-rgb), .85); border: 0; border-radius: 50%; cursor: pointer; color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.totop.is-on { opacity: 1; pointer-events: auto; }
.totop svg { width: 100%; height: 100%; fill: none; stroke-width: 2; }
.totop__track { stroke: var(--line); }
.totop__ring { stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0) * 100); transform: rotate(-90deg); transform-origin: 50% 50%; }
.totop path { stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hud__steps span:not(.is-on) { display: none; }
}
@media (max-width: 860px) {
  :root { --hdr-h: 64px; }
  .motion-toggle__lbl { display: none; }
  .motion-toggle { padding: 0 12px; }
  /* phone: text, then the scene in the remaining height (in flow, so a taller text never covers the scene) */
  .hero { height: auto; min-height: 100svh; display: flex; flex-direction: column; }
  .hero__grid { height: auto; align-items: flex-start; padding-top: calc(var(--hdr-h) + 18px); }
  .hero__stage { position: relative; order: 2; top: auto; bottom: auto; width: 100%; flex: 1 0 300px; margin-bottom: 104px; }
  .hero__logo { width: min(62vw, 250px); margin-bottom: 14px; }
  .eyebrow { letter-spacing: .12em; font-size: 11px; }
  .hero__title { font-size: clamp(34px, 10.4vw, 56px); margin-top: 16px; }
  .svc { margin-top: 14px; gap: 6px; grid-template-columns: 1fr 1fr; }
  .ftr__grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .svc li { padding: 6px 8px; font-size: 11px; }
  .hero__lead { margin-top: 14px; font-size: 16px; }
  .hero__cta { margin-top: 20px; }
  .hero__cta .btn { min-height: 48px; padding: 0 20px; font-size: 14px; }
  .hero__cta .btn--ghost { display: none; }
  .hud { left: var(--gutter); justify-items: stretch; }
  .hud__steps { justify-content: space-between; }
  .hud__meters { justify-content: space-between; }
  .hud__m { justify-items: start; }
  .hud__m b { font-size: 20px; }
  .hud__bar { min-width: 0; }
  .lbl span { font-size: 12px; padding: 5px 9px; left: 40px; top: -30px; }
  .lbl i::after { width: 38px; }
  .lbl[data-side="l"] span, .lbl[data-side="ld"] span { right: 40px; }
  .lbl[data-side="ld"] span { top: 6px; }
  .lbl[data-part="pistons"] i::after { rotate: -90deg; width: 26px; left: 3px; top: 0; }
  .lbl[data-part="pistons"] span { top: -62px; left: -10px; }
}
@media (max-height: 700px) and (min-width: 861px) {
  .hero__logo { width: clamp(220px, 22vw, 320px); margin-bottom: 16px; }
  .hero__title { font-size: clamp(36px, 4.6vw, 64px); }
  .hero__cta { margin-top: 24px; }
}
