/*
  BlindGrader public site.
  Concept: the exam blue book. Blue cover bands frame the page; content sits on
  ruled paper; the one bold moment is the hero quiz page getting redacted.
  Light only by design (paper metaphor); every color is still a token.
*/
:root {
  --cover: #1d3a6e;        /* blue book cover */
  --cover-deep: #142a52;
  --on-cover: #f2f6fb;
  --on-cover-muted: #b9c8de;
  --paper: #ffffff;
  --page: #f3f6fa;         /* cool off-white behind paper */
  --rule: #d3deee;         /* notebook ruling */
  --ink: #121a26;
  --muted: #4b586b;
  --student: #2747a3;      /* student's pen */
  --pen: #c8202b;          /* grader's red pen */
  --redact: #000000;
  --focus: #f2b600;

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;

  --step--1: 0.9rem;
  --step-0: 1.1875rem;     /* 19px body */
  --step-1: 1.45rem;
  --step-2: 1.9rem;
  --step-3: clamp(2.4rem, 5.2vw, 4.1rem);

  --gutter: clamp(16px, 4vw, 40px);
  --measure: 66ch;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 var(--step-0)/1.65 var(--body);
  font-optical-sizing: auto;
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter); }

h1, h2, h3 { font-family: var(--display); font-stretch: 78%; line-height: 1.05; margin: 0; text-wrap: balance; }
h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); font-weight: 750; }
h3 { font-size: var(--step-1); font-weight: 700; font-stretch: 85%; line-height: 1.2; }
p { margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font: 650 1.05rem/1 var(--display);
  font-stretch: 90%;
  text-decoration: none;
  padding: 0.95rem 1.4rem;
  border-radius: 3px;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-light { background: var(--on-cover); color: var(--cover-deep); }
.btn-light:hover { background: #fff; }
.btn-ghost { border-color: var(--on-cover-muted); color: var(--on-cover); }
.btn-ghost:hover { border-color: var(--on-cover); }
.btn-ink { background: var(--cover); color: var(--on-cover); }
.btn-ink:hover { background: var(--cover-deep); }

/* ---------- cover band (hero) ---------- */
.cover { background: var(--cover); color: var(--on-cover); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 800 1.45rem/1 var(--display); font-stretch: 75%; text-decoration: none; letter-spacing: 0.01em; }
.wordmark i { display: inline-block; width: 26px; height: 10px; background: var(--redact); border: 2px solid var(--on-cover); }
.nav ul { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin: 0; padding: 0; font: 550 1rem/1 var(--display); font-stretch: 90%; }
.nav ul a { text-decoration: none; color: var(--on-cover-muted); }
.nav ul a:hover { color: var(--on-cover); }
.nav ul .btn { color: var(--cover-deep); padding: 0.7rem 1rem; }

.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(28px, 6vw, 72px) 0; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; padding-bottom: clamp(32px, 6vw, 80px); }
.hero-copy .sub { font-size: 1.25rem; color: var(--on-cover-muted); max-width: 34em; }
.hero-copy .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-art { align-self: end; display: flex; justify-content: center; }

/* the quiz page */
.exam {
  position: relative;
  width: min(100%, 440px);
  background:
    linear-gradient(90deg, transparent 52px, rgba(200, 32, 43, 0.35) 52px, rgba(200, 32, 43, 0.35) 54px, transparent 54px),
    repeating-linear-gradient(to bottom, var(--paper) 0, var(--paper) 33px, var(--rule) 33px, var(--rule) 34px);
  background-color: var(--paper);
  color: var(--ink);
  border-radius: 3px 3px 0 0;
  padding: 26px 24px 96px 70px;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.4), 0 24px 60px rgba(4, 12, 28, 0.45);
  transform: rotate(-1.4deg) translateY(10px);
  font-family: var(--body);
}
.exam-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.exam-head .lbl { font: 600 0.95rem var(--body); }
.namefield { position: relative; display: inline-block; border-bottom: 1.5px solid var(--ink); padding: 0 8px; min-width: 150px; }
.namefield .hand { font-size: 1.7rem; line-height: 1.2; }
.namefield .bar { position: absolute; inset: 2px 0 -2px 0; background: var(--redact); transform-origin: left center; }
.stamp {
  margin-left: auto;
  font: 700 0.95rem/1 var(--display);
  font-stretch: 80%;
  letter-spacing: 0.06em;
  color: var(--cover);
  border: 2px solid var(--cover);
  padding: 6px 8px;
  border-radius: 2px;
  transform: rotate(4deg);
}
.exam-title { font: 700 1.05rem/1.3 var(--display); font-stretch: 85%; margin: 14px 0 6px; }
.qs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.qs li { display: grid; grid-template-columns: minmax(0, 1fr) 28px; column-gap: 8px; padding-block: 3px; }
.qs .q { font-size: 0.95rem; line-height: 34px; grid-column: 1; }
.qs .ans { grid-column: 1; }
.qs .mark { grid-column: 2; grid-row: 1 / span 2; align-self: end; font: 700 1.9rem/1 var(--hand); color: var(--pen); }
.hand { font-family: var(--hand); color: var(--student); font-size: 1.55rem; line-height: 34px; }
.score {
  position: absolute; right: 22px; bottom: 22px;
  font: 700 2.4rem/1 var(--hand); color: var(--pen);
  border: 3px solid var(--pen); border-radius: 50%;
  padding: 14px 12px 10px;
  transform: rotate(-8deg);
}

