/* Business Outreach Optimizer — shell styles. Light through glass. */
:root {
  --abyss: #04121A;
  --glass: #0E2F3A;
  --glass-edge: #1E5563;
  --caustic: #7FF0E0;
  --ember: #FF4E1F;
  --amber: #FFB547;
  --paper: #E6F2EF;
  --mist: #8FB3B0;
  --c-deliverability: #6FE3FF;
  --c-clarity: #B8F27C;
  --c-relevance: #FFD166;
  --c-ask: #FF8FB1;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --display: 'Bricolage Grotesque', 'Geologica', 'Avenir Next Condensed', system-ui, sans-serif;
  --body: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --fs-14: .875rem; --fs-16: 1rem; --fs-20: 1.25rem; --fs-25: 1.5625rem; --fs-31: 1.9375rem;
  --fs-39: 2.4375rem; --fs-49: 3.0625rem; --fs-61: 3.8125rem; --fs-76: 4.75rem; --fs-96: 6rem;

  --gutter: clamp(16px, 5vw, 72px);
  --r-section: 28px;
  --r-control: 14px;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--abyss);
  background-image:
    radial-gradient(120vw 80vh at 80% -10%, rgba(30, 85, 99, .45), transparent 60%),
    radial-gradient(90vw 70vh at -10% 110%, rgba(14, 47, 58, .7), transparent 60%);
  background-attachment: fixed;
  color: var(--paper);
  font: 400 var(--fs-16)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--caustic); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--paper); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(127, 240, 224, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--caustic); outline-offset: 3px; border-radius: 6px; }

.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 12px 16px; background: var(--caustic); color: var(--abyss); border-radius: var(--r-control); font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- type ---------- */
.display {
  font-family: var(--display);
  font-weight: 760;
  font-variation-settings: 'wdth' 88, 'opsz' 96;
  font-size: clamp(2.6rem, 6.2vw, var(--fs-96));
  line-height: .96;
  letter-spacing: -.022em;
  text-wrap: balance;
}
.display-md { font-size: clamp(2.4rem, 5.2vw, var(--fs-76)); }
.h2 {
  font-family: var(--display);
  font-weight: 720;
  font-variation-settings: 'wdth' 85, 'opsz' 60;
  font-size: clamp(var(--fs-31), 4.2vw, var(--fs-61));
  line-height: 1;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.h4 { font-family: var(--display); font-size: var(--fs-20); font-weight: 650; letter-spacing: -.01em; }

/* ---------- buttons ---------- */
.btn {
  --bh: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--bh); padding: 0 1.5em;
  border-radius: var(--r-control); border: 1px solid transparent;
  font-weight: 600; font-size: var(--fs-16); letter-spacing: -.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .5s var(--ease), background-color .4s var(--ease), box-shadow .5s var(--ease), color .3s, border-color .3s;
}
.btn-sm { --bh: 44px; padding: 0 1.1em; font-size: var(--fs-14); }
.btn-primary {
  background: linear-gradient(180deg, #A9FFF2, var(--caustic) 55%, #52D6C4);
  color: var(--abyss);
  box-shadow: 0 0 0 1px rgba(255,255,255,.35) inset, 0 10px 40px -12px rgba(127, 240, 224, .7);
}
.btn-primary:hover { color: var(--abyss); transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,.5) inset, 0 16px 50px -12px rgba(127, 240, 224, .9); }
.btn-quiet {
  background: rgba(14, 47, 58, .55); color: var(--paper);
  border-color: var(--glass-edge);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.btn-quiet:hover { border-color: var(--caustic); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--mist); border-color: transparent; }
.btn-ghost:hover { color: var(--paper); border-color: var(--glass-edge); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 68px; padding: 0 var(--gutter);
  transition: background-color .5s var(--ease), border-color .5s;
  border-bottom: 1px solid transparent;
}
.top.is-scrolled {
  background: rgba(4, 18, 26, .9);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: rgba(30, 85, 99, .6);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--paper); text-decoration: none; font-family: var(--display); font-weight: 650; font-size: var(--fs-16); letter-spacing: -.01em; font-variation-settings: 'wdth' 90; }
.wordmark:hover { color: var(--paper); }
.wordmark-mark { width: 28px; height: 28px; color: var(--caustic); flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--mist); text-decoration: none; font-size: var(--fs-14); font-weight: 500; border-radius: 10px; transition: color .3s; }
.nav a:not(.btn):hover, .nav a.is-current { color: var(--paper); }
.nav .btn { margin-left: 10px; }
.menu-toggle { display: none; }

