@import url('https://fonts.googleapis.com/css2?family=Literata:opsz,wght@7..72,400;7..72,600;7..72,700&family=Public+Sans:wght@400;500;600;700&display=swap');

:root {
  --gold: #e3ab4f;
  --coral: #e2685a;
  --teal: #52c2a1;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Public Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: 'Literata', Georgia, serif; }
button { font-family: inherit; cursor: pointer; }
.tabular { font-variant-numeric: tabular-nums; }

/* ============================= PRESENTER (dark, projector) ============================= */
body.presenter {
  --bg: #14182b;
  --surface: #1d2238;
  --surface-raised: #242a47;
  --text: #f1efe6;
  --text-dim: #b7bad0;
  --line: #333a5c;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.stage {
  display: grid;
  grid-template-columns: 1fr 440px;
  height: 100vh;
}

.slide-area {
  padding: 4.5vh 4vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.eyebrow {
  font-family: 'Public Sans', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}
.slide-title {
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.9rem;
  text-wrap: balance;
  max-width: 26ch;
}
.slide-subtitle {
  font-size: 1.55rem;
  color: var(--text-dim);
  max-width: 50ch;
  margin: 0;
  line-height: 1.5;
}

.bullets {
  list-style: none;
  margin: 1.3rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 74ch;
}
.bullets li {
  font-size: 1.45rem;
  line-height: 1.5;
  padding-left: 2.2rem;
  position: relative;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

.callout {
  margin-top: 1.6rem;
  max-width: 62ch;
  padding: 1.1rem 1.4rem;
  background: rgba(227, 171, 79, 0.12);
  border: 1px solid rgba(227, 171, 79, 0.4);
  border-radius: var(--radius);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--text);
}

.stage-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-top: 2.2rem;
  max-width: 90ch;
}
.stage-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.stage-chip-name { font-weight: 700; color: var(--gold); font-size: 1.05rem; margin-bottom: 0.35rem; }
.stage-chip-outlook { font-size: 0.9rem; color: var(--text-dim); line-height: 1.4; }

.stagemap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.6rem;
}
.stage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.stage-card .stage-num {
  font-family: 'Public Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.stage-card h3 { font-size: 1.15rem; margin: 0; line-height: 1.25; }
.stage-card dl { margin: 0.3rem 0 0; display: flex; flex-direction: column; gap: 0.5rem; }
.stage-card dt {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.stage-card dd { margin: 0.1rem 0 0; font-size: 0.92rem; line-height: 1.4; color: var(--text); }

.scaffold-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.4rem;
  max-width: 62ch;
}
.scaffold-box, .bad-examples {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-size: 1.1rem;
  flex: 1 1 260px;
}
.scaffold-box { border-color: rgba(82, 194, 161, 0.5); }
.scaffold-label, .bad-examples-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.bad-example {
  text-decoration: line-through;
  color: var(--coral);
  opacity: 0.85;
  margin-bottom: 0.3rem;
}
.bad-examples-note { font-size: 0.85rem; color: var(--text-dim); margin: 0.5rem 0 0; }

#revealBox:empty { display: none; }
.reveal-card {
  margin-top: 1.6rem;
  max-width: 64ch;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  position: relative;
}
.reveal-text { font-family: 'Literata', serif; font-size: 1.6rem; line-height: 1.4; }
.reveal-close {
  position: absolute;
  top: 0.7rem; right: 0.8rem;
  background: none; border: none; color: var(--text-dim);
  font-size: 1rem;
}
.reveal-hint { font-size: 0.78rem; color: var(--text-dim); margin: 0 0 0.6rem; }

.scholar-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }
.scholar-card {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
}
.scholar-avatar {
  width: 3.4rem; height: 3.4rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--coral));
  color: #1b1200; font-weight: 700; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.scholar-photo { object-fit: cover; object-position: top center; }
.scholar-card { padding: 0.7rem 1.3rem 0.7rem 0.7rem; gap: 1rem; }
.scholar-name { font-size: 1.1rem; }
.scholar-role, .scholar-note { font-size: 0.9rem; }
.scholar-name { font-size: 0.92rem; font-weight: 600; }
.scholar-role, .scholar-note { font-size: 0.76rem; color: var(--text-dim); }

.progression-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.flow-stage {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.5rem 1rem; font-size: 1rem; font-weight: 600;
}
.flow-arrow { color: var(--gold); font-size: 1.3rem; }
.branch-list { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 1.2rem; max-width: 62ch; }
.branch-item {
  display: flex; gap: 0.9rem; align-items: baseline;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1rem;
}
.branch-name { font-weight: 700; color: var(--coral); flex: none; width: 8rem; }
.branch-desc { font-size: 0.98rem; color: var(--text); line-height: 1.45; }

.challenge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 1.4rem; max-width: 56ch; }
.quadrant { border-radius: var(--radius); padding: 1rem 1.1rem; border: 1px solid var(--line); }
.quadrant.tone-good { background: rgba(82, 194, 161, 0.14); border-color: var(--teal); }
.quadrant.tone-bad { background: rgba(226, 104, 90, 0.14); border-color: var(--coral); }
.quadrant.tone-low { background: var(--surface); }
.quadrant-label { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 0.4rem; }
.quadrant-outcome { font-weight: 700; font-size: 1.05rem; }

