/* Candide — built on the Sodobat design system.
   Geist, one brand colour (petrol), warm neutrals, 1px rules instead of shadows. */

:root {
  /* Brand */
  --petrol: #0E5A5F;
  --petrol-hover: #0B4A4E;
  --petrol-light: #9CC3C3;
  --petrol-tint: #E3ECEC;
  --total-row: #EEF3F2;
  --track: #EEF1F0;

  /* Neutrals */
  --ink: #16181A;
  --grey-700: #3D4145;
  --grey-600: #5A5E62;
  --grey-500: #6B6F73;
  --grey-400: #8A8E92;
  --grey-300: #A3A6A9;

  /* Surfaces and rules */
  --page: #F6F6F4;
  --surface: #FFFFFF;
  --surface-soft: #FAFAF8;
  --surface-sunken: #F0F0EC;
  --rule: #E6E6E2;
  --rule-control: #DCDCD7;
  --axis: #D8D8D3;

  /* Semantic: used only where the colour carries the meaning */
  --good: #1F7A4D;
  --good-bg: #E3F1E9;
  --bad: #B4352A;
  --bad-bg: #F7E6E3;
  --warn: #8A4B06;
  --warn-dot: #D9822B;
  --warn-bg: #FBEFD9;

  --font: Geist, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure, dl, dd, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
svg { display: block; }
input, button, select, textarea { font: inherit; color: inherit; }

a { color: var(--petrol); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
[id] { scroll-margin-top: 84px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -80px; z-index: 60;
  padding: 9px 14px; background: var(--surface); border: 1px solid var(--rule-control); border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ---------- Type roles ---------- */

.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--petrol);
}
.card-title { font-size: 16px; font-weight: 600; }
.meta { font-size: 13px; color: var(--grey-500); }
.caption { font-size: 12px; color: var(--grey-500); }
.mono { font-family: var(--mono); font-size: 13px; color: var(--grey-700); }
.link-arrow { font-weight: 500; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px;
  min-height: 64px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--rule);
}

.identity { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--ink); }
.identity:hover { text-decoration: none; }
.logo {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 8px; background: var(--petrol); color: #fff;
  font-size: 15px; font-weight: 700;
}
.identity-text { display: flex; flex-direction: column; line-height: 1.15; }
.identity-name { font-size: 15px; font-weight: 600; }
.identity-sub { font-size: 12px; color: var(--grey-500); }

.tabs {
  display: flex; gap: 2px; flex: 1 1 auto; justify-content: center; align-self: stretch;
  min-height: 64px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; padding: 0 12px;
  font-size: 14px; color: var(--grey-600); white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-current="page"] { font-weight: 600; color: var(--petrol); border-bottom-color: var(--petrol); }

.topbar-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.context {
  padding: 7px 12px; border: 1px solid var(--rule); border-radius: 8px;
  font-size: 13px; color: var(--grey-700); white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border: 1px solid var(--rule-control); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font-size: 14px; line-height: 1.5; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--surface-soft); text-decoration: none; }
.btn-primary { padding: 9px 16px; border-color: var(--petrol); background: var(--petrol); color: #fff; font-weight: 500; }
.btn-primary:hover { border-color: var(--petrol-hover); background: var(--petrol-hover); }
.btn:disabled { opacity: .7; cursor: progress; }

/* ---------- Page layout ---------- */

.page {
  display: flex; flex-direction: column; gap: 40px;
  padding: 28px 24px 64px;
}
.stack { display: flex; flex-direction: column; gap: 20px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.page-intro { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-head h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
.page-sub { max-width: 680px; color: var(--grey-500); text-wrap: pretty; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Home hero. The headline is the one size above the system's 36px ceiling. */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center;
  padding: 32px 0 20px;
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; min-width: 0; }
.hero-kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero h1 {
  font-size: clamp(30px, 3.4vw, 60px); font-weight: 600; letter-spacing: -.03em; line-height: 1.08;
  text-wrap: balance;
}
.hero h1 .accent { display: block; color: var(--petrol); }
.hero-sub { max-width: 38em; font-size: 16px; line-height: 1.55; color: var(--grey-600); text-wrap: pretty; }

.hero-card-body { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 18px; }
.hero-art {
  aspect-ratio: 5 / 2; overflow: hidden;
  border: 1px solid var(--petrol-light); border-radius: 8px; background: var(--petrol-tint);
}
.hero-art svg { width: 100%; height: 100%; }
.hero-prompt { display: flex; flex-direction: column; gap: 4px; }
.hero-explain { display: flex; flex-direction: column; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--rule); }
.ticks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.ticks li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--grey-700); }
.tick {
  flex: 0 0 auto; width: 16px; height: 16px; display: grid; place-items: center;
  border-radius: 4px; background: var(--petrol); color: #fff; font-size: 11px; line-height: 1;
}
.hero-explain-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.section { display: flex; flex-direction: column; gap: 14px; }
.section-intro { max-width: 680px; color: var(--grey-500); text-wrap: pretty; }
.section-intro strong { font-weight: 600; color: var(--ink); }

