/* Studio Board — TV display. Lightbox brand tokens + one accent per person.
   Everything is in rem, and 1rem scales with the screen (16px at 1920×1080), so any TV fills edge to edge. */
@font-face { font-family: "Archivo"; src: url(/fonts/archivo-latin-wdth-normal.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: block; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: block; }

:root {
  --ink: #0A0B0C;
  --panel: #141619;
  --edge: #23262B;
  --muted: #8A9099;
  --paper: #F2F1EE;
  --signal: #FF7A1A;   /* due today */
  --red: #FF4D4D;      /* overdue */
  --green: #3DDC84;    /* done */
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Public Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 0.8333vw; font-size: min(calc(100vw / 120), calc(100vh / 67.5)); background: var(--ink); } /* tv.js also sets this for old browsers */
body {
  width: 100vw; height: 100vh; overflow: hidden; cursor: none;
  background: var(--ink); color: var(--paper);
  font: 400 1rem/1.25 var(--text);
  -webkit-font-smoothing: antialiased;
}
.brand-label, .clock, .p-name, .section-title, .flag, .alert, .c-owner, .progress-count, .clear {
  font-family: var(--display); font-stretch: 82%; font-weight: 640; text-transform: uppercase; letter-spacing: 0.02em;
}

/* Slow ambient light + a few px of drift: keeps the panel from burning in and makes it feel alive. */
.glow {
  position: fixed; top: -20%; right: -20%; bottom: -20%; left: -20%; pointer-events: none;
  background: radial-gradient(40% 35% at 30% 105%, rgba(255, 255, 255, 0.035), transparent 70%),
              radial-gradient(35% 30% at 80% 100%, rgba(255, 255, 255, 0.025), transparent 70%);
  animation: glow 90s ease-in-out infinite alternate;
}
@keyframes glow { to { transform: translate(6%, -4%) scale(1.08); } }

.stage {
  position: relative; height: 100vh;
  padding: 2.25rem 2.75rem 2.5rem;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-gap: 2rem; gap: 2rem;
  animation: drift 1800s ease-in-out infinite alternate;
}
@keyframes drift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(0.35rem, -0.25rem); }
  66% { transform: translate(-0.3rem, 0.3rem); }
  100% { transform: translate(0.2rem, 0.35rem); }
}

/* ── Header ─────────────────────────────────────────── */
.top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; }
.logo { height: 2.5rem; width: auto; display: block; margin-right: 1.4rem; }
.brand-label { font-size: 1.15rem; letter-spacing: 0.22em; color: var(--muted); padding-left: 1.4rem; border-left: 0.12rem solid var(--edge); line-height: 2.5rem; }
.top-right { display: flex; align-items: center; }
.top-right > * + * { margin-left: 2.4rem; }
.when { text-align: right; }
.date { font-size: 1.45rem; font-weight: 500; }
.week { font-size: 1.05rem; color: var(--muted); margin-top: 0.2rem; letter-spacing: 0.08em; text-transform: uppercase; }
.clock { min-height: 4.15rem; font-size: 4.6rem; line-height: 0.9; font-variant-numeric: tabular-nums; color: #fff; letter-spacing: 0; }
.ampm { font-size: 1.6rem; margin-left: 0.4rem; color: var(--muted); }
.alert {
  font-size: 1.55rem; color: #FF8A8A; padding: 0.5rem 1.2rem 0.45rem;
  border: 0.15rem solid var(--red); border-radius: 99rem; background: rgba(255, 77, 77, 0.14);
  animation: pulse-soft 2.8s ease-in-out infinite;
}
.alert b { color: #fff; font-weight: 750; }
.alert[hidden] { display: none; }

/* ── People columns ─────────────────────────────────── */
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 2.75rem; gap: 2.75rem; min-height: 0; }
.person { position: relative; display: flex; flex-direction: column; min-height: 0; isolation: isolate; }
.person::before { /* the person's colour as light falling from above, not a block */
  content: ""; position: absolute; left: -2rem; right: -2rem; top: -7rem; height: 24rem; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 55% at 50% 0%, var(--c18), transparent 75%);
}
.p-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 0.8rem; margin-bottom: 1.3rem; position: relative;
}
.p-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0.24rem; border-radius: 1rem; background: linear-gradient(90deg, var(--c), var(--c00)); }
.p-name { font-size: 3.5rem; line-height: 0.95; color: var(--c); }
.p-count { font-size: 1.25rem; color: var(--muted); }
.p-count b { color: var(--paper); font-weight: 700; font-size: 1.6rem; margin-right: 0.15rem; }
.p-body { flex: 1; min-height: 0; overflow: hidden; --fit: 1; padding: 0.3rem; margin: -0.3rem; }

.tasks { list-style: none; }
.tasks > li + li { margin-top: calc(0.85rem * var(--fit)); }
.task {
  padding: calc(0.85rem * var(--fit)) calc(1.15rem * var(--fit));
  border-left: 0.4rem solid var(--edge); border-radius: 0 0.6rem 0.6rem 0;
}
.t-title { font-size: calc(2.1rem * var(--fit)); line-height: 1.15; font-weight: 560; letter-spacing: -0.005em; }
.t-meta > * { margin: 0.18rem 1rem 0.18rem 0; }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: calc(0.27rem * var(--fit)); font-size: calc(1.15rem * var(--fit)); color: var(--muted); }

