/* beam — dark instrument. One room per screen, one gold moment per room. */

:root {
  --ink:    #0f0d16;
  --ink-2:  #17141f;
  --raise:  rgba(250, 248, 244, 0.045);
  --raise-2:rgba(250, 248, 244, 0.075);
  --line:   rgba(250, 248, 244, 0.11);
  --paper:  #faf8f4;
  --muted:  rgba(250, 248, 244, 0.56);
  --faint:  rgba(250, 248, 244, 0.34);
  --purple: #7a5bd6;
  --gold:   #d6a740;
  --red:    #e0574a;
  --ease:   cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(122, 91, 214, 0.17), transparent 68%),
    linear-gradient(180deg, var(--ink-2), var(--ink) 58%);
  background-attachment: fixed;
  color: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }

/* ---------- chrome ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 22px clamp(18px, 4vw, 40px);
}

.wordmark {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 25px; font-weight: 500; letter-spacing: 0.15em;
  text-transform: lowercase; color: var(--paper);
  background: none; border: 0; cursor: pointer; padding: 0;
}
.wordmark .dot { color: var(--gold); }

.top-right { display: flex; align-items: center; gap: 10px; }
.whoami { color: var(--faint); font-size: 14px; letter-spacing: 0.02em; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 17px; border-radius: 12px;
  background: linear-gradient(180deg, var(--raise-2), var(--raise));
  border: 1px solid var(--line);
  color: var(--paper); text-decoration: none;
  font-size: 14.5px; font-weight: 500; letter-spacing: 0.01em;
  cursor: pointer; white-space: nowrap;
  transition: background 260ms var(--ease), border-color 260ms var(--ease), transform 260ms var(--ease);
}
.btn:hover { background: linear-gradient(180deg, rgba(250,248,244,0.11), var(--raise-2)); border-color: rgba(250,248,244,0.2); }
.btn:active { transform: translateY(1px); }
.btn .glyph { font-family: Helvetica, Arial, sans-serif; font-size: 15px; opacity: 0.85; line-height: 1; }
.btn.is-done { border-color: var(--gold); color: var(--gold); }
.btn.gold {
  background: linear-gradient(180deg, #e4b95c, var(--gold));
  border-color: #eac674; color: #241a05; font-weight: 650;
}
.btn.gold:hover { background: linear-gradient(180deg, #eec46a, #dcae46); }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--paper); background: var(--raise); }
.btn.danger:hover { border-color: rgba(224, 87, 74, 0.6); color: var(--red); }

/* ---------- rooms ---------- */