.slide-footer-note { max-width: 62ch; color: var(--text-dim); font-size: 1rem; margin-top: 1.3rem; line-height: 1.5; }

.embed-frame {
  margin-top: 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  max-width: 100%;
  width: 100%;
}
.embed-frame iframe {
  width: 100%; height: 100%; border: none; display: block;
  zoom: 1.35; /* the embedded page (bio/handout) stays normal-sized for phone
                 viewers; this only enlarges it for the projected copy */
}
.embed-qr-row {
  display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem;
}
.embed-qr-row img { border-radius: 6px; background: #fff; padding: 4px; }
.embed-qr-row .handout-url { font-size: 0.85rem; color: var(--text-dim); }

.handout-card {
  display: flex; align-items: center; gap: 1.2rem; margin-top: 1.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; max-width: 56ch;
}
.handout-card img { border-radius: 8px; background: #fff; padding: 6px; }
.handout-url { font-family: 'Public Sans', sans-serif; font-weight: 600; }
.handout-hint { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.3rem; }

.closing-contact { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.closing-row { display: flex; align-items: baseline; gap: 0.9rem; }
.closing-kind {
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); width: 3.6rem; flex: none;
}
.closing-value { font-size: 1.3rem; font-weight: 600; color: var(--gold); }
.closing-subject-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-top: 0.9rem; }
.closing-subject { font-style: italic; font-size: 1.05rem; }

/* Sidebar: join code + live results */
.sidebar {
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 2rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  overflow-y: auto;
}
.join-box {
  background: var(--surface-raised);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
}
.join-box .label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.join-box .code {
  font-family: 'Public Sans', sans-serif;
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: 0.08em;
  color: var(--gold);
}
.join-box .url { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.3rem; }
.join-box img { margin-top: 0.9rem; border-radius: 8px; }

.results-panel h4 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.9rem;
}
.results-count { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 0.7rem; }

.bar-row { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.8rem; }
.bar-row .bar-label { display: flex; justify-content: space-between; font-size: 0.85rem; }
.bar-track { background: rgba(255,255,255,0.08); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--coral)); border-radius: 6px; transition: width 0.4s ease; }

.wall-grid { display: flex; flex-direction: column; gap: 0.6rem; max-height: 60vh; overflow-y: auto; }
.wall-card {
  background: var(--surface-raised);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.cloud { display: flex; flex-wrap: wrap; gap: 0.5rem 0.7rem; align-items: baseline; }
.cloud span { color: var(--text); }

.revealable { cursor: pointer; transition: background 0.15s ease, transform 0.1s ease; }
.wall-card.revealable:hover { background: rgba(227, 171, 79, 0.18); }
.cloud span.revealable:hover { color: var(--gold); transform: scale(1.06); display: inline-block; }

.nav-controls {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  z-index: 5;
}
.nav-btn {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
}
.nav-btn:hover { border-color: var(--gold); }
.nav-progress { font-size: 0.8rem; color: var(--text-dim); }

.setup-screen {
  max-width: 640px;
  margin: 8vh auto;
  padding: 2rem;
  color: var(--text);
}
.setup-screen input, .setup-screen textarea, .setup-screen select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  margin: 0.4rem 0 1.1rem;
}
.setup-screen button.primary {
  background: var(--gold);
  color: #1b1200;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.4rem;
  font-weight: 600;
  font-size: 1rem;
}

/* ============================= STUDENT (light, mobile) ============================= */
body.student {
  --bg: #f2f4f6;
  --surface: #ffffff;
  --text: #1b1f2e;
  --text-dim: #565c72;
  --line: #dbe0e6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.student-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.student-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}
.student-header .brand {
  font-family: 'Literata', serif;
  font-weight: 600;
  font-size: 1.1rem;
}
.student-header .session-code {
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}

.join-card, .prompt-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(20,20,30,0.06);
}

.prompt-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 0.6rem;
}
.prompt-text {
  font-family: 'Literata', serif;
  font-size: 1.35rem;
  line-height: 1.4;
  margin: 0 0 0.4rem;
}
.prompt-instructions {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0 0 1.2rem;
}

.student-wrap input[type="text"], .student-wrap textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  font-family: inherit;
  margin-bottom: 0.9rem;
}
.student-wrap .option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 1.02rem;
  margin-bottom: 0.7rem;
}
.student-wrap .option-btn.selected {
  border-color: var(--coral);
  background: rgba(226, 104, 90, 0.08);
  font-weight: 600;
}
.student-wrap button.submit {
  width: 100%;
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.9rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.student-wrap button.submit:disabled { opacity: 0.5; }

.waiting-state, .thanks-state {
  text-align: center;
  color: var(--text-dim);
  padding: 3rem 1rem;
  font-size: 1.05rem;
}
.thanks-state .big { font-size: 2.2rem; margin-bottom: 0.6rem; }

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; overflow-y: auto; }
  .sidebar { border-left: none; border-top: 1px solid var(--line); }
  .stagemap { grid-template-columns: repeat(2, 1fr); }
}
