/* The way in: a votive tablet caught in Arachne's web. Its body is ASCII
   drawn on the scene's grid by tablet.js (pediment, rings and silk, meander
   frame, chips, a broken corner) through the surface API. These styles are
   for what's ON it: real words and controls on a solid face, made to read
   first and to belong second. Prose is Literata; the controls and labels are
   JetBrains Mono, like the art.
   Contrast on the face (#19150f): body 15.0:1, strong 17.1:1, gold 10.4:1,
   muted 10.3:1, silver 10.9:1, error 8.9:1, green 9.6:1; the placeholder is
   7.4:1 in its well. --bronze/--ornament are never used for text here. */

.entry {
  --t-face: var(--face-tablet, #19150f);
  --t-well: #06080d;
  --t-ink: var(--text-body, #efe6d4);
  --t-strong: var(--text-strong, #fbf5e9);
  --t-mute: var(--text-muted, #b9c2d0);
  --t-gold: #f0c070;
  --t-gold-hi: #ffd894;
  --t-line: #9a7742;          /* control borders: lines, not text */
  --t-silver: #b8d4e4;
  --t-err: #ff9f8a;
  --t-ok: #94c9ae;
  --prose: "Literata", "Iowan Old Style", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  position: relative;
  max-width: 560px;
  margin: 110px auto calc(var(--lh, 20px) * 3);
}

/* The surface: the canvas draws the object; the room in the top padding is
   where its pediment goes. Only the face behind the words is painted here,
   so text never waits on a canvas frame while scrolling. */
.tablet {
  --surface-face: var(--t-face);
  padding: 92px 16px 30px;
}
.tablet[data-surface] { background: none; }
.tablet-face {
  /* the padding is left clear for the canvas's meander bands */
  padding: 32px 22px;
  background: var(--t-face);
  background-clip: content-box;
  color: var(--t-ink);
  font-family: var(--prose);
  font-size: 19px;
  line-height: 1.55;
}

/* ---------- Steps ---------- */

.tablet-steps {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-mute);
}
.tablet-steps li { display: inline-flex; align-items: center; gap: 6px; }
.tablet-steps .num { padding: 0 2px; }
.tablet-steps .num::before { content: "["; }
.tablet-steps .num::after { content: "]"; }
.tablet-steps li.current { color: var(--t-gold); }
.tablet-steps li.current .num { color: #120c05; background: var(--t-gold); }
.tablet-steps li.done { color: var(--t-ok); }
.tablet-steps li.done .num::before { content: "[x"; }
.tablet-steps li.done .num { font-size: 0; }
.tablet-steps li.done .num::before, .tablet-steps li.done .num::after { font-size: 14px; }
.tablet-steps li.done .num::after { content: "]"; }

.entry .tablet-title {
  display: block;
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: clamp(21px, 5vw, 25px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  color: var(--t-gold);
}
.entry .tablet-title::before, .entry .tablet-title::after { content: none; }
.entry .tablet-title:focus { outline: none; }

.step { display: grid; gap: 10px; }
.step[hidden] { display: none; }
.step > * { margin: 0; }

.t-lede { text-wrap: pretty; margin-bottom: 4px !important; }
.t-email { font-family: var(--mono); font-size: 0.9em; color: var(--t-gold); font-weight: 700; overflow-wrap: anywhere; }

.entry .t-label {
  display: block;
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-gold);
}
.entry .t-label::before { content: "> "; color: var(--t-mute); }
.entry .t-label.small { font-size: 14px; }
.t-optional { margin-left: 4px; color: var(--t-mute); font-weight: 400; text-transform: lowercase; }
.t-optional::before { content: "("; }
.t-optional::after { content: ")"; }

/* the wells you write in: solid, dark, square, with a bright focus */
.entry .t-input {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1.4;
  color: var(--t-strong);
  background: var(--t-well);
  border: 2px solid var(--t-line);
  border-radius: 0;
  caret-color: var(--t-gold-hi);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.entry .t-input.small { min-height: 48px; font-size: 17px; }
.entry textarea.t-input { min-height: 140px; font-size: 17px; line-height: 1.5; resize: vertical; }
.entry .t-input::placeholder { color: var(--text-placeholder, #95a1b5); opacity: 1; }
.entry .t-input:hover { border-color: #c09656; }
.entry .t-input:focus {
  outline: none;
  border-color: var(--t-gold-hi);
  background: #0a0d14;
  box-shadow: 0 0 0 3px rgba(255, 216, 148, 0.35), 0 0 22px rgba(255, 216, 148, 0.25);
}
.entry .t-input.code {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.5em;
  padding-left: calc(16px + 0.5em);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.entry .t-input.code::placeholder { color: #6d7486; }

/* ---------- The action: a solid gold plate, [ SEND ME A CODE ] ---------- */

.entry .t-btn {
  display: block;
  width: 100%;
  min-height: 58px;
  margin-top: 10px;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #120c05;
  background: var(--t-gold);
  border: 2px solid var(--t-gold-hi);
  border-radius: 0;
  cursor: pointer;
  animation: t-call 3.2s ease-in-out infinite;
}
.entry .t-btn::before { content: "[ "; }
.entry .t-btn::after { content: " ]"; }
.entry .t-btn:hover { background: var(--t-gold-hi); }
.entry .t-btn:focus-visible { outline: 3px solid var(--t-strong); outline-offset: 3px; background: var(--t-gold-hi); }
.entry .t-btn:active { transform: translateY(1px); }
.entry .t-btn:disabled { cursor: progress; opacity: 0.75; animation: none; }
.entry .t-btn.ghost {
  min-height: 48px;
  font-size: 15px;
  color: var(--t-gold);
  background: transparent;
  border: 2px solid var(--t-line);
  animation: none;
}
.entry .t-btn.ghost:hover, .entry .t-btn.ghost:focus-visible { color: #120c05; background: var(--t-gold); }

@keyframes t-call {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 216, 148, 0); }
  50% { box-shadow: 0 0 22px rgba(255, 216, 148, 0.45); }
}

.t-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; }
.entry .t-link {
  min-height: 44px;
  padding: 0 2px;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--t-silver);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(184, 212, 228, 0.55);
  cursor: pointer;
}
.entry .t-link:hover { color: var(--t-strong); text-decoration-color: currentColor; }
.entry .t-link:focus-visible { outline: 2px solid var(--t-gold-hi); outline-offset: 2px; }
.entry .t-link:disabled { color: var(--t-mute); text-decoration: none; cursor: default; }
.entry .t-link::before, .entry .t-link::after { content: none; }

.t-signed { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; color: var(--t-mute); }
.t-signed .t-link { min-height: 36px; font-size: 14px; }

.entry .t-hint { color: var(--t-mute); font-size: 16.5px; line-height: 1.5; text-wrap: pretty; }
.entry .t-hint::before { content: none; }
.t-hint q, .t-preview q { color: var(--t-ink); quotes: "\201C" "\201D"; }
.entry .t-note {
  padding: 8px 12px;
  color: var(--t-silver);
  font-size: 16.5px;
  border: 1px dashed var(--t-line);
}

/* what she understood from the free text: [kind] value */
.t-preview:empty { display: none; }
.t-preview { font-family: var(--mono); font-size: 14px; }
.t-preview-head { margin: 2px 0 6px; color: var(--t-ok); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.t-preview ul { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0; padding: 0; }
.t-preview li { color: var(--t-strong); overflow-wrap: anywhere; }
.t-preview li .k { color: var(--t-silver); }
.t-preview li .k::before { content: "["; }
.t-preview li .k::after { content: "]"; }
.t-preview li.not-me { color: var(--t-mute); text-decoration: line-through; }
.t-preview-warn { margin: 8px 0 0; color: var(--t-err); font-family: var(--prose); font-size: 16.5px; }
.t-preview-skip { margin: 8px 0 0; color: var(--t-mute); font-family: var(--prose); font-size: 16.5px; }

/* ---------- Consent: [x] ---------- */

.entry .t-consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 10px 0 0;
  padding: 14px;
  color: var(--t-strong);
  font-size: 19px;
  line-height: 1.45;
  background: var(--t-well);
  border: 2px solid var(--t-line);
  cursor: pointer;
}
.entry .t-consent:hover { border-color: #c09656; }
.t-consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.t-check {
  flex: none;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--t-gold);
  white-space: pre;
}
.t-check::before { content: "[ ]"; }
.t-consent input:checked + .t-check::before { content: "[x]"; }
.t-consent input:focus-visible + .t-check { color: #120c05; background: var(--t-gold-hi); outline: 2px solid var(--t-strong); outline-offset: 2px; }
.t-consent:has(input:checked) { border-color: var(--t-gold); }
.t-consent-text strong { color: var(--t-gold); }
.entry .t-fine { font-family: var(--mono); color: var(--t-mute); font-size: 13px; text-align: right; }

/* ---------- Disclosures: operator sign-in, replays ---------- */

.entry .t-more { margin: 4px 0 0; }
.entry .t-more summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  font-family: var(--mono);
  color: var(--t-silver);
  font-size: 15px;
  text-transform: none;
}
.entry .t-more summary::before { content: "[+] "; white-space: pre; color: var(--t-gold); }
.entry .t-more[open] summary::before { content: "[-] "; }
.entry .t-more summary:focus-visible { outline: 2px solid var(--t-gold-hi); outline-offset: 2px; }
.entry .t-more[open] { display: grid; gap: 8px; }
.entry .t-more > :not(summary) { margin: 0; }
.entry .replay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.entry .replay-list li { display: grid; }

/* ---------- Errors, on the tablet ---------- */

.entry .t-error {
  list-style: none;
  margin: 16px 0 0;
  padding: 11px 14px;
  color: var(--t-err);
  font-size: 17.5px;
  line-height: 1.45;
  background: #160805;
  border: 2px solid #e0644f;
}
.entry .t-error[hidden] { display: none; }
.entry .t-error li::before { content: "!! "; font-family: var(--mono); font-weight: 700; }

/* the engine's status, on the foot of the tablet */
.entry .t-mode {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--t-mute);
}
.entry .t-mode:empty { display: none; }
.entry .t-mode::before { content: "-- "; }
.entry .t-mode::after { content: " --"; }
/* simulating because no engine answered: a way to knock again */
.entry .t-retry { margin: 2px 0 0; text-align: center; }
.entry .t-retry[hidden] { display: none; }
.entry .t-retry .t-link { min-height: 36px; font-size: 14px; }

/* the loose footer line stays off while the tablet is up (its status is on
   the tablet instead); the audit view still shows it */
body:has(#form-view:not([hidden])) > footer { display: none; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Small screens ---------- */

@media (max-width: 520px) {
  .entry { margin-top: 96px; }
  .tablet { padding: 84px 14px 28px; }
  .tablet-face { padding: 30px 14px; font-size: 18px; }
  .entry .t-hint { font-size: 16px; }
  .entry .t-btn { font-size: 17px; letter-spacing: 0.05em; }
}

@media (prefers-reduced-motion: reduce) {
  .entry .t-btn { animation: none; }
  .entry .t-input { transition: none; }
}
