@font-face {
  font-family: "Golos Text";
  src: url("/static/golos-text.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f7f7f2;
  --surface: #ecede7;
  --text: #10110f;
  --muted: #53545c;
  --line: #81838a;
  --divider: #d5d6ce;
  --accent: #282b60;
  --on-accent: #fff;
  --focus: #445dab;
  --success: #285c37;
  --danger: #a12628;
  --monitor: #1c1e24;
  --coral: #e96e5d;
  --motion: 120ms cubic-bezier(.2,.8,.2,1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #101110;
  --surface: #1c1e24;
  --text: #f7f7f2;
  --muted: #c0c4d0;
  --line: #868b9a;
  --divider: #3b3d45;
  --accent: #c0c8ff;
  --on-accent: #10110f;
  --focus: #c0c8ff;
  --success: #a7d484;
  --danger: #ffa598;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 280px;
  background: var(--page);
  color: var(--text);
  font: 400 1rem/1.6 "Golos Text", Arial, sans-serif;
  font-synthesis: none;
}

button, select { font: inherit; }

button:focus-visible, select:focus-visible, video:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.masthead { border-bottom: 1px solid var(--divider); }

.masthead-inner, .workspace {
  width: min(100%, 1280px);
  margin-inline: auto;
  padding-inline: 36px;
}

.masthead-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 76px;
}

.wordmark {
  color: var(--text);
  font-size: 1.375rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.theme-label select {
  max-width: 100%;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
}
.theme-label select:hover { border-color: var(--line); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  padding-block: clamp(48px, 8vw, 110px) 64px;
}

.context {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
}
.context span { margin-inline: 6px; }

h1, h2, h3 { text-wrap: pretty; }

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 3.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.025em;
  overflow-wrap: break-word;
}

.question-note {
  max-width: 39ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.0625rem;
}

.answer { min-width: 0; }

.answer-head {
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.answer-head h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
}

.clock {
  color: var(--text);
  white-space: nowrap;
  font-size: .875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.clock-limit { color: var(--muted); }

.monitor {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: var(--monitor);
  color: #f7f7f2;
}

.monitor video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.standby {
  display: grid;
  place-items: center;
  gap: 16px;
  color: #c0c4d0;
  font-size: .875rem;
}

.viewfinder {
  width: 64px;
  height: 48px;
  position: relative;
  --edge: linear-gradient(#a5a9c4 0 0);
  background: var(--edge) left top, var(--edge) right top,
    var(--edge) left bottom, var(--edge) right bottom,
    var(--edge) left top, var(--edge) right top,
    var(--edge) left bottom, var(--edge) right bottom;
  background-size: 14px 1px, 14px 1px, 14px 1px, 14px 1px,
    1px 14px, 1px 14px, 1px 14px, 1px 14px;
  background-repeat: no-repeat;
}

.viewfinder::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 7px;
  aspect-ratio: 1;
  border: 1px solid #a5a9c4;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.live {
  position: absolute;
  left: 16px;
  top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--monitor);
  color: #f7f7f2;
  font-size: .875rem;
}
.live::before {
  content: "";
  width: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--coral);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

button {
  min-height: 48px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: .9375rem;
  font-weight: 600;
  transition: background var(--motion), opacity var(--motion);
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}
button.primary:hover:not(:disabled) { opacity: .87; }
button.secondary:hover:not(:disabled) { background: var(--surface); }
button:active:not(:disabled) { opacity: .74; }
button:disabled { opacity: .56; cursor: default; }

.status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .875rem;
}

.status[data-tone="error"] { color: var(--danger); }

.result {
  min-height: 225px;
  border-top: 2px solid var(--accent);
  background: var(--surface);
  padding: clamp(20px, 4vw, 36px);
  overflow-wrap: anywhere;
}
.result h3 {
  margin: 0 0 12px;
  font-size: clamp(1.375rem, 2.1vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
}
.result p { margin: 0; }
.result[data-tone="done"] { border-top-color: var(--success); }
.result[data-tone="error"] { border-top-color: var(--danger); }

.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 820px) {
  .masthead-inner, .workspace { padding-inline: 20px; }
  .masthead-inner { min-height: 64px; }
  .workspace { grid-template-columns: 1fr; gap: 32px; padding-block: 36px 48px; }
  .context { margin-bottom: 12px; }
  h1 { max-width: 21ch; }
  .question-note { margin-top: 16px; }
}

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