@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-latin-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #151413;
  --paper-raised: #1d1c1a;
  --ink: #efebe3;
  --ink-2: #c9c4b9;
  --muted: #a29d93;
  --rule: #3a3835;
  --accent: #ff8421;
  --on-accent: #151413;
  --cta: var(--accent);
  --on-cta: #151413;
  --tape: #e9e4d8;
  --on-tape: #151413;
  --focus: var(--accent);
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --bg: var(--paper);
  --fg: #ffffff;
  --panel: #222222;
  --green: #007a33;
  --red: #b00020;
  --amber: #ffb000;
  --amber-fg: #111111;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 20px;
  -webkit-text-size-adjust: 100%;
}

body {
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.bar,
main {
  color: var(--ink);
  font-family: var(--font-body);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 12px;
  margin-bottom: 16px;
  border-bottom: 3px solid var(--rule);
}

.device {
  min-width: 0;
  padding: 4px 10px;
  color: var(--on-tape);
  background: var(--tape);
  font-family: var(--font-display);
  font-stretch: 70%;
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.15;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  transform: rotate(-1deg);
}

.device:empty {
  visibility: hidden;
}

.health {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dot {
  width: 12px;
  height: 12px;
  background: var(--muted);
}

.health[data-state="online"] .dot {
  background: #2ecc71;
}

.health[data-state="offline"] .dot {
  background: var(--amber);
}

.health[data-state="offline"] {
  color: var(--amber);
}

.panel {
  padding: 32px 0;
}

.panel h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-stretch: 62%;
  font-weight: 900;
  font-size: clamp(3.5rem, 22vw, 6rem);
  line-height: 0.85;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.panel p {
  margin: 0;
  padding-top: 12px;
  border-top: 2px solid var(--rule);
  color: var(--ink-2);
  font-size: 1.1rem;
  line-height: 1.4;
}

.viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 60vh;
  background: #000000;
  border: 3px solid var(--rule);
  overflow: hidden;
}

.viewfinder video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewfinder .primary {
  position: absolute;
  inset: auto 16px 16px 16px;
}

button {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 14px;
  min-height: 64px;
  padding: 0 20px;
  cursor: pointer;
}

.primary {
  border-radius: 0;
  background: var(--cta);
  color: var(--on-cta);
  font-family: var(--font-display);
  font-stretch: 70%;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.quiet {
  width: 100%;
  margin: 24px 0;
  border-radius: 0;
  border: 2px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  min-height: 56px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note {
  color: var(--ink-2);
  text-align: center;
  margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.wedge label {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.wedge input {
  width: 100%;
  min-height: 56px;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0 14px;
  border-radius: 0;
  border: 2px solid var(--muted);
  background: var(--paper-raised);
  color: var(--ink);
}

.result {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px;
  text-align: center;
  z-index: 10;
}

.result[data-tone="green"] {
  background: var(--green);
  color: #ffffff;
}

.result[data-tone="red"] {
  background: var(--red);
  color: #ffffff;
}

.result[data-tone="amber"] {
  background: repeating-linear-gradient(-45deg, var(--amber) 0 40px, #e69500 40px 80px);
  color: var(--amber-fg);
}

.result[data-tone="neutral"] {
  background: var(--panel);
}

.result-title {
  font-size: clamp(3rem, 16vw, 7rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
}

.result[data-tone="amber"] .result-title {
  font-size: clamp(2.2rem, 11vw, 5rem);
}

.result-subtitle {
  font-size: clamp(1.3rem, 6vw, 2.2rem);
  font-weight: 700;
  max-width: 24ch;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

.retry {
  background: #111111;
  color: var(--amber);
  font-size: 1.6rem;
  min-height: 80px;
}

.dismiss {
  background: transparent;
  color: var(--amber-fg);
  border: 3px solid var(--amber-fg);
}

[hidden] {
  display: none !important;
}