.grid { display: grid; gap: 20px; }
.grid-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }

/* ---------- Cards ---------- */

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; }
.card-pad { padding: 22px 24px; }
.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  padding: 18px 24px; border-bottom: 1px solid var(--rule);
}
.card-head-title { display: flex; align-items: center; gap: 10px; }

.tile { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; }
.tile p { color: var(--grey-700); }
.tile .chips, .tile .link-arrow { margin-top: auto; padding-top: 8px; }
.tile-total { background: var(--total-row); }

/* ---------- Chips, tags, badges ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  background: var(--surface-sunken); color: var(--grey-700);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  background: var(--petrol); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: var(--petrol-tint); color: var(--petrol); font-size: 12px; font-weight: 600;
}
.kicker {
  justify-self: start; padding: 2px 8px; border-radius: 6px;
  background: var(--petrol-tint); color: var(--petrol); font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* ---------- KPI strip ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); overflow: hidden; }
.kpi {
  display: flex; flex-direction: column; gap: 10px; padding: 22px 24px;
  box-shadow: -1px 0 0 var(--rule), 0 -1px 0 var(--rule);
}
.kpi-label { font-size: 13px; font-weight: 500; color: var(--grey-500); }
.kpi-value {
  display: flex; align-items: baseline; gap: 6px;
  font-size: clamp(26px, 2.6vw, 36px); font-weight: 600; letter-spacing: -.025em; line-height: 1.05;
}
.kpi-unit { font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--grey-500); }
.kpi-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--grey-500); }

/* ---------- Lists inside cards ---------- */

.list > * { border-top: 1px solid var(--surface-sunken); }
.list > :first-child { border-top: 0; }

.q-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 16px; align-items: start;
  padding: 13px 24px;
}
.q-row b { display: block; font-weight: 600; }

.item-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; }
.item-row > div { min-width: 0; }
.item-row b { display: block; font-weight: 500; }
.item-row .mono { flex: 0 0 28px; }
.item-row .grow { flex: 1 1 auto; }

.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 24px; }
.kv-row dt { color: var(--grey-500); font-size: 13px; }
.kv-row dd { font-weight: 500; text-align: right; }

/* ---------- Portfolio illustration ---------- */

.versions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 22px 24px; }
.version { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.version-art {
  width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--page);
}
.version-art svg { height: 82%; }
.version:last-child .version-art { background: var(--petrol-tint); border-color: var(--petrol-light); }
.prompt { font-family: var(--mono); font-size: 12px; line-height: 1.45; color: var(--grey-700); }
.reflection { display: flex; flex-direction: column; gap: 6px; padding: 16px 24px; border-top: 1px solid var(--rule); }
.reflection p { font-weight: 500; }
.portfolio-caption { padding: 0 24px 18px; }

/* ---------- FAQ ---------- */

.faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 24px; font-weight: 500; cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "▼"; flex: 0 0 auto; font-size: 10px; color: var(--grey-400); transition: transform .15s ease; }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item summary:hover { background: var(--surface-soft); }
.faq-item summary:focus-visible { outline-offset: -2px; }
.faq-item:last-child summary { border-radius: 0 0 11px 11px; }
.faq-item[open]:last-child summary { border-radius: 0; }
.faq-item p { max-width: 760px; padding: 0 24px 16px; color: var(--grey-700); text-wrap: pretty; }

/* ---------- Closing call to action ---------- */

.cta { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.cta > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cta p { max-width: 620px; color: var(--grey-500); }

/* ---------- Footer ---------- */

.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 10px 24px; flex-wrap: wrap;
  padding: 20px 24px 40px;
  border-top: 1px solid var(--rule); font-size: 12px; color: var(--grey-500);
}
.footer nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.footer a { color: var(--grey-600); }

/* ---------- Programme: week-by-week table ---------- */

.table { font-size: 14px; }
.t-head, .t-row { display: grid; grid-template-columns: 76px minmax(180px, 250px) minmax(0, 1fr); }
.t-head {
  background: var(--surface-soft); border-bottom: 1px solid var(--rule);
  font-size: 12px; font-weight: 500; color: var(--grey-500);
}
.t-head > div { padding: 10px 20px; }
.t-group {
  display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap;
  padding: 16px 20px 8px; border-bottom: 1px solid var(--rule);
}
.t-row { border-bottom: 1px solid var(--surface-sunken); }
.t-row > div { padding: 12px 20px; }
.t-title { font-weight: 500; }
.t-desc { color: var(--grey-700); }
.t-total { background: var(--total-row); border-bottom: 0; border-radius: 0 0 11px 11px; }
.t-total .t-title { font-weight: 600; }
.t-total .t-desc { color: var(--ink); }

/* ---------- Programme: session breakdown ---------- */

