/* Layout concept: a club noticeboard. Bright header with the logo, one warm line of welcome,
   then event tiles cut like ticket stubs with big date stamps. Brand colors come from the FunDA logo. */
:root {
  --paper: #f4f7f2;
  --card: #ffffff;
  --ink: #13233a;
  --muted: #536276;
  --line: #d9e1d6;
  --navy: #17558f;
  --navy-ink: #ffffff;
  --leaf: #4f7d1c;
  --leaf-soft: #e6f0d8;
  --plum: #35246a;
  --ember: #b8321f;
  --ember-soft: #fbe6e1;
  --logo-plate: #ffffff;
  --focus: #17558f;
  --shadow: 0 1px 2px rgb(19 35 58 / 6%), 0 8px 24px rgb(19 35 58 / 7%);

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.55rem;
  --step-3: 2.1rem;
  --step-4: clamp(2.3rem, 5vw, 3.4rem);
  --radius: 14px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1622; --card: #162133; --ink: #e7edf5; --muted: #9eabbd; --line: #263449;
    --navy: #6ea6df; --navy-ink: #0b1420; --leaf: #9cc75b; --leaf-soft: #22321a; --plum: #b9a6f0;
    --ember: #ff8b75; --ember-soft: #3a1d18; --focus: #8bbcf0;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1622; --card: #162133; --ink: #e7edf5; --muted: #9eabbd; --line: #263449;
  --navy: #6ea6df; --navy-ink: #0b1420; --leaf: #9cc75b; --leaf-soft: #22321a; --plum: #b9a6f0;
  --ember: #ff8b75; --ember-soft: #3a1d18; --focus: #8bbcf0;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: 1120px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.eyebrow { font-size: var(--step--1); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--leaf); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; background: var(--logo-plate); border-radius: 10px; padding: 4px 8px; }
.brand img { height: 52px; width: auto; }
.nav { display: flex; gap: 20px; flex-wrap: wrap; font-weight: 600; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--navy); }
@media (max-width: 520px) {
  .brand img { height: 40px; }
  .nav { gap: 14px; font-size: var(--step--1); }
}
@media (max-width: 420px) { .brand img { height: 34px; } .nav { gap: 11px; font-size: 0.82rem; } }
.btn.jump { display: none; }
@media (max-width: 900px) { .btn.jump { display: inline-flex; justify-self: start; } }

/* Hero */
.hero .wrap { padding-block: 56px 40px; display: grid; gap: 16px; max-width: 1120px; }
.hero h1 { font-size: var(--step-4); font-weight: 800; max-width: 18ch; }
.hero h1 em { font-style: normal; color: var(--leaf); }
.hero p { font-size: var(--step-1); color: var(--muted); max-width: 52ch; }

/* Sections */
.section .wrap { padding-block: 32px 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { font-size: var(--step-3); font-weight: 750; }

/* Event tiles */
.tiles { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; color: inherit; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tile:hover { transform: translateY(-3px); }
.tile-media { aspect-ratio: 16 / 9; max-width: 100%; background: var(--leaf-soft); position: relative; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-media.logo-media { display: grid; place-items: center; background: var(--logo-plate); }
.tile-media.logo-media img { width: 62%; height: auto; object-fit: contain; }
.stamp {
  position: absolute; left: 14px; top: 14px; background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 6px 10px 4px; text-align: center; min-width: 58px; box-shadow: var(--shadow);
  font-family: var(--font-display); line-height: 1;
}
.stamp .m { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ember); }
.stamp .d { display: block; font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stamp.wide .d { font-size: 1rem; padding-block: 4px 2px; }
/* the perforated tear line between the picture and the stub */
.tile-body { position: relative; padding: 20px 20px 18px; display: grid; gap: 8px; flex: 1; border-top: 2px dashed var(--line); }
.tile-body::before, .tile-body::after {
  content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper);
}
.tile-body::before { left: -10px; }
.tile-body::after { right: -10px; }
.tile .cat { font-size: var(--step--1); font-weight: 700; color: var(--leaf); letter-spacing: .06em; text-transform: uppercase; }
.tile h3 { font-size: var(--step-2); font-weight: 750; }
.tile .when, .tile .where { font-size: var(--step--1); color: var(--muted); }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf); }
.chip.warn { background: var(--ember-soft); color: var(--ember); }
.empty { background: var(--card); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--navy); color: var(--navy-ink); font: 700 var(--step-0)/1 var(--font-body);
  padding: 12px 18px; border-radius: 999px; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; padding-block: 15px; }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }

/* About band */
.about { background: var(--card); border-block: 1px solid var(--line); }
.about .wrap { display: grid; gap: 32px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); padding-block: 56px; }
.about h2 { font-size: var(--step-3); font-weight: 750; margin-bottom: 16px; }
.about .copy { display: grid; gap: 14px; max-width: 62ch; }
.traditions { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; align-content: start; }
.traditions li { border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; font-weight: 600; }
.traditions li:nth-child(3n+1) { border-color: var(--navy); }
.traditions li:nth-child(3n+2) { border-color: var(--leaf); }
.traditions li:nth-child(3n) { border-color: var(--plum); }
@media (max-width: 760px) { .about .wrap { grid-template-columns: 1fr; } }

