/* The public demo's email step (templates/demo/gate.html; Jon, 2026-11-24: "this page needs to be a lot better anyway,
   its quite dull"). It stands alone, outside the app shell, dark by default (theme_lock) and correct in light too: every
   colour is a product token. The squared look: 2 px radii from the tokens, mono eyebrows, squares for marks, structure
   from 1 px rules and the band colour, no coloured edge bars. The scene behind is the chooser's blueprint grid and two
   soft lights (deploy/demo/chooser/index.html), drawn here from the product's tokens so the two steps read as one.
   Motion: one quiet rise on first paint, nothing that loops, none at all with reduced motion; the animation fills
   backwards only, so nothing holds a transform (or a stacking context) once it has run. */

.focus-shell:has(> .gate-frame) {
  --gate-grid: color-mix(in srgb, var(--title) 5%, transparent);
  position: relative; isolation: isolate; place-items: center; align-content: center;
  padding: clamp(20px, 3.2vw, 56px) clamp(16px, 4vw, 72px);
  background: radial-gradient(60% 55% at 86% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 72%),
              radial-gradient(48% 55% at 0% 100%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 72%),
              var(--canvas);
}
.focus-shell:has(> .gate-frame)::before {           /* the blueprint grid, fading out towards the edges */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--gate-grid) 1px, transparent 1px) 0 0 / 48px 48px,
              linear-gradient(90deg, var(--gate-grid) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image: radial-gradient(110% 85% at 60% 35%, #000 35%, transparent 100%);
          mask-image: radial-gradient(110% 85% at 60% 35%, #000 35%, transparent 100%);
}
.focus-shell .focus-card.gate-frame { width: min(1520px, 100%); }
.gate-frame .focus-brand { justify-content: flex-start; margin-bottom: clamp(22px, 3vw, 40px); }
.gate-frame .focus-brand img { height: 34px; }
.gate-frame > footer { margin-top: clamp(24px, 3vw, 40px); }

/* -- the two columns ------------------------------------------------------------------------------------------------ */
.demo-enter.demo-gate { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; justify-items: stretch; align-items: start; text-align: left; }
@media (min-width: 1000px) {
  .demo-enter.demo-gate { grid-template-columns: minmax(340px, 412px) minmax(0, 1fr); gap: clamp(48px, 5.5vw, 104px); }
}
/* a very wide screen: the same page, larger, not a small island in an empty screen */
@media (min-width: 2200px) { .focus-shell .focus-card.gate-frame { zoom: 1.22; } }
@media (min-width: 2500px) { .focus-shell .focus-card.gate-frame { zoom: 1.34; } }

/* -- the form side -------------------------------------------------------------------------------------------------- */
.gate-form { display: grid; align-content: start; gap: 0; min-width: 0; }
.gate-steps { display: flex; align-items: center; gap: 0; margin: 0 0 28px; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.gate-steps li { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.gate-steps li:not(:last-child) { flex: 1 1 auto; }
.gate-steps li:not(:last-child)::after { content: ""; flex: 1 1 12px; min-width: 12px; height: 1px; margin: 0 10px; background: var(--border-strong); }
.gate-step-n { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); font: 500 10.5px/1 var(--font-mono); letter-spacing: .04em; color: var(--muted); background: var(--surface); }
.gate-steps li.is-now { color: var(--title); font-weight: 500; }
.gate-steps li.is-now .gate-step-n { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.gate-steps li.is-done .gate-step-n { border-color: var(--accent); background: var(--accent); color: var(--surface); }
.gate-steps li.is-done::after { background: var(--accent); }

.gate-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.gate-eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--success, #16a34a); }      /* the demo is live: a square, not a dot */
.demo-gate h1 { margin: 12px 0 14px; font-family: var(--font-display); font-size: clamp(30px, 2.5vw, 42px); line-height: 1.08; font-weight: 700;
  letter-spacing: -.018em; color: var(--title); text-wrap: balance; }
.demo-gate .demo-note { margin: 0 0 26px; max-width: 42ch; font-size: 15px; line-height: 1.55; color: var(--text); }
.demo-gate .demo-note strong { color: var(--title); font-weight: 600; overflow-wrap: anywhere; }

.gate-card { display: grid; gap: 16px; margin: 0; padding: 22px 22px 20px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.gate-field { display: grid; gap: 7px; }
.gate-field > label { font-size: 13px; font-weight: 600; color: var(--title); }
.gate-field > input { height: 46px; padding: 0 14px; font-size: 15.5px; background: var(--bg); }
.gate-field > input.gate-code { height: 60px; padding: 0 12px 0 calc(12px + .42em); font: 500 28px/1 var(--font-mono); letter-spacing: .42em;
  text-align: center; font-variant-numeric: tabular-nums; }
.gate-field > input.gate-code::placeholder { letter-spacing: .42em; color: var(--faint); }
.gate-field.has-error > input { border-color: var(--danger); }
.gate-field.has-error > input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 28%, transparent); }
.gate-error { display: flex; gap: 9px; align-items: baseline; margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--danger-text); }
.gate-error::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--danger); transform: translateY(-1px); }
.gate-hint { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.gate-consent { font-size: 13.5px; color: var(--text); align-items: flex-start; }
.gate-consent input { margin: 2px 0 0; flex: none; }
.gate-go { width: 100%; min-height: 46px; font-size: 14.5px; font-weight: 600; }
.gate-kept, .gate-links { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.gate-links { padding-top: 12px; border-top: 1px solid var(--border); }
.gate-links a { overflow-wrap: anywhere; }
.gate-again { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.gate-resend { display: flex; align-items: center; gap: 8px; margin: 0; }
.gate-resend button.link { margin-left: -6px; font-size: 13px; }
.gate-resend button.link:disabled { opacity: .45; cursor: not-allowed; background: none; }
.gate-wait { font: 12px/1 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.gate-wait:empty { display: none; }

/* -- the other side: what the visitor walks into (information, not controls: no hover, no pointer, nothing selected) -- */
.gate-world { display: grid; gap: 20px; min-width: 0; }
.gate-world-head .eyebrow { color: var(--muted); }
.gate-world-head h2 { margin: 8px 0 6px; font-family: var(--font-display); font-size: clamp(20px, 1.6vw, 26px); line-height: 1.2; font-weight: 700;
  letter-spacing: -.01em; color: var(--title); }
.gate-world-head p { margin: 0; font-size: 14px; color: var(--muted); max-width: 72ch; }
.gate-cos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.gate-co { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-md); }
/* each company as one drawing, its sites side by side on shared Purdue level rows: the website demo page's drawing
   (website/demo.html, .dm-stacks), generated into gate.html by website/tools/build_demo_stacks.py. Level colours are the
   product's (--l0 .. --l4, cinqstack.css); the firewall dash is the website's amber, which the product has no token for.
   Still: no motion. Drawn for a phone card (320 units, about 1 px each there), never wider than 420 px. */
.gate-co figure { --fw: #b45309; --tint: 21%; display: flex; flex-direction: column; margin: 0; border-bottom: 1px solid var(--border); }
:root[data-theme="dark"] .gate-co figure { --fw: #ff9d5c; --tint: 24%; }
.gate-stacks { flex: 1; display: grid; align-content: center; padding: 20px 12px 10px; background: var(--bg); }   /* side by side, the strips line up */
.gate-stacks svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; overflow: visible; }
.gate-stacks .l4 { --lv: var(--l4); } .gate-stacks .l35 { --lv: var(--l35); } .gate-stacks .l3 { --lv: var(--l3); }
.gate-stacks .l2 { --lv: var(--l2); } .gate-stacks .l1 { --lv: var(--l1); } .gate-stacks .l0 { --lv: var(--l0); }
.gate-stacks .datum { fill: none; stroke: color-mix(in srgb, var(--lv) 34%, transparent); stroke-width: 1; }
.gate-stacks .lab { font: 600 11.5px var(--font-mono); fill: var(--lv); }
.gate-stacks .face { fill: color-mix(in srgb, var(--lv) var(--tint), var(--bg)); stroke: color-mix(in srgb, var(--lv) 55%, transparent); stroke-width: 1; }
.gate-stacks .edge, .gate-stacks circle { fill: var(--lv); }
.gate-stacks .fw { fill: none; stroke: var(--fw); stroke-width: 2; stroke-dasharray: 6 4; }
.gate-stacks .name { font: 600 12px var(--font-display); fill: var(--title); }
.gate-co figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 9px 14px; border-top: 1px solid var(--border);
  font: 500 11px/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.gate-co figcaption b { font-weight: 600; color: var(--title); }
.gate-co figcaption .dash { display: inline-block; width: 22px; margin: 0 8px 0 16px; border-top: 2px dashed var(--fw); vertical-align: middle; }
.gate-co-body { display: grid; gap: 10px; align-content: start; flex: 1; padding: 16px 18px 16px; }
.gate-co-body h3 { margin: 0; font-family: var(--font-display); font-size: 19px; line-height: 1.2; font-weight: 700; color: var(--title); }
.gate-kind { display: flex; align-items: center; gap: 8px; margin-top: -4px; font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); }
.gate-co-body > p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.gate-sites, .gate-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.gate-sites li { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 8px; font-size: 12px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.gate-sites li .mono { font-size: 10.5px; letter-spacing: .04em; color: var(--title); }
.gate-levels li { padding: 2px 6px; font: 600 10.5px/1.4 var(--font-mono); letter-spacing: .03em; color: var(--lv-t); background: var(--lv-c); border-radius: var(--radius); }
.gate-levels .l4 { --lv-t: var(--lt4); --lv-c: var(--lc4); } .gate-levels .l35 { --lv-t: var(--lt35); --lv-c: var(--lc35); }
.gate-levels .l3 { --lv-t: var(--lt3); --lv-c: var(--lc3); } .gate-levels .l2 { --lv-t: var(--lt2); --lv-c: var(--lc2); }
.gate-levels .l1 { --lv-t: var(--lt1); --lv-c: var(--lc1); } .gate-levels .l0 { --lv-t: var(--lt0); --lv-c: var(--lc0); }
.gate-co-body > p.gate-vendors { margin: 2px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font: 11px/1.45 var(--font-mono); color: var(--muted); }

.gate-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 1px; margin: 0; padding: 0; list-style: none;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gate-facts li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; font-size: 12.5px; line-height: 1.45; color: var(--muted);
  background: color-mix(in srgb, var(--band, var(--surface-2)) 94%, transparent); }
.gate-facts li i { flex: none; width: 14px; margin-top: 2px; font-size: 12.5px; text-align: center; color: var(--accent); }
.gate-facts li b { display: block; margin-bottom: 1px; font-size: 13px; font-weight: 600; color: var(--title); }

/* -- a phone ------------------------------------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .gate-frame .focus-brand img { height: 28px; }
  .gate-steps { margin-bottom: 22px; }
  .gate-steps li:not(.is-now) > span:last-child { display: none; }       /* the numbers keep the place; the current step says what it is */
  .gate-card { padding: 18px 16px 16px; }
  .demo-gate h1 { font-size: 28px; }
  .demo-gate .demo-note { font-size: 14.5px; margin-bottom: 20px; }
}

/* -- first paint ----------------------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .gate-form, .gate-world { animation: gate-rise .48s cubic-bezier(.2, .7, .2, 1) backwards; }
  .gate-world { animation-delay: .07s; }
}
@keyframes gate-rise { from { opacity: 0; transform: translateY(8px); } }
