/* Libre Baskerville (SIL Open Font License 1.1, see fonts/OFL.txt), self-hosted so no visitor data goes to Google. */
@font-face {
  font-family: "Libre Baskerville"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/libre-baskerville-latin.054afe25df5f.woff2") format("woff2");
}

:root { --ink: #1a1a1a; --muted: #6b6b6b; --line: #e6e6e6; --paper: #ffffff; }

* { box-sizing: border-box; }

body {
  margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font-family: "Libre Baskerville", Baskerville, "Baskerville Old Face", Georgia, serif;
}

.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem 1.25rem;
}
/* Sized by height too, so the drawing and the words share one screen. */
.sketch { width: auto; height: auto; max-width: min(100%, 20rem); max-height: 43vh; max-height: 43svh; margin-bottom: 1.5rem; animation: fade 1.6s ease-out both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* The left margin balances the trailing letter-spacing, so the word sits optically centred. */
.wordmark { font-weight: 400; font-size: clamp(2.6rem, 8vw, 4.5rem); letter-spacing: 0.4em; margin: 0 0 0 0.4em; }
.rule { width: clamp(60px, 12vw, 120px); height: 1px; background: #c8c8c8; border: 0; margin: 1.4rem auto 0; }
.lede { margin: 1.6rem 0 0; font-size: clamp(1.2rem, 2.6vw, 1.5rem); line-height: 1.4; }
.sublede { text-wrap: balance; max-width: 28rem; margin: 1rem 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.7; }

.foot {
  display: flex; justify-content: space-between; align-items: center;
  width: min(40rem, calc(100% - 2.5rem)); margin: 0 auto;
  padding: 1.1rem 0.75rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.72rem;
}
.foot .mark { letter-spacing: 0.4em; }

/* The name surfaces letter by letter, then the rule draws out and the text follows. */
.wordmark > span > span { display: inline-block; animation: unveil 1.4s cubic-bezier(0.2, 0.6, 0.2, 1) both; animation-delay: 0.2s; }
.wordmark > span > span:nth-child(2) { animation-delay: 0.34s; }
.wordmark > span > span:nth-child(3) { animation-delay: 0.48s; }
.wordmark > span > span:nth-child(4) { animation-delay: 0.62s; }
.rule { animation: draw 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.4s both; }
.lede { animation: rise 0.8s ease-out 1.9s both; }
.sublede { animation: rise 0.8s ease-out 2.1s both; }
@keyframes unveil { from { opacity: 0; filter: blur(14px); transform: scale(1.04); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .sketch, .wordmark > span > span, .rule, .lede, .sublede { animation: none; }
}

/* Signed-in and sign-in pages */
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.enter { margin: 1.6rem 0 0; font-size: 0.95rem; animation: rise 0.8s ease-out 2.3s both; }
.skip { position: absolute; left: -999rem; }
.unseen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem; }
.bar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: center;
  width: min(40rem, calc(100% - 2.5rem)); margin: 0 auto; padding: 1.1rem 0.75rem;
  border-bottom: 1px solid var(--line); font-size: 0.85rem;
}
.bar nav { display: flex; gap: 1.25rem; align-items: center; }
.bar form { margin: 0; }
.brand { letter-spacing: 0.4em; text-decoration: none; }
.page { flex: 1; width: min(40rem, calc(100% - 2.5rem)); margin: 0 auto; padding: 2rem 0.75rem; line-height: 1.7; overflow-wrap: anywhere; }
.page h1 { font-weight: 400; font-size: 1.6rem; line-height: 1.3; }
.button {
  font: inherit; font-size: 0.95rem; cursor: pointer; margin: 0.4rem 0; padding: 0.7rem 1.4rem;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 2px;
}
.button.danger { background: #8c1d18; border-color: #8c1d18; }
.linklike { font: inherit; color: inherit; background: none; border: 0; padding: 0.25rem 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.small { color: var(--muted); font-size: 0.85rem; }
.check input { width: 1.15rem; height: 1.15rem; vertical-align: -0.2rem; margin-right: 0.4rem; }
.errorlist { color: #8c1d18; padding-left: 1.2rem; }
.messages { list-style: none; padding: 0.75rem 1rem; border: 1px solid var(--line); }
dt { color: var(--muted); font-size: 0.85rem; }
dd { margin: 0 0 0.8rem; }
@media (prefers-reduced-motion: reduce) { .enter { animation: none; } }

/* Courses */
.page h2 { font-weight: 400; font-size: 1.2rem; margin: 2.2rem 0 0.5rem; border-top: 1px solid var(--line); padding-top: 1.4rem; }
a.button { display: inline-block; text-decoration: none; }
.description { white-space: pre-line; }
.list { list-style: none; padding: 0; }
.list li, .blocks li { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.list .small { display: block; }
.actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem; font-size: 0.85rem; }
.actions form { display: flex; gap: 1rem; margin: 0; }
.linklike:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.stack input[type="text"], .stack input[type="number"], .stack textarea, .share input {
  display: block; width: 100%; font: inherit; font-size: 1rem; padding: 0.55rem 0.7rem;
  border: 1px solid #8a8a8a; border-radius: 2px; background: var(--paper); color: var(--ink);
}
.check label { display: inline; }

/* Block material. Code keeps its spacing and scrolls rather than wrapping. */
code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.85em; }
:not(pre) > code { background: #f2f2f2; border-radius: 3px; padding: 0.05em 0.3em; }
pre { background: #f6f6f6; border: 1px solid var(--line); border-radius: 3px; padding: 0.75rem 0.9rem; overflow-x: auto; line-height: 1.55; overflow-wrap: normal; }
pre code { font-size: 1em; }
.objective { border-bottom: 1px solid var(--line); padding: 0.3rem 0; }
.objective h3 { font-weight: 400; font-size: 1.02rem; margin: 0.8rem 0 0.4rem; }
summary { cursor: pointer; font-size: 0.9rem; }
.warning { border-left: 3px solid #8a6100; padding: 0.4rem 0.9rem; background: #fdf8ec; }
.stack textarea { line-height: 1.5; }
input[type="file"] { max-width: 100%; font: inherit; font-size: 0.9rem; margin-top: 0.4rem; }
.blocks .small { display: block; }

/* Practice */
.scores { display: flex; gap: 2rem; margin: 1rem 0; }
.scores dd { margin: 0; font-size: 1.5rem; }
fieldset { border: 0; padding: 0; margin: 1rem 0; min-width: 0; }
legend { color: var(--muted); font-size: 0.85rem; padding: 0; }
.option { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0.4rem 0; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 3px; }
.option input { width: 1.15rem; height: 1.15rem; margin: 0.25rem 0 0; flex: none; }
.option label { flex: 1; min-width: 0; cursor: pointer; }
.stem { min-width: 0; }

.foot nav { display: flex; gap: 1rem; }

/* Cohort totals */
.totals { width: 100%; border-collapse: collapse; }
.totals th, .totals td { text-align: left; vertical-align: top; font-weight: 400; padding: 0.55rem 0.4rem 0.55rem 0; border-bottom: 1px solid var(--line); }
.totals thead th { color: var(--muted); font-size: 0.85rem; overflow-wrap: normal; }

/* Scores beside a question: quiet, with the arrow and not only its colour showing direction. */
.standing { display: flex; flex-wrap: wrap; gap: 0.2rem 1.25rem; list-style: none; margin: 0; padding: 0 0 0.6rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; }
.standing li { white-space: nowrap; }
.rose, .fell { font-size: 0.72rem; margin-left: 0.15rem; }
.rose { color: #2f6b3a; }
.fell { color: #8c1d18; }

/* A student's view of a course */
.unit summary { font-size: 0.95rem; padding: 0.35rem 0; }
.objectives { padding-left: 1.1rem; }
.objectives li { margin-bottom: 0.9rem; }
.course-end { border-top: 1px solid var(--line); margin-top: 2.2rem; padding-top: 0.6rem; }

.practising { margin-top: 2rem; padding-top: 0.8rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }

/* Marked answers: the same boxes as the question. Tick, cross and words carry the meaning too. */
.marked { list-style: none; padding: 0; margin: 1rem 0; }
.said { flex: 1; min-width: 0; }
.verdict { display: block; font-size: 0.8rem; }
.sign { flex: none; font-family: system-ui, sans-serif; font-size: 1.2rem; font-weight: 700; line-height: 1.5; }
.option.right { background: #edf6ee; border-color: #2f6b3a; }
.option.wrong { background: #fbeeed; border-color: #8c1d18; }
.right .sign { color: #2f6b3a; }
.wrong .sign { color: #8c1d18; }

/* Written answers */
textarea#answer { display: block; width: 100%; font: inherit; font-size: 1rem; line-height: 1.5; padding: 0.6rem 0.7rem; border: 1px solid #8a8a8a; border-radius: 2px; background: var(--paper); color: var(--ink); resize: vertical; }
.alignment progress { width: 100%; height: 0.7rem; margin-top: 0.6rem; accent-color: #2f6b3a; }
.alignment p { margin: 0.2rem 0 0.8rem; }
.answer { white-space: pre-wrap; }
select { font: inherit; font-size: 0.95rem; padding: 0.3rem; }
