/* UCA Summit: one hand-written stylesheet for the public site and the admin.
   Colors are tokens so dark mode and a future brand palette are one edit. */
:root {
  color-scheme: light dark;
  /* Sampled from the UCAS logo. */
  --navy: #062550;
  --navy-2: #12356b;
  --red: #b1091b;
  --red-2: #cc1f30;
  --cream: #f1e2ce;
  --cream-2: #faf4ea;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #15181d;
  --muted: #5c6573;
  --line: #d9dee6;
  --accent: var(--red);
  --link: #1f4f9a;
  --ok-bg: #e8f5ec;
  --ok-fg: #1d5b33;
  --warn-bg: #fff4dc;
  --warn-fg: #7a5200;
  --err-bg: #fdecee;
  --err-fg: #8a1c2a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #171b23;
    --text: #e8ebf0;
    --muted: #9aa3b2;
    --line: #2a303b;
    --link: #8db6ff;
    --ok-bg: #12301d; --ok-fg: #9fe0b4;
    --warn-bg: #33270b; --warn-fg: #f1cf7d;
    --err-bg: #3a1419; --err-fg: #ffadb8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 2fr 1fr; } }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons and forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4em; padding: .55em 1em; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--red-2); border-color: var(--red-2); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-sm { padding: .3em .65em; font-size: .85rem; }
.btn-link { border: 0; background: none; color: var(--link); padding: 0; font-weight: 500; }
.btn-danger { color: var(--err-fg); }
form.inline { display: inline; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: .55em .7em; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 7em; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--link); outline-offset: 1px; }
.field { margin-bottom: 1rem; }
.fields { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: flex; gap: .5em; align-items: center; font-weight: 500; }
.check input { width: auto; }
.flash { padding: .75em 1em; border-radius: 8px; margin: 1rem 0; }
.flash-ok { background: var(--ok-bg); color: var(--ok-fg); }
.flash-err { background: var(--err-bg); color: var(--err-fg); }