/* ---------- the stage (shared prism) ---------- */
.stage {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  opacity: var(--stage-o, 1);
  --t: 0; --p: 0;
}
.stage-mount, .stage-mount canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-mount { opacity: var(--hero-dim, 1); }
.stage.has-webgl .stage-mount canvas { opacity: 0; transition: opacity 1.2s var(--ease); }
.stage.is-live .stage-mount canvas { opacity: 1; }
.stage.is-live .prism-art { opacity: 0; transition: opacity 1.2s var(--ease); }
.prism-art {
  position: absolute; top: 50%; right: -2vw;
  width: min(66vw, 1060px);
  transform:
    translate(calc(var(--t) * -16vw), -50%)
    scale(calc(1 + var(--t) * .12 + var(--p) * .55))
    rotate(calc(var(--p) * -6deg));
  transform-origin: 55% 50%;
  will-change: transform;
}
.prism-svg { width: 100%; height: auto; overflow: visible; }
.pf-embers { mix-blend-mode: screen; }
.pf-ember { transform-box: fill-box; transform-origin: center; animation: ember 3.6s var(--ease) infinite alternate; opacity: calc(.75 + var(--p) * .25); }
.pf-ember.e2 { animation-delay: -1.2s; animation-duration: 4.4s; }
.pf-ember.e3 { animation-delay: -2.1s; animation-duration: 3.1s; }
@keyframes ember { from { transform: scale(.82); } to { transform: scale(1.12); } }
.pf-spectrum { animation: shimmer 6s ease-in-out infinite alternate; transform-origin: 62% 49%; transform-box: view-box; }
@keyframes shimmer { from { opacity: .82; transform: scaleY(.96); } to { opacity: 1; transform: scaleY(1.04); } }
.pf-words text { animation: drift 7s linear infinite; }
.pf-words text:nth-child(2) { animation-delay: -2.4s; }
.pf-words text:nth-child(3) { animation-delay: -4.6s; }
@keyframes drift { from { transform: translateX(-40px); opacity: 0; } 20%, 70% { opacity: .7; } to { transform: translateX(160px); opacity: 0; } }