.room { display: none; padding: 0 clamp(18px, 4vw, 40px) 90px; }
.room.is-on { display: block; animation: rise 380ms var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.center {
  min-height: 63vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 28px;
}

.lede { font-size: clamp(30px, 5.2vw, 46px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.12; }
.sub { color: var(--muted); font-size: 15.5px; font-weight: 400; max-width: 44ch; line-height: 1.6; }

/* ---------- the altar: record button ---------- */

.rec-btn {
  position: relative; width: 172px; height: 172px; border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, #241d33, #15121d 72%);
  border: 1px solid rgba(214, 167, 64, 0.42);
  cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 22px 60px -22px rgba(214, 167, 64, 0.5);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease), border-color 320ms var(--ease);
}
.rec-btn:hover { transform: scale(1.035); border-color: rgba(214, 167, 64, 0.8); box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 26px 74px -20px rgba(214, 167, 64, 0.62); }
.rec-btn:active { transform: scale(0.99); }
.rec-btn:disabled { opacity: 0.45; cursor: progress; }
.rec-btn .core {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(180deg, #e8be62, var(--gold));
  box-shadow: 0 5px 18px -4px rgba(214,167,64,0.85);
  transition: all 340ms var(--ease);
}
.rec-btn.is-live .core { width: 50px; height: 50px; border-radius: 12px; background: linear-gradient(180deg, #ea6a5d, var(--red)); box-shadow: 0 5px 18px -4px rgba(224,87,74,0.85); }
.rec-btn.is-live { border-color: rgba(224, 87, 74, 0.5); }
.rec-btn .ring {
  position: absolute; inset: -13px; border-radius: 50%;
  border: 1px solid rgba(224, 87, 74, 0.5); opacity: 0;
}
.rec-btn.is-live .ring { animation: breathe 2.6s var(--ease) infinite; }
@keyframes breathe {
  0% { opacity: 0.85; transform: scale(0.96); }
  70% { opacity: 0; transform: scale(1.16); }
  100% { opacity: 0; transform: scale(1.16); }
}

/* ---------- toggles ---------- */

.toggles { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.toggle {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px 11px 14px; border-radius: 13px;
  background: var(--raise); border: 1px solid var(--line);
  cursor: pointer; transition: all 260ms var(--ease);
}
.toggle:hover { border-color: rgba(250,248,244,0.24); }
.toggle .glyph { font-family: Helvetica, Arial, sans-serif; font-size: 17px; width: 20px; text-align: center; opacity: 0.5; transition: opacity 260ms var(--ease); }
.toggle .word { font-size: 14.5px; font-weight: 500; color: var(--muted); transition: color 260ms var(--ease); }
.toggle .state { font-size: 12px; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }
.toggle[aria-pressed="true"] { background: rgba(122, 91, 214, 0.16); border-color: rgba(122, 91, 214, 0.55); }
.toggle[aria-pressed="true"] .glyph { opacity: 1; color: #b9a2f3; }
.toggle[aria-pressed="true"] .word { color: var(--paper); }
.toggle[aria-pressed="true"] .state { color: #b9a2f3; }

/* ---------- live ---------- */

.clock { font-size: clamp(46px, 9vw, 74px); font-weight: 200; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 15px;
  border-radius: 999px; background: var(--raise); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted); letter-spacing: 0.02em;
}
.pill .bead { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.pill.live .bead { background: var(--red); animation: blink 1.5s var(--ease) infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- share ---------- */

.share-card {
  width: min(660px, 100%); padding: 26px; border-radius: 20px;
  background: linear-gradient(180deg, var(--raise-2), var(--raise));
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px;
}
.share-link {
  display: flex; align-items: center; gap: 12px; padding: 15px 17px;
  border-radius: 13px; background: rgba(0,0,0,0.3);
  border: 1px solid rgba(214, 167, 64, 0.42);
  font-size: 15.5px; color: var(--gold); word-break: break-all; text-align: left;
}
.title-input {
  width: 100%; padding: 13px 15px; border-radius: 12px;
  background: rgba(0,0,0,0.26); border: 1px solid var(--line);
  color: var(--paper); font-size: 15.5px; font-family: inherit;
}
.title-input:focus { outline: none; border-color: rgba(122, 91, 214, 0.7); }
.title-input::placeholder { color: var(--faint); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- library ---------- */

.grid {
  display: grid; gap: 20px; margin-top: 30px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.card {
  border-radius: 16px; overflow: hidden; background: var(--raise);
  border: 1px solid var(--line); display: flex; flex-direction: column;
  transition: border-color 280ms var(--ease), transform 280ms var(--ease);
}
.card:hover { border-color: rgba(250,248,244,0.24); transform: translateY(-2px); }
.card .thumb {
  aspect-ratio: 16 / 10; background: #0a0810 center/cover no-repeat;
  display: block; position: relative; border-bottom: 1px solid var(--line);
}
.card .thumb .dur {
  position: absolute; right: 9px; bottom: 9px; padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,0.76); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--paper);
}
.card .body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.card .name { font-size: 15.5px; font-weight: 500; line-height: 1.35; }
.card .meta { font-size: 12.5px; color: var(--faint); letter-spacing: 0.02em; }
.card .acts { display: flex; gap: 7px; margin-top: auto; }
.card .acts .btn { padding: 7px 11px; font-size: 13px; border-radius: 9px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 12px; }
.section-head h2 { font-size: 27px; font-weight: 300; letter-spacing: -0.015em; }

.empty-note { color: var(--muted); font-size: 15px; margin-top: 26px; line-height: 1.6; }

/* ---------- people (admin) ---------- */

.people { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.person {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 15px 17px; border-radius: 13px; background: var(--raise); border: 1px solid var(--line);
}
.person .who { font-size: 15.5px; font-weight: 500; min-width: 130px; }
.person .stat { font-size: 13px; color: var(--faint); }
.person .key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  color: var(--muted); background: rgba(0,0,0,0.3); padding: 6px 10px;
  border-radius: 8px; border: 1px solid var(--line); word-break: break-all; flex: 1; min-width: 210px;
}

/* ---------- notice ---------- */

.notice {
  margin: 0 auto; max-width: 560px; padding: 13px 17px; border-radius: 12px;
  background: rgba(224, 87, 74, 0.13); border: 1px solid rgba(224, 87, 74, 0.42);
  color: #ffb9b1; font-size: 14.5px; line-height: 1.55; text-align: center;
}
.notice.good { background: rgba(122, 91, 214, 0.15); border-color: rgba(122, 91, 214, 0.5); color: #c6b3f7; }

/* ---------- watch page ---------- */

body.watch { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 26px; }
.stage { width: min(1180px, 100%); display: flex; flex-direction: column; gap: 18px; }
.stage video {
  width: 100%; border-radius: 15px; background: #000; display: block;
  border: 1px solid var(--line); box-shadow: 0 34px 90px -40px rgba(0,0,0,0.9);
}
.stage-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.stage-title h1 { font-size: 23px; font-weight: 400; letter-spacing: -0.01em; }
.stage-title p { color: var(--faint); font-size: 13.5px; margin-top: 6px; letter-spacing: 0.02em; }
.stage-actions { display: flex; gap: 9px; }
.stage.empty { text-align: center; align-items: center; gap: 14px; }
.stage.empty h1 { font-size: 34px; font-weight: 300; }
.stage.empty p { color: var(--muted); }

@media (max-width: 560px) {
  .rec-btn { width: 146px; height: 146px; }
  .stage-bar { flex-direction: column; }
}

/* A CSS `display` rule beats the `hidden` attribute, which had the admin-only
   controls showing for everyone. Nothing hidden should ever paint. */
[hidden] { display: none !important; }


/* ---------- live audio meters ---------- */
/* Each bar carries its own symbol and its own word. A bare moving band would
   tell you nothing about which side of the call it belonged to. */

.meters { display: flex; flex-direction: column; gap: 11px; width: min(330px, 84vw); }
.meter { display: flex; align-items: center; gap: 12px; }
.meter .m-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted); width: 122px; flex: none; letter-spacing: 0.01em;
}
.meter .m-label .glyph { font-family: Helvetica, Arial, sans-serif; font-size: 13px; opacity: 0.65; }
.meter .m-track {
  flex: 1; height: 6px; border-radius: 999px;
  background: rgba(250, 248, 244, 0.09); overflow: hidden;
}
.meter .m-fill {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), #a98df0);
  transition: width 90ms linear;
}
.meter.is-off .m-label { color: var(--faint); text-decoration: line-through; }
.meter.is-off .m-track { opacity: 0.4; }
.meter.is-hot .m-fill { background: linear-gradient(90deg, #e8be62, var(--gold)); }
