/* =============================================================================
   Kopek — Hero v1: exploded-view scissors
   Scroll runway sets two custom properties on .xv (see hero-explode.js):
     --t  0→1  camera tilt from plan view to three-quarter view
     --e  0→1  parts separate along the pivot axis
   Everything else is derived from those two values.
   ============================================================================= */

:root { --font-mono: 'DM Mono', ui-monospace, Consolas, monospace; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--text-primary); font-family: var(--font-body); }
a { color: inherit; text-decoration: none; }

/* ---- Prototype-only chrome (the live site injects its own header) ------- */
.pt-header {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: 64px; padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.pt-logo img { display: block; height: 28px; width: auto; }
.pt-tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}
.pt-next {
  min-height: 60vh; display: flex; align-items: center; justify-content: center;
  border-top: 1px solid var(--border);
  font-family: var(--font-body); font-weight: 300; color: var(--text-muted);
}

/* ---- Shared site styles (copied from index.html / chrome.css) ----------- */
.hero-eyebrow {
  font-family: var(--font-heading);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--brand-accent);
  margin: 0 0 16px;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 4.4vw, 4rem);
  font-weight: 300; line-height: 1.1; letter-spacing: -0.02em;
  color: var(--brand-primary);
  max-width: 560px; margin: 0 0 24px;
}
.hero-title em { font-style: italic; font-weight: 200; }
.btn-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-heading);
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brand-primary);
  border-bottom: 1px solid var(--brand-primary);
  padding-bottom: 4px;
  transition: gap 220ms var(--ease-standard), color 160ms;
}
.btn-link:hover { gap: 16px; color: var(--brand-accent); border-color: var(--brand-accent); }
.btn-solid {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--brand-primary); color: #fff;
  font-family: var(--font-heading);
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 14px 28px;
  transition: background 180ms, gap 220ms var(--ease-standard);
}
.btn-solid:hover { background: var(--brand-accent); gap: 16px; }
.btn-link svg, .btn-solid svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.btn-link:focus-visible, .btn-solid:focus-visible { outline: none; box-shadow: var(--shadow-focus, 0 0 0 3px rgba(11,78,82,0.28)); }

