:root {
  color-scheme: dark;
  --bg: #151426;
  --surface: #201e34;
  --ink: #f5f2ff;
  --muted: #c5bfd6;
  --line: #463f5d;
  --accent: #d5c3ff;
  --correct: #bcf7d5;
  --correct-bg: #203c37;
  font: 100%/1.55 "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
h1, h2, p { margin-top: 0; }
h1 {
  font: 400 clamp(4rem, 11vw, 8rem)/.95 Georgia, serif;
  letter-spacing: -.065em;
  margin-bottom: 1.2rem;
}
.subject { color: var(--accent); font-weight: 650; margin-bottom: 1.1rem; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

.gate-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 9% 86%, #352957 0%, transparent 55%),
    var(--bg);
}
.gate {
  width: min(100%, 27rem);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2rem 6rem #100d20aa;
}
.access { padding: clamp(1.7rem, 5vw, 2.5rem); }
.access label { display: block; margin-bottom: .55rem; font-weight: 650; }
.access input, button { font: inherit; border-radius: .55rem; min-height: 3rem; }
.access input {
  display: block;
  width: 100%;
  border: 1px solid #85769e;
  padding: .65rem .8rem;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, Consolas, monospace;
}
.access input[aria-invalid] { border-color: #ffb9cd; }
.error { margin: .6rem 0 0; color: #ffb9cd; font-size: .93rem; }
button {
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--accent);
  color: #24153e;
  font-weight: 700;
  padding: .5rem 1rem;
}
button:hover { background: #e4d8ff; }
button:active { background: #c3a5ff; }
.access button { margin-top: 1rem; width: 100%; }

.shell { width: min(100% - 3rem, 68rem); margin-inline: auto; }
.masthead {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  padding: 3.5rem 0 1.8rem;
  border-bottom: 1px solid var(--line);
}
.masthead h1 { font-size: clamp(3.6rem, 8vw, 6.2rem); }
.masthead .muted, .session p { margin-bottom: 0; }
.session { text-align: right; color: var(--muted); }
.session p { font-size: .875rem; }
.session code { display: block; color: var(--accent); margin-bottom: .6rem; }
.secondary { background: transparent; color: var(--ink); border-color: #85769e; }
.secondary:hover, .secondary:active { background: #34294d; }
.review { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 2rem; padding-block: 2rem 4rem; }
.index { position: sticky; top: 1.5rem; align-self: start; }
.index h2 { font-size: 1rem; margin-bottom: .65rem; }
.index div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .32rem; }
.index a {
  min-height: 2.75rem;
  display: grid;
  place-items: center;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: .35rem;
}
.index a:hover { background: #34294d; border-color: var(--accent); }
.question {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .8rem;
  margin-bottom: 1rem;
  padding: clamp(.9rem, 3vw, 1.5rem);
  scroll-margin-top: 1rem;
}
.question:target { border-color: var(--accent); }
.question h2 {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .72rem;
  font-size: clamp(1.025rem, 2vw, 1.22rem);
  line-height: 1.46;
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}
.ticket { text-align: right; margin-bottom: .5rem; color: #aaa0c0; font: .76rem ui-monospace, Consolas, monospace; }
.number { font: 650 .9rem/2 ui-monospace, Consolas, monospace; color: var(--accent); }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.choices li, .short { border-radius: .4rem; padding: .5rem .7rem; border: 1px solid transparent; }
.choices li { display: grid; grid-template-columns: 1.15rem minmax(0, 1fr) auto; gap: .4rem; }
.option { color: var(--muted); }
.choices .correct, .short.correct { color: var(--correct); background: var(--correct-bg); border-color: #42685a; }
.answer-label { font-size: .8125rem; align-self: center; }
.short { margin: 0; display: flex; flex-wrap: wrap; gap: .7rem; }
.short code { font-size: 1em; }
.watermark {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  color: #d9cdff;
  opacity: .13;
  font: 650 clamp(.65rem, 1.2vw, .85rem) ui-monospace, Consolas, monospace;
}
.watermark span { transform: rotate(-24deg); }
.print-note { display: none; }

@media (max-width: 42rem) {
  .review { grid-template-columns: minmax(0, 1fr); }
  .masthead { padding-top: 2rem; align-items: start; }
  .masthead h1 { margin-bottom: .7rem; }
  .shell { width: calc(100% - 1.5rem); }
  .review { gap: 1rem; padding-top: 1.25rem; }
  .index { position: static; }
  .index div { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .index a { min-width: 0; }
  .choices .answer-label { grid-column: 2; }
}

@media (max-width: 26rem) {
  .masthead { flex-direction: column; }
  .session { display: flex; align-items: center; gap: 1rem; text-align: left; }
  .session code { margin: 0; }
  .index div { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media print {
  .protected { display: none; }
  .print-note { display: block; color: #000; }
}
