:root {
  --ink: #296f34;
  --ink-deep: #296f34;
  --paper: #eef2f6;
  --muted: #607086;
  --white: #ffffff;
  --danger: #d91f2f;
  --dark: #111820;
  --shadow: 0 28px 70px rgba(20, 45, 80, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(32, 62, 107, 0.05), transparent 35%),
    #d8dee6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  opacity: 1;
  transition:
    opacity 500ms ease,
    visibility 500ms ease;
}

.preloader.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.preloader-logo {
  width: min(520px, 82vw);
  max-height: 33vh;
  object-fit: contain;
  animation: preloader-pulse 1500ms ease-in-out infinite;
}

@keyframes preloader-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.card {
  position: relative;
  width: min(1180px, 100%);
  min-height: min(820px, calc(100vh - 64px));
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(224, 230, 238, 0.86)),
    var(--paper);
  box-shadow: var(--shadow);
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: -3;
  background:
    linear-gradient(130deg, transparent 0 18%, rgba(122, 139, 162, 0.18) 18% 32%, transparent 32% 42%, rgba(255, 255, 255, 0.68) 42% 55%, transparent 55% 100%),
    linear-gradient(130deg, transparent 0 48%, rgba(126, 143, 167, 0.14) 48% 66%, transparent 66% 100%);
}

.card::after {
  inset: auto -210px -330px auto;
  width: 560px;
  height: 560px;
  transform: rotate(45deg);
  background:
    linear-gradient(90deg, transparent 0 18%, var(--ink-deep) 18% 26%, transparent 26% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0));
  z-index: -1;
}

.brand {
  position: absolute;
  z-index: 4;
  top: clamp(28px, 6vw, 66px);
  right: clamp(24px, 6vw, 68px);
  display: block;
  width: clamp(220px, 30vw, 360px);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(132px, 17vw, 184px) clamp(24px, 7vw, 76px) clamp(44px, 6vw, 72px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 7px rgba(217, 31, 47, 0.12);
}

.live-dot.is-muted {
  background: var(--muted);
  box-shadow: 0 0 0 7px rgba(96, 112, 134, 0.12);
}

.name {
  margin: 0 0 clamp(28px, 4vw, 42px);
  max-width: 720px;
  color: var(--ink-deep);
  font-size: clamp(2.15rem, 5vw, 4.65rem);
  line-height: 0.98;
  font-weight: 800;
}

.home-title {
  max-width: none;
  font-size: clamp(1.56rem, 3.12vw, 2.8rem);
  line-height: 1;
  white-space: nowrap;
}

.camera-title {
  font-size: clamp(1rem, 2vw, 1.8rem);
  line-height: 1;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(980px, 100%);
}

.camera-tile {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.preview-link {
  display: block;
}

.preview,
.video-shell {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(41, 111, 52, 0.76);
  background: var(--dark);
  box-shadow: 0 18px 34px rgba(20, 45, 80, 0.16);
}

.preview {
  aspect-ratio: 16 / 9;
}

.preview-video,
.video {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--dark);
  object-fit: cover;
}

.preview-placeholder,
.video-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 18px;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  font-weight: 800;
}

.preview-placeholder svg,
.video-placeholder svg {
  width: 38px;
  height: 38px;
  color: rgba(255, 255, 255, 0.78);
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 9px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.is-live {
  color: var(--danger);
}

.camera-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 18px;
  border: 2px solid var(--ink);
  background: rgba(245, 248, 252, 0.92);
  color: var(--ink-deep);
  font-weight: 800;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.camera-button:hover,
.button:hover {
  background: var(--ink-deep);
  color: var(--white);
  transform: translateY(-1px);
}

.video-shell {
  width: min(920px, 100%);
  aspect-ratio: 16 / 9;
}

.status {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: calc(100% - 28px);
  padding: 9px 12px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--ink-deep);
  font-size: 0.92rem;
  font-weight: 800;
}

.status.is-error {
  color: #b00020;
}

.button-icon,
.icon {
  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.button-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  width: min(920px, 100%);
  margin-top: 28px;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}

.stream-info {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  font-size: clamp(1.15rem, 2.4vw, 1.85rem);
  font-weight: 800;
}

.stream-info svg {
  width: 34px;
  height: 34px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button:focus-visible,
.camera-button:focus-visible,
.preview-link:focus-visible {
  outline: 3px solid rgba(238, 23, 37, 0.42);
  outline-offset: 5px;
}

@media (max-width: 920px) {
  .camera-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page {
    padding: 0;
  }

  .card {
    min-height: 100vh;
    width: 100%;
    box-shadow: none;
  }

  .brand {
    left: 24px;
    right: auto;
    width: min(270px, calc(100% - 48px));
  }

  .content {
    padding: 132px 24px 190px;
  }

  .home-title {
    white-space: normal;
  }

  .camera-grid {
    grid-template-columns: 1fr;
  }

  .footer,
  .video-shell {
    width: 100%;
  }

  .actions {
    width: 100%;
  }

  .button {
    flex: 1 1 160px;
  }

  .card::after {
    inset: auto -210px -290px auto;
    width: 520px;
    height: 520px;
  }
}

@media (max-width: 420px) {
  .content {
    padding-inline: 18px;
    padding-bottom: 180px;
  }

  .status {
    left: 10px;
    bottom: 10px;
    font-size: 0.82rem;
  }
}