.split { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; }
.split-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.split-row { display: flex; flex-direction: column; gap: 7px; padding: 10px 0; border-top: 1px solid var(--surface-sunken); }
.split-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.split-name { font-weight: 500; }
.split-vals { display: flex; gap: 14px; white-space: nowrap; }
.split-vals b { font-weight: 600; }
.split-pct { width: 36px; font-size: 13px; font-weight: 600; color: var(--petrol); text-align: right; }
.bar { height: 5px; overflow: hidden; border-radius: 3px; background: var(--track); }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--petrol); }

.chart { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chart-head .meta b { font-weight: 600; color: var(--ink); }
.histo, .histo-labels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.histo { align-items: end; height: 190px; border-bottom: 1px solid var(--axis); }
.histo-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.histo-val { font-size: 12px; font-weight: 500; color: var(--grey-600); }
.histo-bar { width: 100%; max-width: 44px; border-radius: 5px 5px 0 0; background: var(--petrol-light); }
.histo-col.is-key .histo-val { color: var(--petrol); }
.histo-col.is-key .histo-bar { background: var(--petrol); }
.histo-labels { margin-top: -8px; font-size: 12px; color: var(--grey-500); text-align: center; }
.chart-note { font-size: 12px; color: var(--grey-500); }

/* ---------- Founding list: form ---------- */

.enrol-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 20px; align-items: start; }

.form-body { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.label { font-size: 13px; font-weight: 500; color: var(--grey-700); }
.hint { font-weight: 400; color: var(--grey-500); }

.input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--rule-control); border-radius: 8px; background: var(--surface);
  font-size: 14px; line-height: 1.5;
}
.input::placeholder { color: var(--grey-400); }
.input:focus-visible { outline: 2px solid var(--petrol); outline-offset: 0; border-color: var(--petrol); }
textarea.input { min-height: 84px; resize: vertical; }
select.input {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' fill='%238A8E92'%3E%3Cpath d='M0 0h9L4.5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}

.segmented { display: inline-flex; align-self: flex-start; padding: 3px; border-radius: 8px; background: var(--surface-sunken); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 5px 12px; border-radius: 6px; font-size: 13px; color: var(--grey-500); cursor: pointer; }
.segmented input:checked + span { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); font-weight: 500; color: var(--ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--petrol); outline-offset: 1px; }

.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input {
  appearance: none; flex: 0 0 auto; width: 16px; height: 16px; margin: 2.5px 0 0;
  display: grid; place-items: center;
  border: 1px solid var(--rule-control); border-radius: 4px; background: var(--surface);
}
.check input:checked { border-color: var(--petrol); background: var(--petrol); }
.check input:checked::after { content: "✓"; font-size: 11px; line-height: 1; color: #fff; }

.form-foot { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }

.notice { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.notice::before { content: ""; flex: 0 0 7px; height: 7px; border-radius: 50%; transform: translateY(-1px); }
.notice code { font-family: var(--mono); font-size: 12px; }
.notice-warn, .notice[data-kind="warn"] { background: var(--warn-bg); color: var(--warn); }
.notice-warn::before, .notice[data-kind="warn"]::before { background: var(--warn-dot); }
.notice[data-kind="error"] { background: var(--bad-bg); color: var(--bad); }
.notice[data-kind="error"]::before { background: var(--bad); }

.success { display: flex; flex-direction: column; gap: 6px; margin: 22px 24px; padding: 16px 18px; border-radius: 8px; background: var(--good-bg); }
.success h2 { font-size: 16px; font-weight: 600; color: var(--good); }
.success:focus { outline: none; }

.hp { position: absolute; left: -9999px; }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 12px 0 8px; }
  .hero h1 { font-size: clamp(32px, 6.5vw, 44px); }
}

@media (max-width: 860px) {
  [id] { scroll-margin-top: 16px; }

  .topbar { position: static; padding: 0 16px; column-gap: 12px; }
  .page { padding-left: 16px; padding-right: 16px; }
  .footer { padding-left: 16px; padding-right: 16px; }
  .identity { flex: 1 1 auto; min-height: 60px; }
  .context { display: none; }
  .tabs {
    order: 3; flex: 1 0 100%; justify-content: flex-start; min-height: 44px;
    margin: 0 -16px; padding: 0 4px; border-top: 1px solid var(--rule);
  }

  .enrol-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .page { gap: 32px; }
  .page-head .actions { width: 100%; }

  .q-row { grid-template-columns: minmax(0, 1fr); }

  .t-head, .t-row { grid-template-columns: 52px minmax(0, 1fr); }
  .t-head > :nth-child(3) { display: none; }
  .t-head > div, .t-row > div { padding-left: 16px; padding-right: 16px; }
  .t-row .mono { grid-row: span 2; }
  .t-row .t-title { padding-bottom: 2px; }
  .t-row .t-desc { grid-column: 2; padding-top: 0; }
  .t-group { padding-left: 16px; padding-right: 16px; }

  .versions { gap: 10px; padding: 18px 16px; }
  .field-row { grid-template-columns: 1fr; }
  .histo, .histo-labels { gap: 8px; }

  /* Below 16px, iOS zooms the page when a field takes focus. */
  .input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .faq-item summary::after { transition: none; }
}
