/* Theme "light" from src/index.css (generated). */
:root {
  --canvas: #f5f5fa;
  --surface: #ffffff;
  --surface-muted: #efeff6;
  --ink: #14142b;
  --ink-muted: #4b4b66;
  --ink-subtle: #7c7c96;
  --line: #e4e4ee;
  --line-strong: #cfcfdf;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eeedfd;
  --on-brand: #ffffff;
  --success: #047857;
  --success-soft: #ecfdf5;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warning: #78350f;
  --warning-soft: #fffbeb;
  --weak: #ea580c;
  --weak-ink: #9a3412;
  --weak-soft: #fff7ed;
  --ring: #6366f1;
  --accent: #8b5cf6;
  --illo: var(--ink-subtle);
  --illo-active: var(--brand);
  --illo-bg: var(--brand-soft);
  --illo-stroke: 1.5;
  --brand-logo: #6366f1;
  --on-brand-logo: #ffffff;
  color-scheme: light;
  --content-rem: 1rem;
}

/* Public pages (ADR 052): plain CSS on the variables of the light theme, sizes in rem. Reading width 45rem (720 px).
   Text is --ink or --ink-muted (--ink-subtle is under 4.5:1 on the light canvas: borders only). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-strong);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0;
}

h1 {
  font-size: 1.75rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: 45rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--brand);
  color: var(--on-brand);
}

.skip-link:focus {
  top: 1rem;
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
}

.logo-mark {
  width: 2rem;
  height: 2rem;
}

.logo-word {
  height: 1.25rem;
  width: auto;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover {
  background: var(--surface-muted);
}

main.wrap {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.site-footer .wrap {
  display: grid;
  gap: 0.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* Breadcrumbs */

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: '›';
  margin-left: 0.5rem;
}

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink-muted);
}