/* ---------- Cards, tables, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.card h2, .card h3 { margin-top: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55em .6em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.badge { display: inline-block; padding: .1em .55em; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.badge-main { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge-won { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.badge-lost { background: var(--err-bg); color: var(--err-fg); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.empty { padding: 1.5rem; text-align: center; color: var(--muted); }

/* ---------- Public site ---------- */
/* The logo is navy on transparent, so the header stays cream in both themes. */
.site-header { background: var(--cream-2); color: var(--navy); border-bottom: 4px solid var(--red); }
.site-header a { color: var(--navy); text-decoration: none; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; min-height: 64px; padding-top: .5rem; padding-bottom: .5rem; }
.brand { font-weight: 800; letter-spacing: .02em; font-size: 1.15rem; margin-right: auto; display: flex; align-items: center; }
.brand .logo { height: 88px; width: auto; }
@media (max-width: 640px) { .brand .logo { height: 64px; } }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-weight: 600; font-size: .95rem; }
.site-nav a { opacity: .8; padding: .2em 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current=page] { opacity: 1; border-bottom-color: var(--red-2); }
.switcher { display: flex; align-items: center; gap: .4rem; }
.switcher select { width: auto; max-width: 15rem; padding: .35em .5em; background: #fff; color: var(--navy); border-color: rgba(6,37,80,.3); font-size: .9rem; }
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--red) 140%); color: #fff; padding: 4rem 0 3.5rem; position: relative; overflow: hidden; }
.hero.has-image { background-size: cover; background-position: center; }
.hero.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(19,41,75,.92), rgba(19,41,75,.55)); }
.hero .wrap { position: relative; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: .8rem; color: var(--cream); }
.hero h1 { color: #fff; margin: .3rem 0 .6rem; }
.hero .tagline { font-size: 1.2rem; max-width: 40rem; opacity: .95; }
.hero .meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-weight: 600; margin: 1.25rem 0 1.5rem; }
.section { padding: 3rem 0; }
.section + .section { padding-top: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-title h2 { margin: 0; }
.prose { max-width: 46rem; }
.prose p { white-space: pre-line; }
.speaker { text-align: center; }
.speaker .photo { aspect-ratio: 1; width: 100%; max-width: 220px; margin: 0 auto .75rem; border-radius: 50%; object-fit: cover; background: var(--line); }
.speaker .initials { aspect-ratio: 1; width: 100%; max-width: 220px; margin: 0 auto .75rem; border-radius: 50%; display: grid; place-items: center; font-size: 2.5rem; font-weight: 800; color: #fff; background: var(--navy-2); }
.speaker h3 { margin-bottom: .15rem; }
.speaker .talk { font-style: italic; margin-top: .4rem; }
.speaker-full { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { .speaker-full { grid-template-columns: 160px 1fr; } }
.speaker-full .photo, .speaker-full .initials { max-width: 160px; margin: 0; }
.sponsor-tier { margin-bottom: 2rem; }
.sponsor-tier h3 { text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.sponsor-logos { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.sponsor-logos a, .sponsor-logos div { display: grid; place-items: center; min-width: 160px; min-height: 90px; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 700; }
.sponsor-logos img { max-height: 70px; max-width: 200px; width: auto; }
.package { display: flex; flex-direction: column; }
.package .price { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
@media (prefers-color-scheme: dark) { .package .price { color: #fff; } }
.package ul { padding-left: 1.2em; margin: .5rem 0 1rem; }
.package .left { margin-top: auto; }
.day { margin-bottom: 2rem; }
.day h3 { background: var(--navy); color: #fff; padding: .5rem .9rem; border-radius: 8px; }
.slot { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.slot .time { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.slot.break { opacity: .75; }
.slot .kind { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; font-weight: 800; color: var(--red); }
.ticket { display: grid; gap: .75rem; grid-template-columns: 1fr auto; align-items: center; }
.ticket .price { font-weight: 800; font-size: 1.25rem; }
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .9rem; margin-top: 3rem; }

/* ---------- Admin ---------- */
.admin-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.admin-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; min-height: 56px; }
.admin-header .brand { color: var(--navy); text-decoration: none; }
@media (prefers-color-scheme: dark) { .admin-header .brand { color: #fff; } }
.admin-nav { display: flex; flex-wrap: wrap; gap: .1rem .9rem; font-weight: 600; font-size: .95rem; }
.admin-nav a { color: var(--muted); text-decoration: none; padding: .3em 0; }
.admin-nav a:hover, .admin-nav a[aria-current=page] { color: var(--text); }
.admin-main { padding: 1.5rem 0 3rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.tabs a { padding: .5em .9em; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current=page] { color: var(--text); border-bottom-color: var(--accent); }
.today-group { margin-bottom: 1.5rem; }
.today-group h2 { font-size: 1rem; margin-bottom: .5rem; }
.today-item { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.today-item:last-child { border-bottom: 0; }
.today-item .who { font-weight: 700; }
.today-item .what { color: var(--muted); }
.today-item.overdue .what { color: var(--err-fg); }
.today-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: flex-end; }
.today-actions input[type=date] { width: auto; padding: .25em .4em; font-size: .85rem; }
.board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.board-col { flex: 0 0 260px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; min-height: 160px; }
.board-col.drop-target { outline: 2px dashed var(--link); }
.board-col h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; margin: .2rem .2rem .6rem; }
.board-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; margin-bottom: .5rem; cursor: grab; box-shadow: var(--shadow); }
.board-card a { font-weight: 700; text-decoration: none; color: var(--text); }
.board-card .small { margin-top: .2rem; }
.board-card.dragging { opacity: .5; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.timeline .when { font-size: .8rem; color: var(--muted); }
.timeline .body { white-space: pre-wrap; margin-top: .3rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; }
details.card summary { cursor: pointer; font-weight: 700; }
.login { max-width: 380px; margin: 10vh auto; }
.login-logo { background: var(--cream-2); border-radius: 8px; padding: 1rem 1.5rem; margin: -.25rem -.25rem 1rem; }
.admin-header .mark { width: 32px; height: 32px; }
.pill-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill-nav a { padding: .3em .8em; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); font-size: .9rem; background: var(--surface); }
.pill-nav a[aria-current=page] { background: var(--navy); color: #fff; border-color: var(--navy); }
.site-footer img { width: 28px; height: 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.site-footer a { color: var(--muted); }
.policy { max-width: 46rem; }
.policy h2 { font-size: 1.2rem; margin-top: 1.75rem; }
.policy ul { padding-left: 1.25rem; }
.policy li { margin-bottom: .4rem; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); padding: .4em .6em; border-radius: 6px; border: 1px solid var(--line); word-break: break-all; }
.edit-rows { display: grid; gap: .4rem; overflow-x: auto; }
.edit-row { display: grid; gap: .5rem; align-items: center; min-width: 640px; }
.edit-row input[type=checkbox] { width: auto; justify-self: start; }
.edit-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.stage-cols { grid-template-columns: 5rem 1fr 7rem 7rem 5rem auto; }
.deadline-cols { grid-template-columns: 7rem 1fr 7rem 9rem 4rem auto; }
