/* Blackboard Dark Stage (CI v2.3): pure black page, EloquiaDisplay, BB_LIGHT eyebrows, pill buttons. */
@font-face { font-family: "Eloquia"; src: url("fonts/EloquiaDisplay-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Eloquia"; src: url("fonts/EloquiaDisplay-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Eloquia"; src: url("fonts/EloquiaDisplay-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Eloquia"; src: url("fonts/EloquiaDisplay-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --black: #000000;
  --white: #ffffff;
  --soft: #D9DDE6;
  --muted: #B3B3B3;
  --subtle: #8C8C8C;
  --line: #6B6B6B;
  --line-dim: #24293a;
  --surface: #0B0F1C;
  --surface-2: #05070D;
  --blue: #3B6BF5;
  --navy: #1F3380;
  --light: #6C9FCB;
  --green: #7BC096;
  --red: #E62B1E;
  --signal: #C2560C;
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font: 400 17px/1.55 "Eloquia", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--light); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--white); }
:focus-visible { outline: 2px solid var(--light); outline-offset: 3px; }
img { max-width: 100%; height: auto; }

/* ---------- Frame ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1080px; margin: 0 auto; padding: 20px 16px;
}
.brand img { display: block; width: 170px; height: auto; }
.topnav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 15px; }
.topnav a, .linklike { color: var(--muted); text-decoration: none; }
.topnav a:hover, .linklike:hover { color: var(--white); }
.linklike { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.page { max-width: 780px; margin: 0 auto; padding: 24px 16px 64px; }
.page:has(#people), .page:has(.table) { max-width: 1080px; }
.footer { max-width: 1080px; margin: 0 auto; padding: 32px 16px 48px; border-top: 1px solid var(--line-dim); color: var(--subtle); font-size: 13px; }
.footer a { color: var(--subtle); }
.footer a:hover { color: var(--white); }
.coreline { color: var(--muted); font-weight: 300; font-size: 16px; margin: 0 0 6px; }

/* ---------- Type ---------- */
h1 { font-weight: 800; font-size: clamp(32px, 6vw, 48px); line-height: 1.08; letter-spacing: -0.015em; margin: 6px 0 12px; }
h2 { font-weight: 600; font-size: 24px; line-height: 1.2; margin: 4px 0 10px; }
.h3 { font-size: 20px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.h4 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.24em; color: var(--light); margin: 0; }
.eyebrow a { color: var(--light); text-decoration: none; }
.lead { color: var(--soft); font-size: 18px; max-width: 62ch; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.fine { color: var(--subtle); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 14px; }
.break { word-break: break-all; }
.req { color: var(--light); }
.hint { color: var(--subtle); font-weight: 400; font-size: 13px; }
.ok { color: var(--green); }
.warn { color: var(--signal); }
.notice { border-left: 3px solid var(--green); background: var(--surface); padding: 12px 16px; border-radius: 8px; color: var(--soft); }
.error { border-left: 3px solid var(--red); background: var(--surface); padding: 12px 16px; border-radius: 8px; color: var(--white); }
.error::before { content: "⚠ "; color: var(--red); }

.narrow { max-width: 560px; }
.narrow-form { max-width: 640px; margin-top: 32px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 28px; border-radius: 999px; border: 1px solid transparent;
  font: 600 17px/1 "Eloquia", "Helvetica Neue", Arial, sans-serif; color: var(--white);
  text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s;
}
.btn:hover { color: var(--white); }
.btn-primary { background: var(--blue); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--signal); }
.btn-signal { background: var(--signal); }
.btn-signal:hover, .btn-signal:focus-visible { background: var(--blue); }
.btn-outline { background: transparent; border-color: var(--line); font-weight: 400; }
.btn-outline:hover, .btn-outline:focus-visible { background: var(--blue); border-color: var(--blue); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0; }
form.inline { display: inline; margin: 0; }
@media (max-width: 560px) { .btn { min-height: 44px; font-size: 15px; padding: 0 22px; } }

/* ---------- Cards and forms ---------- */
.card {
  background: var(--surface-2); border: 1px solid var(--line-dim); border-radius: var(--radius);
  padding: 24px; margin: 20px 0;
}
.form label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 16px; }
.form input[type=text], .form input[type=email], .form input[type=date], .form input[type=number], .form select, .form textarea,
.inline-form input[type=text], .inline-form input[type=number], .inline-form select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  background: var(--black); color: var(--white); border: 1px solid var(--line); border-radius: 10px;
  font: 400 16px/1.4 "Eloquia", "Helvetica Neue", Arial, sans-serif;
}
.form textarea.mono { font-family: var(--mono); font-size: 14px; }
.form input:focus, .form textarea:focus, .form select:focus, .inline-form input:focus { border-color: var(--light); outline: none; }
.form input[type=file] { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }
.check { display: flex !important; gap: 12px; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.consent-text { color: var(--muted); font-size: 14px; }
.code-input { font-size: 28px !important; letter-spacing: 0.3em; text-align: center; font-family: var(--mono) !important; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.inline-form input[type=text], .inline-form select { width: auto; flex: 1 1 220px; margin: 0; }
.inline-form input.num { width: 90px; flex: none; margin: 0; }
.checks { border: 0; padding: 0; margin: 0 0 12px; }
.checks .check { margin-bottom: 6px; }
.danger-zone { border-color: #3a1c1a; }
.top-gap { margin-top: 28px; }

/* ---------- Workshop page ---------- */
.ws-head { margin-bottom: 8px; }
.toc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.toc-section { color: var(--light); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; margin: 16px 0 6px; }
.toc-list { margin: 0; padding-left: 22px; }
.toc-list li { padding: 3px 0; }
.toc-list li span { float: right; color: var(--subtle); font-size: 14px; margin-left: 12px; }
.toc-list a { color: var(--white); text-decoration: none; }
.toc-list a:hover { color: var(--light); }

.ws-section { margin: 36px 0 0; }
.ws-section > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.ws-section > summary::-webkit-details-marker { display: none; }
.ws-section > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.ws-section:not([open]) > summary::after { transform: rotate(-90deg); }
.ws-section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--light); }
.count { display: inline-flex; min-width: 26px; height: 22px; padding: 0 8px; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--navy); color: var(--white); font-size: 12px; font-weight: 600; letter-spacing: 0; }

