/* Live captions on phones, "Daylight" design (ui-concepts/03-daylight.html): paper white, navy ink, the brand blue
   only where something is live. A dark version of the same palette for dim rooms (Display → Theme). */
:root {
  --ground: #f4f5fb; --paper: #fff; --ink: #0a152b; --past: #4a5373; --faint: #7a82a3; --blue: #0512ff;
  --tone: #e8eaf7; --tone-hi: #dadef3; --on-blue: #fff; --warn: #b45309;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --display: "Parkinsans", var(--font);
  --fs: 20px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ground: #070b18; --paper: #0e1428; --ink: #eef0fa; --past: #a3abc8; --faint: #7d86a8; --blue: #6b78ff;
  --tone: #1a2242; --tone-hi: #232d55; --warn: #f5a524;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ground); }
body { margin: 0; min-height: 100dvh; background: var(--ground); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
::selection { background: var(--blue); color: var(--on-blue); }
.inner { max-width: 680px; margin: 0 auto; }

/* ---------- header */
.head { background: var(--paper); padding: calc(env(safe-area-inset-top) + 20px) 20px 24px; }
.logos { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.logo { display: block; height: 36px; animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
.logo img { height: 100%; width: auto; }
:root[data-theme="dark"] .logo { padding: 4px 8px; border-radius: 10px; background: #fff; }   /* logos are drawn for white */
.logos .x { color: var(--faint); }
h1 { margin: 24px 0 0; font-family: var(--display); font-weight: 700; font-size: clamp(28px, 7.6vw, 40px); line-height: 1.05; letter-spacing: -.025em; text-wrap: balance; }
.sub { margin: 10px 0 0; font-size: 17px; color: var(--past); }

/* ---------- the live strip stays at the top while you read */
.strip { position: sticky; top: 0; z-index: 10; background: var(--paper); }
.strip .inner { display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.onair { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--tone); color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 14px; transition: background .3s, color .3s; }
[data-state="live"] .onair { background: var(--blue); color: var(--on-blue); }
[data-state="connecting"] .onair, [data-state="offline"] .onair, [data-state="waiting"] .onair, [data-state="paused"] .onair { color: var(--warn); }
.onair svg { width: 26px; height: 12px; overflow: visible; }
.onair path { stroke-dasharray: 6 4; }
[data-state="live"] .onair path { animation: flow .9s linear infinite; }
.clock { font-size: 15px; color: var(--past); font-variant-numeric: tabular-nums; }
.aa { margin-left: auto; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--tone); color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 15px; transition: background .2s; }
.aa:hover { background: var(--tone-hi); }
.zz { height: 10px; background: url("brand/nw-pattern.jpg") 0 0 / 120px auto repeat-x; }

/* ---------- captions: one block per voice, the newest one in full ink */
main { max-width: 680px; margin: 0 auto; padding: 8px 20px 48px; }
main:empty { display: none; }
.blk { margin-top: 28px; color: var(--past); transition: color .6s ease; }
.blk.cur { color: var(--ink); }
.who { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--blue); }
.who:empty { display: none; }
[data-state="live"] .blk.cur .who::after { content: "Speaking now"; margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--tone); color: var(--blue); font-size: 12px; }
.blk p { margin: 0; font-size: var(--fs); line-height: 1.55; overflow-wrap: break-word; }
.ln.in, .who.in { animation: ink .5s ease-out; }
.tn { color: var(--faint); }
.paused-note { margin: 20px 0 0; color: var(--warn); font-family: var(--display); font-weight: 600; font-size: 14px; }

/* ---------- before the first caption */
#empty { max-width: 680px; margin: 0 auto; padding: 32px 20px 48px; }
.when { padding: 28px 24px; border-radius: 24px; background: var(--blue); color: var(--on-blue); animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.when h2 { margin: 0; font-family: var(--display); font-size: 34px; line-height: 1.05; letter-spacing: -.025em; }
.when p { margin: 10px 0 0; font-size: 17px; opacity: .85; }
.sched { margin-top: 24px; }
.sched div { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 16px 4px; font-size: 17px; }
.sched time { font-family: var(--display); font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; }
.fine { margin: 20px 4px 0; font-size: 13px; line-height: 1.5; color: var(--faint); }

/* ---------- after the session: the NEWWAVE card */
#end { max-width: 680px; margin: 0 auto; padding: 0 20px 40px; }
.end-card { overflow: hidden; border-radius: 28px; background: var(--blue); color: var(--on-blue); animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.end-card .pat { height: 72px; background: url("brand/nw-pattern.jpg") 0 0 / 240px auto repeat; }
.end-card .body { padding: 24px 24px 28px; }
.end-card .mark { width: 48px; }
.end-card h2 { margin: 16px 0 8px; font-family: var(--display); font-size: 28px; line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; }
.end-card p { margin: 0 0 22px; font-size: 17px; opacity: .88; }
.cta { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px; border-radius: 999px; background: #fff; color: #0512ff; font-family: var(--display); font-weight: 600; text-decoration: none; transition: scale .15s, background .2s; }
.cta:hover { background: #eef0ff; } .cta:active { scale: .97; }

/* ---------- back to live */
#jump { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 20; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ink); color: var(--ground); font-family: var(--display); font-weight: 600; font-size: 15px; box-shadow: 0 10px 28px rgb(10 21 43 / .25);
  translate: -50% 16px; opacity: 0; pointer-events: none; transition: opacity .25s, translate .35s cubic-bezier(.2, .8, .2, 1); }
#jump.on { translate: -50% 0; opacity: 1; pointer-events: auto; }

/* ---------- credit */
footer { padding: 24px 20px calc(28px + env(safe-area-inset-bottom)); text-align: center; }
footer a { display: inline-flex; align-items: center; gap: 8px; color: var(--past); font-size: 14px; text-decoration: none; }
footer b { font-family: var(--display); letter-spacing: .12em; color: var(--ink); }
footer .nw { width: 22px; color: var(--blue); }

/* ---------- display sheet */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .45); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 41; left: 50%; bottom: 0; width: min(100%, 520px); translate: -50% 105%; visibility: hidden;
  padding: 28px 24px calc(24px + env(safe-area-inset-bottom)); background: var(--paper); color: var(--ink);
  border-radius: 24px 24px 0 0; box-shadow: 0 -12px 40px rgb(0 0 0 / .25); transition: translate .4s cubic-bezier(.2, .8, .2, 1), visibility .4s; }
.sheet.on { translate: -50% 0; visibility: visible; }
.sheet h2 { margin: 0 0 16px; font-family: var(--display); font-size: 20px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; font-size: 16px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--tone); }
.seg button { min-width: 44px; height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--past); font-weight: 600; }
.seg button.on { background: var(--blue); color: var(--on-blue); }
#sizes [data-size="0"] { font-size: 13px; } #sizes [data-size="1"] { font-size: 16px; }
#sizes [data-size="2"] { font-size: 19px; } #sizes [data-size="3"] { font-size: 22px; }
.switch { appearance: none; width: 52px; height: 32px; margin: 0; border-radius: 999px; background: var(--tone); position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--past); transition: translate .25s cubic-bezier(.2, .8, .2, 1), background .2s; }
.switch:checked { background: var(--blue); }
.switch:checked::after { translate: 20px 0; background: var(--on-blue); }
.sheet .fine { margin: 12px 0 0; }
.sheet .fine a { color: var(--blue); }
.done { width: 100%; height: 52px; margin-top: 16px; border: 0; border-radius: 999px; background: var(--blue); color: var(--on-blue); font-family: var(--display); font-weight: 600; font-size: 16px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes flow { to { stroke-dashoffset: -20; } }
@keyframes ink { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
