:root {
  color-scheme: dark;
  --ink: #eef3ff;
  --muted: #a8b3cd;
  --accent: #6ad3ff;
  --accent-warm: #ffd36f;
  --panel: rgba(18, 22, 42, 0.68);
  --panel-border: rgba(255, 255, 255, 0.12);
  --night-a: #070b22;
  --night-b: #11152f;
  --floor-shadow: rgba(5, 7, 18, 0.56);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html {
  background: var(--night-a);
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 18%, rgba(71, 84, 138, 0.24), transparent 28%),
    radial-gradient(circle at 72% 78%, rgba(141, 56, 88, 0.16), transparent 34%),
    linear-gradient(135deg, var(--night-a), var(--night-b) 58%, #07091a);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.app {
  position: relative;
  display: block;
  min-height: 100vh;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(18px, 3vw, 38px);
  isolation: isolate;
}

.hero::after {
  position: absolute;
  right: -10vw;
  bottom: -22vh;
  z-index: -1;
  width: min(68vw, 820px);
  height: min(68vw, 820px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106, 211, 255, 0.18), transparent 62%);
  content: "";
}

.hero-copy {
  position: absolute;
  z-index: 3;
  top: clamp(104px, 12vh, 140px);
  left: clamp(20px, 4vw, 64px);
  max-width: min(370px, 29vw);
  text-shadow: 0 3px 22px rgba(4, 6, 18, 0.72);
  transition:
    opacity 720ms ease 180ms,
    transform 860ms cubic-bezier(0.16, 1, 0.3, 1) 180ms;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(3.1rem, 5.2vw, 6rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.lead {
  max-width: 42rem;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  line-height: 1.55;
  overflow-wrap: break-word;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.primary-action {
  background: #f3f7ff;
  color: #0e1426;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.service-row {
  position: absolute;
  right: clamp(20px, 4vw, 64px);
  bottom: clamp(74px, 9vh, 96px);
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: min(650px, 48vw);
  color: rgba(238, 243, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    opacity 620ms ease 420ms,
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1) 420ms;
}

.service-row button {
  color: inherit;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(10, 15, 32, 0.42);
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  text-transform: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.service-row button:hover,
.service-row button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(106, 211, 255, 0.58);
  background: rgba(106, 211, 255, 0.12);
  color: #eff9ff;
  outline: none;
}

.service-row button.is-active {
  border-color: rgba(255, 211, 111, 0.62);
  background: rgba(255, 211, 111, 0.14);
  color: #fff3c8;
}

.stage {
  --stage-final-transform: translateX(18vw) translateY(-1vh) scale(0.96);
  --stage-start-transform: translateX(18vw) translateY(2vh) scale(0.9);

  position: relative;
  width: min(100%, 1180px);
  aspect-ratio: 1120 / 780;
  max-height: calc(100vh - 24px);
  overflow: hidden;
  opacity: 0;
  filter: blur(12px) saturate(0.82);
  transform: var(--stage-start-transform);
  transform-origin: center;
  transition:
    opacity 900ms ease,
    filter 1050ms ease,
    transform 1180ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter, transform;
}

body.scene-ready .stage {
  opacity: 1;
  filter: none;
  transform: var(--stage-final-transform);
}

body:not(.scene-ready) .hero-copy,
body:not(.scene-ready) .service-row,
body:not(.scene-ready) .toolbar {
  opacity: 0;
}

body:not(.scene-ready) .hero-copy {
  transform: translateY(14px);
}

body:not(.scene-ready) .service-row {
  transform: translateY(10px);
}

.stage::before {
  position: absolute;
  inset: 8% 2% -9%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.56), transparent 68%);
  content: "";
}

#room {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: manipulation;
}

.toolbar {
  position: fixed;
  z-index: 4;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.26);
  transition: opacity 520ms ease 560ms;
}

.tool-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.tool-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sound-muted-mark {
  opacity: 0;
  transition: opacity 160ms ease;
}

.tool-button:not(.is-active) .sound-muted-mark {
  opacity: 1;
}

.tool-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
}

