/* ═══════════════════════════════════════════════════════════════════════════
 * 80/20 LAUNCH AUDIT — the elite contract.  Register: OBSIDIAN IRIS / TITANIUM
 *
 * A precision-instrument register for a technical audit tool: an obsidian
 * near-black ground with no blue cast, ONE iris accent that is the only
 * saturated hue on the page, and a brushed TITANIUM trim — a cool grey metal,
 * not a warm one. Nothing else in the estate uses a metal trim that is not a
 * metal you would find on a workbench: verdigris/brass, basalt/signal-orange,
 * cobalt/ember, chalk/mulberry, brick/sage, carbon/phosphor, teal/gold, Elite
 * Solar Dark and Warm Editorial are all warm-trimmed or single-accent. This
 * one is cold, and it is meant to read as an instrument, not as a brochure.
 *
 * ───────────────────────────────────────────────────────────────────────────
 * CONTRAST — measured with the WCAG 2.x relative-luminance formula, not
 * eyeballed. Every text tier against every surface it is actually painted on.
 * AA body floor is 4.5:1. Nothing here is below 5.7:1.
 *
 * token                 bg #08080C   surface #101017  s-1 #17171F  s-2 #1E1E28
 * ─────────────────────────────────────────────────────────────────────────
 * ink        #F5F6FB      18.52:1        17.55:1        16.51:1      15.30:1
 * ink-2      #C8CBD8      12.37:1        11.72:1        11.02:1      10.22:1
 * ink-3      #9DA1B2       7.78:1         7.37:1         6.93:1       6.43:1
 * accent     #8B92FF       7.29:1         6.90:1         6.49:1       6.02:1
 * accent-2   #B79BFF       8.71:1         8.25:1         7.76:1       7.19:1
 * trim       #C9CEDB      12.70:1        12.03:1        11.31:1      10.49:1
 * ok         #4ECB8A       9.74:1         9.23:1         8.68:1       8.05:1
 * warn       #E8B14A      10.30:1         9.76:1         9.18:1       8.51:1
 * bad        #FF7A85       7.97:1         7.55:1         7.10:1       6.59:1
 * crit       #FF6472       6.97:1         6.60:1         6.21:1       5.76:1
 * info       #6FC7E8      10.48:1         9.93:1         9.34:1       8.66:1
 *
 * On the accent itself: --elite-accent-on #08080C on #8B92FF = 7.29:1.
 * On the pressed/wipe target: ink #F5F6FB on accent-deep #5D63D6 = 4.61:1 (AA).
 * The eyebrow, the table meta and every FIELD LABEL use ink-2 or ink-3, never
 * a fourth grey — a grey-on-dark field label is the fastest way to fail this.
 * ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ---- surfaces ---------------------------------------------------------- */
  --elite-bg:              #08080C;
  --elite-surface:         #101017;
  --elite-surface-inverse: #F5F6FB;

  /* ---- ink --------------------------------------------------------------- */
  --elite-ink:    #F5F6FB;
  --elite-ink-2:  #C8CBD8;
  --elite-ink-3:  #9DA1B2;

  /* ---- accent: iris ------------------------------------------------------ */
  --elite-accent:       #8B92FF;
  --elite-accent-2:     #B79BFF;
  --elite-accent-deep:  #5D63D6;
  --elite-accent-on:    #08080C;
  --elite-accent-rgb:   139, 146, 255;

  /* ---- trim: titanium. Cold metal, brushed, never gold. ------------------ */
  --elite-trim:   #C9CEDB;
  --elite-sheen:  #E6E9F2;
  --elite-shade:  rgba(0, 0, 0, .62);

  /* ---- status: colour AND glow, per the contract ------------------------- */
  --elite-ok:   #4ECB8A;
  --elite-warn: #E8B14A;
  --elite-bad:  #FF7A85;
  --elite-info: #6FC7E8;
  --la-crit:    #FF6472;

  /* ---- hairlines --------------------------------------------------------- */
  --elite-rule: rgba(201, 206, 219, .12);

  /* ---- radius scale: never one radius stamped on everything -------------- */
  --elite-radius:        26px;  /* hero */
  --elite-radius-hero:   26px;
  --elite-radius-card:   16px;
  --elite-radius-input:  11px;
  --elite-radius-pill:   999px;

  /* ---- faces ------------------------------------------------------------- */
  --elite-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ---- texture: a dark register carries full grain ----------------------- */
  --elite-grain-opacity: .055;
  --elite-dust-opacity:  .42;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * PRODUCT LAYER — the pieces the kit deliberately does not ship because they
 * are this product's own artefacts: the score gauge, the severity chips with
 * their glow pairs, the findings table skin, the sample report.
 * ═══════════════════════════════════════════════════════════════════════════ */
