@font-face {
  font-family: Inter;
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #050505;
  --panel: #111;
  --white: #f7f7f7;
  --gray: #a2a2a2;
  --line: #343434;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--black); color: var(--white); font-family: Inter, sans-serif; }

.app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  display: block;
  overflow: hidden;
}

.camera {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--panel);
}
.camera img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.camera-state {
  position: absolute;
  z-index: 2;
  top: clamp(12px, 1.6vw, 24px);
  left: clamp(12px, 1.6vw, 24px);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  color: var(--white);
  background: #050505d9;
  font-size: clamp(12px, 1vw, 15px);
  font-weight: 500;
  line-height: 1;
}
.state-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--gray); }
.camera-state.state-online .state-dot { background: var(--white); }
.camera-state.state-offline .state-dot { background: transparent; border: 1px solid var(--white); }
.camera-message {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #050505d9;
  text-align: center;
  font-size: clamp(17px, 1.7vw, 27px);
  line-height: 1.25;
  font-weight: 450;
}
.camera-message[hidden] { display: none; }
.catalog-shortcut { position: absolute; z-index: 3; right: clamp(12px, 1.6vw, 24px); bottom: clamp(12px, 1.6vw, 24px); padding: 9px 11px; color: #f7f7f7; background: #050505a6; text-decoration: none; font-size: 12px; letter-spacing: .02em; }
.catalog-shortcut:hover, .catalog-shortcut:focus-visible { text-decoration: underline; }

.readout {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.counter {
  position: absolute;
  top: clamp(18px, 3vh, 40px);
  right: clamp(18px, 3vw, 48px);
  display: grid;
  place-items: center;
  min-width: clamp(82px, 10vw, 150px);
  min-height: clamp(82px, 10vw, 150px);
  padding: 8px 14px;
  color: var(--white);
  background: #050505b8;
}
.counter-number {
  display: block;
  font-size: clamp(64px, 10vw, 144px);
  font-weight: 570;
  line-height: .9;
  letter-spacing: -.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.counter-number[data-digits="2"] { font-size: clamp(58px, 8vw, 116px); }
.counter-number[data-digits="3"] { font-size: clamp(52px, 6.5vw, 94px); }
.counter-number[data-digits="4"] { font-size: clamp(46px, 5vw, 72px); }
.counter-number.count-pop { animation: count-pop .32s ease-out; }

.camera-selector {
  position: absolute;
  z-index: 2;
  top: calc(clamp(18px, 3vh, 40px) + 150px);
  right: clamp(118px, 14vw, 208px);
  width: min(300px, 36vw);
  padding: 10px 11px 9px;
  color: var(--white);
  background: #050505db;
  border: 1px solid #4b4b4b;
}
.camera-selector label { display: block; margin-bottom: 6px; color: #d3d3d3; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.camera-selector select { width: 100%; min-width: 0; padding: 7px 25px 7px 8px; color: var(--white); background: #171717; border: 1px solid #626262; border-radius: 0; font: inherit; font-size: clamp(11px, .9vw, 13px); }
.camera-selector select:disabled { color: #a8a8a8; cursor: wait; }
.camera-selector p { margin: 7px 0 0; color: #b8b8b8; font-size: clamp(10px, .75vw, 12px); line-height: 1.35; }

.profile-link {
  position: absolute;
  z-index: 2;
  top: clamp(18px, 3vh, 40px);
  right: clamp(118px, 14vw, 208px);
  width: min(300px, 36vw);
  padding: 11px 12px 10px;
  color: var(--white);
  background: #050505db;
  border: 1px solid #4b4b4b;
}
.profile-link label { display: block; margin-bottom: 7px; color: #d3d3d3; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.profile-link select { width: 100%; min-width: 0; padding: 7px 25px 7px 8px; color: var(--white); background: #171717; border: 1px solid #626262; border-radius: 0; font: inherit; font-size: clamp(11px, .9vw, 13px); }
.profile-link p { margin: 8px 0 0; color: #b8b8b8; font-size: clamp(10px, .75vw, 12px); line-height: 1.35; }

.description {
  position: absolute;
  left: clamp(16px, 3vw, 48px);
  bottom: clamp(18px, 3vh, 40px);
  width: min(760px, 68vw);
  max-height: min(34vh, 310px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(16px, 2vw, 28px) clamp(20px, 2.5vw, 36px);
  background: linear-gradient(90deg, #050505e8 0%, #050505bf 82%, #05050500 100%);
  border-left: 2px solid var(--white);
  overflow: hidden;
}
.description p {
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  font-size: clamp(16px, 1.65vw, 25px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.025em;
}
.description-note { color: #c0c0c0; font-size: clamp(11px, .85vw, 13px); font-weight: 450; }
.description p.typing::after { content: ""; display: inline-block; width: 1px; height: .95em; margin-left: 3px; background: currentColor; vertical-align: -.08em; animation: caret .7s steps(1, end) infinite; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes count-pop {
  from { opacity: .6; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes caret { 50% { opacity: 0; } }

@media (max-width: 900px) and (orientation: portrait) {
  .camera img { object-fit: cover; object-position: 32% center; }
  .counter { top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); min-width: 76px; min-height: 76px; }
  .counter-number { font-size: clamp(60px, 18vw, 94px); }
  .counter-number[data-digits="2"] { font-size: clamp(54px, 15vw, 80px); }
  .counter-number[data-digits="3"] { font-size: clamp(48px, 12vw, 68px); }
  .counter-number[data-digits="4"] { font-size: clamp(44px, 10vw, 58px); }
  .description { left: max(12px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); width: min(100% - 24px, 560px); max-height: 30vh; padding: 14px 16px; }
  .description p { font-size: clamp(15px, 4.2vw, 20px); margin-bottom: 8px; -webkit-line-clamp: 4; }
  .description-note { font-size: 11px; }
  .catalog-shortcut { right: max(12px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 30vh + 8px); }
  .camera-selector { top: 258px; right: max(12px, env(safe-area-inset-right)); width: min(278px, calc(100% - 24px)); }
  .profile-link { top: 102px; right: max(12px, env(safe-area-inset-right)); width: min(278px, calc(100% - 24px)); }
}

@media (max-height: 500px) and (orientation: landscape) {
  .counter { top: 12px; right: 16px; min-width: 68px; min-height: 68px; }
  .counter-number { font-size: clamp(54px, 11vh, 78px); }
  .counter-number[data-digits="2"] { font-size: clamp(48px, 9vh, 65px); }
  .counter-number[data-digits="3"] { font-size: clamp(44px, 7vh, 54px); }
  .counter-number[data-digits="4"] { font-size: clamp(40px, 6vh, 46px); }
  .description { left: 16px; bottom: 12px; width: min(68vw, 760px); max-height: 40vh; padding: 12px 16px; }
  .description p { font-size: clamp(14px, 2.1vh, 18px); margin-bottom: 6px; -webkit-line-clamp: 3; }
  .description-note { font-size: 10px; }
  .catalog-shortcut { bottom: auto; top: 12px; left: 16px; right: auto; }
  .camera-selector { top: 126px; right: 102px; width: min(270px, 34vw); padding: 8px 10px; }
  .camera-selector label { margin-bottom: 4px; }
  .camera-selector p { margin-top: 5px; font-size: 10px; }
  .profile-link { top: 12px; right: 102px; width: min(270px, 34vw); padding: 8px 10px; }
  .profile-link label { margin-bottom: 4px; }
  .profile-link p { margin-top: 5px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) { .counter-number.count-pop, .description p.typing::after { animation: none; } }