/* Priority ladder: urgent = solid colour card, high = raised panel with colour edge, normal = plain line. */
.p-urgent { background: var(--c); color: var(--ink); border-left-color: var(--c); border-radius: 0.7rem; box-shadow: 0 0 3.5rem var(--c33); }
.p-urgent .t-title { font-size: calc(2.45rem * var(--fit)); font-weight: 720; }
.p-urgent .t-meta { color: rgba(10, 11, 12, 0.72); }
.p-urgent .due.today { color: var(--ink); font-weight: 750; }
.p-high { background: var(--panel); border-left-color: var(--c); }
.p-normal .t-title { font-weight: 450; color: rgba(242, 241, 238, 0.9); }

.flag { display: inline-block; font-size: calc(1rem * var(--fit)); letter-spacing: 0.08em; padding: 0.22em 0.6em 0.16em; border-radius: 0.35rem; line-height: 1.1; }
.flag.urgent { background: var(--ink); color: var(--c); }
.flag.overdue { background: var(--red); color: #fff; }
.due.today { color: var(--signal); font-weight: 650; }
.due.soon { color: var(--paper); font-weight: 550; }
.due.done { color: var(--green); font-weight: 650; }

.is-overdue:not(.p-urgent) { border-left-color: var(--red); background: linear-gradient(90deg, rgba(255, 77, 77, 0.16), rgba(255, 77, 77, 0) 75%); }
.p-urgent.is-overdue { outline: 0.22rem solid var(--red); outline-offset: 0.22rem; }
.is-done { opacity: 0.45; background: none; border-left-color: var(--green); box-shadow: none; }
.is-done .t-title { text-decoration: line-through; text-decoration-thickness: 0.07em; font-weight: 450; font-size: calc(1.8rem * var(--fit)); color: var(--paper); }
.is-done .t-meta { color: var(--muted); }

.more { font-size: calc(1.2rem * var(--fit)); color: var(--muted); padding: 0.2rem 1.55rem; letter-spacing: 0.04em; }
.clear { font-size: 1.7rem; color: #4A4F57; letter-spacing: 0.14em; padding: 1rem 0; }

/* ── Weekly recurring ───────────────────────────────── */
.weekly { display: flex; flex-direction: column; min-height: 0; }
.weekly-head { margin-bottom: 1.1rem; }
.weekly-head { display: flex; align-items: baseline; justify-content: space-between; padding-top: 1.3rem; border-top: 0.12rem solid var(--edge); }
.section-title { font-size: 1.6rem; letter-spacing: 0.2em; color: var(--paper); }
.progress > * + * { margin-left: 1.1rem; }
.progress { display: flex; align-items: center; color: var(--muted); font-size: 1.1rem; }
.progress-count { font-size: 1.5rem; color: var(--muted); }
.progress-count b { color: var(--green); font-weight: 750; }
.progress-track { width: 13rem; height: 0.45rem; border-radius: 1rem; background: var(--edge); overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1); }
.progress-note { letter-spacing: 0.06em; }

.chips { --fit: 1; max-height: 15.5rem; overflow: hidden; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); grid-auto-rows: max-content; grid-gap: calc(1rem * var(--fit)); gap: calc(1rem * var(--fit)); align-content: start; }
.chip {
  position: relative; overflow: hidden;
  padding: calc(0.95rem * var(--fit)) calc(1.2rem * var(--fit)) calc(0.95rem * var(--fit)) calc(1.55rem * var(--fit));
  background: var(--panel); border: 0.15rem solid var(--edge); border-radius: 0.75rem;
}
.chip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0.35rem; background: var(--c); }
.c-title { font-size: calc(1.65rem * var(--fit)); font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-owner { margin-right: 1rem; }
.c-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: calc(0.4rem * var(--fit)); font-size: calc(1.1rem * var(--fit)); }
.c-owner { color: var(--c); letter-spacing: 0.08em; font-size: calc(1.1rem * var(--fit)); }
.c-state { color: var(--muted); font-variant-numeric: tabular-nums; }
.c-state.done { color: var(--green); font-weight: 650; }
.c-state.today { color: var(--signal); font-weight: 650; }
.c-state.overdue { color: #FF8A8A; font-family: var(--display); font-stretch: 82%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

.s-done { background: rgba(61, 220, 132, 0.12); border-color: rgba(61, 220, 132, 0.5); }
.s-done::before { background: var(--green); }
.s-done .c-title { color: rgba(242, 241, 238, 0.75); }
.s-today { border-color: rgba(255, 122, 26, 0.75); }
.s-overdue { animation: pulse 2.6s ease-in-out infinite; }
.s-overdue::before { background: var(--red); }

/* A slow breath, not a strobe: ~2.6 s per cycle, never fully off. */
@keyframes pulse {
  0%, 100% { background: rgba(255, 77, 77, 0.08); border-color: rgba(255, 77, 77, 0.35); box-shadow: 0 0 0 rgba(255, 77, 77, 0); }
  50% { background: rgba(255, 77, 77, 0.26); border-color: rgba(255, 77, 77, 1); box-shadow: 0 0 2.2rem rgba(255, 77, 77, 0.35); }
}
@keyframes pulse-soft {
  0%, 100% { background: rgba(255, 77, 77, 0.1); }
  50% { background: rgba(255, 77, 77, 0.24); }
}

.offline {
  position: fixed; right: 1.5rem; bottom: 1rem; font-size: 0.95rem; color: var(--muted);
  display: flex; align-items: center;
}
.offline::before { content: ""; margin-right: 0.5rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--signal); }
.offline[hidden] { display: none; }
.task[hidden] { display: none; }