main, .foot { position: relative; z-index: 1; }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px var(--gutter) 96px;
  position: relative;
}
.hero::before { /* scrim so the words always read over the glass */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 18, 26, .9) 0%, rgba(4, 18, 26, .78) 34%, rgba(4, 18, 26, .35) 48%, rgba(4, 18, 26, 0) 60%);
}
.hero-copy { max-width: 46rem; }
.hero h1 { margin-bottom: 28px; }
.line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.line > span { display: block; animation: rise 1.1s var(--ease) both; }
.line:nth-child(2) > span { animation-delay: .08s; }
.line:nth-child(3) > span { animation-delay: .16s; }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
.lede { font-size: clamp(var(--fs-16), 1.5vw, var(--fs-20)); line-height: 1.55; color: var(--paper); max-width: 34rem; opacity: .92; animation: fade 1s .35s var(--ease) both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; animation: fade 1s .45s var(--ease) both; }
.hero-note { margin-top: 20px; font-size: var(--fs-14); color: var(--mist); animation: fade 1s .55s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.scroll-cue {
  position: absolute; left: var(--gutter); bottom: 28px;
  display: inline-flex; align-items: center; gap: 14px; min-height: 44px;
  color: var(--mist); text-decoration: none; font-size: var(--fs-14);
}
.scroll-cue-line { width: 64px; height: 1px; background: linear-gradient(90deg, var(--caustic), transparent); position: relative; overflow: hidden; }
.scroll-cue-line::after { content: ''; position: absolute; inset: 0; background: #fff; transform: translateX(-100%); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { to { transform: translateX(100%); } }

/* ---------- inside the glass ---------- */
.inside { position: relative; height: 180vh; }
.inside-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center;
  padding: 88px var(--gutter) 48px;
}
.beats { list-style: none; margin: 0; padding: 0; position: relative; width: min(30rem, 100%); height: 100%; }
.beat {
  position: absolute; left: 0; right: 0; top: 50%;
  padding: 28px 30px 26px;
  border-radius: var(--r-section);
  background: linear-gradient(160deg, rgba(14, 47, 58, .84), rgba(4, 18, 26, .8)), var(--noise);
  border: 1px solid rgba(30, 85, 99, .9);
  box-shadow: inset 0 1px 0 rgba(230, 242, 239, .12), 0 40px 80px -40px rgba(0, 0, 0, .8);
  backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%);
  opacity: 0; transform: translateY(calc(-50% + 40px)) scale(.98);
  transition: opacity .8s var(--ease), transform 1s var(--ease);
  visibility: hidden;
}
.beat.is-on { opacity: 1; transform: translateY(-50%); visibility: visible; }
.beat.is-past { transform: translateY(calc(-50% - 40px)) scale(.98); }
.beat-num { font-size: var(--fs-14); color: var(--mist); margin-bottom: 10px; }
.beat-num span { font-family: var(--display); font-weight: 700; color: var(--caustic); font-size: var(--fs-20); margin-right: 2px; }
.beat-title { font-family: var(--display); font-weight: 700; font-variation-settings: 'wdth' 88; font-size: clamp(var(--fs-25), 2.6vw, var(--fs-39)); line-height: 1.05; letter-spacing: -.025em; margin-bottom: 14px; text-wrap: balance; }
.beat p { color: rgba(230, 242, 239, .86); }
.beat .chips { margin: 16px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px; font-size: var(--fs-14); border: 1px solid var(--glass-edge); background: rgba(4, 18, 26, .5); color: var(--mist); }
.chip-ember { color: #FFD3C2; border-color: rgba(255, 78, 31, .55); background: radial-gradient(120% 140% at 50% 120%, rgba(255, 78, 31, .38), rgba(255, 78, 31, .06)); box-shadow: 0 0 22px -6px rgba(255, 78, 31, .7); }
.chip-caustic { color: var(--abyss); background: var(--caustic); border-color: transparent; font-weight: 600; }
.inside-rail { opacity: 0; transition: opacity .4s var(--ease); position: absolute; left: calc(var(--gutter) - 22px); top: 30%; bottom: 30%; width: 2px; background: rgba(30, 85, 99, .6); border-radius: 2px; }
.inside.is-pinned .inside-rail { opacity: 1; }
.inside-rail-fill { position: absolute; inset: 0 0 auto; height: calc(var(--p, 0) * 100%); background: linear-gradient(var(--c-deliverability), var(--c-clarity), var(--c-relevance), var(--c-ask)); border-radius: 2px; }

/* ---------- panels ---------- */
.panel {
  position: relative;
  border-radius: var(--r-section);
  background: linear-gradient(165deg, rgba(14, 47, 58, .7), rgba(14, 47, 58, .55) 40%, rgba(6, 26, 35, .72)), var(--noise);
  border: 1px solid rgba(30, 85, 99, .85);
  box-shadow: inset 0 1px 0 rgba(230, 242, 239, .1), inset 0 0 0 1px rgba(127, 240, 224, .03), 0 50px 100px -50px rgba(0, 0, 0, .9);
  backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%);
}

section.check, section.domain, section.rules, section.studio { padding: 120px var(--gutter) 0; }
.section-head { max-width: 46rem; margin-bottom: 40px; }
.section-head .h2 { margin-bottom: 16px; }
.section-head p { color: var(--mist); font-size: var(--fs-20); line-height: 1.5; max-width: 38rem; margin: 0; }

/* ---------- checker ---------- */
.check { position: relative; }
.check::before { /* light leaking from where the prism went */
  content: ''; position: absolute; inset: -120px 0 auto; height: 520px; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 60% at 70% 30%, rgba(127, 240, 224, .09), transparent 70%);
}
@media (prefers-reduced-motion: reduce) { .score.is-charged .bar-track::before { animation: none; } }
.check-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.editor { padding: 22px; display: flex; flex-direction: column; gap: 18px; margin: 0; }

