/* PREVIEW ONLY (WEBSITE-PREVIEW-1). Skin for long-form live bodies rendered inside .pv-legacy
   (src/preview/LegacyBody.astro). legacy.css carries the live layout rules scoped under
   :where(.pv-legacy); this file maps the live tokens to the new system and restyles the controls.
   Loaded after preview.css and legacy.css. Caution: inside .pv-legacy, --body and --paper keep
   their live meanings (a font family and the text colour), so new-system components never nest here. */

.pv-legacy {
  /* Ground and text */
  --ink: #000000;
  --panel: #0b0b0c;
  --panel-2: #121214;
  --paper: #ededee;
  --mute: #919196;
  --mute-2: #8c8c93;
  --hair: #252527;
  --hair-2: #3a3a3e;
  /* The live sapphire ramp becomes Record blue; washes follow it */
  --accent-bright: #83a9ff;
  --accent: #83a9ff;
  --accent-strong: #5f85dc;
  --accent-lift: #5f85dc;
  --accent-rise: #4f74cc;
  --accent-deep: #3f63b8;
  --accent-press: #3457a3;
  --accent-abyss: #2b4a8e;
  --accent-rgb: 131 169 255;
  --sovereign: #512679;
  --sovereign-rgb: 81 38 121;
  --glass-cyan: #83a9ff;
  /* Type */
  --display: Manrope, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: Manrope, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-base: 1.0625rem;
  --fs-sm: .875rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.625rem;
  --fs-xl: 2rem;
  --fs-2xl: 2.5rem;
  --fs-3xl: 3rem;
  --fs-4xl: 4rem;
  --track-tight: -.02em;
  --track-tighter: -.03em;
  --track-tightest: -.03em;
  /* Layout */
  --wrap: 1240px;
  --space-section: var(--section);
  --space-section-sm: var(--section);
  --radius-card: 14px;
  --radius-btn: 8px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  /* Flat panels on a black ground: no gradients, one hairline */
  --surface-hi: #0d0d0f;
  --surface-lo: #0b0b0c;
  --surface: #0b0b0c;
  --surface-hi-2: #0f0f11;
  --surface-lo-2: #0b0b0c;
  --surface-2: #0d0d0f;
  --surface-rim: #252527;
  --surface-rim-hover: #3a3a3e;
  --elev-card: none;
  --elev-card-hover: none;
  --grad-accent: #ffffff;
  --grad-accent-hover: #dcdce0;
  --grad-accent-active: #cfcfd4;
  --btn-edge: none;
  --btn-edge-hover: none;
  --btn-edge-active: none;
  --btn-edge-sm: none;
  --btn-edge-sm-hover: none;
  --btn-focus-ring: 0 0 0 3px rgb(131 169 255 / .35);

  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Width and rhythm follow the new grid */
.pv-legacy .wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); padding: 0 var(--gutter); }
.pv-legacy section { padding: var(--section) 0; border-top: 1px solid var(--hair); }
.pv-legacy section:first-of-type, .pv-legacy .page-head + section { border-top: 0; }

/* First viewport: room under the fixed header, the new display scale */
.pv-legacy .page-head { padding: calc(var(--header-h) + clamp(40px, 6vw, 80px)) 0 clamp(24px, 4vw, 48px); border-top: 0; }
.pv-legacy .page-head + section { padding-top: clamp(40px, 6vw, 80px); }
.pv-legacy .page-head h1 { font-size: clamp(2.375rem, 1.4rem + 3.4vw, 4.5rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 500; max-width: 14em; margin: 0; }
.pv-legacy h1, .pv-legacy h2, .pv-legacy h3, .pv-legacy h4 { font-family: var(--display); font-weight: 500; letter-spacing: -.03em; color: var(--paper); text-wrap: balance; }
.pv-legacy h2 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem); line-height: 1.08; max-width: 22ch; }
.pv-legacy h3 { letter-spacing: -.02em; }
.pv-legacy .lead { color: var(--mute); max-width: 40em; }
.pv-legacy .lead-lg { font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3125rem); line-height: 1.5; }
.pv-legacy p, .pv-legacy li { text-wrap: pretty; }

/* Section labels: quiet, in the body face, without the accent line */
.pv-legacy .chain { font-family: var(--body); font-size: .75rem; font-weight: 600; letter-spacing: .04em; color: var(--mute); margin-bottom: 20px; }
.pv-legacy .chain::before { display: none; }
.pv-legacy .chain .h { color: var(--accent-bright); }
.pv-legacy .page-head .chain { margin-bottom: 18px; }

