/* © 2026 Cromulent, Inc. All Rights Reserved.
   door.css - the suite's one sign-in door, laid out the same on every product (Maestro, 2026-11-20: "all of the login
   pages need to be standardized and identically laid out, but branded with a hero"). Served by the edge at
   /_cromulent/door.css on every product host (conf.d/_mark.caddy), so one file lays every door out. standpoints' /login
   is its own page and does not load it.

   SPAWN IS THE MODEL (its gate took the suite's longest run of passes): the word large under a central hero, the
   fields stacked under it with mono labels, one full-width button in the lead, the PIN line, and the other ways in
   quiet at the foot. Only the hero differs from product to product (door.js draws it), and the hero is black, white
   and the product's lead, cromulent.tech style, as the research pages are.

   THE CONTRACT. A product's door is this markup (tests/deploy/test_suite_door.py reads every door against it):
     <section class="cd-door" data-product="NAME" style="--cd-lead:#RRGGBB">
       <figure class="cd-hero"><canvas></canvas><button class="cd-pause" type="button">Pause</button></figure>
       <div class="cd-word"><h1 class="cd-title">NAME<i class="cd-pt"></i></h1><p class="cd-line">...</p></div>
       <form class="cd-form"> .cd-say, then .cd-label + .cd-input pairs, an optional .cd-hint, .cd-door .cd-go </form>
       <p class="cd-pin">Need a PIN, or forgot it? ...</p>
       <nav class="cd-others"> the advisor and admin ways in </nav>
       <p class="cd-legal"> the legal line (docs/brand/cromulentech-brand.md) </p>
     </section>
   A product keeps its own ids, names and submit wiring on the form; the door only lays it out. The word is the
   product's name in the suite's grotesque on every door, as it is on every front page (wchesher, 2026-11-25: "put all
   of the product names in this font", "just on the front"); the product's own faces reach the rest of the door through
   --cd-body and --cd-mono (set where the product sets --cd-lead). */

/* the suite's grotesque for the word, served beside this file (fonts/, OFL-1.1, fonts/bricolage-grotesque-OFL.txt;
   the Fontsource 5.2.5 latin build, byte-identical to spawn's static/fonts copy), so a door draws its name in the same
   face whichever product it is on, a strict style policy included (font-src 'self') */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/bricolage-grotesque-var-latin.woff2") format("woff2"); }

.cd-door {
  --cd-ink: #f4f5f6;
  --cd-muted: #9aa0a8;
  --cd-line-colour: rgba(255, 255, 255, .16);
  --cd-ground: #000;
  --cd-field: #0b0c0e;
  --cd-bad: #ff6b5e;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-height: min(100svh, 900px);
  margin: 0;
  padding: clamp(24px, 6vh, 64px) 16px clamp(28px, 6vh, 56px);
  display: grid;
  align-content: center;
  justify-items: center;
  background: var(--cd-ground);
  color: var(--cd-ink);
  font-family: var(--cd-body, system-ui, -apple-system, "Segoe UI", sans-serif);
  text-align: center;
  isolation: isolate;
}
.cd-door *, .cd-door *::before, .cd-door *::after { box-sizing: border-box; }

/* EACH PRODUCT'S LEAD AND TYPE, here and not on the page: a product whose Content-Security-Policy refuses inline style
   (tag's is style-src 'self') still gets its colour. The leads are A+ (docs/brand/cromulentech-brand.md, the lineup
   line); sfhsbta/admin/test_product_leads.py holds this copy to it. The faces are each product's own tokens. */
