:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  color: #fff;
  background: #070612;
  --edge: clamp(22px, 3.3vw, 60px);
  --orange: #ff7a1a;
  --gold: #ffc04c;
  --violet: #8d55ff;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #070612;
}

body { min-height: 100svh; }
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.scene {
  isolation: isolate;
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 420px;
  overflow: hidden;
  background: #070612;
}

.background-video,
.space-wash,
.sound-gate {
  position: absolute;
  inset: 0;
}

.background-video { z-index: -5; width: 100%; height: 100%; object-fit: cover; object-position: center; background: #070612; }

.space-wash {
  z-index: -4;
  background:
    linear-gradient(90deg, rgba(4, 3, 13, .82) 0%, rgba(5, 4, 16, .38) 34%, transparent 62%),
    linear-gradient(180deg, rgba(4, 3, 14, .38), transparent 28% 68%, rgba(2, 2, 10, .66));
}

.topbar {
  position: absolute;
  z-index: 10;
  top: max(var(--edge), env(safe-area-inset-top));
  left: var(--edge);
  right: var(--edge);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.cat-mark { display: block; width: 52px; height: 44px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(255,115,34,.48)); }
.brand-name { font-size: 13px; line-height: .93; font-weight: 800; letter-spacing: -.02em; }

.media-controls { display: flex; align-items: flex-start; gap: 20px; }
.sound-toggle, .motion-toggle { border: 0; padding: 2px 0 8px 8px; color: #fff; background: transparent; text-align: right; font: 9px/1.4 "Courier New", monospace; letter-spacing: .16em; }
.sound-toggle span, .motion-toggle span { display: block; color: rgba(255,255,255,.54); }
.sound-toggle strong, .motion-toggle strong { color: #ffb349; font-size: 9px; }

.footer {
  position: absolute;
  z-index: 10;
  left: var(--edge);
  right: var(--edge);
  bottom: max(var(--edge), env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.caption { margin: 0; display: flex; gap: 12px; align-items: flex-start; color: rgba(255,255,255,.74); font: 10px/1.5 "Courier New", monospace; letter-spacing: .14em; }
.caption span { color: var(--orange); font-size: 26px; line-height: .65; }
.controls { display: grid; grid-template-columns: 80px 230px 225px; gap: 8px; }
.x-control,
.ca-control,
.launch-control { min-height: 62px; border-radius: 999px; display: grid; align-items: center; grid-template-columns: auto 1fr auto; gap: 12px; padding: 8px 19px; text-decoration: none; }
.x-control { grid-template-columns: auto 1fr; border: 1px solid rgba(255,255,255,.28); color: #fff; background: rgba(7,6,18,.52); backdrop-filter: blur(14px); }
.ca-control { border: 1px solid rgba(255,255,255,.28); color: #fff; background: rgba(7,6,18,.52); backdrop-filter: blur(14px); }
.launch-control { overflow: hidden; position: relative; border: 1px solid rgba(255,193,82,.72); color: #261006; background: linear-gradient(105deg, #ff8a1f, #ffd064); box-shadow: 0 14px 36px -14px rgba(255,100,25,.9), inset 0 2px 3px rgba(255,236,172,.72), inset 0 -3px 5px rgba(220,68,16,.46); }
.launch-control::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.34), transparent 67%); transform: translateX(-110%); transition: transform 350ms ease; }
.launch-control:hover::before { transform: translateX(110%); }
.x-control span,
.ca-control span,
.launch-control span { position: relative; font: 9px "Courier New", monospace; letter-spacing: .13em; }
.x-control strong,
.ca-control strong,
.launch-control strong { position: relative; font: 700 10px "Courier New", monospace; letter-spacing: .09em; text-align: center; }
.ca-control i,
.launch-control i { position: relative; font-style: normal; font-size: 17px; }
.x-control:hover, .ca-control:hover { border-color: rgba(255,164,62,.88); background: rgba(25,14,31,.72); }
.launch-control:hover { filter: brightness(1.08); }

:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.toast { position: absolute; z-index: 20; right: var(--edge); bottom: calc(var(--edge) + 75px); padding: 11px 15px; border: 1px solid rgba(255,255,255,.2); border-radius: 99px; background: rgba(8,6,18,.86); color: #fff; font: 9px "Courier New", monospace; letter-spacing: .12em; opacity: 0; transform: translateY(5px); transition: 160ms ease; pointer-events: none; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.sound-gate { z-index: 100; display: grid; place-items: center; background: rgba(3,2,10,.62); backdrop-filter: blur(10px); transition: opacity 380ms ease, visibility 380ms ease; }
.sound-gate.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
.sound-gate button { display: grid; place-items: center; min-width: min(310px, calc(100vw - 40px)); min-height: 148px; padding: 26px 34px; border: 1px solid rgba(255,182,79,.72); border-radius: 999px; color: #251006; background: linear-gradient(115deg, #ff7b1d, #ffd36b); box-shadow: 0 24px 80px rgba(255,72,10,.32), inset 0 2px rgba(255,246,207,.7); }
.sound-gate span { font: 8px "Courier New", monospace; letter-spacing: .22em; }
.sound-gate strong { margin: 8px 0; font-size: 24px; letter-spacing: -.05em; }
.sound-gate i { font: 9px "Courier New", monospace; font-style: normal; letter-spacing: .14em; }
.sound-gate button:hover { filter: brightness(1.08); transform: scale(1.015); }

@media (max-width: 760px) {
  :root { --edge: 20px; }
  .scene { min-height: 540px; }
  .background-video { object-position: center; }
  .space-wash { background: linear-gradient(180deg, rgba(4,3,14,.74), transparent 29% 63%, rgba(2,2,10,.8)); }
  .cat-mark { width: 44px; height: 38px; }
  .brand-name { font-size: 11px; }
  .media-controls { gap: 10px; }
  .sound-toggle, .motion-toggle { font-size: 7px; }
  .sound-toggle strong, .motion-toggle strong { font-size: 7px; }
  .footer { display: block; }
  .caption { margin-bottom: 15px; font-size: 8px; }
  .caption span { font-size: 20px; }
  .controls { width: 100%; grid-template-columns: 58px .9fr 1.1fr; gap: 6px; }
  .x-control, .ca-control, .launch-control { min-height: 56px; padding: 8px 10px; gap: 6px; }
  .x-control span, .ca-control span, .launch-control span { font-size: 7px; }
  .x-control strong, .ca-control strong, .launch-control strong { font-size: 8px; }
  .toast { left: var(--edge); right: auto; bottom: calc(var(--edge) + 69px); }
}

@media (max-height: 560px) and (min-width: 761px) {
  :root { --edge: 20px; }
  .caption { display: none; }
  .controls { grid-template-columns: 68px 190px 200px; }
}

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