/* The app: side panel controls, camera overlay, and the start page. */

/* ---------------------------------------------------------------- camera overlay
   Drawn into the video stream. The page itself is transparent; the canvas
   paints only the clock (and a solid backdrop in "whole tile" placement). */

html.camera {
  color-scheme: normal;
}

html.camera,
html.camera body {
  background: transparent;
  overflow: hidden;
  height: 100%;
}

.overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------------------------------------------------------------- side panel */

.panel {
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 16px 28px;
}

/* Settings sits at the top right, above the clock, where people look for it.
   The two lamps sit at the top left. */
.panel-top {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

/* Two lamps for the person running the timer: a camera and a bullhorn. Dim
   while off. Lit, a lamp glows red and breathes, as a studio light does. They
   are in the panel, which is never part of what the meeting sees. */
.lamps {
  display: flex;
  gap: 14px;
  padding-left: 6px;
}

.lamp {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sunken);
  font: 21px/1 "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  filter: grayscale(1);
  opacity: 0.5;
  cursor: default;
}

.lamp.on {
  filter: none;
  opacity: 1;
  background: #ffe3ea;
  box-shadow: 0 0 0 2px var(--stop), 0 0 12px 3px rgba(207, 36, 80, 0.6);
  animation: lamp-breathe 2.6s ease-in-out infinite;
}

.lamp.on .lamp-picture {
  filter: drop-shadow(0 0 2px rgba(207, 36, 80, 0.9));
}

@keyframes lamp-breathe {
  0%,
  100% {
    box-shadow: 0 0 0 2px var(--stop), 0 0 4px 0 rgba(207, 36, 80, 0.35);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 2px var(--stop), 0 0 18px 7px rgba(207, 36, 80, 0.8);
    transform: scale(1.1);
  }
}

/* For people who ask their computer for less motion, a lit lamp glows
   steadily and does not breathe. */
@media (prefers-reduced-motion: reduce) {
  .lamp.on {
    animation: none;
  }
}

/* Where the clock sits. Its color is the clock's own backdrop: the panel
   sets --stage from the clock colors, so it matches "Whole tile" on video. */
.well {
  background: var(--stage, var(--sunken));
  border-radius: 14px;
  padding: 16px;
  display: grid;
  place-items: center;
}

.face {
  display: block;
  width: min(100%, 236px);
  aspect-ratio: 1;
}

.group {
  padding: 14px 0 12px;
  border-top: 1px solid var(--line);
}

.well + .group {
  border-top: 0;
}

.group > h2 {
  font: 500 12px/1.2 var(--font-ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.row + .row {
  margin-top: 8px;
}

.key {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--key);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.key:hover {
  background: var(--key-up);
}

.key:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.key.primary {
  flex: 1 1 120px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}

.key.primary:hover {
  background: var(--sun-up);
}

.key.small {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
}

/* The four fixed steps, and the length presets, share their row evenly. */
.steps .key,
.presets .key {
  flex: 1 1 0;
  padding-left: 2px;
  padding-right: 2px;
}

.presets .key {
  letter-spacing: 0.04em;
}

.key.sign {
  min-width: 34px;
  font-size: 18px;
  letter-spacing: 0;
}

/* Add or remove any number of seconds. */
.manual {
  color: var(--muted);
  font-size: 13px;
}

.manual input {
  width: 64px;
}

.manual input,
.custom-length input {
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Chosen option in a set (length presets, placement, room sound on):
   filled with ink, so it is told apart by more than a color. */
.key[aria-pressed="true"],
.key[aria-pressed="true"]:hover {
  background: var(--ink);
  color: #fff;
}

.custom-length {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.custom-length input {
  width: 52px;
}

/* A switch with a lamp. The lamp is dim until the thing it controls is live. */
.switch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  padding: 8px 0;
}

.switch-row .label {
  font-weight: 500;
  font-size: 16px;
}

.switch-row .state {
  margin-left: 6px;
  font-weight: 400;
  color: var(--muted);
}

.switch-row .state.live {
  color: var(--stop);
  font-weight: 600;
}

.switch-row .hint,
.switch-row .options {
  grid-column: 1 / -1;
}

.hint {
  color: var(--muted);
  font-size: 13.5px;
}

.row + .hint {
  margin-top: 8px;
}

.hint.problem {
  color: var(--alert);
}

.switch-row .options {
  margin-top: 6px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--field);
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.12s ease;
}

.switch[aria-checked="true"] {
  border-color: var(--go);
  background: var(--go);
}

.switch[aria-checked="true"]::after {
  transform: translateX(20px);
  background: #fff;
}

/* On air is the one switch that goes red, as a studio light does. */
.switch.on-air[aria-checked="true"] {
  border-color: var(--stop);
  background: var(--stop);
}

.switch:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.switch[aria-busy="true"] {
  cursor: progress;
}

.message {
  margin-top: 10px;
  padding: 8px 10px;
  border-left: 3px solid var(--alert);
  background: var(--sunken);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
}

.checks summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.checks + .checks {
  margin-top: 10px;
}

.checks dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 10px 0 0;
  font-size: 13px;
}

.checks dt {
  color: var(--muted);
}

.checks dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  .switch::after {
    transition: none;
  }
}