/* ---- Hero layout --------------------------------------------------------- */
.xv {
  --t: 0; --e: 0; --dim: 1; --cue: 1;
  --gap: clamp(64px, 8.5vw, 136px);   /* Z distance between parts when fully exploded */
  position: relative;
  height: 320vh;                       /* scroll runway */
  background: var(--surface-alt);
}
.xv-sticky {
  position: sticky; top: 0;
  height: 100vh; min-height: 640px;
  overflow: hidden;
  /* drawing-sheet grid */
  background-image:
    linear-gradient(rgba(11,78,82,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,78,82,0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center 64px;
}
.xv-inner {
  height: 100%;
  max-width: 1440px; margin: 0 auto;
  padding: 64px 40px 0;
  display: grid;
  grid-template-columns: minmax(340px, 0.78fr) 1.22fr;
  align-items: center;
  gap: 24px;
}
.xv-copy { position: relative; z-index: 2; }
.xv-lede {
  font-family: var(--font-body);
  font-size: 16px; font-weight: 300; line-height: 1.65;
  color: var(--text-muted);
  max-width: 400px; margin: 0 0 32px;
}
.xv-ctas { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.xv-cue {
  display: flex; align-items: center; gap: 12px;
  margin: 56px 0 0;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  opacity: var(--cue);
}
.xv-cue-rule { width: 40px; height: 1px; background: var(--brand-accent); }

/* ---- Figure / 3D stage -------------------------------------------------- */
.xv-figure { position: relative; height: 100%; margin: 0; }
.xv-canvas {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  perspective: 1700px;
  perspective-origin: 50% 35%;
}
.xv-stage {
  position: relative;
  width: min(100%, 820px);
  aspect-ratio: 1000 / 400;
  transform-style: preserve-3d;
  transform:
    translateY(calc(var(--t) * -10%))
    rotateX(calc(var(--t) * 56deg))
    rotateZ(calc(var(--t) * -26deg));
}
.xv-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.xv-part {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform-origin: 75.5% 50%;        /* the pivot: (755, 200) in the 1000×400 drawing */
}
.xv-part--b     { transform: translateZ(calc(-2px - var(--e) * var(--gap))) rotate(calc(var(--e) * -3deg)); }
.xv-part--a     { transform: rotate(calc(var(--e) * 3deg)); }
.xv-part--screw { transform: translateZ(calc(3px + var(--e) * var(--gap) * 1.1)); }

/* Drawing: one compound outline per half. paint-order draws the stroke first,
   so the white fill hides inner joins and only the silhouette line remains. */
.xv-body {
  fill: #fff;
  stroke: var(--brand-primary); stroke-width: 2.5; stroke-linejoin: round;
  paint-order: stroke;
  vector-effect: non-scaling-stroke;
}
.xv-detail {
  fill: none;
  stroke: var(--brand-primary); stroke-opacity: 0.32; stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.xv-tc { fill: none; stroke: var(--brand-accent); stroke-width: 5; stroke-linecap: round; }
.xv-pin {
  fill: var(--surface-alt);
  stroke: var(--brand-primary); stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}
.xv-slot { stroke: var(--brand-primary); stroke-width: 3.5; stroke-linecap: round; }

/* Plate thickness: JS stacks three copies of each face just below it. */
.xv-edge .xv-body { fill: #C4D5D6; stroke: rgba(11,78,82,0.35); }
.xv-edge .xv-detail, .xv-edge .xv-tc, .xv-edge .xv-pin, .xv-edge .xv-slot { display: none; }

/* Screw shank: a plane standing on the pivot, perpendicular to the plates. */
.xv-thread {
  position: absolute;
  left: 75.5%; top: 50%;
  width: 1.3%; margin-left: -0.65%;
  height: calc(var(--e) * var(--gap) * 0.55 + 4px);
  transform-origin: top center;
  transform: rotateX(-90deg);
  background: repeating-linear-gradient(to bottom, var(--brand-primary) 0 1px, #fff 1px 4px);
  border: 1px solid var(--brand-primary);
  opacity: var(--e);
}

/* Assembly axis: dashed line along Z through the pivot. */
.xv-axis {
  position: absolute;
  left: 75.5%; top: 50%;
  width: 0;
  height: calc(var(--gap) * 2.6);
  border-left: 1px dashed var(--brand-accent);
  transform-origin: top center;
  transform: translateZ(calc(var(--gap) * 1.45)) rotateX(-90deg);
  opacity: calc(var(--e) * 0.9);
}

.xv-anchor { position: absolute; width: 0; height: 0; }

/* Plan-view annotations */
.xv-dim { opacity: var(--dim); }
.xv-centre {
  fill: none; stroke: var(--brand-primary); stroke-opacity: 0.4; stroke-width: 1;
  stroke-dasharray: 18 5 3 5; vector-effect: non-scaling-stroke;
}
.xv-ext, .xv-dimline {
  fill: none; stroke: var(--brand-primary); stroke-opacity: 0.55; stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.xv-arrow { fill: var(--brand-primary); fill-opacity: 0.7; }
.xv-dimtext {
  font-family: var(--font-mono); font-size: 17px; letter-spacing: 0.06em;
  fill: var(--brand-primary); text-anchor: middle;
}

/* ---- Callouts ----------------------------------------------------------- */
.xv-leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.xv-mark { opacity: 0; transition: opacity 280ms var(--ease-standard); }
.xv-mark.is-on { opacity: 1; }
.xv-mark path { fill: none; stroke: var(--brand-primary); stroke-opacity: 0.6; stroke-width: 1; }
.xv-mark circle { fill: var(--brand-accent); stroke: #fff; stroke-width: 1.5; }
.xv-mark text {
  font-family: var(--font-mono); font-size: 10px;
  fill: #fff; text-anchor: middle; dominant-baseline: central;
}

.xv-callouts { list-style: none; margin: 0; padding: 0; counter-reset: xv; }
.xv-callout {
  counter-increment: xv;
  position: absolute; left: 0; top: 0;
  width: 210px;
  display: grid; gap: 3px;
  opacity: 0;
  transition: opacity 280ms var(--ease-standard);
  pointer-events: none;
}
.xv-callout.is-on { opacity: 1; }
.xv-callout.is-left { text-align: right; }
.xv-callout::before {
  content: counter(xv, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--brand-accent);
}
.xv-callout-title {
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--brand-primary);
}
.xv-callout-body {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 300; line-height: 1.45;
  color: var(--text-muted);
}

/* Title block, engineering-drawing style */
.xv-titleblock {
  position: absolute; right: 0; bottom: 32px;
  display: grid; grid-template-columns: auto auto;
  border: 1px solid var(--brand-primary);
  background: var(--surface);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--brand-primary);
}
.xv-tb-cell { padding: 7px 12px; border-top: 1px solid rgba(11,78,82,0.25); }
.xv-tb-cell:nth-child(-n+2) { border-top: 0; }
.xv-tb-cell:nth-child(odd):not(.xv-tb-wide) { border-right: 1px solid rgba(11,78,82,0.25); }
.xv-tb-brand { font-weight: 600; }
.xv-tb-wide { border-right: 1px solid rgba(11,78,82,0.25); }

/* ---- Static fallbacks ---------------------------------------------------- */
/* Reduced motion: no runway; drawing is shown fully exploded. */
@media (prefers-reduced-motion: reduce) {
  .xv { height: auto; }
  .xv-sticky { position: relative; }
  .xv-mark, .xv-callout { transition: none; }
}

/* Narrow screens: copy above, exploded figure below, callouts as a list. */
@media (max-width: 820px) {
  .pt-header { padding: 0 20px; }
  .xv { height: auto; }
  .xv-sticky { position: relative; height: auto; min-height: 0; }
  .xv-inner { display: block; height: auto; padding: 104px 20px 48px; }
  .xv-cue { display: none; }
  .xv-figure { height: auto; margin-top: 40px; }
  .xv-canvas { position: relative; inset: auto; aspect-ratio: 1 / 0.8; }
  .xv-stage { width: 92%; }
  .xv-mark path { display: none; }
  .xv-callouts { display: grid; gap: 18px; margin-top: 8px; }
  .xv-callout { position: static; width: auto; opacity: 1; transform: none !important; text-align: left !important; }
  .xv-titleblock { position: static; margin-top: 32px; grid-template-columns: 1fr; }
  .xv-tb-cell { border-right: 0 !important; border-top: 1px solid rgba(11,78,82,0.25) !important; }
  .xv-tb-cell:first-child { border-top: 0 !important; }
}