.seg {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 0; padding: 4px; border: 1px solid var(--glass-edge); border-radius: var(--r-control);
  background: rgba(4, 18, 26, .55); min-width: 0;
}
.seg label { position: relative; z-index: 1; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; font-size: var(--fs-14); font-weight: 500; color: var(--mist); text-align: center; border-radius: 10px; transition: color .4s var(--ease); line-height: 1.2; }
.seg input:checked + span { color: var(--abyss); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--caustic); outline-offset: 2px; }
.seg-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 10px; background: linear-gradient(180deg, #A9FFF2, var(--caustic)); box-shadow: 0 6px 24px -8px rgba(127, 240, 224, .8); transition: transform .6s var(--ease); }
.seg[data-i="1"] .seg-thumb { transform: translateX(100%); }
.seg[data-i="2"] .seg-thumb { transform: translateX(200%); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field[hidden] { display: none; }
.field label { font-size: var(--fs-14); color: var(--mist); font-weight: 500; }
.field input, .field textarea, .domain-form input {
  width: 100%; min-height: 52px; padding: 14px 16px;
  border-radius: var(--r-control); border: 1px solid var(--glass-edge);
  background: rgba(4, 18, 26, .62); color: var(--paper);
  font-size: var(--fs-16); line-height: 1.6;
  transition: border-color .3s, box-shadow .4s var(--ease), background-color .3s;
  caret-color: var(--caustic);
}
.field textarea { resize: vertical; min-height: 300px; }
.field input::placeholder, .field textarea::placeholder, .domain-form input::placeholder { color: rgba(143, 179, 176, .6); }
.field input:focus, .field textarea:focus, .domain-form input:focus { outline: none; border-color: var(--caustic); box-shadow: 0 0 0 3px rgba(127, 240, 224, .18), 0 0 40px -10px rgba(127, 240, 224, .35); background: rgba(4, 18, 26, .8); }
.field textarea::selection, .field input::selection { background: rgba(255, 78, 31, .45); color: #fff; }
.field.is-flash textarea, .field.is-flash input { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(255, 78, 31, .25); }
.editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.counter { margin: 0; font-size: var(--fs-14); color: var(--mist); font-variant-numeric: tabular-nums; }
.counter.is-over { color: #FF8A66; }
.counter b { color: var(--paper); font-weight: 600; }
.editor-actions { display: flex; gap: 8px; }

.score { padding: 26px; position: sticky; top: 88px; }
.score-top { display: flex; align-items: center; gap: 22px; margin-bottom: 24px; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: rgba(30, 85, 99, .55); }
.ring-arc { stroke-linecap: butt; transition: stroke-dasharray .9s var(--ease), stroke-dashoffset .9s var(--ease); stroke-dasharray: 0 400; filter: drop-shadow(0 0 5px currentColor); }
.ring-arc[data-dim="deliverability"] { stroke: var(--c-deliverability); color: var(--c-deliverability); }
.ring-arc[data-dim="clarity"] { stroke: var(--c-clarity); color: var(--c-clarity); }
.ring-arc[data-dim="relevance"] { stroke: var(--c-relevance); color: var(--c-relevance); }
.ring-arc[data-dim="ask"] { stroke: var(--c-ask); color: var(--c-ask); }
.ring-num { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ring-num span { font-family: var(--display); font-weight: 760; font-size: var(--fs-39); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ring-num small { font-size: 12px; color: var(--mist); margin-top: 4px; }
.verdict { font-family: var(--display); font-size: var(--fs-25); font-weight: 680; line-height: 1.1; letter-spacing: -.02em; margin-bottom: 8px; text-wrap: balance; }
.verdict-sub { color: var(--mist); font-size: var(--fs-14); margin: 0; }
.score[data-verdict="will-be-filtered"] .verdict { color: #FF8A66; }
.score[data-verdict="fix-first"] .verdict { color: var(--c-relevance); }
.score[data-verdict="ready"] .verdict { color: var(--caustic); }

.bars { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 7.5rem 1fr 2.5rem; align-items: center; gap: 12px; font-size: var(--fs-14); }
.bar-name { color: var(--paper); }
.bar-track { position: relative; height: 10px; border-radius: 999px; background: rgba(4, 18, 26, .7); box-shadow: inset 0 0 0 1px rgba(30, 85, 99, .7); overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--v, 0) * 1%); border-radius: inherit; background: var(--bc); box-shadow: 0 0 16px var(--bc); transition: width .9s var(--ease); }
.bar-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, rgba(255, 255, 255, .55)); border-radius: inherit; }
.score.is-charged .bar-track { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bc) 42%, transparent), 0 0 14px -4px var(--bc); transition: box-shadow 1.2s var(--ease); }
.bar-track::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bc) 90%, #fff) 50%, transparent); transform: translateX(-110%); opacity: 0; }
.score.is-charged .bar-track::before { animation: charge 1.6s var(--ease) both; }
.bar:nth-child(2) .bar-track::before { animation-delay: .12s; }
.bar:nth-child(3) .bar-track::before { animation-delay: .24s; }
.bar:nth-child(4) .bar-track::before { animation-delay: .36s; }
@keyframes charge { 0% { transform: translateX(-110%); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateX(110%); opacity: 0; } }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--mist); }
.bar[data-dim="deliverability"] { --bc: var(--c-deliverability); }
.bar[data-dim="clarity"] { --bc: var(--c-clarity); }
.bar[data-dim="relevance"] { --bc: var(--c-relevance); }
.bar[data-dim="ask"] { --bc: var(--c-ask); }
.score:not([data-state="empty"]) .bar-val { color: var(--paper); }