.tool-button.is-active {
  border-color: rgba(252, 214, 135, 0.58);
  background: rgba(252, 214, 135, 0.17);
  color: #ffe8a9;
}

.video-drawer {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  align-items: end;
  justify-items: center;
  pointer-events: none;
  visibility: hidden;
}

.video-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

body.video-gallery-open {
  overflow: hidden;
}

.video-drawer__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 68% 18%, rgba(106, 211, 255, 0.14), transparent 34%),
    rgba(5, 7, 18, 0.62);
  opacity: 0;
  transition: opacity 180ms ease;
}

.video-drawer.is-open .video-drawer__backdrop {
  opacity: 1;
}

.video-panel {
  position: relative;
  width: min(860px, calc(100vw - 32px));
  max-height: min(78vh, 680px);
  margin: 0 auto clamp(16px, 4vh, 42px);
  padding: clamp(18px, 3vw, 28px);
  overflow: auto;
  overflow-x: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(14, 20, 38, 0.94), rgba(24, 29, 52, 0.92)),
    rgba(12, 16, 31, 0.94);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.video-drawer.is-open .video-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.video-panel:focus {
  outline: none;
}

.video-panel__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.video-panel__close:hover,
.video-panel__close:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.video-panel__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.video-panel__eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.video-panel h2 {
  max-width: calc(100% - 48px);
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.video-panel__description {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.video-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin-top: 22px;
}

.video-tabs button {
  max-width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(238, 243, 255, 0.78);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.video-tabs button:hover,
.video-tabs button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(106, 211, 255, 0.54);
  background: rgba(106, 211, 255, 0.12);
  color: #eff9ff;
  outline: none;
}

.video-tabs button[aria-selected="true"] {
  border-color: rgba(255, 211, 111, 0.62);
  background: rgba(255, 211, 111, 0.15);
  color: #fff3c8;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.video-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(9, 13, 29, 0.62);
}

.video-card__media {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(18, 59, 97, 0.9), rgba(37, 26, 54, 0.92)),
    #0b1122;
}

.video-card__media::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.28;
  content: "";
}

.video-card__media video {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card__placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(238, 243, 255, 0.32);
  border-radius: 50%;
  background: rgba(238, 243, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
}

.video-card__placeholder svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
  fill: #eef3ff;
}

.video-card__body {
  padding: 13px;
}

.video-card__body h3 {
  margin: 0;
  color: #f3f7ff;
  font-size: 0.98rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.video-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.video-card__meta span {
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(106, 211, 255, 0.11);
  color: #bceeff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.video-card__status {
  margin: 10px 0 0;
  color: rgba(238, 243, 255, 0.7);
  font-size: 0.84rem;
  line-height: 1.4;
}

body:not(.motion-on) *,
body:not(.motion-on) *::before,
body:not(.motion-on) *::after {
  animation-play-state: paused !important;
}

.twinkle {
  animation: twinkle 2.4s ease-in-out infinite;
}

.float {
  animation: float 4.8s ease-in-out infinite;
}

.moon-drift {
  animation: moon-drift 9s ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes moon-drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-8px, 5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage,
  .hero-copy,
  .service-row,
  .toolbar {
    transition-duration: 1ms;
    transition-delay: 0ms;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app {
    min-height: 100svh;
  }

  .toolbar {
    top: 12px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .stage {
    --stage-final-transform: none;
    --stage-start-transform: translateY(12px) scale(0.94);

    width: 100%;
    max-height: none;
    margin-top: 40px;
  }

  .hero {
    align-content: start;
    min-height: 100vh;
    padding: 72px 12px 28px;
  }

  .hero-copy {
    position: relative;
    top: auto;
    left: auto;
    order: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 18px;
    text-align: left;
  }

  .lead {
    max-width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(2.85rem, 16vw, 4.25rem);
  }

  .lead {
    margin-top: 16px;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .service-row {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    order: 3;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 100%;
    margin-top: 20px;
  }

  .video-panel {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 22px);
    margin-bottom: 10px;
    padding: 18px 14px;
  }

  .video-panel h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .video-panel__description {
    font-size: 0.95rem;
  }

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

@media (min-width: 721px) and (max-width: 980px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