.breadcrumbs [aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* On a phone the current page is the heading right below: its crumb would only take a line. */
@media (max-width: 39.99rem) {
  .breadcrumbs li:last-child:not(:first-child) {
    display: none;
  }

  .breadcrumbs li:nth-last-child(2)::after {
    content: none;
  }
}

/* Text blocks */

.lead {
  margin-top: 0.75rem;
  color: var(--ink-muted);
  font-size: 1.0625rem;
}

.note {
  margin-top: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.card {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.card > p {
  margin-top: 0.5rem;
  color: var(--ink-muted);
}

/* The waiting-list card under the sheets on the home page: secondary, so smaller. */
.card.small {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
}

.card.small h2 {
  font-size: 1.125rem;
}

.home-sheets {
  margin-top: 2rem;
}

.home-sheets .year {
  margin-top: 1.25rem;
}

.hero h1 {
  font-size: 2rem;
}

.prose p + p {
  margin-top: 0.75rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Buttons and the form */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--brand-strong);
  color: var(--on-brand);
}

.button.secondary {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.button.secondary:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.waitlist {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.field-label {
  font-weight: 600;
}

.field {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ink-subtle); /* 3:1 and more against the card: the field is seen as one */
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.consent input {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.125rem 0 0;
  accent-color: var(--brand);
}

.honeypot {
  position: absolute;
  left: -100vw;
}

/* Lists of sheets and tasks */

/* The list of sheets, grouped by year. */
.year {
  margin-top: 2rem;
}

.year .rows {
  margin-top: 0.75rem;
}

.rows {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.row {
  display: grid;
  gap: 0.25rem;
  min-height: 2.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.row:hover {
  border-color: var(--brand);
  color: var(--ink);
}

.row.task {
  grid-template-columns: 2.75rem 1fr;
  align-items: center;
  gap: 0.875rem;
}

.row-body {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.row-title {
  font-weight: 600;
}

.row-meta {
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.number {
  display: grid;
  place-items: center;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* The problem */

.problem-header {
  margin-top: 0.5rem;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 600;
}

.problem-header h1 {
  margin-top: 0.25rem;
}

.statement {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  font-size: 1.0625rem;
}

.statement > p + p,
.statement > .figures + p,
.statement > p + .figures {
  margin-top: 0.75rem;
}

.statement .command {
  font-weight: 700;
}

.line {
  display: block;
}

.displayed {
  overflow-x: auto;
  text-align: center;
}

.statement .line.displayed {
  margin: 0.25rem 0;
}

.figures {
  display: grid;
  justify-items: center;
  gap: 1rem;
}

.figure {
  margin: 0;
  width: 100%;
  max-width: 25rem;
}

.figure.compact {
  max-width: 15rem;
}

.drawing {
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: var(--surface-muted);
  color: var(--ink);
}

.drawing svg {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  margin-top: 0.25rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.options {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.options li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.options .key {
  font-weight: 700;
}

.option-body {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  overflow-x: auto;
}

.answer,
.solution,
.scoring {
  margin-top: 2rem;
}

.answer p {
  margin-top: 0.5rem;
  font-size: 1.0625rem;
}

.steps {
  display: grid;
  gap: 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.75rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.step-body {
  min-width: 0;
  padding-top: 0.125rem;
}

.formula {
  margin-top: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface-muted);
}

.award {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.badge {
  flex-shrink: 0;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
}

.criterion {
  color: var(--ink-muted);
}

.final {
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--success);
  border-radius: 1rem;
  background: var(--success-soft);
}

.final-label {
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.final p + p {
  margin-top: 0.25rem;
}

.scoring {
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.scoring .lead {
  margin-top: 0.25rem;
  font-size: 0.875rem;
}

.scoring .stage {
  margin-top: 1rem;
  font-size: 0.875rem;
}

.stage-text {
  margin-top: 0.125rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.scoring-lines,
.notes {
  display: grid;
  gap: 0.375rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.notes {
  color: var(--ink-muted);
}

.notes.bullets {
  padding-left: 1.25rem;
  list-style: disc;
}

.scoring-lines li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.5rem;
}

.scoring-lines .points {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.scoring-lines .text {
  min-width: 0;
  overflow-x: auto;
  color: var(--ink-muted);
}

.separator {
  display: block;
  color: var(--ink-muted);
  font-size: 0.8125em;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.total {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  font-weight: 600;
}

.cta {
  margin-top: 2rem;
}

.cta .button {
  width: 100%;
}

.source {
  margin-top: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

/* The answer and the solution behind "Pokaż odpowiedź i rozwiązanie" (<details>, no script): a secondary button whose
   arrow turns down when open; the prompt under it is shown only while it is closed. */
.reveal {
  margin-top: 1.5rem;
}

.reveal > summary {
  display: grid;
  justify-items: start;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
}

.reveal > summary::-webkit-details-marker {
  display: none;
}

.reveal-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
}

.reveal > summary:hover .reveal-button {
  background: var(--surface-muted);
}

.reveal-button::before {
  content: '';
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateX(-0.125rem) rotate(-45deg);
  transition: transform 0.15s ease;
}

.reveal[open] .reveal-button::before {
  transform: translateY(-0.125rem) rotate(45deg);
}

.reveal > summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 0.75rem;
}

.reveal-prompt {
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.reveal[open] .reveal-prompt {
  display: none;
}

.reveal-body > :first-child {
  margin-top: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-button::before {
    transition: none;
  }
}

/* Above the problem, always open: all the problems of the sheet as tiles (44 px for touch) that wrap, the current one
   in the brand colour. */
.task-picker {
  margin-top: 0.5rem;
}

.picker-title {
  font-size: 1rem;
  font-weight: 600;
}

.picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.picker-grid a {
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.375rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.picker-grid a:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.picker-grid a[aria-current='page'] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}

.picker-back {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.picker-back a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

@media (min-width: 40rem) {
  h1 {
    font-size: 2rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .cta .button {
    width: auto;
  }
}

/* KaTeX: formulas follow the text colour; a long one scrolls inside its block instead of widening the page. */
.katex {
  font-size: 1.1em;
}

.katex-display {
  margin: 0.5rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}
