:root {
  color-scheme: dark;
  font-family: "Courier New", Courier, monospace;
  --cyan: #65ffe0;
  --ink: #06100e;
  --glass: rgba(2, 10, 9, 0.78);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050909;
  display: grid;
  place-items: center;
}

button,
a { font: inherit; }

.signal-filters {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene {
  --glass-top: 10%;
  --glass-right: 10%;
  --glass-bottom: 15%;
  --glass-left: 10%;
  isolation: isolate;
  position: relative;
  width: min(100vw, calc(100svh * 1.7777778));
  max-width: 100vw;
  max-height: 100svh;
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  overflow: hidden;
  background: #050909;
}

.scene-media {
  position: absolute;
  z-index: -3;
  inset: 0;
}

.scene-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
}

.scene::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 70%, transparent 0 18%, rgba(0, 0, 0, 0.08) 41%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(110deg, rgba(0, 0, 0, 0.38), transparent 34% 72%, rgba(0, 0, 0, 0.18));
}

.scanlines {
  position: absolute;
  z-index: 15;
  top: 6%;
  right: 7.5%;
  bottom: 12%;
  left: 7.5%;
  border-radius: 9% / 6%;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.3;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.72) 3px, rgba(255, 255, 255, 0.045) 4px);
  mix-blend-mode: multiply;
}

.scanlines::before,
.scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
}

.scanlines::before {
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 74, 74, 0.16) 0 1px,
    rgba(72, 255, 163, 0.12) 1px 2px,
    rgba(76, 128, 255, 0.14) 2px 3px
  );
  opacity: 0.2;
  mix-blend-mode: screen;
}

.scanlines::after {
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.34) 100%),
    linear-gradient(to bottom, transparent 0 48%, rgba(157, 255, 232, 0.06) 49%, transparent 50% 100%);
  box-shadow: inset 0 0 6cqw rgba(0, 0, 0, 0.3);
  opacity: 0.7;
}

.brand {
  position: absolute;
  z-index: 4;
  top: var(--glass-top);
  left: var(--glass-left);
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.02cqw, 20px);
  color: rgba(231, 255, 248, 0.9);
  filter: url("#crt-signal") saturate(0.72) contrast(0.92) brightness(0.94);
  opacity: 0.9;
  transform: perspective(900px) rotateY(2.1deg) rotateX(-1.65deg) skewY(-0.32deg);
  transform-origin: left top;
  text-shadow:
    -0.7px 0 rgba(255, 65, 90, 0.2),
    0.8px 0 rgba(44, 160, 255, 0.22),
    0 0 7px rgba(189, 255, 241, 0.25),
    1px 2px 3px rgba(0, 0, 0, 0.9);
}

.micro-mark {
  display: grid;
  place-items: center;
  width: clamp(30px, 3.75cqw, 72px);
  height: clamp(30px, 3.75cqw, 72px);
  border: 1px solid rgba(101, 255, 224, 0.48);
  color: rgba(101, 255, 224, 0.88);
  background: rgba(0, 18, 15, 0.3);
  font: 700 clamp(21px, 2.58cqw, 50px)/1 Arial, sans-serif;
  box-shadow: 0 0 24px rgba(101, 255, 224, 0.14), inset 0 0 16px rgba(101, 255, 224, 0.08);
}

h1 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(22px, 4cqw, 77px);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.065em;
  color: rgba(229, 247, 242, 0.88);
}

.brand p {
  margin: clamp(5px, 0.7cqw, 13px) 0 0;
  color: rgba(101, 255, 224, 0.82);
  font-size: clamp(8px, 0.85cqw, 16px);
  font-weight: 700;
  letter-spacing: 0.16em;
}

.controls {
  position: absolute;
  z-index: 4;
  left: var(--glass-left);
  bottom: var(--glass-bottom);
  width: min(390px, 32%);
  filter: url("#crt-signal") saturate(0.66) contrast(0.9) brightness(0.9);
  opacity: 0.9;
  transform: perspective(900px) rotateY(2.15deg) rotateX(1.7deg) skewY(0.34deg);
  transform-origin: left bottom;
}

.ca-control,
.action {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(125, 239, 218, 0.28);
  border-radius: 1.4% / 8%;
  clip-path: polygon(0.35% 1.5%, 99.5% 0, 100% 96.5%, 0 100%);
  color: rgba(206, 247, 237, 0.82);
  background:
    radial-gradient(ellipse at 48% 35%, rgba(76, 172, 151, 0.09), transparent 68%),
    linear-gradient(91deg, rgba(2, 13, 11, 0.5), rgba(5, 20, 17, 0.6) 52%, rgba(1, 10, 9, 0.48));
  backdrop-filter: blur(1px) brightness(0.7) saturate(0.75);
  -webkit-backdrop-filter: blur(1px) brightness(0.7) saturate(0.75);
  box-shadow:
    0 0 9px rgba(59, 255, 214, 0.035),
    inset 0 0 24px rgba(48, 255, 213, 0.035),
    inset 0 1px rgba(225, 255, 248, 0.08),
    inset 0 -1px rgba(0, 0, 0, 0.62);
  text-shadow:
    -0.55px 0 rgba(255, 60, 78, 0.2),
    0.65px 0 rgba(46, 151, 255, 0.22),
    0 0 5px rgba(101, 255, 224, 0.26),
    1px 1px rgba(0, 0, 0, 0.82);
}