@media (prefers-reduced-motion: no-preference) {
  .namefield .bar { animation: redact 0.55s cubic-bezier(.6,.05,.3,1) 0.7s both; }
  .stamp { animation: stamp 0.35s ease-out 1.35s both; }
  .score { animation: stamp 0.35s ease-out 1.95s both; }
  @keyframes redact { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes stamp { from { opacity: 0; transform: rotate(4deg) scale(1.6); } to { opacity: 1; } }
}

/* ---------- body sections ---------- */
section.block { padding-block: clamp(56px, 8vw, 96px); }
section.block + section.block { border-top: 1px solid var(--rule); }
.block-head { display: flex; flex-direction: column; gap: 12px; max-width: var(--measure); margin-bottom: 34px; }
.block-head p { color: var(--muted); }

/* steps: a real sequence */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; border-top: 3px solid var(--ink); }
.steps li { counter-increment: step; padding: 18px 22px 8px 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.steps li + li { padding-left: 22px; border-left: 1px solid var(--rule); }
.steps li::before { content: counter(step); font: 800 2.6rem/1 var(--display); font-stretch: 75%; color: var(--cover); }
.steps p { font-size: 1.05rem; color: var(--muted); }
@media (max-width: 880px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:nth-child(3) { padding-left: 0; border-left: none; }
  .steps li:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 540px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li + li { padding-left: 0; border-left: none; border-top: 1px solid var(--rule); }
}

/* data boundary */
.boundary { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: stretch; }
.side { background: var(--paper); border: 2px solid var(--ink); padding: 24px 24px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side.sent { border-style: dashed; border-color: var(--cover); }
.side ul { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; }
.side .foot { font-size: 1rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; margin-top: auto; }
.code { font: 700 0.95rem var(--display); font-stretch: 80%; letter-spacing: 0.05em; color: var(--cover); white-space: nowrap; }
.arrow { display: flex; align-items: center; justify-content: center; }
.arrow svg { width: 44px; height: 24px; }
@media (max-width: 760px) {
  .boundary { grid-template-columns: minmax(0, 1fr); }
  .arrow { padding-block: 8px; }
  .arrow svg { transform: rotate(90deg); }
}

/* control + limits */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); }
@media (max-width: 760px) { .two { grid-template-columns: minmax(0, 1fr); } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.list li:first-child { border-top: 1px solid var(--rule); }
.list b { font-family: var(--display); font-stretch: 85%; font-weight: 700; display: block; font-size: 1.15rem; margin-bottom: 2px; }
.list span { color: var(--muted); }
.limits { background: var(--paper); border-left: 4px solid var(--pen); padding: 6px 24px; }
.limits .list li:first-child { border-top: none; }
.limits .list li:last-child { border-bottom: none; }

/* faq */
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-of-type { border-top: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; position: relative; font: 700 1.2rem/1.3 var(--display); font-stretch: 85%; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font: 400 1.6rem/1 var(--display); color: var(--cover); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 20px; color: var(--muted); max-width: var(--measure); }

/* pilot form */
.pilot { padding-block: clamp(56px, 8vw, 96px); }
.pilot-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .pilot-grid { grid-template-columns: minmax(0, 1fr); } }
.pilot-copy { display: flex; flex-direction: column; gap: 16px; }
.pilot-copy p { color: var(--on-cover-muted); }
.pilot-copy a { color: var(--on-cover); }
form.card { background: var(--paper); color: var(--ink); border-radius: 3px; padding: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 18px; }
@media (max-width: 560px) { form.card { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font: 650 0.98rem var(--display); font-stretch: 90%; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  font: 400 1.05rem/1.4 var(--body);
  color: var(--ink);
  background: var(--page);
  border: 1.5px solid #9fb0c8;
  border-radius: 3px;
  padding: 10px 12px;
  width: 100%;
}
.field textarea { min-height: 110px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.form-foot .btn { font-size: 1.1rem; }
.status { font-size: 1rem; color: var(--muted); }
.status.err { color: var(--pen); }
.sent-msg { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.sent-msg h3 { color: var(--cover); }

/* footer */
footer { background: var(--cover-deep); color: var(--on-cover-muted); padding-block: 28px; font: 500 0.98rem/1.5 var(--display); font-stretch: 90%; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; justify-content: space-between; }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--on-cover); }

/* responsive hero */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-bottom: 8px; }
  .exam { transform: rotate(-1deg) translateY(10px); }
}

/* legal pages */
.doc { background: var(--paper); max-width: 820px; margin: clamp(24px, 5vw, 56px) auto; padding: clamp(24px, 5vw, 56px); border: 1px solid var(--rule); }
.doc h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 8px; }
.doc .updated { color: var(--muted); font-size: 1rem; }
.doc .draft { background: #fff4d6; border-left: 4px solid var(--focus); padding: 12px 16px; margin: 22px 0 8px; font-size: 1.02rem; }
.doc h2 { font-size: 1.5rem; margin: 34px 0 10px; }
.doc p, .doc li { max-width: var(--measure); }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; }
.doc-nav { background: var(--cover); }
.doc-nav .nav { padding-block: 16px; }

/* phones: keep the nav to the two actions that matter */
@media (max-width: 640px) {
  .nav ul li:nth-child(-n+3) { display: none; }
  .doc-nav .nav ul li:first-child { display: none; }
}
