:root {
  --bg: #14110f;
  --bg-glow: #2a1d14;
  --panel: #1d1814;
  --ink: #f4ebe0;
  --muted: #b8a999;
  --accent: #f2a65a;
  --accent-ink: #1d1814;
  --onair: #ff5a4e;
  --ok: #7fd1a0;
  --danger: #ff8a80;
  --cabinet: #3a2a1f;
  --cabinet-edge: #5a4030;
  --grille: #241a14;
  --dial: #f8e3c4;
  --rule: rgba(244, 235, 224, 0.14);
  --chip: rgba(244, 235, 224, 0.08);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f1e8; --bg-glow: #f1dcc2; --panel: #fffaf3; --ink: #241a14; --muted: #6b5a4b; --accent: #b8611f;
    --accent-ink: #ffffff; --onair: #d33a2f; --ok: #2f7d4f; --danger: #b3261e; --rule: rgba(36, 26, 20, 0.14);
    --chip: rgba(36, 26, 20, 0.07); color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(ellipse at 50% 0%, var(--bg-glow), var(--bg) 60%) no-repeat, var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
[hidden] { display: none !important; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.hero { text-align: center; padding: 40px 16px 24px; }
.radio { width: min(260px, 70vw); height: auto; display: block; margin: 0 auto 18px; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); margin: 0 0 4px; line-height: 1.1; }
.tagline { margin: 0 0 22px; font-family: Georgia, serif; font-style: italic; color: var(--accent); font-size: 1.1rem; }
.needle { animation: tune 9s ease-in-out infinite; }
.live .lamp { fill: var(--onair); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes tune { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(80px); } }
@media (prefers-reduced-motion: reduce) { .needle, .live .lamp, .badge i { animation: none; } }

.onair { display: grid; justify-items: center; gap: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px; border: 1px solid var(--rule); border-radius: 999px;
  font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live .badge { color: var(--onair); border-color: var(--onair); }
.live .badge i { background: var(--onair); box-shadow: 0 0 10px var(--onair); animation: pulse 1.6s ease-in-out infinite; }
.when { margin: 0; font-size: 1.05rem; }
.play {
  display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 600; cursor: pointer;
  padding: 12px 26px; border-radius: 999px; border: none; background: var(--accent); color: var(--accent-ink); font-size: 1.05rem;
}
.play svg { width: 22px; height: 22px; fill: currentColor; }

main { max-width: 720px; margin: 0 auto; padding: 0 16px 40px; display: grid; gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: 18px; padding: 22px; }
.card h2 { margin: 0 0 6px; font-size: 1.5rem; }
.card > p { margin: 0 0 14px; }

.lineup { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.lineup li { display: flex; gap: 16px; align-items: baseline; }
.lineup .time { font-family: Georgia, serif; color: var(--accent); width: 70px; flex: none; white-space: nowrap; }
.lineup div { display: grid; }
.lineup div span { color: var(--muted); font-size: 0.95rem; overflow-wrap: anywhere; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { font-weight: 400; color: var(--muted); }
input, textarea, select {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--rule);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.check input { width: auto; margin-top: 4px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
button.primary {
  justify-self: start; font: inherit; font-weight: 600; cursor: pointer; padding: 10px 22px; border-radius: 10px;
  border: none; background: var(--accent); color: var(--accent-ink);
}
button:disabled { opacity: 0.6; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reply:empty { display: none; }
.reply { padding: 12px 14px; border-radius: 10px; background: var(--chip); }
.reply.ok { border-left: 3px solid var(--ok); }
.reply.bad { border-left: 3px solid var(--danger); }
.reply ul { margin: 8px 0 0; padding-left: 20px; }

.archive { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 14px; }
.archive li { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.archive li:last-child { border-bottom: none; padding-bottom: 0; }
.archive .date { color: var(--muted); font-size: 0.85rem; }
.archive .title { font-weight: 600; }
.archive .meta { color: var(--muted); font-size: 0.9rem; }
.archive audio { width: 100%; }
.about p { margin: 0 0 12px; }
footer { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 0 16px 32px; }
footer p { margin: 0 0 6px; }

@media (max-width: 560px) {
  .form .row { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}

/* your tickets */
.tickets { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.ticket { padding: 12px 14px; border-radius: 12px; background: var(--chip); border-left: 3px solid var(--accent); display: grid; gap: 4px; }
.ticket.done { border-left-color: var(--ok); }
.ticket.off { border-left-color: var(--muted); }
.ticket .kind { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ticket .snippet { font-style: italic; overflow-wrap: anywhere; }
.ticket .state { font-weight: 600; }
.ticket audio { width: 100%; margin-top: 6px; }
button.listen, button.chapter {
  font: inherit; cursor: pointer; border-radius: 999px; padding: 5px 14px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink); justify-self: start;
}
button.listen { border-color: var(--ok); color: var(--ok); font-weight: 600; margin-top: 4px; }
.chapters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chapter { font-size: 0.85rem; }

/* sponsor */
.sponsor {
  display: inline-grid; justify-items: center; gap: 2px; margin: 22px auto 0; padding: 12px 22px;
  border: 1px solid var(--rule); border-radius: 14px; background: var(--panel); color: var(--ink); text-decoration: none;
}
.sponsor[href]:hover { border-color: var(--accent); }
.sponsor .label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sponsor .name { font-family: Georgia, serif; font-size: 1.6rem; line-height: 1.2; }
.sponsor .tag { color: var(--muted); font-size: 0.9rem; font-style: italic; }
.sponsor .site { color: var(--accent); font-size: 0.9rem; font-weight: 600; }
footer a { color: inherit; }

/* questions closed */
.closed-note { padding: 10px 14px; border: 1px dashed var(--rule); border-radius: 10px; color: var(--ink); font-weight: 600; }
.form :disabled { opacity: 0.55; cursor: not-allowed; }

/* the hosts */
.hosts { display: flex; justify-content: center; align-items: flex-end; gap: clamp(2px, 2vw, 22px); margin: 0 auto 18px; }
.hosts .radio { width: min(260px, 46vw); margin: 0; flex: none; }
.host { margin: 0; display: grid; justify-items: center; gap: 2px; }
.host img {
  width: clamp(76px, 22vw, 140px); height: auto; display: block; transition: transform 0.25s ease, filter 0.25s ease;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}
.host figcaption {
  font-family: Georgia, serif; font-size: 0.9rem; color: var(--muted); padding: 1px 10px; border-radius: 999px;
  border: 1px solid transparent; transition: color 0.25s ease, border-color 0.25s ease;
}
.host.speaking img { transform: scale(1.05); filter: drop-shadow(0 0 22px rgba(242, 166, 90, 0.55)); animation: bob 0.9s ease-in-out infinite; }
.host.speaking figcaption { color: var(--accent); border-color: var(--accent); }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) { .host.speaking img { animation: none; } }
.meet { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.meet li { display: grid; gap: 10px; align-content: start; }
.meet img { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--rule); }
@media (max-width: 520px) { .meet { grid-template-columns: 1fr; } }

/* live perk: tonight's lesson picture */
.perk { margin: 4px auto 0; max-width: 460px; font-size: 0.88rem; color: var(--accent); }
.perk-tag {
  justify-self: start; margin-top: 4px; padding: 1px 10px; border-radius: 999px; font-size: 0.78rem !important;
  color: var(--accent) !important; border: 1px solid var(--accent);
}
.lesson-live { border-color: var(--accent); }
.lesson-live .eyebrow { margin: 0; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--onair); }
.notes-meta { margin: 0 0 10px; color: var(--muted); font-size: 0.88rem; }
.notes { display: grid; gap: 12px; }
.notes .key-idea { margin: 0; font-size: 1.05rem; padding: 10px 14px; border-left: 3px solid var(--accent);
  background: var(--chip); border-radius: 0 10px 10px 0; }
.notes .note h3 { margin: 0 0 6px; font-family: system-ui, sans-serif; font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); }
.notes .note p { margin: 0 0 6px; }
.notes ul, .notes ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.formulas { list-style: none; padding: 0 !important; }
.formulas li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; }
.f-name { font-weight: 600; font-size: 0.9rem; }
.f-math { font-size: 1.35rem; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.f-note { color: var(--muted); font-size: 0.85rem; }
.terms { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.terms dt { font-weight: 700; }
.terms dd { margin: 0; }
.phrases .eg { color: var(--muted); font-style: italic; }
.notes .answer { font-weight: 500; }
.notes details summary { cursor: pointer; color: var(--accent); }
.notes-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
@media print {
  body.printing-notes { background: #fff; color: #000; }
  body.printing-notes > header, body.printing-notes > footer, body.printing-notes main > :not(#lesson-live),
  body.printing-notes .notes-actions { display: none !important; }
  body.printing-notes .lesson-live { border: none; background: #fff; color: #000; }
  body.printing-notes .notes .key-idea, body.printing-notes .formulas li { background: #fff; border-color: #999; }
  body.printing-notes details > *:not(summary) { display: block; }
}
.lesson-live.arrive { animation: arrive 0.6s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lesson-live.arrive { animation: none; } }

/* the lesson notes image */
.notes-picture { display: block; margin: 4px 0 10px; }
.notes-picture img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--rule); }
.notes-text { margin: 6px 0; }
.notes-text summary { cursor: pointer; color: var(--accent); margin-bottom: 8px; }
a.button { display: inline-block; padding: 10px 18px; border-radius: 10px; text-decoration: none; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); }

/* the browser-drawn notes paper (only used to make the image; kept off screen) */
.paper-stage { position: fixed; left: -12000px; top: 0; pointer-events: none; }
.paper { width: 1080px; box-sizing: border-box; padding: 70px 64px 50px 120px; background: #fffdf6; color: #241a14;
  font: 38px/1.42 "DejaVu Sans", "Noto Sans", "Noto Sans SC", "Noto Sans Tamil", system-ui, sans-serif;
  border-top: 14px solid #b8611f; background-image: linear-gradient(to right, transparent 84px, #e2786e 84px,
  #e2786e 87px, transparent 87px); }
.paper h2 { font: bold 64px/1.2 inherit; font-family: inherit; margin: 4px 0 8px; color: #241a14; }
.paper .paper-meta { font-size: 27px; font-weight: 700; color: #b8611f; text-transform: uppercase; letter-spacing: 0.04em; }
.paper .paper-ref, .paper .paper-foot { font-size: 27px; color: #6e6054; margin-bottom: 16px; }
.paper .paper-foot { margin-top: 30px; padding-top: 16px; border-top: 2px solid #e7decd; }
.paper .key-idea { background: #fff3c4; border-left: none; border-radius: 16px; padding: 22px 26px; font-size: 41px; color: #241a14; }
.paper .note h3 { font-size: 31px; color: #b8611f; margin: 22px 0 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.paper .formulas li { background: #faf6ec; border: none; border-radius: 16px; padding: 20px 24px; }
.paper .f-name { font-size: 34px; }
.paper .f-math { font-size: 54px; overflow: visible; }
.paper .f-note, .paper .phrases .eg { font-size: 31px; color: #6e6054; }
.paper ul, .paper ol { padding-left: 46px; }
.paper details summary { display: none; }