.findings-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding-top: 20px; border-top: 1px solid rgba(30, 85, 99, .6); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--mist); margin: 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.empty { padding: 18px; border-radius: var(--r-control); border: 1px dashed var(--glass-edge); color: var(--mist); }
.empty p { margin-bottom: 14px; max-width: 34ch; }
.score:not([data-state="empty"]) .empty { display: none; }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--glass-edge) transparent; }
.findings:empty { display: none; }
.finding { position: relative; }
.finding-btn {
  display: grid; grid-template-columns: 18px 1fr; gap: 4px 12px; width: 100%;
  padding: 14px 14px 14px 12px; min-height: 44px; text-align: left;
  border-radius: var(--r-control); border: 1px solid rgba(30, 85, 99, .7);
  background: rgba(4, 18, 26, .45); color: var(--paper); cursor: pointer;
  transition: border-color .3s, background-color .3s, transform .5s var(--ease);
  animation: fade .6s var(--ease) both;
}
div.finding-btn { cursor: default; }
button.finding-btn:hover { border-color: var(--caustic); background: rgba(14, 47, 58, .7); }
.finding[data-sev="block"] .finding-btn { border-color: rgba(255, 78, 31, .45); background: linear-gradient(90deg, rgba(255, 78, 31, .12), rgba(4, 18, 26, .45) 55%); }
.finding .sev { margin-top: 4px; grid-row: span 3; }
.finding-title { font-weight: 600; line-height: 1.35; }
.finding-match { margin: 2px 0 0; font-size: var(--fs-14); color: #FFD3C2; overflow-wrap: anywhere; }
.finding[data-sev="tip"] .finding-match { color: var(--mist); }
.finding-match q { quotes: '\201C' '\201D'; background: rgba(255, 78, 31, .14); padding: 0 4px; border-radius: 4px; }
.finding-fix { margin: 4px 0 0; font-size: var(--fs-14); color: var(--mist); line-height: 1.5; }
.finding-fix::before { content: 'Fix: '; color: var(--caustic); font-weight: 600; }
.finding-dim { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.nothing { padding: 16px 18px; border-radius: var(--r-control); background: rgba(127, 240, 224, .08); border: 1px solid rgba(127, 240, 224, .3); color: var(--paper); font-size: var(--fs-14); }

/* severity shapes, not only colour */
.sev { display: inline-block; width: 12px; height: 12px; flex: none; }
.sev-block { background: var(--ember); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); box-shadow: 0 0 10px var(--ember); }
.sev-warn { background: var(--amber); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sev-tip { border: 2px solid var(--caustic); border-radius: 50%; }

/* ---------- domain ---------- */
.domain-panel { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; padding: clamp(24px, 4vw, 56px); overflow: hidden; }
.domain-lede { color: var(--mist); font-size: var(--fs-20); line-height: 1.5; max-width: 34rem; margin: 18px 0 28px; }
.domain-form { display: flex; gap: 10px; max-width: 34rem; }
.domain-form input { flex: 1; min-width: 0; }
.domain-msg { margin: 12px 0 0; font-size: var(--fs-14); color: var(--mist); min-height: 1.6em; }
.domain-msg.is-error { color: #FF8A66; }
.checks { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 8px; max-width: 38rem; }
.checks:empty { display: none; }
.check-item { border-radius: var(--r-control); border: 1px solid rgba(30, 85, 99, .7); background: rgba(4, 18, 26, .5); animation: fade .6s var(--ease) both; }
.check-item summary { display: grid; grid-template-columns: 22px 8.5rem 1fr 16px; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; cursor: pointer; list-style: none; border-radius: var(--r-control); }
.check-item summary::-webkit-details-marker { display: none; }
.check-item summary::after { content: ''; width: 8px; height: 8px; border-right: 1.5px solid var(--mist); border-bottom: 1.5px solid var(--mist); transform: rotate(45deg); transition: transform .4s var(--ease); justify-self: end; margin-top: -4px; }
.check-item[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.check-label { font-weight: 600; }
.check-status { font-size: 12px; color: var(--mist); display: block; font-weight: 500; }
.check-summary { color: rgba(230, 242, 239, .86); font-size: var(--fs-14); line-height: 1.45; }
.check-body { padding: 0 14px 14px 48px; font-size: var(--fs-14); color: var(--mist); }
.check-body p { margin: 0 0 10px; }
.check-body pre { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(30, 85, 99, .6); color: var(--paper); font: 12px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.st { width: 20px; height: 20px; display: grid; place-items: center; }
.st svg { width: 20px; height: 20px; }
.check-item[data-status="pass"] { --sc: var(--caustic); }
.check-item[data-status="warn"] { --sc: var(--amber); }
.check-item[data-status="fail"] { --sc: var(--ember); border-color: rgba(255, 78, 31, .45); }
.check-item[data-status="unknown"] { --sc: var(--mist); }
.check-item .st { color: var(--sc); }
.check-item .check-status { color: var(--sc); }

.orbit { position: relative; min-height: 380px; height: min(560px, 70vh); position: sticky; top: 96px; align-self: start; }
.orbit-mount, .orbit-mount canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit.has-webgl .orbit-art { display: none; }
.orbit-art { position: absolute; inset: 0; margin: auto; width: 100%; max-width: 440px; height: 100%; overflow: visible; }
.of-sats { transform-origin: 200px 200px; animation: orbit-spin 60s linear infinite; }
.of-sat path { fill: rgba(143, 179, 176, .25); stroke: var(--mist); stroke-width: 1; transition: fill .6s, stroke .6s; }
.of-sat text { fill: var(--mist); font: 600 11px var(--body); text-anchor: middle; }
.of-sat[data-status="pass"] path { fill: var(--caustic); stroke: #fff; filter: drop-shadow(0 0 8px var(--caustic)); }
.of-sat[data-status="warn"] path { fill: var(--amber); stroke: #fff; filter: drop-shadow(0 0 8px var(--amber)); }
.of-sat[data-status="fail"] path { fill: var(--ember); stroke: #FFD3C2; filter: drop-shadow(0 0 10px var(--ember)); }
.orbit.is-loading .of-sat path { animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { fill: rgba(127, 240, 224, .7); } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
.of-sat text { animation: orbit-spin 60s linear infinite reverse; transform-box: fill-box; transform-origin: center; }

/* ---------- rules ---------- */
.strata { display: grid; gap: 0; border-top: 1px solid rgba(30, 85, 99, .7); }
.stratum { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 32px; padding: 32px 0; border-bottom: 1px solid rgba(30, 85, 99, .7); position: relative; }
.stratum::before { content: ''; position: absolute; left: 0; top: -1px; height: 2px; width: 72px; background: var(--dc); box-shadow: 0 0 14px var(--dc); }
.stratum[data-dim="deliverability"] { --dc: var(--c-deliverability); }
.stratum[data-dim="clarity"] { --dc: var(--c-clarity); }
.stratum[data-dim="relevance"] { --dc: var(--c-relevance); }
.stratum[data-dim="ask"] { --dc: var(--c-ask); }
.stratum h3 { font-family: var(--display); font-size: clamp(var(--fs-25), 2.4vw, var(--fs-39)); font-weight: 700; letter-spacing: -.025em; color: var(--dc); line-height: 1.05; margin-bottom: 6px; font-variation-settings: 'wdth' 85; }
.stratum header p { color: var(--mist); margin: 0; }
.stratum header .count { font-size: var(--fs-14); margin-top: 6px; }
.stratum ul { list-style: none; margin: 0; padding: 0; columns: 2 20rem; column-gap: 40px; }
.stratum li { display: flex; gap: 12px; break-inside: avoid; padding: 8px 0 12px; font-size: var(--fs-14); color: var(--mist); line-height: 1.5; }
.stratum li .sev { margin-top: 5px; }
.stratum li b { display: block; color: var(--paper); font-weight: 600; font-size: var(--fs-16); margin-bottom: 2px; }
.rules-meta { margin: 20px 0 0; font-size: var(--fs-14); color: var(--mist); }

/* ---------- studio ---------- */
.studio { position: relative; padding-bottom: 80px !important; overflow: hidden; }
.studio-inner { max-width: 48rem; position: relative; z-index: 1; padding-top: 40px; }
.studio-inner > p { color: rgba(230, 242, 239, .86); font-size: var(--fs-20); line-height: 1.5; max-width: 36rem; margin-top: 22px; }
.studio .display { max-width: 12ch; }
.studio-spectrum { position: absolute; right: 0; top: 30%; width: 60%; height: 200px; opacity: .55; overflow: visible; -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%); mask-image: linear-gradient(90deg, transparent, #000 35%); }
.studio-spectrum path { fill: none; stroke-width: 2; filter: drop-shadow(0 0 6px currentColor); }

/* ---------- footer ---------- */
.foot { display: flex; justify-content: space-between; gap: 16px 40px; flex-wrap: wrap; padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(30, 85, 99, .6); font-size: var(--fs-14); color: var(--mist); }
.foot p { margin: 0; }
.foot a { display: inline-block; padding: 12px 0; margin: -12px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .check-grid { grid-template-columns: minmax(0, 1fr); }
  .score { position: relative; top: 0; }
  .domain-panel { grid-template-columns: minmax(0, 1fr); }
  .orbit { min-height: 300px; height: 340px; position: relative; top: 0; }
}
@media (max-width: 860px) {
  .menu-toggle {
    display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -8px;
    background: transparent; border: 0; cursor: pointer; border-radius: 10px;
  }
  .menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after { display: block; width: 20px; height: 1.5px; background: var(--paper); border-radius: 2px; transition: transform .4s var(--ease), opacity .3s; }
  .menu-toggle-bars { position: relative; }
  .menu-toggle-bars::before, .menu-toggle-bars::after { content: ''; position: absolute; left: 0; }
  .menu-toggle-bars::before { top: -6px; }
  .menu-toggle-bars::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .nav {
    position: fixed; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) 20px;
    background: rgba(4, 18, 26, .94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(30, 85, 99, .6);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .35s var(--ease), transform .5s var(--ease), visibility .35s;
  }
  .top.is-open { background: rgba(4, 18, 26, .94); }
  .top.is-open .nav { transform: none; opacity: 1; visibility: visible; }
  .nav a:not(.btn) { min-height: 52px; font-size: var(--fs-20); color: var(--paper); padding: 0; border-bottom: 1px solid rgba(30, 85, 99, .4); }
  .nav .btn { margin: 16px 0 0; }
}
@media (max-width: 768px) {
  body { background-attachment: scroll; }
  .prism-art { right: 50%; top: 23%; width: 122vw; transform: translate(calc(50% + var(--t) * 0vw), -50%) scale(calc(1 + var(--p) * .35)) rotate(calc(var(--p) * -6deg)); }
  /* Keep a clear zone for the prism above the copy, even on short screens (address bar showing). */
  .hero { justify-content: flex-end; padding-top: max(96px, 36svh); padding-bottom: 88px; }
  .hero::before { background: linear-gradient(180deg, rgba(4, 18, 26, 0) 20%, rgba(4, 18, 26, .78) 46%, rgba(4, 18, 26, .86) 78%, rgba(4, 18, 26, 0) 100%); }
  .display { font-size: clamp(2.35rem, 11vw, 3.4rem); line-height: .98; }
  .hero-actions .btn { flex: 1 1 auto; }
  .scroll-cue { bottom: 24px; }
  .inside-sticky { align-items: flex-end; padding-bottom: 28px; }
  .beats { height: auto; min-height: 330px; width: 100%; }
  .beat { top: auto; bottom: 0; padding: 22px 20px; transform: translateY(40px) scale(.98); }
  .beat.is-on { transform: none; }
  .beat.is-past { transform: translateY(-30px) scale(.98); }
  .inside-rail { display: none; }
  section.check, section.domain, section.rules, section.studio { padding-top: 88px; }
  .section-head { margin-bottom: 28px; }
  .section-head p, .domain-lede { font-size: var(--fs-16); }
  .editor { padding: 14px; gap: 14px; }
  .field textarea { min-height: 240px; }
  .score { padding: 18px; }
  .score-top { gap: 16px; }
  .ring { width: 108px; height: 108px; }
  .ring-num span { font-size: var(--fs-31); }
  .verdict { font-size: var(--fs-20); }
  .bar { grid-template-columns: 6.6rem 1fr 2.2rem; gap: 10px; }
  .findings { max-height: none; }
  .domain-panel { padding: 20px; border-radius: 22px; }
  .domain-form { flex-direction: column; }
  .orbit { min-height: 300px; height: 340px; margin: -8px -8px 0; }
  .check-item summary { grid-template-columns: 22px 1fr 16px; row-gap: 2px; }
  .check-item summary .check-summary { grid-column: 2; }
  .check-item summary::after { grid-column: 3; grid-row: 1; }
  .check-body { padding-left: 14px; }
  .stratum { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 26px 0; }
  .studio-spectrum { width: 100%; top: auto; bottom: 20px; opacity: .3; }
  .foot { flex-direction: column; }
}
@media (max-width: 400px) {
  .wordmark span { font-size: 15px; }
  .seg label span { font-size: 13px; padding: 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .pf-words text { animation: none !important; opacity: .5; }
}

[hidden] { display: none !important; }

/* ---------- language switch ---------- */
.lang-switch { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 12px; margin-left: 4px; color: var(--mist); text-decoration: none; font-size: var(--fs-14); font-weight: 600; border: 1px solid rgba(30, 85, 99, .9); border-radius: 999px; }
.lang-switch:hover { color: var(--paper); border-color: var(--caustic); }

/* ---------- score actions ---------- */
.score-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.score-actions[hidden] { display: none; }

/* ---------- lead form ---------- */
.lead { margin-top: 32px; padding: clamp(20px, 3vw, 32px); max-width: 44rem; }
.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lead-wide { grid-column: 1 / -1; }
.lead .field textarea { min-height: 120px; }
.lead .opt { color: rgba(143, 179, 176, .7); font-weight: 400; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check-opt { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; font-size: var(--fs-14); color: rgba(230, 242, 239, .86); line-height: 1.5; cursor: pointer; }
.check-opt[hidden] { display: none; }
.check-opt input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--caustic); }
.check-opt a { color: var(--caustic); }
.lead-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 22px; }
.lead-msg { margin: 0; font-size: var(--fs-14); color: var(--mist); min-height: 1.5em; }
.lead-msg.is-ok { color: var(--caustic); }
.lead-msg.is-error { color: #FF8A66; }
.lead.is-sent .lead-grid, .lead.is-sent .check-opt, .lead.is-sent #lead-btn { display: none; }
.lead.is-sent .lead-msg { font-size: var(--fs-20); color: var(--paper); }
.studio-alt { margin-top: 18px; font-size: var(--fs-14); color: var(--mist); }
.studio-alt a { color: var(--paper); }
.foot-links a { color: var(--mist); }
.foot-links a:hover { color: var(--paper); }
@media (max-width: 640px) { .lead-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- printable report ---------- */
.print-report { display: none; }
@media print {
  @page { margin: 16mm; }
  html, body { background: #fff !important; color: #0B1F27 !important; }
  body > *:not(.print-report) { display: none !important; }
  .print-report { display: block !important; font: 11pt/1.5 Geist, system-ui, sans-serif; color: #0B1F27; }
  .print-report h1 { font: 700 20pt/1.1 'Bricolage Grotesque', system-ui, sans-serif; margin: 0 0 4pt; }
  .print-report h2 { font: 700 13pt/1.2 'Bricolage Grotesque', system-ui, sans-serif; margin: 16pt 0 6pt; border-bottom: 1pt solid #C9D8D6; padding-bottom: 3pt; }
  .print-report .meta { color: #4B6663; margin: 0 0 12pt; }
  .print-report .scores { display: flex; gap: 14pt; flex-wrap: wrap; margin: 6pt 0; }
  .print-report .scores div { border: 1pt solid #C9D8D6; border-radius: 6pt; padding: 6pt 10pt; }
  .print-report .scores b { display: block; font-size: 16pt; }
  .print-report ol { padding-left: 16pt; }
  .print-report li { margin: 0 0 7pt; break-inside: avoid; }
  .print-report .sev { font-weight: 700; }
  .print-report .sev-block { color: #C2331A; }
  .print-report .sev-warn { color: #9A6A00; }
  .print-report .sev-tip { color: #1F6F66; }
  .print-report q { background: #FFF1EC; }
  .print-report pre { white-space: pre-wrap; font: 9.5pt/1.45 ui-monospace, Menlo, monospace; background: #F3F7F6; padding: 8pt; border-radius: 4pt; }
}

/* ---------- Bulgarian page: Cyrillic display face (Geologica) is wider than Bricolage ---------- */
html[lang="bg"] .display, html[lang="bg"] .h2, html[lang="bg"] .h4, html[lang="bg"] .beat-title { font-feature-settings: "locl" 0; letter-spacing: -.025em; }
html[lang="bg"] .hero .display { font-size: clamp(2.2rem, 4.6vw, 4.3rem); }
html[lang="bg"] .studio .display { max-width: 16ch; }
@media (max-width: 768px) { html[lang="bg"] .hero .display { font-size: clamp(2rem, 9vw, 2.9rem); } }
