/* IntelliCore holding page. Blue sampled from the logo artwork; navy, gold and panel values
   from the call-card source of truth (Call Cards/build/card_data.py). */
:root {
  --navy-0: #00133A;
  --navy: #0B1F4A;
  --blue: #003399;
  --blue-lt: #4B7BD1;
  --cyan: #62D2FF;
  --cyan-dim: rgba(98, 210, 255, .35);
  --gold: #B08A34;
  --gold-lt: #C9A961;
  --text: #E8EEF9;
  --muted: #A7B4D0;
  --bad: #FF7A6B;
  --good: #8FE3FF;  /* success reads in the brand cyan, not an off-palette green */
  --glass: rgba(4, 18, 52, .62);
  --glass-edge: rgba(98, 210, 255, .28);
  --serif: "Instrument Serif", Georgia, serif;
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 2.2vw, 32px);
  --px: 0px; --py: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--navy-0); color: var(--text);
  font: 400 15px/1.5 var(--display);
  display: grid; grid-template-rows: auto 1fr auto auto auto;
  min-height: 100dvh; overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
a { color: var(--cyan); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--gold); color: #111; padding: 8px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--gold-lt); outline-offset: 3px; }

/* ---- backdrop plate, with cursor parallax ---- */
.plate { position: fixed; inset: -24px; z-index: -1; overflow: hidden; }
.plate-img {
  position: absolute; inset: 0; background: var(--navy) center / cover no-repeat;
  background-image: var(--plate, none);
  transform: translate3d(var(--px), var(--py), 0) scale(1.03);
  transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .8s;
}
.plate::after { /* keeps HUD legible over any plate */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 55%, rgba(0,19,58,.15) 0%, rgba(0,19,58,.55) 70%, rgba(0,19,58,.85) 100%);
}
.plate-grain {
  position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay; pointer-events: none;
  background-image: 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'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.glass {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 14px;
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ---- header ---- */
.top {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--gutter);
  padding: 14px var(--gutter) 6px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { display: block; fill: #fff; }
.brand-mark svg { height: 46px; width: auto; }
.brand-word svg { height: 40px; width: auto; }
.brief { justify-self: center; width: min(820px, 100%); padding: 10px 18px 12px; min-height: 76px; }
.brief-label { margin: 0 0 4px; font: 600 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-lt); }
.brief-text { margin: 0; font: 400 16px/1.55 var(--display); color: var(--text); }
.caret { display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--cyan); animation: blink 1s steps(1) infinite; }
.caret.done { opacity: .0; animation: none; }
@keyframes blink { 50% { opacity: 0; } }
.top-right { display: flex; align-items: center; gap: 12px; }
.timer { font: 400 14px var(--mono); color: var(--muted); min-width: 4.2ch; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- buttons ---- */
.btn {
  border: 1px solid var(--glass-edge); background: rgba(8, 30, 80, .55); border-radius: 999px;
  padding: 9px 18px; min-height: 44px; cursor: pointer; letter-spacing: .02em;
  transition: background .2s, border-color .2s, transform .15s;
}
.btn:hover { background: rgba(20, 60, 140, .7); border-color: var(--cyan); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(180deg, var(--gold-lt), var(--gold)); color: #151007; border-color: transparent; font-weight: 600; }
.btn.gold:hover { filter: brightness(1.08); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--cyan); text-decoration: underline; cursor: pointer; }

/* ---- method rail ---- */
.rail {
  position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 5;
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 26px;
}
.rail li { display: flex; align-items: center; gap: 10px; flex-direction: row-reverse; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); transition: color .4s; }
.rail i { width: 14px; height: 14px; transform: rotate(45deg); border: 1.5px solid rgba(98,210,255,.55); transition: all .4s; }
.rail li.on { color: var(--text); }
.rail li.on i { background: var(--gold); border-color: var(--gold-lt); box-shadow: 0 0 14px var(--gold); }

