:root {
  color-scheme: light;
  --bg: #fbfaf6;
  --panel: #f1eee6;
  --line: #d9d4c8;
  --text: #1e1d1b;
  --muted: #7a766d;
  --blue: #2f7bc0;
  --blue-bg: #e2edf7;
  --blue-ink: #1d5a91;
  --pink-bg: #fbe6ed;
  --pink-ink: #9b3457;
  --green-bg: #e3f1e4;
  --green-ink: #2d6a35;
  /* three font roles: body text, UI chrome (labels, nav, buttons, tables), headings */
  --body: "Crimson Pro", Georgia, serif;
  --ui: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --head: var(--body);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 19px/1.5 var(--body);
}
/* Generative pattern (Turing labyrinth by default) in the side gutters on wide screens, fading out toward
   the content column. background.js grows a pattern live in a canvas; the static tile is the fallback. */
#bg { display: none; }
@media (min-width: 1100px) {
  #bg {
    display: block; position: fixed; top: 0; left: 0; z-index: -1; pointer-events: none; opacity: .13;
    --g: calc((100vw - 720px) / 2);
    --fade: linear-gradient(to right, #000 calc(var(--g) * .3), transparent var(--g),
                            transparent calc(100vw - var(--g)), #000 calc(100vw - var(--g) * .3));
    -webkit-mask-image: var(--fade); mask-image: var(--fade);
  }
  .bg-live body::before, .bg-live body::after { display: none; }
  body::before, body::after {
    content: ""; position: fixed; top: 0; bottom: 0; z-index: -1; pointer-events: none;
    width: calc((100vw - 720px) / 2);
    background: url(/assets/turing.png) 0 0 / 320px repeat;
    opacity: .13;
  }
  body::before { left: 0; -webkit-mask-image: linear-gradient(to right, #000 30%, transparent); mask-image: linear-gradient(to right, #000 30%, transparent); }
  body::after { right: 0; background-position: 160px 90px; -webkit-mask-image: linear-gradient(to left, #000 30%, transparent); mask-image: linear-gradient(to left, #000 30%, transparent); }
}
a { color: var(--blue); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.3; }
h1 { font-size: 30px; margin: 0 0 8px; }
h2 { font-family: var(--ui) !important; font-size: 13px; font-weight: 500; letter-spacing: .12em; margin: 40px 0 12px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 16px; }
.bar, .btn, .chip, .seg, .card > .label, .panel-title, .social, .crumb, .dense, .cal, .row .date,
.meta-grid dt, form label, .seg-label, details summary.small { font-family: var(--ui); }
.dot { font-size: 12px; color: var(--muted); }
.dot.ws { color: var(--blue); }
.dot.talk { color: #e07a9b; }
.caps { text-transform: uppercase; letter-spacing: .08em; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: stretch;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 13px; letter-spacing: .06em;
}
[id] { scroll-margin-top: 56px; } /* in-page jumps land below the sticky bar */
.bar a, .bar button { color: var(--text); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 9px 12px; }
.bar a:hover, .bar button:hover { background: var(--line); }
.brand { font-weight: 600; }
.nav { display: flex; flex: 1; }
.nav a[aria-current="page"] { background: var(--text); color: var(--bg); }
.nav a[aria-current="page"] .k { background: #555; color: var(--bg); }
.k { background: var(--line); color: var(--muted); padding: 0 5px; margin-right: 7px; font-size: 11px; }
.menu-btn { display: none; margin-left: auto; }
.signin { position: relative; display: flex; }
#signin-btn { background: var(--text); color: var(--bg); }
#signin-btn:hover { background: #444; }
#signin-btn.me { display: flex; align-items: center; gap: 8px; padding-top: 0; padding-bottom: 0; }
#signin-btn.me .spk-av { box-shadow: none; border-color: var(--bg); }
.bell-wrap { position: relative; display: flex; }
.bell-dot { position: absolute; top: -2px; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: #e0507e; }
.panel .nudge { background: var(--blue-bg); color: var(--blue-ink); padding: 10px 12px; margin-bottom: 12px; }
.panel .nudge p { margin: 0 0 8px; font-size: 16px; line-height: 1.35; }
.panel .nudge .btn { margin-right: 8px; }
#pf-photo { scroll-margin-top: 90px; }   /* the menu note's "Add a photo" lands here; keep the label in view */
/* .panel raises these above `.bar a`, whose padding and hover background would indent and shade them */
.panel .menu-link { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-top: 1px dashed var(--line); padding: 8px 0; color: var(--text); text-decoration: none; cursor: pointer; }
.panel .menu-link:hover { color: var(--blue); background: none; }

.panel {
  position: absolute; right: 0; top: 100%;
  width: min(320px, 100vw);
  background: var(--bg);
  border: 1px solid var(--text);
  box-shadow: 6px 6px 0 var(--line);
  padding: 14px 16px;
  letter-spacing: 0;
  font-size: 17px;
}
.panel[hidden] { display: none; }
/* the page's text as the Worker serves it, for readers without JavaScript; app.js replaces it with the real page */
.prerender { display: none; }
.panel-title { font-size: 12px; letter-spacing: .12em; margin-bottom: 8px; font-weight: 600; }
.panel .hint-list { margin: 2px 0 0; padding-left: 18px; }
.panel-more { margin-top: 18px; font-size: 13px; }
.panel-more .menu-link { display: flex; justify-content: space-between; gap: 12px; }
.panel-more .menu-link span { color: var(--muted); }

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 16px; border-top: 1px solid var(--line); }
}

/* ---------- layout ---------- */
main { max-width: 720px; margin: 0 auto; padding: 28px 16px 56px; min-height: 60vh; }
.foot { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line); text-align: center; }
.foot details { border-bottom: none; }
.foot summary { display: inline-block; color: var(--muted); letter-spacing: .1em; }
.foot details > div { padding: 4px 0 0; }
.social { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 14px; font-size: 13px; letter-spacing: .08em; }

/* box with its title sitting in the border */
.card { position: relative; border: 1px solid var(--line); padding: 20px 18px 14px; margin: 30px 0; }
.card.strong { border: 3px double var(--text); }
.card > .label {
  position: absolute; top: -.75em; left: 14px;
  background: var(--bg); padding: 0 1ch;
  font-size: 12px; letter-spacing: .12em; color: var(--muted);
}
.card > :last-child { margin-bottom: 0; }

.btn {
  display: inline-block; border: 1px solid var(--text); background: none;
  padding: 8px 14px; color: var(--text); text-decoration: none; cursor: pointer;
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
}
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { background: #444; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

.chip { display: inline-block; font-size: 11px; letter-spacing: .1em; padding: 1px 6px; text-transform: uppercase; white-space: nowrap; }
.chip.ws { background: var(--blue-bg); color: var(--blue-ink); }
.chip.talk { background: var(--pink-bg); color: var(--pink-ink); }
.chip.off, .chip.future { background: var(--panel); color: var(--muted); }
.chip.rec { background: var(--text); color: var(--bg); }
.chip.badge { border: 1px solid var(--c, var(--text)); color: color-mix(in srgb, var(--c, var(--text)) 80%, black); padding: 0 6px; margin-left: 4px; vertical-align: 2px; }

/* ---------- home ---------- */
/* Optical centering: the wide A pushes the tree and George right of center, so nudge left */
.logo { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto 10px; transform: translateX(-1.8%); }
.hero { text-align: center; }
.hero p { margin-bottom: 0; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list li + li { border-top: 1px dashed var(--line); }
.menu-list a, .menu-list .disabled { display: flex; gap: 12px; align-items: baseline; padding: 10px 4px; text-decoration: none; color: var(--text); }
.menu-list a:hover { background: var(--panel); }
.menu-list .arrow { color: var(--muted); }
.menu-list .grow { flex: 1; }
.menu-list .disabled { color: var(--muted); cursor: not-allowed; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 22px 0 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg-label { font-size: 11px; letter-spacing: .12em; color: var(--muted); margin-right: 8px; }
.seg button {
  background: var(--panel); border: 0; cursor: pointer; padding: 4px 11px;
  font-size: 12px; letter-spacing: .08em; color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* ---------- lists at three detail levels ---------- */
.empty { color: var(--muted); padding: 14px 0; }

table { border-collapse: collapse; width: 100%; }
.dense { font-size: 13px; }
.dense th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--text); padding: 4px 8px 4px 0; }
.dense td { padding: 6px 8px 6px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.dense td:first-child { white-space: nowrap; }
.dense a { color: var(--text); }

.rows { border-top: 1px solid var(--text); }
.row { display: grid; grid-template-columns: 8ch 1fr; gap: 14px; padding: 12px 4px; border-bottom: 1px dashed var(--line); color: var(--text); text-decoration: none; }
.row:hover { background: var(--panel); }
.row .date { color: var(--muted); font-size: 13px; padding-top: 2px; }
.row .title { font-weight: 600; }
.row .meta { font-size: 16px; color: var(--muted); }

.full .card h3 { margin: 0 0 4px; font-size: 23px; }
.full .card h3 a { color: var(--text); }
.full .who { font-size: 16px; color: var(--muted); margin-bottom: 12px; }
.full .bio { font-size: 17px; border-left: 3px solid var(--line); padding-left: 12px; color: #4a4741; }

details { border-bottom: 1px dashed var(--line); }
details summary { cursor: pointer; padding: 10px 0; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; color: var(--muted); }
details[open] summary::before { content: "▾ "; }
details > div { padding: 0 0 14px 2ch; }
.questions { border-bottom: none; margin: -6px 0 6px; }
.questions summary { color: var(--muted); letter-spacing: .1em; }
.questions ol { margin: 0; padding-left: 2.2ch; }
.questions li { margin: 3px 0; }

/* ---------- event page ---------- */
.crumb { font-size: 13px; letter-spacing: .08em; text-decoration: none; }
.meta-grid { display: grid; grid-template-columns: 9ch 1fr; gap: 4px 14px; font-size: 18px; margin: 16px 0; }
.meta-grid dt { color: var(--muted); font-size: 12px; letter-spacing: .1em; padding-top: 2px; }
.meta-grid dd { margin: 0; }
.video {
  aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center;
  background: var(--text); color: var(--bg); text-decoration: none; margin: 20px 0;
}
.video:hover { background: #333; }
.video big { font-size: 34px; display: block; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; font-size: 16px; }
.pager a { text-decoration: none; max-width: 48%; }

/* ---------- calendar ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 8px; }
.cal { table-layout: fixed; font-size: 12px; }
.cal th { font-weight: 500; font-size: 11px; letter-spacing: .1em; color: var(--muted); padding: 4px; text-align: left; border-bottom: 1px solid var(--text); }
.cal td { height: 84px; vertical-align: top; padding: 4px; border: 1px solid var(--line); }
.cal td.today { outline: 2px solid var(--text); outline-offset: -2px; }
.cal .n { color: var(--muted); }
.cal .ev { display: block; margin-top: 4px; padding: 2px 4px; text-decoration: none; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.ws { background: var(--blue-bg); color: var(--blue-ink); }
.cal .ev.talk { background: var(--pink-bg); color: var(--pink-ink); }
.cal .ev.off { background: var(--panel); color: var(--muted); }
.cal .ev .t { display: block; }
@media (max-width: 600px) {
  .cal td { height: 54px; padding: 2px; }
  .cal .ev { font-size: 10px; padding: 1px 2px; }
  .cal .ev .t { display: none; }
}

/* ---------- forms ---------- */
form label { display: block; font-size: 12px; letter-spacing: .1em; color: var(--muted); margin: 14px 0 4px; }
form label.check { font-family: var(--body); letter-spacing: 0; font-size: 18px; color: var(--text); margin: 8px 0; }
.name-row { display:grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 480px) { .name-row { grid-template-columns: 1fr; } }
/* required fields get an asterisk (not in the one-field sign-in panel) */
form:not(.panel) label:has(+ :is(input, textarea, select)[required])::after { content: " *"; color: var(--pink-ink); }
input[type=text], input[type=email], input[type=url], textarea, select {
  width: 100%; font: inherit; font-size: 18px; padding: 6px 10px;
  background: #fff; border: 1px solid var(--line); color: var(--text); border-radius: 0;
}
input[type=file] { font-family: var(--ui); font-size: 13px; color: var(--muted); border: none; padding: 0; background: none; width: auto; }
input[type=file]::file-selector-button {
  font: inherit; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
  border: 1px solid var(--text); background: none; padding: 8px 14px; margin-right: 12px; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--panel); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
form .btn { margin-top: 16px; }
.note { margin-top: 14px; padding: 8px 10px; font-size: 16px; background: var(--green-bg); color: var(--green-ink); }
.note.error { background: var(--pink-bg); color: var(--pink-ink); }
.slot-open { color: #2b7a3d; font-weight: 600; }

/* ---------- showcase presenter box ---------- */
.presenter { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); background: #fff; padding: 8px 10px; margin-top: 10px; }
.presenter .avatar {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--blue-bg); color: var(--text); font-family: var(--ui); font-size: 13px; letter-spacing: .05em;
}
.presenter .pinfo { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.presenter .plabel { font-family: var(--ui); font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.presenter .ptitle { font-size: 17px; }
.presenter b { font-size: 17px; }
.presenter.big { border-color: var(--text); box-shadow: 5px 5px 0 var(--line); padding: 14px 16px; margin: 16px 0; }
.presenter.big .avatar { width: 56px; height: 56px; font-size: 18px; }
.presenter.big b { font-size: 20px; }
.presenter.big .ptitle { font-size: 19px; }
.presenter .pblurb { font-size: 17px; color: #4a4741; margin-top: 8px; }
.presenter.open { background: none; border-style: dashed; box-shadow: none; }
.presenter.open .avatar { background: var(--panel); color: var(--muted); }
.slot-line { font-family: var(--ui); font-size: 12px; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.kinds { margin: 0 0 10px; padding-left: 2ch; }

/* ---------- banner ---------- */
.banner { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; background: var(--panel); border: 1px solid var(--text); box-shadow: 5px 5px 0 var(--line); margin: 16px 0 8px; }
.full .card .banner, .next .banner { margin: 0 0 14px; }
.presenter img.avatar { object-fit: cover; background: #fff; border: 1px solid var(--text); }
.presenter.big img.avatar { width: 72px; height: 72px; box-shadow: 3px 3px 0 var(--line); }
.presenter.big { flex-wrap: wrap; }
.presenter.big .pinfo { flex: 1; }
.presenter .banner { flex-basis: 100%; margin: 0 0 4px; box-shadow: none; }

/* ---------- speaker avatar ---------- */
.spk-av { flex: none; display: block; object-fit: cover; background: #fff; border: 1px solid var(--text); box-shadow: 3px 3px 0 var(--line); }
.row-body { display: flex; gap: 14px; align-items: flex-start; }
.spk { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.spk p { margin-bottom: 8px; }
.spk .bio { margin: 0; flex: 1; }
/* on phones only the big speaker portrait stacks above its bio; small portraits stay beside their line */
@media (max-width: 480px) { .spk.tall { flex-direction: column; } }
@media (max-width: 480px) { .next .spk-av { width: 52px !important; height: 52px !important; } }

/* ---------- people ---------- */
.row.person { grid-template-columns: auto 1fr; align-items: center; }
.spk-av.initials { display: grid; place-items: center; font-family: var(--ui); color: var(--text); }
.plinks { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.link-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-bottom: 8px; }
@media (max-width: 480px) { .link-row { grid-template-columns: 1fr; gap: 4px; margin-bottom: 12px; } }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 20px 0; }
.stat { border: 1px solid var(--line); padding: 10px 12px; }
.stat b { display: block; font-family: var(--head); font-size: 30px; line-height: 1.1; }
.stat span { font-family: var(--ui); font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.scroll { overflow-x: auto; }

/* badge request: color swatches */
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }
.swatches label { margin: 0; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches span[style] { display: block; width: 22px; height: 22px; border: 2px solid var(--bg); outline: 1px solid var(--line); }
.swatches input:checked + span { outline: 2px solid var(--text); }
.swatches input:focus-visible + span { outline: 2px solid var(--blue); }
#pf-badge-preview .badge { margin-left: 8px; }
.btn.sm { padding: 2px 8px; font-size: 11px; }
.form-sub { font-family: var(--ui); font-size: 12px; letter-spacing: .12em; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 18px; margin: 24px 0 4px; }
.human-box { margin-top: 16px; }
.av-maker { display: flex; gap: 16px; align-items: flex-start; margin: 12px 0 0; }
.av-maker #av-out { width: 96px; height: 96px; image-rendering: pixelated; }
/* while a portrait is being made: an 8-pixel chase over the portrait and a block bar that fills in 30s */
.av-frame { position: relative; flex: none; }
.pix-spin { position: absolute; inset: 1px; display: grid; place-content: center; grid-template: repeat(3, 10px) / repeat(3, 10px); gap: 3px; background: rgb(251 250 246 / .8); }
.pix-spin[hidden] { display: none; }
.pix-spin i { background: var(--line); animation: pix-chase .8s steps(1) infinite; }
/* clockwise around the 3x3 grid, center left empty */
.pix-spin i:nth-child(1) { grid-area: 1 / 1; animation-delay: -.8s; }
.pix-spin i:nth-child(2) { grid-area: 1 / 2; animation-delay: -.7s; }
.pix-spin i:nth-child(3) { grid-area: 1 / 3; animation-delay: -.6s; }
.pix-spin i:nth-child(4) { grid-area: 2 / 3; animation-delay: -.5s; }
.pix-spin i:nth-child(5) { grid-area: 3 / 3; animation-delay: -.4s; }
.pix-spin i:nth-child(6) { grid-area: 3 / 2; animation-delay: -.3s; }
.pix-spin i:nth-child(7) { grid-area: 3 / 1; animation-delay: -.2s; }
.pix-spin i:nth-child(8) { grid-area: 2 / 1; animation-delay: -.1s; }
@keyframes pix-chase { 0% { background: var(--text); } 12.5% { background: var(--muted); } 25% { background: var(--line); } }
.av-wait { margin: 10px 0 0; font-family: var(--ui); font-size: 12px; color: var(--muted); }
.av-wait p { margin: 0 0 6px; }
.av-bar { display: block; width: 204px; height: 12px; border: 1px solid var(--text); padding: 1px; }
.av-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--blue) 0 8px, transparent 8px 10px); animation: av-fill 30s steps(20) forwards; }
@keyframes av-fill { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .pix-spin i { animation-duration: 2.4s; } }
.convert summary { cursor: pointer; color: var(--muted); }
.convert input { margin: 4px 0; min-width: 160px; }
