:root {
  --ink: #0D1C26;
  --steel: #3E5C70;
  --yellow: #FFD21F;
  --red: #E5322D;
  --ok: #1E9E5A;
  --amber: #E8A100;

  --display: "Unbounded", "Arial Black", Impact, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  --bg: #EDF1F3;
  --text: #0D1C26;
  --surface: #fff;
  --card: #EDF1F3;
  --mute: #5C6E7B;
  --nav: #3E5C70;
  --line: #D2DBE1;
  --room: #0D1C26;
  --room-edge: #0D1C26;
  --grid: rgba(13, 28, 38, .07);
  --header-bg: rgba(237, 241, 243, .82);
  --lens-glow: none;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0A141B;
  --text: #E6EDF2;
  --surface: #101F2A;
  --card: #172B38;
  --mute: #9DB0BD;
  --nav: #A9C1D1;
  --line: #25404F;
  --room: #03090D;
  --room-edge: #25404F;
  --grid: rgba(169, 193, 209, .07);
  --header-bg: rgba(10, 20, 27, .82);
  --lens-glow: 0 0 .35em rgba(255, 210, 31, .35);

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
ul, ol { padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
[hidden] { display: none !important; }
a { color: inherit; }

body {
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { left: 0; }

html.theme-anim *:not(img) {
  transition: background-color .35s ease, color .35s ease,
              border-color .35s ease, box-shadow .35s ease !important;
}

h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  line-height: 1.1;
  margin-bottom: 24px;
}
h3 { font-size: 1.1rem; margin-bottom: 4px; }

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 5vw;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.3rem;
  text-decoration: none;
}

.top nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 22px;
}
.top nav a {
  font-size: .95rem;
  font-weight: 600;
  color: var(--nav);
  text-decoration: none;
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
}
.theme-btn svg { width: 18px; height: 18px; flex: none; }
.theme-btn .i-sun { display: none; }
html[data-theme="dark"] .theme-btn .i-sun { display: block; }
html[data-theme="dark"] .theme-btn .i-moon { display: none; }

.hero {
  padding: 6vh 5vw 9vh;
  text-align: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(#000 40%, transparent);
          mask-image: linear-gradient(#000 40%, transparent);
  pointer-events: none;
}
.hero > * { position: relative; }

.mark {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .03em;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(6rem, 24vw, 17rem);
  line-height: 1;
  letter-spacing: -.04em;
}

.lens {
  position: relative;
  display: inline-block;
  width: .72em;
  height: .72em;
  border: .09em solid var(--text);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: var(--lens-glow);
}
.lens::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset calc(var(--hx, .707) * .085em) calc(var(--hy, .707) * .085em) 0 rgba(255, 255, 255, .4);
  translate: var(--px, 0px) var(--py, 0px);
  will-change: translate;
}

.tag {
  margin-top: 2vh;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.2rem, 3vw, 2rem);
}
.sub { max-width: 52ch; margin: 16px auto 0; color: var(--mute); }

.go {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 26px;
  border-radius: 99px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}

.room {
  padding: 6vh 5vw;
  background: var(--room);
  color: #fff;
  border-block: 1px solid var(--room-edge);
}
.room-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: start;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.room :focus-visible { outline-color: #fff; }

.screen {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 3px solid var(--steel);
  border-radius: 18px;
  background: #050B10;
}
.screen img,
.screen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity .35s ease, filter .35s ease, transform .35s ease;
}
.screen img.switching,
.screen video.switching { opacity: 0; filter: blur(14px); transform: scale(1.06); }
.screen canvas { width: 100%; height: 100%; display: block; }