/* ---- stage ---- */
.stage-wrap { position: relative; display: grid; place-items: center; padding: 8px calc(var(--gutter) + 120px); min-height: 0; container-type: size; }
.stage { aspect-ratio: var(--ar, 1.8); width: min(100cqw, 100cqh * var(--ar, 1.8)); padding: 10px; display: grid; min-height: 0;
  background: rgba(4, 18, 52, .35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.stage svg { width: 100%; height: 100%; min-height: 0; display: block; overflow: visible; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.status { margin: 0 auto; padding: 0 var(--gutter); min-height: 24px; line-height: 1.35; font: 500 15px var(--display); color: var(--text); text-align: center; max-width: 900px; opacity: 0; transition: opacity .25s; }
.status.show { opacity: 1; }
.status.error { color: var(--bad); }
.status.good { color: var(--good); }

/* shared puzzle vocabulary, used by every module */
.pz-hit { cursor: pointer; outline: none; }
.pz-hit:focus-visible .pz-focus, .pz-hit:focus-visible.pz-focus { stroke: var(--gold-lt); stroke-width: 3; }
.pz-hit:focus-visible { filter: drop-shadow(0 0 6px var(--gold)); }
.pz-hit:hover { filter: brightness(1.2); }
.pz-line { fill: none; stroke: var(--cyan); stroke-width: 1.5; }
.pz-grid { fill: none; stroke: var(--cyan-dim); stroke-width: 1; }
.pz-panel { fill: rgba(8, 30, 80, .55); stroke: var(--glass-edge); stroke-width: 1.2; }
.pz-solid { fill: var(--blue); stroke: var(--cyan); stroke-width: 1.5; }
.pz-gold { fill: var(--gold); stroke: var(--gold-lt); stroke-width: 1.5; }
.pz-sel { filter: drop-shadow(0 0 10px var(--gold)); }
.pz-sel .pz-focus, .pz-sel.pz-focus { stroke: var(--gold-lt); stroke-width: 3; }
.pz-dim { opacity: .35; }
.pz-label { fill: var(--text); font: 600 18px var(--display); }
.pz-small { fill: var(--muted); font: 400 13px var(--mono); letter-spacing: .06em; }
.pz-num { fill: var(--text); font: 600 20px var(--mono); }
.pz-bad { fill: rgba(255,122,107,.25); stroke: var(--bad); }
.pz-good { fill: rgba(143,227,255,.22); stroke: var(--good); }

/* ---- controls and launch bar ---- */
.controls { display: flex; justify-content: center; gap: 10px; padding: 6px var(--gutter); }
.launch {
  display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  padding: 10px calc(var(--gutter) + 130px) calc(12px + env(safe-area-inset-bottom)) var(--gutter);
  background: linear-gradient(0deg, rgba(0,19,58,.92), rgba(0,19,58,.0));
}
.launch-copy { margin: 0; font-size: 14px; color: var(--muted); }
.launch-copy strong { color: var(--text); font-weight: 600; }
.launch-copy .short, .who-inline, .launch-toggle { display: none; }
.signup { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.signup input[type=email] {
  min-height: 44px; width: 250px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--glass-edge); background: rgba(0,19,58,.7);
}
.signup input[type=email]::placeholder { color: #7F8CAB; }
.consent { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.consent input { width: 18px; height: 18px; accent-color: var(--gold); }
.hp { position: absolute; left: -9999px; }
.form-msg { flex-basis: 100%; margin: 0; font-size: 13px; min-height: 0; }
.form-msg:empty { display: none; }
.form-msg.error { color: var(--bad); }
.form-msg.good { color: var(--good); }

/* ---- contact seal ---- */
.seal {
  position: fixed; right: var(--gutter); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer; padding: 6px; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-lt);
}
.seal i { width: 34px; height: 34px; transform: rotate(45deg); border: 2px solid var(--gold-lt); background: radial-gradient(circle, rgba(201,169,97,.35), rgba(0,19,58,.8)); box-shadow: 0 0 18px rgba(176,138,52,.5); transition: transform .5s cubic-bezier(.5,1.8,.4,1); }
.seal:hover i, .seal[aria-expanded=true] i { transform: rotate(225deg); }
.seal.pulse i { animation: pulse 1.4s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 34px var(--gold); } }
.contact { position: fixed; right: var(--gutter); bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 21; width: min(380px, calc(100vw - 32px)); padding: 18px 20px; }
.contact p { margin: 0 0 8px; }
.contact p:first-of-type { padding-right: 34px; }
.addr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 600 16px var(--mono); }
.x { position: absolute; top: 8px; right: 8px; background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; width: 36px; height: 36px; }

/* ---- dossier ---- */
.dossier-tab {
  position: fixed; left: 0; top: 50%; z-index: 6; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl;
  padding: 16px 9px; border: 1px solid var(--glass-edge); border-right: 0; border-radius: 10px 0 0 10px;
  background: var(--glass); cursor: pointer; font: 600 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-lt);
}
.dossier { position: fixed; left: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 40; width: min(430px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 22px 24px; }
.dossier h2 { font: 600 21px/1.3 var(--display); margin: 4px 0 10px; }
.dossier h3 { font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-lt); margin: 0 0 6px; }
.dossier .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
.dossier ul { margin: 0; padding-left: 16px; color: var(--muted); }
.eyebrow { margin: 0; font: 600 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-lt); }
.small { font-size: 13px; color: var(--muted); }
.tagline { font: 600 12px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--cyan); margin-bottom: 0; }