.item { scroll-margin-top: 16px; border-left: 3px solid var(--blue); }
.item-time { color: var(--subtle); font-size: 13px; margin: 0 0 2px; }
.item-desc { color: var(--soft); margin: 0 0 14px; }
.prompt { background: var(--black); border: 1px solid var(--line-dim); border-radius: 12px; margin: 14px 0; overflow: hidden; }
.prompt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line-dim); }
.prompt pre, .small-pre {
  margin: 0; padding: 16px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-wrap: break-word;
  font: 400 14px/1.6 var(--mono); color: var(--soft);
}
.small-pre { background: var(--black); border-radius: 8px; max-height: 240px; }
.files, .links, .plain { list-style: none; margin: 12px 0 0; padding: 0; }
.files li a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line-dim); border-radius: 10px; color: var(--white); text-decoration: none;
}
.files li a:hover { border-color: var(--blue); }
.dl { color: var(--light); font-weight: 800; }
.fname { flex: 1; word-break: break-word; }
.fsize { color: var(--subtle); font-size: 13px; white-space: nowrap; }
.links li { margin: 6px 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line-dim); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 14px 0; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-dim); }
.to-top { margin: 14px 0 0; font-size: 13px; }
.to-top a { color: var(--subtle); text-decoration: none; }

.contribute { margin-top: 56px; }
.divider-label { display: flex; align-items: center; gap: 16px; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line-dim); }
.contribute-card { border-style: dashed; border-color: var(--line); }
.contribute-card > summary { cursor: pointer; font-weight: 600; font-size: 18px; }
.contribute-card[open] > summary { margin-bottom: 8px; }

/* ---------- Home tiles ---------- */
.tiles { list-style: none; padding: 0; display: grid; gap: 14px; }
.tile { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 22px 24px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line-dim); color: var(--white); text-decoration: none; }
.tile:hover { border-color: var(--blue); color: var(--white); }
.tile-meta { color: var(--muted); font-size: 13px; grid-column: 1; }
.tile-title { font-weight: 300; font-size: 26px; line-height: 1.15; grid-column: 1; }
.tile-go { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.tile:hover .tile-go { background: var(--signal); }

/* ---------- Admin ---------- */
.subnav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; border-bottom: 1px solid var(--line-dim); padding-bottom: 10px; }
.subnav a { color: var(--muted); text-decoration: none; }
.subnav a:hover { color: var(--white); }
.share { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.qr canvas { display: block; width: 220px; height: 220px; border-radius: 12px; image-rendering: pixelated; }
@media (max-width: 640px) { .share { grid-template-columns: 1fr; } }
.review { border-top: 1px solid var(--line-dim); padding: 16px 0; }
.review h3 { margin: 0 0 8px; font-size: 19px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.review-actions .inline-form { margin: 0; }
.admin-section { border-top: 1px solid var(--line-dim); padding: 14px 0; }
.section-edit input[type=text] { font-weight: 600; }
.admin-items { margin: 8px 0 0; padding-left: 20px; }
.admin-items li { padding: 4px 0; }
.admin-items a { color: var(--white); }
.table-wrap { overflow-x: auto; margin: 12px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table.small { font-size: 13px; }
.table th { text-align: left; color: var(--light); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line-dim); vertical-align: top; }
.table td a { color: var(--white); }

/* ---------- Legal ---------- */
.legal { max-width: 720px; }
.legal h2 { font-size: 20px; margin-top: 32px; }
.legal p { color: var(--soft); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
