/* tuitium.com. Token values come from the palette table in site/brand/colours.md. */

:root {
  color-scheme: only light;
  --brand: #3b3a9e;
  --brand-dark: #2b2a7a;
  --accent: #b0315f;
  --surface: #fcfcfe;
  --surface-alt: #f1f1f8;
  --text: #1c1b2e;
  --text-muted: #575670;
  --on-brand: #ffffff;
  --border: #d8d7e8;
  --success: #1b7448;
  --warning: #8f5600;
  --danger: #b3261e;
}

/* Layout for tuitium.com. Colours come only from the tokens above (site/brand/colours.md). */

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

svg { max-width: 100%; }

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

@media (min-width: 48rem) {
  .wrap { padding: 0 2rem; }
}

/* Links and focus */

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--brand-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.skip-link {
  position: absolute;
  top: -10rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border: 2px solid var(--brand);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Header and menu: a thin deep-indigo band on top */

.site-header { border-top: 4px solid var(--brand-dark); border-bottom: 1px solid var(--border); background: var(--surface); }

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 2rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text); text-decoration: none; }
.brand svg { flex: none; width: 2.25rem; height: 2.25rem; }
.brand-name { font-size: 1.35rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.brand:hover { color: var(--brand-dark); }
.brand:hover .brand-name { text-decoration: underline; }

.site-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.1rem; margin: 0; padding: 0; list-style: none; }
.site-nav li { margin: 0; }
.site-nav a:not(.button) {
  display: inline-block;
  padding: 0.3rem 0;
  border-bottom: 3px solid transparent;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:not(.button):hover { border-bottom-color: var(--border); color: var(--brand-dark); }
.site-nav a:not(.button)[aria-current] { border-bottom-color: var(--accent); color: var(--brand); }
.site-nav .nav-action .button { padding: 0.35rem 0.9rem; font-size: 0.95rem; }
.site-nav .nav-action:first-of-type { margin-left: 0.25rem; }

@media (max-width: 40rem) {
  .site-nav { width: 100%; }
  .site-nav ul { gap: 0.4rem 1rem; }
  .site-nav .nav-action:first-of-type { margin-left: 0; }
}

/* Page content */

main { display: block; padding: 2rem 0 3.5rem; }

h1, h2, h3 { line-height: 1.25; }
h1 { margin: 0 0 0.75rem; color: var(--brand); font-size: 2.05rem; letter-spacing: -0.015em; }
h2 { margin: 2.5rem 0 0.75rem; color: var(--brand); font-size: 1.5rem; }
h3 { margin: 1.75rem 0 0.4rem; color: var(--text); font-size: 1.15rem; }

@media (min-width: 48rem) {
  h1 { font-size: 2.6rem; }
}

p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin: 0.35rem 0; }

code {
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: var(--surface-alt);
  font-family: ui-monospace, Consolas, "Cascadia Mono", Menlo, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.content > p,
.content > ul:not(.cards):not(.actions),
.content > ol,
.content > h2,
.content > h3,
.page-head > * { max-width: 46rem; }

/* Home hero and inner page head */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem 3rem;
  margin-bottom: 1rem;
  padding: 2.5rem 2.25rem;
  border: 1px solid var(--border);
  border-top: 6px solid var(--brand);
  border-radius: 1rem;
  background: var(--surface-alt);
}
.hero h1 { max-width: 34rem; }
.hero-text > :last-child { margin-bottom: 0; }
.hero-text > p:first-of-type { font-size: 1.2rem; }
.hero-art svg { display: block; width: 17rem; height: auto; }

@media (max-width: 52rem) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 1.5rem 1.25rem; }
  .hero-art { order: -1; }
  .hero-art svg { width: 9rem; }
}

.page-head { margin-bottom: 2rem; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 6px solid var(--accent); }
.page-head > :last-child { margin-bottom: 0; }
.page-head > h1 + p { font-size: 1.2rem; }
.crumb { margin: 0 0 0.35rem; font-size: 0.95rem; font-weight: 600; }

/* Buttons */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; padding: 0; list-style: none; }
.actions li { margin: 0; }
.button {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border: 2px solid var(--brand);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--brand);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.button:hover { border-color: var(--brand-dark); color: var(--brand-dark); text-decoration: underline; }
.button-primary { background: var(--brand); color: var(--on-brand); }
.button-primary:hover { background: var(--brand-dark); color: var(--on-brand); }
.button[aria-current] { background: var(--brand-dark); border-color: var(--brand-dark); }

/* Cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
  padding: 0;
  list-style: none;
}
.card {
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-alt);
}
.card > h2,
.card > h3 { margin: 0 0 0.5rem; color: var(--brand); font-size: 1.2rem; }
.card > h2::before,
.card > h3::before {
  content: "";
  display: block;
  width: 2rem;
  height: 3px;
  margin-bottom: 0.6rem;
  border-radius: 2px;
  background: var(--accent);
}
.card > :last-child { margin-bottom: 0; }

/* Status tags and placeholders */

.tag {
  display: inline-block;
  margin-right: 0.5rem;
  padding: 0.1rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Placeholder slots the owner still has to fill in. Prod refuses to deploy while any remain. */
.placeholder {
  padding: 0 0.2rem;
  border: 2px dashed var(--accent);
  border-radius: 0.25rem;
  background: var(--surface-alt);
  color: var(--text);
}

/* Footer */

.site-footer { padding: 2rem 0; border-top: 1px solid var(--border); background: var(--surface-alt); color: var(--text-muted); font-size: 0.95rem; }
.site-footer p { margin: 0 0 0.75rem; }
.site-footer p:last-child { margin-bottom: 0; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.footer-nav li { margin: 0; }
.site-footer .copyright { color: var(--text); font-weight: 600; }

/* The drawings: the mark (logo) and the home page's timetable */

.d-brand { fill: var(--brand); }
.d-accent { fill: var(--accent); }
.d-on { fill: var(--on-brand); }
.d-dot { fill: var(--accent); stroke: var(--on-brand); stroke-width: 2; }
.d-card { fill: var(--surface); stroke: var(--border); stroke-width: 2; }
.d-slot { fill: var(--surface-alt); stroke: var(--border); stroke-width: 1.5; }
.d-line { fill: var(--border); }