/* Controls in the new system: white primary, hairline ghost */
.pv-legacy .btn { min-height: 48px; padding: 0 22px; border-radius: var(--r-control); font-family: var(--body); font-size: 1rem; font-weight: 600; letter-spacing: -.005em; border: 1px solid rgb(255 255 255 / .28); background: transparent; color: #fff; box-shadow: none; transition: transform var(--t-micro) var(--ease-out), box-shadow var(--t-micro) var(--ease-out), background-color var(--t-ui) ease, color var(--t-ui) ease, border-color var(--t-ui) ease; }
.pv-legacy .btn:hover { transform: none; background: rgb(255 255 255 / .04); border-color: rgb(255 255 255 / .45); box-shadow: none; }
.pv-legacy .btn:active { transform: scale(.98); scale: 1; background: rgb(255 255 255 / .04); box-shadow: none; }
.pv-legacy .btn.primary { background: #fff; color: #0a0a0b; border-color: #fff; box-shadow: var(--shadow-btn); }
.pv-legacy .btn.primary:hover { background: #fff; border-color: #fff; box-shadow: var(--shadow-btn-hover); transform: translateY(-1px); }
.pv-legacy .btn.primary:active { background: #fff; box-shadow: var(--shadow-btn-press); transform: translateY(0) scale(.98); }
.pv-legacy .btn.primary:focus-visible { box-shadow: var(--shadow-btn); outline: 2px solid var(--record); outline-offset: 3px; }
.pv-legacy .btn.ghost { background: transparent; box-shadow: none; }
.pv-legacy .btn.ghost:hover, .pv-legacy .btn.ghost:active { box-shadow: none; transform: none; }
.pv-legacy .btn.sm { min-height: 40px; padding: 0 16px; font-size: .9375rem; }
.pv-legacy .cta-row { gap: 14px 18px; }
.pv-legacy .cta-row .btn { width: auto; }
.pv-legacy .go { color: var(--accent-bright); }

/* Panels and cards: flat, one hairline, 14 px radius */
.pv-legacy .card, .pv-legacy .panel { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-card); box-shadow: var(--shadow-card); transition: transform var(--t-ui) var(--ease-out), box-shadow var(--t-ui) var(--ease-out), border-color var(--t-ui) ease; }
@media (hover: hover) and (pointer: fine) { .pv-legacy .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); background: var(--panel); border-color: var(--hair-2); } }
.pv-legacy .go { position: relative; text-decoration: none; padding-bottom: 2px; }
.pv-legacy .go::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform var(--t-ui) var(--ease-out); }
.pv-legacy .go:hover::after, .pv-legacy .go:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.pv-legacy .tiles, .pv-legacy .switch-wrap, .pv-legacy .quotable, .pv-legacy table { font-variant-numeric: tabular-nums; }
.pv-legacy .panel { background: var(--panel); }

/* Prose */
.pv-legacy .prose p, .pv-legacy .prose li { color: #c9c9ce; font-size: var(--fs-base); line-height: 1.65; }
.pv-legacy .prose h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2.125rem); margin: 48px 0 14px; }
.pv-legacy .prose a { color: var(--paper); text-decoration-color: #4a4a50; }
.pv-legacy .prose .updated { font-family: var(--mono); font-size: .75rem; letter-spacing: 0; text-transform: none; color: var(--mute); }
.pv-legacy .nofunds { font-size: .8125rem; line-height: 1.55; color: var(--mute); }
.pv-legacy .mono { font-family: var(--mono); }

/* Forms inside legacy bodies (the careers application): calm fields on black */
.pv-legacy input, .pv-legacy select, .pv-legacy textarea { background: #050506; border: 1px solid #34343a; border-radius: 8px; box-shadow: none; color: #f1f1f3; font-family: var(--body); }
.pv-legacy input:focus, .pv-legacy select:focus, .pv-legacy textarea:focus { border-color: var(--record); box-shadow: 0 0 0 3px rgb(131 169 255 / .22); }
.pv-legacy input::placeholder, .pv-legacy textarea::placeholder { color: #75757c; }

/* Focus ring in the new colour */
.pv-legacy :focus-visible { outline: 2px solid var(--record); outline-offset: 3px; }

/* Tables and figures keep their layout; only the lines change */
.pv-legacy table { border-color: var(--hair); }
.pv-legacy th, .pv-legacy td { border-color: var(--hair); }

/* Phones: the live mobile rules (padding, stacked grids) stay; the gutters follow the new grid */
@media (max-width: 767px) {
  .pv-legacy .page-head { padding-top: calc(var(--header-h) + 32px); }
}

/* The short sum of the application form (FORM-HUMAN-CHECK-1, CareersForm.astro): the question is the label, above a
   narrow field. Hidden until js/human-check.js runs ([hidden] in preview.css); without it .hc-careers-nojs says why. */
.pv-legacy .hc-careers { display: grid; gap: 6px; }
.pv-legacy .hc-careers label { font-size: .9375rem; font-weight: 600; color: #f1f1f3; }
.pv-legacy .hc-careers-hint { margin: 0; font-size: .8125rem; line-height: 1.45; color: #a1a1a8; }
.pv-legacy .hc-careers input[name='checkAnswer'] { max-width: 9.5rem; font-variant-numeric: tabular-nums; }
.pv-legacy .hc-careers[data-invalid='true'] input[name='checkAnswer'] { border-color: #e0796f; }
.pv-legacy .hc-careers-err { margin: 0; font-size: .8125rem; color: #e0796f; }
.pv-legacy .hc-careers-nojs { margin: 0; padding: 12px 14px; border: 1px solid #34343a; border-radius: 8px; font-size: .9375rem; line-height: 1.5; color: #f1f1f3; }