.ca-control::before,
.action::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.28) 3px, rgba(142, 255, 229, 0.035) 4px),
    repeating-linear-gradient(96deg, transparent 0 7px, rgba(255, 255, 255, 0.022) 8px, transparent 9px 17px),
    radial-gradient(circle at 18% 31%, rgba(160, 255, 233, 0.12) 0 0.45px, transparent 0.8px);
  background-size: auto, auto, 7px 6px;
  opacity: 0.9;
  mix-blend-mode: screen;
  pointer-events: none;
}

.ca-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(7px, 1.02cqw, 20px);
  width: 100%;
  min-height: clamp(40px, 4.06cqw, 78px);
  padding: clamp(7px, 0.78cqw, 15px) clamp(8px, 0.94cqw, 18px);
  text-align: left;
  cursor: pointer;
}

.ca-control span,
.ca-control i {
  color: var(--cyan);
  font-size: clamp(8px, 0.78cqw, 15px);
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.ca-control strong {
  overflow: hidden;
  font-size: clamp(9px, 0.94cqw, 18px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-row {
  display: grid;
  grid-template-columns: 1.5fr 0.75fr 0.55fr 1fr;
  gap: clamp(5px, 0.63cqw, 12px);
  margin-top: clamp(5px, 0.63cqw, 12px);
}

.action {
  display: grid;
  place-items: center;
  min-height: clamp(38px, 3.75cqw, 72px);
  padding: clamp(8px, 0.94cqw, 18px) clamp(5px, 0.5cqw, 10px);
  font-size: clamp(8px, 0.86cqw, 13px);
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.action.primary {
  border-color: rgba(101, 255, 224, 0.38);
  color: rgba(168, 249, 231, 0.88);
  background:
    radial-gradient(ellipse at 50% 35%, rgba(95, 255, 220, 0.13), transparent 70%),
    linear-gradient(91deg, rgba(5, 38, 32, 0.58), rgba(7, 50, 41, 0.56) 52%, rgba(3, 26, 22, 0.58));
}

.action:hover,
.action:focus-visible,
.ca-control:hover,
.ca-control:focus-visible {
  outline: none;
  border-color: rgba(187, 255, 241, 0.86);
  color: #dffff8;
  background: rgba(9, 48, 40, 0.9);
  box-shadow: 0 0 15px rgba(101, 255, 224, 0.18), inset 0 0 18px rgba(101, 255, 224, 0.08);
  transform: translateY(-1px);
}

.action.primary:hover,
.action.primary:focus-visible { color: #dffff8; }

.toast {
  position: absolute;
  z-index: 10;
  left: var(--glass-left);
  bottom: calc(var(--glass-bottom) + clamp(74px, 8.4cqw, 161px));
  padding: 8px 10px;
  color: var(--cyan);
  background: rgba(0, 0, 0, 0.8);
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-aspect-ratio: 4 / 5) {
  .scene {
    --glass-top: 8.5%;
    --glass-right: 10%;
    --glass-bottom: 11%;
    --glass-left: 10%;
    width: min(100vw, calc(100svh * 0.562799));
    aspect-ratio: 941 / 1672;
  }

  .scene-image { object-position: center; }

  .scanlines {
    top: 6%;
    right: 6.5%;
    bottom: 8.5%;
    left: 6.5%;
    border-radius: 8% / 4%;
  }

  .scene::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.38), transparent 30% 64%, rgba(0, 0, 0, 0.32));
  }

  .brand {
    gap: 2.3cqw;
  }

  .micro-mark { width: 10cqw; height: 10cqw; font-size: 6.9cqw; }
  h1 { font-size: 10.5cqw; }
  .brand p { margin-top: 1.5cqw; font-size: max(8px, 2.05cqw); }

  .controls {
    width: min(360px, 80%);
  }

  .ca-control {
    gap: 3.3cqw;
    min-height: 13.3cqw;
    padding: 2.55cqw 3.05cqw;
  }

  .ca-control span,
  .ca-control i { font-size: 2.55cqw; }
  .ca-control strong { font-size: 3.05cqw; }
  .action-row { gap: 2.05cqw; margin-top: 2.05cqw; }
  .action { min-height: 12.3cqw; padding: 3cqw 1.4cqw; font-size: min(2.8cqw, 13px); }

  .toast {
    bottom: calc(var(--glass-bottom) + 27.7cqw);
  }
}

@media (max-height: 560px) {
  .brand p { display: none; }
  .controls {
    width: min(390px, 46%);
  }
  .ca-control { min-height: clamp(34px, 4.06cqw, 52px); }
  .action { min-height: clamp(34px, 3.75cqw, 48px); padding: clamp(6px, 0.7cqw, 10px); }
  .toast { bottom: calc(var(--glass-bottom) + clamp(74px, 8.4cqw, 100px)); }
}

@media (max-width: 340px) and (min-height: 561px) {
  .action { padding-inline: 5px; font-size: 9px; letter-spacing: 0.04em; }
}

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