@layer components {

  /* ---- severity chips: five levels, each a colour AND a glow ------------- */
  .chip-crit { --chip: var(--la-crit); }
  .chip-crit::before { box-shadow: 0 0 8px 2px color-mix(in srgb, var(--la-crit) 78%, transparent); }
  .sev-chip {
    font-family: var(--elite-font-mono);
    font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    padding: 3px 9px 3px 7px;
  }

  /* ---- the score gauge -------------------------------------------------- */
  .la-gauge { position: relative; width: 168px; height: 168px; flex: none; }
  .la-gauge svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
  .la-gauge__track { fill: none; stroke: color-mix(in srgb, var(--elite-trim) 12%, transparent); stroke-width: 10; }
  .la-gauge__arc {
    fill: none; stroke-width: 10; stroke-linecap: round;
    stroke: var(--la-band, var(--elite-accent));
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--la-band, var(--elite-accent)) 55%, transparent));
    transition: stroke-dashoffset 1.1s var(--elite-ease-editorial, cubic-bezier(.22,1,.36,1));
  }
  .la-gauge__ticks { fill: none; stroke: color-mix(in srgb, var(--elite-trim) 26%, transparent); stroke-width: 1.5; }
  .la-gauge__face {
    position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px;
  }
  .la-gauge__num {
    font-family: var(--elite-font-mono); font-variant-numeric: tabular-nums;
    font-size: 46px; line-height: 1; font-weight: 700; color: var(--elite-ink);
    letter-spacing: -.02em;
  }
  .la-gauge__den { font-family: var(--elite-font-mono); font-size: 11px; color: var(--elite-ink-3); letter-spacing: .12em; }
  .la-gauge__band {
    font-family: var(--elite-font-mono); font-size: 10.5px; letter-spacing: .14em;
    text-transform: uppercase; color: var(--la-band, var(--elite-accent)); margin-top: 4px;
  }
  .la-gauge.is-green  { --la-band: var(--elite-ok); }
  .la-gauge.is-yellow { --la-band: var(--elite-warn); }
  .la-gauge.is-red    { --la-band: var(--la-crit); }
  .la-gauge.is-blocked{ --la-band: var(--elite-ink-3); }
  .la-gauge.is-sm { width: 124px; height: 124px; }
  .la-gauge.is-sm .la-gauge__num { font-size: 34px; }
  .la-gauge.is-sm .la-gauge__den { font-size: 10px; }
  /* The band word does not fit inside a 124px ring without touching the arc,
     and a label clipped by its own gauge reads as a rendering fault. The
     colour of the arc already carries the band, and the aria-label states it
     in words for anyone who cannot see the colour. */
  .la-gauge.is-sm .la-gauge__band { display: none; }

  /* ---- report shell ----------------------------------------------------- */
  .la-report {
    border-radius: var(--elite-radius-card);
    background: var(--elite-surface);
    box-shadow: inset 0 0 0 1px var(--elite-rule), 0 30px 70px -40px var(--elite-shade);
    overflow: hidden;
  }
  .la-report__head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 26px;
    padding: 26px 26px 24px;
    background:
      radial-gradient(120% 160% at 12% 0%, color-mix(in srgb, var(--elite-accent) 9%, transparent), transparent 62%),
      var(--elite-surface-1);
    box-shadow: inset 0 -1px 0 var(--elite-rule);
  }
  .la-report__meta { min-width: 0; flex: 1 1 320px; }
  .la-report__url {
    font-family: var(--elite-font-mono); font-size: var(--elite-t4); color: var(--elite-ink);
    word-break: break-all; margin: 0 0 8px;
  }
  .la-report__sub { font-size: var(--elite-t5); line-height: var(--elite-lh5); color: var(--elite-ink-2); margin: 0; }
  .la-report__counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

  /* the severity bar — one real problem, one segment, widths from the data */
  .la-sevbar {
    display: flex; height: 6px; border-radius: 999px; overflow: hidden;
    background: color-mix(in srgb, var(--elite-trim) 10%, transparent);
    margin-top: 16px;
  }
  .la-sevbar > i { display: block; height: 100%; transition: width .9s var(--elite-ease-editorial, cubic-bezier(.22,1,.36,1)); }
  .la-sevbar > i.s-crit { background: var(--la-crit); }
  .la-sevbar > i.s-high { background: var(--elite-bad); }
  .la-sevbar > i.s-med  { background: var(--elite-warn); }
  .la-sevbar > i.s-low  { background: var(--elite-info); }

  /* ---- findings table --------------------------------------------------- */
  .la-findings { padding: 0; }
  .la-findings .elite-table td.la-what { max-width: 460px; }
  .la-findings .elite-table td.la-what b { display: block; color: var(--elite-ink); font-weight: 600; }
  .la-findings .elite-table td.la-what span { display: block; color: var(--elite-ink-2); margin-top: 3px; font-size: var(--elite-t6); line-height: var(--elite-lh6); }
  .la-cat {
    font-family: var(--elite-font-mono); font-size: 11px; letter-spacing: .06em;
    color: var(--elite-ink-3); text-transform: uppercase; white-space: nowrap;
  }
  .la-row-crit td:first-child { box-shadow: inset 3px 0 0 var(--la-crit); }
  .la-row-high td:first-child { box-shadow: inset 3px 0 0 var(--elite-bad); }
  .la-row-med  td:first-child { box-shadow: inset 3px 0 0 var(--elite-warn); }
  .la-row-low  td:first-child { box-shadow: inset 3px 0 0 var(--elite-info); }

  /* ---- error state (distinct from empty: something went wrong) ----------- */
  .la-error {
    display: grid; gap: 10px; justify-items: center; text-align: center;
    padding: 40px 24px; border-radius: var(--elite-radius-card);
    background: color-mix(in srgb, var(--la-crit) 7%, var(--elite-surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--la-crit) 26%, transparent);
  }
  /* The kit sizes the disc but not the glyph inside it: an <svg> with no
     intrinsic size collapses to 300x150 and gets clipped to a smear by the
     grid. Both marks get an explicit glyph size here. */
  .elite-empty__mark svg, .la-error__mark svg { width: 21px; height: 21px; display: block; }
  .la-error__mark {
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-content: center; color: var(--la-crit);
    background: color-mix(in srgb, var(--la-crit) 14%, transparent);
    box-shadow: 0 0 22px -4px color-mix(in srgb, var(--la-crit) 60%, transparent);
  }
  .la-error h4 { margin: 0; font-size: var(--elite-t3); line-height: var(--elite-lh3); color: var(--elite-ink); }
  .la-error p  { margin: 0; max-width: 46ch; font-size: var(--elite-t5); line-height: var(--elite-lh5); color: var(--elite-ink-2); }

  /* ---- the "what is checked" split panel -------------------------------- */
  .la-split { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .la-panel {
    position: relative; padding: 24px; border-radius: var(--elite-radius-card);
    background: var(--elite-surface);
    box-shadow: inset 0 0 0 1px var(--elite-rule);
  }
  .la-panel h3 { margin: 0 0 4px; font-size: var(--elite-t3); line-height: var(--elite-lh3); color: var(--elite-ink); }
  .la-panel > p { margin: 0 0 16px; font-size: var(--elite-t5); line-height: var(--elite-lh5); color: var(--elite-ink-2); }
  .la-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
  /* Block + absolute marker, NOT a two-column grid. A grid row makes every
     inline child its own grid item, so a single <b> inside the sentence splits
     the text into extra columns and the line wraps one word at a time. Found
     by looking at the rendered page, not at the rule. */
  .la-list li {
    position: relative; display: block; padding-left: 26px;
    font-size: var(--elite-t5); line-height: var(--elite-lh5); color: var(--elite-ink-2);
  }
  .la-list li > b { color: var(--elite-ink); font-weight: 650; }
  .la-list li::before {
    content: ""; position: absolute; left: 0; top: .34em;
    width: 15px; height: 15px; border-radius: 50%;
    background: color-mix(in srgb, var(--la-dot, var(--elite-accent)) 16%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--la-dot, var(--elite-accent)) 44%, transparent);
  }
  .la-list.is-deep { --la-dot: var(--elite-accent); }
  .la-list.is-surface { --la-dot: var(--elite-trim); }

  /* ---- figure: a generated plate with a caption that reads as a caption -- */
  .la-figure { margin: 0; }
  .la-figure img, .la-figure svg { display: block; width: 100%; height: auto; border-radius: var(--elite-radius-card); }
  .la-figure figcaption {
    margin-top: 10px; font-size: var(--elite-t6); line-height: var(--elite-lh6);
    color: var(--elite-ink-3); font-family: var(--elite-font-mono); letter-spacing: .02em;
  }

  /* ---- pinned moment ----------------------------------------------------- */
  .la-pin { position: relative; }
  .la-pin__stage {
    position: sticky; top: 0; height: 100svh; overflow: hidden;
    display: grid; place-items: center;
  }
  .la-pin__plate {
    position: absolute; inset: 0; background-size: cover; background-position: 50% 42%;
    will-change: transform;
  }
  /* The scrim is not decoration, it is the contrast guarantee. The copy band
     is pinned to a measured ceiling: the lightest pixel a headline can sit on
     is held at or below #1E1E28, where the gradient's palest stop (#B79BFF)
     still measures 7.19:1 and the body ink (#C8CBD8) measures 10.22:1. */
  .la-pin__scrim {
    position: absolute; inset: 0;
    background:
      radial-gradient(72% 58% at 50% 46%, color-mix(in srgb, var(--elite-bg) 93%, transparent), transparent 74%),
      linear-gradient(180deg, color-mix(in srgb, var(--elite-bg) 84%, transparent), color-mix(in srgb, var(--elite-bg) 70%, transparent) 45%, var(--elite-bg));
  }
  .la-pin__copy { position: relative; text-align: center; padding: 0 22px; max-width: 900px; }
}

/* Reduced motion — OUTSIDE every @layer, so nothing can out-specify it. */
@media (prefers-reduced-motion: reduce) {
  .la-gauge__arc, .la-sevbar > i { transition: none !important; }
  .la-pin__stage { position: static; height: auto; }
  .la-pin__plate { position: relative; height: 46svh; transform: none !important; }
}