.placeholder { padding: 20px; text-align: center; color: #8EA3B2; }
.placeholder strong { font-family: var(--display); font-size: 1.1rem; color: #fff; }

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
}
.badge.off  { background: #5B6B78; }
.badge.live { background: var(--ok); }
.badge.err  { background: var(--red); }
.badge.demo { background: var(--amber); color: var(--ink); }

.hud {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(5, 11, 16, .7);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.hud i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.hud .sep { opacity: .4; }

.switchlabel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 20px;
  font-family: var(--display);
  font-size: 1.2rem;
  text-align: center;
  color: #fff;
  pointer-events: none;
}
.switchlabel::after {
  content: "";
  position: absolute;
  bottom: 18%;
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, .25);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bar { margin-top: 16px; }
.bar label { font-size: .88rem; font-weight: 600; color: #A9BAC6; }
.row { display: flex; gap: 8px; margin-top: 4px; }
.msg { min-height: 1.5em; margin-top: 6px; font-size: .9rem; color: #A9BAC6; }
.msg.bad { color: #FF9C94; }

.modes { display: flex; gap: 8px; margin-bottom: 12px; }
.modes button {
  padding: 8px 14px;
  border-radius: 99px;
  background: #17303F;
  color: #fff;
  font-size: .88rem;
}
.modes button[aria-pressed=true] { background: var(--yellow); color: var(--ink); }

.bar .check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: .85rem;
  font-weight: 400;
  color: #A9BAC6;
  cursor: pointer;
}
.cam .check { margin-top: 8px; }
input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--yellow); }

input[type=text],
input[type=password] {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 2px solid var(--steel);
  border-radius: 10px;
  background: #0A1822;
  color: #fff;
  font: inherit;
}

button {
  padding: 13px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
button:active { filter: brightness(.88); }
button:disabled { opacity: .4; cursor: not-allowed; }

.tools { display: grid; gap: 10px; }
.tools button { background: #17303F; color: #fff; text-align: left; }
.tools button[aria-pressed=true] { background: var(--yellow); color: var(--ink); }
.tools button.ghost { background: transparent; border: 2px solid var(--steel); color: #A9BAC6; font-size: .9rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair button { text-align: center; }
.note { font-size: .82rem; line-height: 1.45; color: #8EA3B2; }

.cam {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--steel);
  border-radius: 14px;
  background: #0A1822;
}
.cam h3 { font-family: var(--display); font-size: 1rem; }
.cam label { font-size: .88rem; font-weight: 600; color: #A9BAC6; }
.cam-hint { font-size: .9rem; line-height: 1.45; color: #A9BAC6; }
.cam video {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  background: #050B10;
}
.cam .row button { flex: 1; }

.block { max-width: 1100px; margin: 0 auto; padding: 10vh 5vw; }
.alt { max-width: none; background: var(--surface); }
.alt > * { max-width: 1000px; margin-inline: auto; }
.lead { max-width: 56ch; margin-bottom: 36px; font-size: 1.25rem; }

.list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px 36px;
}
.list li { padding-left: 16px; border-left: 6px solid var(--yellow); }
.list p { max-width: 34ch; color: var(--mute); }

.flow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.flow li { padding: 16px; border-radius: 14px; background: var(--card); }
.flow strong { display: block; margin-bottom: 4px; font-family: var(--display); font-size: .95rem; }

.alt > .table-wrap {
  max-width: 760px;
  margin-inline: auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: center; }
tr:last-child td { border-bottom: 0; }
th { background: var(--room); color: #fff; }

.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 48px;
}
.watch .lead { margin-bottom: 28px; }
.phone {
  justify-self: center;
  width: min(320px, 100%);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 3px solid var(--steel);
  border-radius: 28px;
  background: #050B10;
}
.phone iframe { display: block; width: 100%; height: 100%; border: 0; }

.team { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; }
.team li {
  flex: 1 1 200px;
  padding: 20px;
  border-radius: 14px;
  border-bottom: 6px solid var(--yellow);
  background: var(--surface);
}
.team span { display: block; color: var(--mute); }

footer { padding: 26px 5vw; background: var(--room); color: #A9BAC6; text-align: center; }

.demo { display: grid; gap: 10px; margin-top: 14px; }
.demo-cmds, .demo-drive { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.demo button { padding: 11px 8px; background: #17303F; color: #fff; font-size: .9rem; text-align: center; }
.demo [data-cmd="fire"] { background: var(--red); }
.demo-drive button:active { background: var(--yellow); color: var(--ink); }

.demolog {
  list-style: none;
  min-height: 11em;
  padding: 12px 14px;
  border: 1px solid var(--steel);
  border-radius: 10px;
  background: #0A1822;
  font-size: .88rem;
  line-height: 1.5;
  color: #A9BAC6;
}
.demolog b { margin-right: 8px; font-variant-numeric: tabular-nums; color: #8EA3B2; }
.demolog .alert { color: #FF9C94; }
.demolog .ok { color: #6EE7A8; }

@media (hover: hover) {
  .top nav a:hover {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 5px;
  }
  .theme-btn:hover { border-color: var(--nav); }
  .go:hover { background: var(--steel); color: #fff; }
  button:hover { filter: brightness(.93); }
  button:disabled:hover { filter: none; }
  .tools button:hover { background: #1F4054; filter: none; }
  .tools button[aria-pressed=true]:hover { background: var(--yellow); filter: brightness(.93); }
  .tools button.ghost:hover { background: #17303F; color: #fff; }
  .modes button:hover { background: #1F4054; filter: none; }
  .modes button[aria-pressed=true]:hover { background: var(--yellow); filter: brightness(.93); }
  .demo button:hover { background: #1F4054; filter: none; }
  .demo [data-cmd="fire"]:hover { background: #C92A26; }
}

@media (pointer: coarse) {
  button, input[type=text], input[type=password] { min-height: 46px; }
  .modes button { min-height: 40px; }
}

@media (max-width: 900px) {
  .room-in { grid-template-columns: 1fr; }
  .tools { grid-template-columns: 1fr 1fr; }
  .tools .note, .tools .pair, .tools .ghost { grid-column: 1 / -1; }
  .watch { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 640px) {
  .top { gap: 10px; padding: 10px 5vw; }
  .top nav { gap: 8px 16px; }
  .top nav a { font-size: .88rem; }
  .theme-btn { padding: 6px 12px; }
  .block { padding: 8vh 5vw; }
  .room { padding: 4vh 4vw; }
}

@media (max-width: 520px) {
  .demo-cmds, .demo-drive { grid-template-columns: 1fr 1fr; }
  .tools { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .row input { flex: 1 1 100%; }
  .row button { flex: 1 1 100%; }
  .modes { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .screen img, .screen video { transition: none; }
  .switchlabel::after { animation: none; }
  html.theme-anim *:not(img) { transition: none !important; }
}

@media (prefers-reduced-motion: no-preference) {
  .badge.live, .hud i { animation: pulse 1.6s infinite; }
  .lens::after { animation: blink 5s infinite; }

  @keyframes pulse { 50% { opacity: .6; } }
  @keyframes blink {
    0%, 94%, 100% { transform: scaleY(1); }
    97%           { transform: scaleY(.08); }
  }
}