/* ---- dialogs ---- */
dialog { color: var(--text); padding: 26px 28px; max-width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
dialog::backdrop { background: rgba(0, 10, 30, .6); backdrop-filter: blur(3px); }
.debrief h2 { font: 400 40px/1.1 var(--serif); margin: 6px 0 0; }
.db-big { font: 400 64px/1 var(--serif); color: var(--gold-lt); margin: 8px 0 4px; }
.db-stats { font: 400 13px var(--mono); letter-spacing: .04em; color: var(--muted); margin: 0 0 18px; }
.db-body h3, .solver h3 { font: 600 15px var(--display); margin: 0 0 6px; color: var(--gold-lt); }
.db-body p { margin: 0 0 10px; color: var(--text); }
.db-service { color: var(--muted) !important; font-size: 14px; }
.solver { margin: 18px 0 12px; padding: 16px; border-radius: 12px; border: 1px solid rgba(201,169,97,.4); background: rgba(176,138,52,.08); }
.solver p { flex-basis: 100%; margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.solver h3 { flex-basis: 100%; }
.db-contact { font-size: 14px; color: var(--muted); }
.db-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; position: sticky; bottom: -26px; margin: 0 -28px -26px; padding: 14px 28px 20px; background: linear-gradient(transparent, rgba(4,18,52,.96) 30%); }
.privacy p { color: var(--muted); }

/* ---- intro ---- */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 22px; background: radial-gradient(ellipse at center, #0B1F4A 0%, #00133A 70%); }
.intro-logo svg { width: min(260px, 50vw); height: auto; display: block; fill: #fff; overflow: visible; }
.intro-logo g { transform-box: fill-box; }
.intro-tag { margin: 0; font: 600 12px var(--mono); letter-spacing: .4em; text-transform: uppercase; color: var(--gold-lt); opacity: 0; }
.intro-skip { position: absolute; right: 20px; bottom: 20px; background: none; border: 1px solid var(--glass-edge); border-radius: 999px; padding: 6px 14px; color: var(--muted); cursor: pointer; }
.intro.gone { display: none; }
.noscript { position: fixed; inset: auto 16px 16px; padding: 16px; z-index: 200; }

/* ---- small screens ---- */
@media (max-width: 900px) {
  .top { grid-template-columns: auto 1fr; row-gap: 8px; padding-top: 10px; }
  .brief { grid-column: 1 / -1; grid-row: 2; min-height: 0; padding: 8px 12px 10px; }
  .brief-text { font-size: 13px; }
  .top-right { justify-self: end; }
  .brand-mark svg { height: 34px; }
  .brand-word svg { height: 28px; }
  .rail { position: static; transform: none; flex-direction: row; justify-content: center; gap: 16px; padding: 4px var(--gutter) 0; grid-row: 2; }
  body { grid-template-rows: auto auto 1fr auto auto auto; }
  .status { font-size: 13px; min-height: 20px; line-height: 1.3; }
  .rail li { flex-direction: row; font-size: 10px; gap: 6px; }
  .rail i { width: 10px; height: 10px; }
  .stage-wrap { padding: 6px var(--gutter); }
  .stage { padding: 4px; }
  .launch { padding: 8px var(--gutter) calc(10px + env(safe-area-inset-bottom)); padding-right: calc(var(--gutter) + 64px); gap: 8px; justify-content: flex-start; }
  .launch-copy { font-size: 13px; flex: 1; }
  .launch-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; }
  .launch .signup { display: none; }
  .launch.open .signup { display: flex; }
  .launch.open .launch-toggle { display: none; }
  .signup input[type=email] { width: auto; flex: 1 1 150px; }
  .seal i { width: 26px; height: 26px; }
  .dossier-tab { display: none; }
  .launch-copy .long { display: none; }
  .launch-copy .short, .who-inline { display: inline; }
  .launch .signup { width: 100%; gap: 8px; }
  .launch .signup input[type=email] { flex-basis: 100%; }
  .launch .consent { flex: 1; }
  .launch .form-msg { order: 4; }
  .controls .btn { padding: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .plate-img { transform: scale(1.03); }
}
.intro-logo path { transform-box: fill-box; }

/* ---- hero title card ---- */
.hero {
  position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; text-align: center;
  padding: 120px var(--gutter) 140px; gap: 18px;
  background: radial-gradient(ellipse 46% 42% at 50% 50%, rgba(0,19,58,.82) 0%, rgba(0,19,58,.55) 60%, rgba(0,19,58,.35) 100%);
}
/* blueprint framing lines, like a drawing sheet's border and centre marks */
.hero::before, .hero::after { content: ""; position: absolute; pointer-events: none; }
.hero::before { inset: 88px 5vw 96px; border: 1px solid rgba(98,210,255,.28); }
.hero::after { left: 50%; top: 88px; bottom: 96px; width: 1px; background: linear-gradient(rgba(98,210,255,.5) 0 40px, transparent 40px calc(100% - 40px), rgba(98,210,255,.5) calc(100% - 40px)); }
.hero > * { position: relative; }
body.hero-open .stage-wrap, body.hero-open .controls, body.hero-open .launch, body.hero-open .dossier-tab { visibility: hidden; }
body.hero-open .plate-img { filter: brightness(.55); }
.top { position: relative; z-index: 31; }
body.hero-open .brief, body.hero-open .top-right, body.hero-open .rail { visibility: hidden; }
.hero[hidden] { display: none; }
.hero h1 { margin: 0; max-width: 15ch; font: 400 clamp(44px, 7.2vw, 104px)/1 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.hero h1 em { color: var(--gold-lt); }
.hero-sub { margin: 0; max-width: 46ch; font-size: clamp(15px, 1.3vw, 18px); color: var(--muted); }
.hero-actions { display: flex; gap: 22px; align-items: center; margin-top: 10px; }
.btn.lg { min-height: 54px; padding: 12px 30px; font-size: 16px; }

/* ---- intro: the mark is drawn in blueprint line, then filled ---- */
.intro { background: radial-gradient(ellipse at center, rgba(11,31,74,.0) 0%, #00133A 75%), repeating-linear-gradient(0deg, rgba(98,210,255,.07) 0 1px, transparent 1px 40px), repeating-linear-gradient(90deg, rgba(98,210,255,.07) 0 1px, transparent 1px 40px), #0B1F4A; }
.intro-logo path { fill: rgba(255,255,255,0); stroke: var(--cyan); stroke-width: 1.3px; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.intro-tag { color: #C9A961; }