.cd-door[data-product="spawn"] { --cd-lead: #95FE46; --cd-display: var(--display); --cd-body: var(--body); --cd-mono: var(--mono); }
.cd-door[data-product="bench"] { --cd-lead: #D386F3; --cd-display: var(--disp); --cd-body: var(--body); --cd-mono: var(--mono); }
.cd-door[data-product="launch"] { --cd-lead: #FD8719; }
.cd-door[data-product="glitch"] { --cd-lead: #FD52E1; }
.cd-door[data-product="tag"] { --cd-lead: #EDC81E; --cd-display: var(--display); --cd-body: var(--body); --cd-mono: var(--mono); }
.cd-door[data-product="claim"] { --cd-lead: #D51249; --cd-on-lead: #fff; --cd-display: var(--face); --cd-body: var(--face); --cd-mono: var(--mono); }
.cd-door[data-product="train"] { --cd-lead: #0D72DA; --cd-on-lead: #fff; }
.cd-door[data-product="data"] { --cd-lead: #72E3FE; --cd-display: var(--disp); --cd-body: var(--disp); --cd-mono: var(--mono); }
.cd-door[data-product="standpoints"] { --cd-lead: #8434F4; --cd-on-lead: #fff; }

/* a page that is the door wears its black edge to edge (a door inside another page, spawn's gate, brings its own) */
body:has(main.cd-door) { background: #000; }
/* a product's page-wide grain and vignette (claim's body::before and ::after) stay off the door: the vignette sat over
   the door's foot and greyed its button and its legal line at a phone's height */
body:has(main.cd-door)::before, body:has(main.cd-door)::after { display: none; }
.cd-door[hidden] { display: none; }

/* the hero: one central figure, the product's own kinetic drawing (door.js) */
.cd-door .cd-hero { position: relative; width: min(100%, 440px); height: clamp(132px, 22vh, 196px); margin: 0 0 18px; }
.cd-door .cd-hero canvas { display: block; width: 100%; height: 100%; }
.cd-door .cd-pause {
  position: absolute; right: 0; bottom: 0; padding: 4px 8px; border: 1px solid var(--cd-line-colour); border-radius: 999px;
  background: transparent; color: var(--cd-muted); cursor: pointer;
  font: 500 11px/1 var(--cd-mono, ui-monospace, "SFMono-Regular", Menlo, monospace); letter-spacing: .08em; text-transform: lowercase;
}
/* quiet by colour, never by opacity: at half opacity the word read at 2.9:1 on black, under AA */
.cd-door .cd-pause:hover, .cd-door .cd-pause:focus-visible { color: var(--cd-ink); border-color: var(--cd-muted); }
.cd-door .cd-pause:focus-visible { outline: 2px solid var(--cd-lead, #fff); outline-offset: 2px; }

/* the word: the product's name, large, its full stop in the lead */
.cd-door .cd-word { width: min(100%, 440px); margin: 0 0 28px; }
.cd-door .cd-title {
  margin: 0; color: var(--cd-ink); font: 700 clamp(56px, 15vw, 96px)/.95 "Bricolage Grotesque", var(--cd-display, var(--cd-body, system-ui, -apple-system, "Segoe UI", sans-serif));
  letter-spacing: -.03em; text-transform: lowercase;
}
/* a long name steps down so it holds one line at the door's width */
.cd-door[data-long] .cd-title { font-size: clamp(40px, 11vw, 66px); }
.cd-door .cd-pt { display: inline-block; width: .16em; height: .16em; margin-left: .05em; background: var(--cd-lead, #fff); vertical-align: baseline; }
.cd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cd-door .cd-line {
  margin: 12px 0 0; color: var(--cd-muted);
  font: 400 12px/1.4 var(--cd-mono, ui-monospace, "SFMono-Regular", Menlo, monospace); letter-spacing: .14em; text-transform: uppercase;
}

/* the form: label over field, the same on every product */
.cd-door .cd-form { width: min(100%, 440px); display: grid; gap: 8px; margin: 0; text-align: left; }
.cd-door .cd-form[hidden] { display: none; }
.cd-door .cd-label {
  display: block; margin: 0; color: var(--cd-muted);
  font: 500 12px/1.4 var(--cd-mono, ui-monospace, "SFMono-Regular", Menlo, monospace); letter-spacing: .1em; text-transform: uppercase;
}
.cd-door .cd-input + .cd-label { margin-top: 10px; }
.cd-door .cd-input {
  display: block; width: 100%; min-height: 52px; padding: 12px 14px; margin: 0;
  border: 1px solid var(--cd-line-colour); border-radius: 8px; background: var(--cd-field); color: var(--cd-ink);
  font: 400 18px/1.2 var(--cd-body, system-ui, -apple-system, "Segoe UI", sans-serif); appearance: none;
}
.cd-door .cd-input::placeholder { color: #5d636b; }
.cd-door .cd-input:focus { outline: none; border-color: var(--cd-lead, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cd-lead, #fff) 30%, transparent); }
.cd-door .cd-hint { margin: 2px 0 0; color: var(--cd-muted); font-size: 14px; line-height: 1.4; }
.cd-door .cd-go {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin: 10px 0 0; padding: 12px 18px;
  border: 0; border-radius: 8px; background: var(--cd-lead, #fff); color: var(--cd-on-lead, #000); cursor: pointer;
  font: 700 18px/1 var(--cd-body, system-ui, -apple-system, "Segoe UI", sans-serif); text-align: center; text-decoration: none;
}
.cd-door .cd-go:hover { filter: brightness(1.08); }
.cd-door .cd-go:focus-visible { outline: 2px solid var(--cd-ink); outline-offset: 3px; }
.cd-door .cd-go:disabled { opacity: .55; cursor: progress; }
/* the second button (signed in: Sign out under the way on) is an outline, so the lead button stays the one way on */
.cd-door .cd-go.quiet { background: transparent; color: var(--cd-ink); border: 1px solid var(--cd-line-colour); }
.cd-door .cd-go.quiet:hover { filter: none; border-color: var(--cd-muted); }

/* what the door says back: a refusal, or a note on the way in; empty, it takes no room */
.cd-door .cd-say { margin: 0 0 6px; padding: 10px 12px; border-left: 3px solid var(--cd-bad); background: rgba(255, 107, 94, .08); color: var(--cd-ink); font-size: 15px; line-height: 1.4; }
.cd-door .cd-say:empty, .cd-door .cd-say[hidden] { display: none; }
.cd-door .cd-say.ok { border-left-color: var(--cd-lead, #fff); background: rgba(255, 255, 255, .05); }
.cd-door .cd-say p { margin: 0; }
.cd-door .cd-say p + p { margin-top: 4px; color: var(--cd-muted); }

/* the PIN line and the other ways in: quiet, centred, last */
.cd-door .cd-pin { width: min(100%, 440px); margin: 18px 0 0; color: var(--cd-muted); font-size: 14px; line-height: 1.5; }
.cd-door .cd-pin[hidden] { display: none; }
.cd-door .cd-pin a, .cd-door .cd-others a, .cd-door .cd-others button { color: var(--cd-ink); text-decoration: underline; text-decoration-color: var(--cd-lead, #fff); text-underline-offset: 3px; }
.cd-door .cd-others { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; width: min(100%, 440px); margin: 14px 0 0; font-size: 14px; }
.cd-door .cd-others a, .cd-door .cd-others button { padding: 6px 2px; background: none; border: 0; font: inherit; cursor: pointer; }
.cd-door .cd-others:empty { display: none; }
.cd-door .cd-pin a:focus-visible, .cd-door .cd-others a:focus-visible, .cd-door .cd-others button:focus-visible,
.cd-door .cd-legal a:focus-visible { outline: 2px solid var(--cd-lead, #fff); outline-offset: 2px; border-radius: 2px; }

/* signed in: who, and the way out, in the form's place */
.cd-door .cd-in { width: min(100%, 440px); display: grid; gap: 10px; margin: 0; }
.cd-door .cd-in[hidden] { display: none; }
.cd-door .cd-in p { margin: 0 0 4px; font-size: 18px; }

@media (prefers-reduced-motion: reduce) { .cd-pause { display: none; } }
@media print { .cd-door { background: #fff; color: #000; min-height: 0; } .cd-hero { display: none; } }

/* a product's own sentence-case rule (bench and spawn lift every heading's first letter) never reaches the door's word,
   which is the product's name and lowercase always */
.cd-door h1.cd-title::first-letter { text-transform: none; }
.cd-door button.cd-pause::first-letter { text-transform: lowercase; }

/* the ways in, as one group a page can hide when someone is signed in; it lays out as if it were not there */
.cd-ways { display: contents; }
.cd-ways[hidden] { display: none; }

/* right ID and PIN, but the product is closed for this student (the admin's access switches): its own state, never
   read as a wrong PIN, so it wears no warning colour */
.cd-door .cd-say.closed { border-left-color: var(--cd-muted); background: rgba(255, 255, 255, .05); }

/* THE LEGAL LINE AT THE DOOR'S FOOT (Maestro, 2026-11-20: "standardize terms of use and privacy links across 9 rooms and
   main site"): the one line every footer carries (docs/brand/cromulentech-brand.md, "Legal line"), small and quiet
   under the other ways in, so no sign-in page is the one page without it. */
.cd-door .cd-legal { width: min(100%, 440px); margin: 28px 0 0; color: var(--cd-muted); font-size: 12px; line-height: 1.5; }
.cd-door .cd-legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* A SHORT WINDOW (a 1366 by 768 school laptop, the same laptop zoomed to 125% or 150%, or a browser with its toolbars
   open: 768, 650, 614 and 512 pixels tall). The hero and the word give up their height so a refusal, both fields and
   the button stay inside the window: a student who typed a wrong PIN must see what the door said and the button to
   try again without scrolling. Measured on every product's door on five school screens (glitch's and train's are the
   tall ones: a hint under the PIN, and glitch's three-line refusal); sfhsbta/launch/test_console_door.py and
   tests/deploy/test_suite_door.py hold it. The door keeps its order. */
@media (max-height: 800px) {
  .cd-door { padding-top: clamp(16px, 3vh, 24px); }
  .cd-door .cd-hero { height: clamp(100px, 16vh, 132px); margin-bottom: 12px; }
}
@media (max-height: 720px) {
  .cd-door { padding-top: 16px; padding-bottom: 20px; }
  .cd-door .cd-hero { height: clamp(48px, 12vh, 100px); margin-bottom: 10px; }
  .cd-door .cd-title, .cd-door[data-long] .cd-title { font-size: clamp(36px, 10vh, 64px); }
  .cd-door .cd-word { margin-bottom: 12px; }
  .cd-door .cd-line { margin-top: 6px; }
}
@media (max-height: 560px) {
  .cd-door { padding-top: 10px; }
  .cd-door .cd-hero { height: 48px; margin-bottom: 6px; }
  .cd-door .cd-title, .cd-door[data-long] .cd-title { font-size: clamp(32px, 9vh, 64px); }
  .cd-door .cd-word { margin-bottom: 10px; }
  .cd-door .cd-form { gap: 6px; }
  .cd-door .cd-input, .cd-door .cd-go { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  .cd-door .cd-input + .cd-label { margin-top: 4px; }
  .cd-door .cd-hint { font-size: 13px; }
  .cd-door .cd-go { margin-top: 6px; }
  .cd-door .cd-say { margin-bottom: 2px; padding: 6px 10px; }
}