/* ---------------------------------------------------------------- paid tag and locked sections */

.tag {
  font: 600 10px/1 var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--sun-soft);
  color: var(--ink);
}

.section-body {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.locked .section-body {
  opacity: 0.42;
}

.lock-note {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 8px;
}

/* ---------------------------------------------------------------- fields */

.code-form input,
.field input,
.field select {
  min-width: 0;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
}

/* ---------------------------------------------------------------- settings sheet */

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.sheet h2 {
  font: 400 26px/1 var(--font-head);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section {
  margin-top: 22px;
}

.section h3 {
  font: 500 12px/1.2 var(--font-ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  min-width: 0;
}

.field label,
.slot-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input[type="range"] {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--ink);
}

.field input[type="color"] {
  padding: 3px;
  cursor: pointer;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}

.colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}

.small {
  font-size: 13.5px;
  color: var(--muted);
  margin: 6px 0 10px;
}

.small.problem,
.slot-status.problem {
  color: var(--alert);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.slot {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.slot-status {
  font-size: 13.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.logo-thumb {
  display: block;
  max-width: 160px;
  max-height: 64px;
  margin-bottom: 12px;
  padding: 6px;
  background: var(--sunken);
  border-radius: var(--radius);
}

.plan-line {
  margin-bottom: 10px;
}

.plan-actions {
  margin-bottom: 6px;
}

.plan-actions .key {
  flex: 0 0 auto;
}

.code-form {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.sheet-foot {
  margin-top: 24px;
}

/* ---------------------------------------------------------------- stage */

/* A video and the clock side by side, filling the app's window. While the
   app is shared, this is what the meeting sees. The video is a file from the
   person's computer in the browser's own player. Nothing is placed over it,
   so its controls stay in reach, and it is never smaller than 200 by 200. */
.stage {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(170px, 24vw, 340px);
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--paper);
  overflow: auto;
}

.stage-video {
  width: 100%;
  min-width: 200px;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 32px);
  background: #000;
}

/* The whole picture is shown, whatever its shape: a tall video gets black
   bars at its sides instead of losing its top and bottom. */
.stage-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  object-fit: contain;
}

.stage-side {
  display: grid;
  gap: 12px;
  justify-items: center;
  min-width: 0;
}

.stage-well {
  width: 100%;
  background: var(--stage, var(--sunken));
  border-radius: 14px;
  padding: 12px;
  display: grid;
  place-items: center;
}

.stage-face {
  display: block;
  width: min(100%, 300px);
  aspect-ratio: 1;
}

.stage-side .row {
  width: 100%;
  justify-content: center;
}

.stage-status {
  text-align: center;
}

/* Full screen video: the video has the whole window, and the clock and the
   buttons are put away. The X in the corner and the line of words are the
   visible ways back. They show when full screen begins and whenever the
   pointer or a key moves, then step aside so the picture is clean. */
.stage-exit,
.stage-hint {
  display: none;
}

.stage.full {
  display: block;
  padding: 0;
  background: #000;
  overflow: hidden;
}

.stage.full .stage-side {
  display: none;
}

.stage.full .stage-video {
  position: absolute;
  inset: 0;
  width: auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
}

/* With nothing moving, the pointer steps aside too. */
.stage.full:not(.awake) {
  cursor: none;
}

.stage.full .stage-exit {
  display: block;
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

/* The X itself: two white bars. */
.stage-exit::before,
.stage-exit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 3px;
  margin: -1.5px 0 0 -11px;
  border-radius: 2px;
  background: #fff;
}

.stage-exit::before {
  transform: rotate(45deg);
}

.stage-exit::after {
  transform: rotate(-45deg);
}

.stage.full.awake .stage-exit {
  opacity: 1;
  visibility: visible;
}

.stage.full .stage-exit:hover {
  background: rgba(0, 0, 0, 0.85);
}

.stage.full .stage-hint {
  display: block;
  position: absolute;
  top: 24px;
  left: 50%;
  z-index: 2;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font: 500 15px/1.2 var(--font-ui);
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stage.full.hinting .stage-hint {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .stage.full .stage-exit,
  .stage.full .stage-hint {
    transition: none;
  }
}

/* A narrow window, such as the side panel before it grows: the video on top,
   the clock under it. */
@media (max-width: 640px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }

  .stage-face {
    width: min(64%, 220px);
  }
}

/* ---------------------------------------------------------------- start page and notices */

.landing {
  min-height: 100vh;
  max-width: 34rem;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.landing h1 {
  font: 400 clamp(40px, 11vw, 76px) / 1 var(--font-head);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.landing p {
  font-size: 16px;
  max-width: 30rem;
}

/* The few words under the product name. */
.landing .tagline {
  margin-top: -8px;
  color: var(--muted);
  font: 500 clamp(16px, 4.4vw, 22px) / 1.2 var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.landing .actions {
  margin-top: 8px;
}

.landing .key.primary {
  flex: 0 0 auto;
  padding: 10px 18px;
  font-size: 16px;
}

.landing .fine {
  color: var(--muted);
  font-size: 13px;
}
