@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(/fonts/barlow-700.woff2) format("woff2"); }
@font-face { font-family: "Atkinson"; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-400.woff2) format("woff2"); }
@font-face { font-family: "Atkinson"; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-700.woff2) format("woff2"); }

:root {
  --buoy: #FF5A1F;      /* surface marker orange */
  --deep: #06303F;      /* ink */
  --shallow: #E4F0EE;   /* page */
  --foam: #FFFFFF;
  --current: #0B7A80;   /* links, secondary */
  --pencil: #4E6B76;    /* quiet text */
  --line: rgba(6, 48, 63, .16);
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Atkinson", system-ui, sans-serif;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --left: env(safe-area-inset-left, 0px);
  --right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--shallow); color: var(--deep); font: 400 17px/1.45 var(--body); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--current); outline-offset: 2px; }
[hidden] { display: none !important; }
#app { min-height: 100%; height: 100%; }

/* ---------- library ---------- */
.mast { background: var(--buoy); padding: calc(var(--top) + 18px) calc(var(--right) + 22px) 14px calc(var(--left) + 22px); }
.mast h1 { margin: 0; font: 700 clamp(84px, 24vw, 150px)/.8 var(--head); letter-spacing: -.01em; color: var(--deep); }
.mast p { margin: 10px 0 0; font-weight: 700; color: var(--deep); }
.tabs { display: flex; border-bottom: 2px solid var(--deep); background: var(--shallow); position: sticky; top: 0; z-index: 2; padding: 0 calc(var(--right) + 22px) 0 calc(var(--left) + 22px); gap: 26px; }
.tabs button { padding: 14px 0 11px; font: 700 26px/1 var(--head); color: var(--pencil); border-bottom: 5px solid transparent; margin-bottom: -2px; min-height: 44px; }
.tabs button[aria-current="page"] { color: var(--deep); border-bottom-color: var(--buoy); }
main { max-width: 760px; margin: 0; padding: 4px calc(var(--right) + 22px) calc(var(--bottom) + 40px) calc(var(--left) + 22px); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 15px 0; border-bottom: 1px solid var(--line); min-height: 64px; }
.row h2 { margin: 0; font: 700 31px/1.02 var(--head); }
.row small { color: var(--pencil); font-size: 15px; }
.row .grow { flex: 1 1 240px; min-width: 0; }
.row { flex-wrap: wrap; }
.row .act { margin-right: 14px; }
.row .act { color: var(--current); font-weight: 700; padding: 10px 4px; min-height: 44px; }
.row .act.danger { color: #B3261E; }
.note { color: var(--pencil); margin: 18px 0; }
.primary { display: inline-block; background: var(--deep); color: var(--foam); font: 700 24px/1 var(--head); padding: 14px 22px 13px; border-radius: 3px; min-height: 48px; }
.secondary { color: var(--current); font-weight: 700; padding: 12px 0; min-height: 44px; }
.actions { display: flex; align-items: center; gap: 22px; margin: 22px 0; flex-wrap: wrap; }
label.field { display: block; margin: 16px 0; font-weight: 700; }
label.field input, label.field textarea, label.field select { display: block; width: 100%; margin-top: 6px; padding: 12px; font-weight: 400; background: var(--foam); border: 1.5px solid var(--deep); border-radius: 3px; font-size: 17px; }
label.field textarea { min-height: 42vh; resize: vertical; line-height: 1.5; }
.err { color: #B3261E; font-weight: 700; min-height: 24px; }

/* pin */
.pin { min-height: 100%; background: var(--buoy); display: flex; flex-direction: column; justify-content: center; padding: calc(var(--top) + 24px) 28px calc(var(--bottom) + 24px); }
.pin h1 { margin: 0; font: 700 clamp(110px, 34vw, 190px)/.8 var(--head); }
.pin p { font-weight: 700; margin: 16px 0 12px; }
.pin input { width: 100%; max-width: 280px; background: var(--foam); border: 2px solid var(--deep); border-radius: 3px; padding: 14px; font: 700 36px/1 var(--head); letter-spacing: .3em; }
.pin .err { color: var(--deep); margin-top: 10px; }

/* player */
.player { position: fixed; inset: 0; background: #000; z-index: 20; display: flex; flex-direction: column; }
.player video { flex: 1; min-height: 0; width: 100%; }
.player button { color: #fff; font-weight: 700; padding: calc(var(--top) + 14px) 20px 14px; text-align: left; min-height: 44px; }

/* ---------- studio ---------- */
.studio { position: fixed; inset: 0; background: var(--deep); color: #fff; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.studio video.cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio video.cam.mirror { transform: scaleX(-1); }
.studio .scrim { position: absolute; inset: 0 0 auto 0; height: 62%; background: linear-gradient(180deg, rgba(3, 24, 32, .86) 0%, rgba(3, 24, 32, .72) 55%, rgba(3, 24, 32, 0) 100%); pointer-events: none; }
.studio.script-only .scrim { display: none; }

/* the line sits as close to the lens as the screen allows */
.zone { position: absolute; top: calc(var(--top) + 10px); left: 50%; transform: translateX(-50%); width: min(92vw, 880px); text-align: center; padding: 0 6px; cursor: pointer; }
.zone .now { margin: 0; font: 700 calc(var(--text, 1) * clamp(32px, 4.4vw + 16px, 64px))/1.14 var(--body); text-wrap: balance; text-shadow: 0 2px 10px rgba(0, 0, 0, .55); }
.zone .next { margin: 12px 0 0; font: 400 calc(var(--text, 1) * clamp(19px, 1.6vw + 12px, 28px))/1.25 var(--body); opacity: .66; text-wrap: balance; }
.prog { height: 5px; margin: 12px auto 0; width: min(70%, 420px); background: rgba(255, 255, 255, .24); border-radius: 3px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--buoy); }
.studio[data-lens="left"] .zone { left: calc(var(--left) + 10px); transform: none; width: 52vw; text-align: left; }
.studio[data-lens="right"] .zone { left: auto; right: calc(var(--right) + 10px); transform: none; width: 52vw; text-align: left; }
.studio[data-lens="left"] .prog, .studio[data-lens="right"] .prog { margin-left: 0; }
.studio[data-lens="left"] .zone .now, .studio[data-lens="right"] .zone .now { font-size: calc(var(--text, 1) * 28px); }

.countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 min(44vw, 300px)/1 var(--head); color: var(--buoy); pointer-events: none; }

.dock { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px calc(var(--right) + 14px) calc(var(--bottom) + 14px) calc(var(--left) + 14px); background: linear-gradient(0deg, rgba(3, 24, 32, .8), rgba(3, 24, 32, 0)); }
.status { text-align: center; font-size: 15px; font-weight: 700; margin-bottom: 8px; min-height: 22px; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
.meter { height: 4px; width: 150px; margin: 0 auto 10px; background: rgba(255, 255, 255, .24); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: #7CF2C4; }
.keys { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center; justify-items: center; max-width: 560px; margin: 0 auto; }
.keys button.k { font-weight: 700; font-size: 16px; min-height: 48px; min-width: 62px; padding: 6px 4px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
.keys button.k:disabled { opacity: .35; }
.rec { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; display: flex; align-items: center; justify-content: center; }
.rec i { display: block; width: 56px; height: 56px; border-radius: 50%; background: var(--buoy); transition: all .15s; }
.rec.on i { width: 28px; height: 28px; border-radius: 4px; }
.rec.go i { background: #fff; }

.sheet { position: absolute; left: 50%; transform: translateX(-50%); width: min(100%, 560px); bottom: 0; max-height: 86%; overflow: auto; background: var(--shallow); color: var(--deep); padding: 18px calc(var(--right) + 22px) calc(var(--bottom) + 18px) calc(var(--left) + 22px); border-radius: 12px 12px 0 0; }
.sheet h2 { font: 700 34px/1 var(--head); margin: 0 0 6px; }
.sheet .check { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 16px 0; min-height: 44px; }
.sheet .check input { width: 22px; height: 22px; accent-color: var(--buoy); }
.sheet input[type="range"] { padding: 0; border: 0; background: none; accent-color: var(--buoy); }
.alert { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(88vw, 480px); background: var(--foam); color: var(--deep); padding: 20px; border-radius: 6px; }
.alert p { margin: 0 0 12px; font-weight: 700; }
.alert button { color: var(--current); font-weight: 700; margin-right: 22px; min-height: 44px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
