/* A lecture-hall board: chalk on slate green, one yellow stick for what matters. */
:root {
  --board: #16201b;
  --board-2: #1d2a23;
  --board-3: #26362d;
  --chalk: #eceee6;
  --dust: #a8b3aa;
  --line: #3d5045;
  --yellow: #f1d36b;
  --red: #f09a88;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { background: var(--board); color: var(--chalk); }

body {
  margin: 0;
  min-height: 100vh;
  font: 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  /* Wiped chalk: a faint smear raked from the upper left, grained so it never bands. */
  background:
    radial-gradient(120% 80% at 12% 0%, rgba(236, 238, 230, .06), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .9  0 0 0 0 .92  0 0 0 0 .88  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    var(--board);
}

a { color: var(--chalk); }
code { font-family: var(--mono); font-size: .88em; background: var(--board-3); padding: 2px 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; margin: 0; }

button, .btn {
  font: 500 15px/1 var(--sans);
  color: var(--chalk);
  background: transparent;
  border: 2px solid var(--line);
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color .2s, background .2s, color .2s;
}
button:hover, .btn:hover { border-color: var(--chalk); }
button:disabled { opacity: .55; cursor: default; }
button[type=submit], .btn.hot { background: var(--yellow); border-color: var(--yellow); color: #1b1a12; }
button[type=submit]:hover, .btn.hot:hover { background: #f7e08d; border-color: #f7e08d; }
button.link { border: 0; padding: 6px 0; color: var(--dust); }
button.link:hover { color: var(--chalk); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

input {
  font: 18px var(--sans);
  color: var(--chalk);
  background: var(--board-2);
  border: 2px solid var(--line);
  padding: 12px 14px;
  width: 100%;
}
input:focus { border-color: var(--chalk); outline: none; }

label { display: grid; gap: 8px; color: var(--dust); font-size: 15px; }
label.check { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
label.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--yellow); flex: none; }
.err { color: var(--red); min-height: 1.5em; margin: 0; }

/* ---------- landing and setup ---------- */
.board {
  max-width: 640px;
  margin: 0 auto;
  padding: 12vh 24px 64px;
  display: grid;
  gap: 48px;
}
.board.narrow { max-width: 520px; }
.board form { display: grid; gap: 18px; }
.board h1 { font-size: clamp(44px, 9vw, 72px); line-height: 1; }
.lead { color: var(--dust); margin: 0; max-width: 34em; }

.code-in input {
  font: 500 clamp(34px, 8vw, 56px)/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 18px 20px;
  text-align: center;
  border-color: var(--dust);
}
.code-in input::placeholder { color: #4b5f53; }
.redeem button { font-size: 18px; padding: 16px; }

.owner { border-top: 2px solid var(--line); padding-top: 18px; }
.owner summary { cursor: pointer; color: var(--dust); list-style: none; }
.owner summary::-webkit-details-marker { display: none; }
.owner summary::before { content: "+ "; color: var(--yellow); }
.owner[open] summary::before { content: "− "; }
.owner summary:hover { color: var(--chalk); }
.owner form { margin-top: 20px; }

/* ---------- the owner's page ---------- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 8px;
}
.bar h1 { font-size: clamp(36px, 6vw, 56px); }
.home main { max-width: 1180px; margin: 0 auto; padding: 24px 24px 80px; }

.decks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 36px 28px;
}
.deck { display: grid; grid-template-rows: auto auto 1fr; gap: 12px; }

/* Each deck as the slide it is: 16:9, framed like a projection on the board. */
.slide {
  aspect-ratio: 16 / 9;
  background: var(--board-2);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 22px 24px;
  text-decoration: none;
  border: 2px solid var(--line);
  transition: border-color .2s;
}
.slide::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(236, 238, 230, .14);
  pointer-events: none;
}
.slide span { font: 400 clamp(22px, 2.3vw, 28px)/1.1 var(--serif); text-wrap: balance; }
.slide:hover { border-color: var(--chalk); }

.meta { display: flex; justify-content: space-between; gap: 12px; color: var(--dust); font-size: 14px; }
.meta span:first-child { font-family: var(--mono); }
.acts { display: flex; gap: 10px; flex-wrap: wrap; align-self: end; }
.acts .btn { flex: 1; text-align: center; white-space: nowrap; }
.empty { color: var(--dust); grid-column: 1 / -1; }

.where { margin-top: 72px; border-top: 2px solid var(--line); padding-top: 28px; }
.where h2 { font-size: 30px; margin-bottom: 18px; }
.sessions { list-style: none; margin: 0; padding: 0; }
.sessions li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px 24px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.sessions li div:first-child { display: grid; }
.sessions b { font-weight: 500; }
.sessions span { color: var(--dust); font-size: 14px; }
.sessions .t { color: var(--dust); font-size: 14px; }
.sessions .tag { color: var(--yellow); font-size: 14px; }
.sessions .btn { padding: 8px 14px; font-size: 14px; }

/* ---------- the code, written on the board ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 12, .82);
  display: grid;
  grid-template-columns: minmax(0, 760px);
  place-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay[hidden] { display: none; }
.sheet {
  background: var(--board);
  border: 2px solid var(--line);
  padding: clamp(20px, 5vw, 48px);
  min-width: 0;
  display: grid;
  gap: 20px;
  text-align: center;
}
.say { font: 400 22px/1.35 var(--serif); margin: 0; }
.say b { color: var(--yellow); font-weight: 400; }
.small { color: var(--dust); margin: 0; font-size: 15px; }
.code { display: flex; justify-content: center; gap: clamp(4px, 1.2vw, 10px); }
.code span {
  font: 500 clamp(26px, 7.4vw, 68px)/1 var(--mono);
  color: var(--chalk);
  border-bottom: 3px solid var(--yellow);
  width: 1em;
  padding: 10px 0 8px;
}
.code span.dash { border: 0; width: .6em; color: var(--dust); }
.code.dead span { color: #55675c; border-color: #55675c; }
.sheet .btn { justify-self: center; min-width: 160px; }

@media (max-width: 640px) {
  .sessions li { grid-template-columns: 1fr auto; }
  .sessions .t { grid-column: 1 / -1; grid-row: 2; }
}

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