/* unlck.cards. A dark desk at night with one sheet of paper on it: the code
   slip, then the card's own page. Theme-neutral until a card is identified
   (spec 8); a theme's reveal.css restyles the sheet. Brand palette and type
   from docs/DESIGN-STANDARDS.md. */
@font-face { font-family: "Courier Prime"; font-weight: 700; font-style: normal; font-display: swap; src: url("/static/fonts/courier-prime-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }

@font-face { font-family: "Courier Prime Fallback"; src: local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"); size-adjust: 100%; ascent-override: 78.1%; descent-override: 34.2%; line-gap-override: 0%; }
@font-face { font-family: "Source Serif 4 Fallback"; font-weight: 400; src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"); size-adjust: 119%; ascent-override: 87.1%; descent-override: 28.2%; line-gap-override: 0%; }
:root {
  --ink: #2e3139;
  --rust: #a7452b;
  --rust-light: #d9774f; /* the accent on the dark desk: 5.1:1 on --desk */
  --paper: #f5f0e6;
  --muted: #5b5d63;
  --desk: #17181c;
  --desk-text: #e9e3d6;
  --desk-muted: #a9a49b;
  --focus: #2f7fd8;
  --type: "Courier Prime", "Courier Prime Fallback", "Courier New", ui-monospace, monospace;
  --serif: "Source Serif 4", Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 80% at 50% 0%, #262830 0%, var(--desk) 60%) fixed, var(--desk);
  color: var(--desk-text);
  font: 400 1.0625rem/1.6 var(--serif);
}
main { width: 100%; max-width: 32rem; margin: 0 auto; padding: clamp(2rem, 8vh, 4.5rem) 1rem 3rem; }
img { max-width: 100%; }

/* The wordmark, typed. */
h1 { margin: 0 0 1.25rem; font: 700 clamp(2rem, 9vw, 2.6rem)/1 var(--type); letter-spacing: 0.01em; }
h1 .dot { color: var(--rust-light); }
p { margin: 0 0 1rem; }
.muted { color: var(--desk-muted); }
.small { font-size: 0.9rem; }
a { color: var(--rust-light); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---- The sheet: paper on the desk ---- */
.sheet, .answer-panel, .reveal {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding: 1.75rem 1.25rem 1.5rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 18px 40px -12px rgba(0, 0, 0, 0.7);
}
.sheet .muted, .answer-panel .muted, .reveal .muted { color: var(--muted); }
.sheet a, .answer-panel a, .reveal a { color: var(--rust); }
.code-sheet { transform: rotate(-0.6deg); }
.code-sheet__prompt { font: 700 0.95rem/1.4 var(--type); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.25rem; }
.desk-note { margin-top: 1.75rem; color: var(--desk-muted); font-size: 0.95rem; }

/* ---- Forms on paper ---- */
label { display: block; font: 700 0.85rem/1.3 var(--type); margin: 1rem 0 0.35rem; }
input[type="text"], input[type="email"], textarea, select {
  width: 100%; min-height: 52px; padding: 0.6rem 0.75rem; font: 400 1.2rem/1.2 var(--serif);
  color: var(--ink); background: #fff; border: 1.5px solid var(--ink); border-radius: 0;
}
textarea { min-height: 8rem; font-size: 1.05rem; line-height: 1.45; resize: vertical; }
.code-input { font: 700 2rem/1 var(--type); letter-spacing: 0.35em; text-transform: uppercase; text-align: center; padding-left: 0.35em; }
input[aria-invalid="true"] { border-color: var(--rust); border-width: 2px; }
button {
  margin-top: 1rem; width: 100%; min-height: 52px; padding: 0.8rem 1rem; font: 700 1rem/1 var(--type); letter-spacing: 0.06em;
  color: var(--paper); background: var(--ink); border: 0; border-radius: 0; cursor: pointer; text-transform: uppercase;
}
button:hover { background: var(--rust); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.notice { border-left: 4px solid var(--rust); background: #fbeee9; padding: 0.6rem 0.8rem; color: #8c3a23; }
.card-code { display: inline-block; font: 700 0.85rem/1 var(--type); letter-spacing: 0.25em; color: var(--muted); margin: 0 0 1rem; }
.answer-heading { font: 700 1.8rem/1.15 var(--type); margin: 0 0 1rem; }

/* A "letters" answer: one box per letter, each with this card's prompt. */
.letters { border: 0; margin: 1rem 0 0; padding: 0; min-width: 0; }
.letters legend { font: 700 0.85rem/1.3 var(--type); padding: 0; margin-bottom: 0.25rem; }
.letters__rows { list-style: none; margin: 0; padding: 0; }
.letters__row { display: grid; grid-template-columns: 1fr 3.25rem; align-items: center; column-gap: 0.75rem; border-bottom: 1px solid rgba(46, 49, 57, 0.18); padding: 0.4rem 0; }
.letters__row label { margin: 0; font: 400 1.05rem/1.3 var(--serif); }
.letter-input { min-height: 52px; padding: 0.4rem 0; text-align: center; text-transform: uppercase; font: 700 1.6rem/1 var(--type); }

/* ---- Lifeline, hints, word check ---- */
.hints { margin: 1.5rem 0 0; padding-left: 1.25rem; }
.hints li { margin-bottom: 0.5rem; }
.lifeline button { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.lifeline--highlight button { border-color: var(--rust); color: var(--rust); }
.lifeline button:hover { background: var(--ink); color: var(--paper); }
.stuck { margin-top: 1.5rem; font-size: 0.95rem; }
.word-check { margin-top: 1.5rem; border-top: 1px solid rgba(46, 49, 57, 0.18); padding-top: 0.75rem; }
.word-check summary { cursor: pointer; font: 700 1rem/1.3 var(--type); min-height: 44px; display: flex; align-items: center; }
.word-check__result { font-weight: 700; margin: 0.5rem 0 0; }

/* ---- Cut-out headings (theme scans) ---- */
.cutout { display: inline-flex; flex-wrap: wrap; gap: 0.15em 0.55em; line-height: 1; }
.cutout__word { display: inline-flex; align-items: center; gap: 0.06em; white-space: nowrap; }
.cutout__letter { height: 1.45em; width: auto; transform: rotate(var(--turn, 0deg)); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }
.cutout__char { font: 700 1em/1 var(--type); }

/* ---- Decoder: one symbol at a time ---- */
.decoder { margin-top: 1.75rem; border-top: 1px solid rgba(46, 49, 57, 0.18); padding-top: 1rem; }
.decoder__title { font: 700 1rem/1.3 var(--type); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.35rem; }
.decoder__intro { font-size: 0.95rem; color: var(--muted); }
.decoder__prompt { font: 700 1.05rem/1.2 var(--type); letter-spacing: 0.04em; text-transform: uppercase; text-align: center; margin: 0.75rem 0 0.25rem; }
.decoder__key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr)); gap: 0.5rem; }
.decoder__symbol {
  margin: 0; width: 100%; min-height: 0; padding: 0.5rem 0.25rem; background: #fff; color: var(--ink);
  border: 1.5px solid var(--ink); display: grid; justify-items: center; gap: 0.35rem; text-transform: none;
}
.decoder__symbol:hover { background: #fff; color: var(--rust); }
.decoder__symbol img { height: 3.5rem; width: auto; }
.decoder__char { font: 700 1.1rem/1 var(--type); }
.decoder__key--one { display: block; }
.decoder__key--one .decoder__symbol { max-width: 13rem; margin: 0 auto; padding: 1rem 1rem 0.75rem; gap: 0.75rem; }
.decoder__key--one .decoder__symbol img { height: 9rem; }
.decoder__key--one .decoder__char { font-size: 2.25rem; }
.decoder__back { text-align: center; margin: 0.5rem 0 0; }
.decoder__prev { width: auto; min-height: 44px; margin: 0; padding: 0.5rem 1rem; background: transparent; color: var(--ink); text-decoration: underline; text-transform: none; letter-spacing: 0; font-weight: 400; }
.decoder__prev:hover { background: transparent; color: var(--rust); }

/* ---- The reveal ---- */
.reveal__title { font: 700 0.95rem/1.2 var(--type); letter-spacing: 0.08em; text-transform: uppercase; color: var(--rust); margin: 0 0 0.75rem; }
.reveal__name { font: 700 2rem/1.1 var(--type); margin: 0 0 1rem; }
.reveal__message p { font-size: 1.2rem; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  body { background: #fff; color: #000; }
  .lifeline, .stuck, .word-check, .decoder, button { display: none; }
  .answer-panel, .reveal { box-shadow: none; }
}

/* ---- Theme lab banner (Ops only; unlck.cards never renders it) ---- */
.test-banner { background: #f2d24b; color: #1d1a16; padding: 0.6rem 1rem; font: 400 0.9rem/1.4 var(--type); border-bottom: 3px dashed #1d1a16; }
.test-banner p { margin: 0 0 0.25rem; }
.test-banner__label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.test-banner__actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.test-banner__actions a { color: inherit; }
.test-banner__actions form { margin: 0; }
.test-banner__actions button { width: auto; min-height: 36px; margin: 0; padding: 0.35rem 0.75rem; font-size: 0.85rem; }

/* ---- Hints: one sheet per puzzle, hints opened one at a time ---- */
.ladder, .stuck-ask { margin: 0 0 1.25rem; }
.ladder:nth-of-type(odd) { transform: rotate(-0.4deg); }
.ladder:nth-of-type(even) { transform: rotate(0.35deg); }
.ladder__title { margin: 0 0 0.75rem; font: 700 1.05rem/1.3 var(--type); letter-spacing: 0.02em; }
.ladder__hints { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.ladder__hints li { padding: 0.55rem 0; border-top: 1px dashed rgba(46, 49, 57, 0.25); line-height: 1.5; }
.ladder__n { display: block; font: 700 0.75rem/1.2 var(--type); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.15rem; }
.ladder__answer { margin: 0.25rem 0 0; padding: 0.7rem 0.8rem; border-left: 3px solid var(--rust); background: rgba(167, 69, 43, 0.06); line-height: 1.5; }
.ladder__more button { margin-top: 0.25rem; }
.ladder__button--answer { background: transparent; color: var(--rust); border: 1.5px solid var(--rust); }
@media (prefers-reduced-motion: reduce) { .ladder { transform: none !important; } }