/* Footer */
.site-footer .wrap { padding-block: 32px 48px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: var(--step--1); color: var(--muted); }

/* Event page */
.crumbs { font-size: var(--step--1); padding-block: 20px 0; }
.event-hero { padding-block: 16px 24px; display: grid; gap: 12px; }
.event-hero h1 { font-size: var(--step-4); font-weight: 800; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-weight: 600; }
.event-grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: start; padding-bottom: 64px; }
@media (max-width: 900px) { .event-grid { grid-template-columns: minmax(0, 1fr); } }
.event-main { display: grid; gap: 28px; min-width: 0; }
.event-main .cover { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; max-width: 100%; background: var(--leaf-soft); }
.event-main .cover img { width: 100%; height: 100%; object-fit: cover; }
.event-main .cover.logo-media { display: grid; place-items: center; background: var(--logo-plate); }
.event-main .cover.logo-media img { width: 55%; height: auto; object-fit: contain; }
.event-main h2 { font-size: var(--step-2); font-weight: 750; margin-bottom: 10px; }
.prose { display: grid; gap: 14px; max-width: 66ch; }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.agenda li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; }
.agenda .t { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.bullets { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.venue-card { display: grid; gap: 4px; }

/* Registration panel */
.register { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 18px; }
@media (max-width: 900px) { .register { position: static; } }
.register h2 { font-size: var(--step-2); font-weight: 750; }
.ticket-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); }
.ticket-row:first-of-type { border-top: 1px solid var(--line); }
.ticket-row .name { font-weight: 700; }
.ticket-row .desc { font-size: var(--step--1); color: var(--muted); grid-column: 1; }
.ticket-row .tprice { font-variant-numeric: tabular-nums; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: 4px; grid-row: span 2; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-size: 1.2rem; font-weight: 700; cursor: pointer; line-height: 1; }
.stepper button:hover:not([disabled]) { border-color: var(--navy); color: var(--navy); }
.stepper button[disabled] { opacity: .4; cursor: not-allowed; }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.subtotals { display: grid; gap: 4px; margin-top: 14px; font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
.subtotals div { display: flex; justify-content: space-between; }
.total { display: flex; justify-content: space-between; font-size: var(--step-1); font-weight: 800; font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 5px; }
.field label { font-weight: 600; font-size: var(--step--1); }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
.field input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy) 25%, transparent); }
.fields { display: grid; gap: 12px; }
.field select { font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.field-pair { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 10px; }
fieldset.choices { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.choices legend { font-weight: 600; font-size: var(--step--1); padding: 0; margin-bottom: 6px; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: var(--step--1); cursor: pointer; background: var(--paper); }
.choice input { width: 16px; height: 16px; accent-color: var(--navy); margin: 0; }
.choice:has(input:checked) { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 10%, var(--paper)); }
.fieldset-title { font-weight: 700; font-size: var(--step-0); }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; font-size: var(--step--1); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--navy); }
.form-error { background: var(--ember-soft); color: var(--ember); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: var(--step--1); }
.secure-note { font-size: 0.8rem; color: var(--muted); text-align: center; }
.notice { background: var(--leaf-soft); color: var(--ink); border-radius: 10px; padding: 12px 14px; font-size: var(--step--1); }

/* Thanks page */
.thanks { padding-block: 64px; display: grid; gap: 16px; max-width: 640px; }
.thanks h1 { font-size: var(--step-4); font-weight: 800; }
.thanks .card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 8px; }

@media (prefers-reduced-motion: reduce) { .tile, .tile:hover { transition: none; transform: none; } }

/* Filling in the form for returning people */
.small { font-size: var(--step--1); }
.linkish { font: inherit; color: var(--navy); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.linkish[disabled] { opacity: .55; cursor: default; }
.prefill { display: grid; gap: 6px; margin-top: -4px; }
.prefill p { margin: 0; }
.pf-row { display: flex; gap: 8px; }
.pf-row input { flex: 1; min-width: 0; letter-spacing: 3px; font-variant-numeric: tabular-nums; }
.pf-row .btn { padding-block: 8px; }
.prefill-note { margin: 0; }

/* Wiki pages (/wiki/ and /admin/wiki/) */
.wiki { padding-block: 48px 72px; display: grid; gap: 18px; max-width: 760px; }
.wiki h1 { font-size: var(--step-4); font-weight: 800; }
.wiki .lede { color: var(--muted); font-size: var(--step-1); }
.wiki-toc { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.wiki-toc a { padding: 6px 12px; border-radius: 999px; background: var(--paper); text-decoration: none; font-weight: 600; font-size: var(--step--1); }
.wiki section { display: grid; gap: 10px; padding-top: 14px; scroll-margin-top: 90px; }
.wiki h2 { font-size: var(--step-2); font-weight: 750; }
.wiki h3 { font-size: var(--step-1); font-weight: 700; margin-top: 6px; }
.wiki ul, .wiki ol { padding-left: 1.3em; display: grid; gap: 6px; }
.wiki code { white-space: nowrap; font-size: .92em; padding: 1px 6px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); }
.wiki pre { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.wiki pre code { background: none; border: 0; padding: 0; white-space: pre; }
