:root {
  color-scheme: dark;
  --bg: #030303;
  --ink: #f6f6ee;
  --muted: rgba(246, 246, 238, 0.66);
  --line: rgba(246, 246, 238, 0.16);
  --panel: rgba(7, 7, 7, 0.62);
  --lime: #c8ff2e;
  --cyan: #25d9ff;
  --red: #ff3d55;
  --pink: #ff63ab;
  --scroll-progress: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 74px 74px;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.scene-ready .film-fallback {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.experience {
  position: relative;
  min-height: 100svh;
  overflow-x: hidden;
}

#av-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  opacity: 0;
  transition: filter 180ms ease, opacity 420ms ease;
}

body.scene-ready #av-scene {
  opacity: 1;
}

body.dragging-scene #av-scene {
  filter: blur(1.1px) brightness(1.08) saturate(1.12);
}

body.launching-media #av-scene {
  filter: blur(2.6px) brightness(1.16) saturate(1.18);
}

body.launching-media .topbar,
body.launching-media .hero-panel,
body.launching-media .readout,
body.launching-media .service-dock {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

.film-fallback {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 58%, rgba(200, 255, 46, 0.11), transparent 28%),
    rgba(3, 3, 3, 0.88);
  transition: opacity 420ms ease, transform 420ms ease;
}

.scene-loader {
  position: relative;
  padding: 12px 14px;
  border: 1px solid rgba(246, 246, 238, 0.18);
  border-radius: 8px;
  background: rgba(8, 8, 8, 0.6);
  color: rgba(246, 246, 238, 0.86);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 0 42px rgba(200, 255, 46, 0.1);
  overflow: hidden;
}

.scene-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, rgba(200, 255, 46, 0.22), transparent);
  transform: translateX(-110%);
  animation: loader-scan 1.4s ease-in-out infinite;
}

.film-loop {
  position: relative;
  width: min(78vw, 1040px);
  height: min(78vw, 1040px);
  border: 34px solid rgba(246, 246, 238, 0.7);
  border-radius: 50%;
  animation: fallback-spin 14s linear infinite;
  box-shadow:
    0 0 80px rgba(200, 255, 46, 0.18),
    inset 0 0 80px rgba(37, 217, 255, 0.16);
}

.film-loop::before,
.film-loop::after {
  content: "";
  position: absolute;
  inset: 58px;
  border: 2px solid rgba(246, 246, 238, 0.24);
  border-radius: 50%;
}

.film-loop::after {
  inset: 132px;
  border-color: rgba(200, 255, 46, 0.42);
}

.film-loop span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 170px;
  height: 106px;
  margin: -53px 0 0 -85px;
  border: 1px solid rgba(246, 246, 238, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 61, 85, 0.85), rgba(37, 217, 255, 0.5)),
    #111;
  color: #f6f6ee;
  font-size: 1.3rem;
  font-weight: 950;
  transform: rotate(calc(var(--i) * 60deg)) translateY(-310px) rotate(calc(var(--i) * -60deg));
}

.film-loop span:nth-child(1) { --i: 0; }
.film-loop span:nth-child(2) { --i: 1; }
.film-loop span:nth-child(3) { --i: 2; }
.film-loop span:nth-child(4) { --i: 3; }
.film-loop span:nth-child(5) { --i: 4; }
.film-loop span:nth-child(6) { --i: 5; }

#av-scene:active {
  cursor: grabbing;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 56px);
  pointer-events: none;
}

.brand,
.mode-nav,
.hero-panel,
.readout,
.service-dock,
.contact-panel {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 950;
  text-transform: uppercase;
}

.brand img {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mode-button,
.button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  text-transform: uppercase;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.mode-button {
  padding: 10px 14px;
  font-size: 0.78rem;
}

.mode-button:hover,
.mode-button:focus-visible,
.mode-button.active,
.button.primary {
  border-color: var(--lime);
  background: var(--lime);
  color: #050505;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.055);
}

.hero-panel {
  position: relative;
  z-index: 3;
  width: min(520px, calc(100vw - 32px));
  padding: 120px clamp(16px, 4vw, 56px) 0;
  transition: opacity 220ms ease, transform 220ms ease;
  transform: translate3d(0, calc(var(--scroll-progress) * -28px), 0);
}

.eyebrow,
.contact-panel p,
.readout span {
  margin: 0 0 14px;
  color: var(--lime);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: 3.95rem;
  line-height: 0.94;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 590px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

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

.readout {
  position: fixed;
  right: clamp(16px, 4vw, 56px);
  top: 116px;
  z-index: 4;
  width: min(340px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  transition: opacity 220ms ease, transform 220ms ease;
  transform: translate3d(0, calc(var(--scroll-progress) * -32px), 0);
}

body.deep-scroll .hero-panel,
body.deep-scroll .readout {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-18px);
}

.readout strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.32rem;
  text-transform: uppercase;
}

.readout p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.service-dock {
  position: fixed;
  left: clamp(16px, 4vw, 56px);
  right: clamp(16px, 4vw, 56px);
  bottom: 22px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  transform: translate3d(0, calc(var(--scroll-progress) * 12px), 0);
}

.service-dock article {
  position: relative;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(0, 0, 0, 0.34) 44%, rgba(255, 255, 255, 0.035)),
    rgba(5, 5, 5, 0.54);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.service-dock article:hover {
  transform: translateY(-7px) rotateX(4deg) scaleX(1.018);
  border-color: var(--lime);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.18), rgba(200, 255, 46, 0.08) 36%, rgba(0, 0, 0, 0.42) 72%),
    rgba(5, 5, 5, 0.54);
  box-shadow: 0 0 28px rgba(200, 255, 46, 0.12);
}

.service-dock article.active {
  border-color: var(--lime);
  background: rgba(200, 255, 46, 0.18);
}

.service-dock span {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 900;
}

.service-dock strong {
  font-size: 1.1rem;
  text-transform: uppercase;
}

.electric-card::before,
.electric-card::after {
  content: "";
  position: absolute;
  inset: -18%;
  opacity: 0;
  pointer-events: none;
}

.electric-card::before {
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.34), rgba(37, 217, 255, 0.12) 18%, transparent 42%);
  filter: blur(10px);
  transform: scale(0.9);
}

.electric-card::after {
  background:
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(255, 255, 255, 0.08) 12px 14px),
    linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-18%) skewX(-10deg);
}

.electric-card:hover::before,
.electric-card.warp::before {
  opacity: 1;
  transform: scale(1.08);
  transition: opacity 180ms ease, transform 180ms ease;
}

.electric-card:hover::after,
.electric-card.warp::after {
  opacity: 1;
  animation: liquid-warp 760ms ease;
}

.contact-panel {
  position: relative;
  z-index: 3;
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 120vh clamp(16px, 4vw, 56px) 180px;
}

.contact-panel h2 {
  max-width: 980px;
  margin-bottom: 28px;
  font-size: 5.6rem;
  line-height: 0.94;
  text-transform: uppercase;
}

.equipment-section {
  position: relative;
  z-index: 4;
  min-height: 100svh;
  padding: 110px clamp(16px, 4vw, 56px) 160px;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.76) 18%, rgba(0, 0, 0, 0.9)),
    linear-gradient(115deg, rgba(255, 255, 255, 0.055), transparent 42%),
    rgba(2, 2, 2, 0.82);
  overflow: hidden;
}

.portrait-watermark {
  position: absolute;
  right: clamp(-20px, 2vw, 40px);
  top: 20px;
  width: min(46vw, 620px);
  opacity: 0.24;
  transform: rotate(-4deg);
  pointer-events: none;
}

.portrait-watermark img {
  width: 100%;
  height: auto;
  filter: grayscale(0.08) saturate(0.88) blur(0.2px);
  mask-image: radial-gradient(circle at 55% 42%, rgba(0, 0, 0, 0.92) 0 42%, transparent 78%);
}

.portrait-watermark::after {
  content: "";
  position: absolute;
  inset: auto 10% 6% 10%;
  height: 38%;
  background: radial-gradient(ellipse at center, rgba(255, 181, 64, 0.18), transparent 70%);
  filter: blur(24px);
}

.portrait-caption {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 8%;
  display: grid;
  gap: 8px;
  text-align: right;
}

.portrait-caption strong {
  color: rgba(246, 246, 238, 0.18);
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 1;
  text-transform: uppercase;
}

.portrait-caption span {
  color: rgba(246, 246, 238, 0.24);
  font-size: clamp(0.82rem, 1.3vw, 1.05rem);
  font-weight: 700;
}

.equipment-heading {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(180px, 0.36fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  margin-bottom: 46px;
}

.equipment-heading p {
  margin: 0;
  color: var(--lime);
  font-weight: 900;
  text-transform: uppercase;
}

.equipment-heading h2 {
  max-width: 1000px;
  margin: 0;
  font-size: 4.4rem;
  line-height: 0.96;
  text-transform: uppercase;
}

.folder-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.folder-card {
  position: relative;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid rgba(246, 246, 238, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.24), rgba(74, 80, 82, 0.2) 28%, rgba(5, 5, 5, 0.82) 60%, rgba(255, 255, 255, 0.09)),
    #090a0a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -26px 60px rgba(0, 0, 0, 0.55),
    0 22px 70px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.folder-card::marker {
  content: "";
}

.folder-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.folder-card strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1.04;
  text-transform: uppercase;
}

.folder-card p {
  margin: 0;
  color: var(--muted);
}

.folder-card:hover {
  border-color: rgba(200, 255, 46, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 45px rgba(37, 217, 255, 0.12),
    0 30px 90px rgba(0, 0, 0, 0.52);
}

.folder-card > * {
  position: relative;
  z-index: 1;
}

.scroll-reveal {
  opacity: 0;
  transform: translate3d(0, 44px, 0) scale(0.97);
  filter: blur(16px);
  transition:
    opacity 760ms cubic-bezier(0.2, 0.8, 0.16, 1),
    transform 900ms cubic-bezier(0.2, 0.8, 0.16, 1),
    filter 900ms cubic-bezier(0.2, 0.8, 0.16, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity, filter;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

.hero-panel .scroll-reveal.revealed,
.contact-panel .scroll-reveal.revealed,
.equipment-heading .scroll-reveal.revealed {
  transform: translate3d(0, calc(var(--scroll-progress) * -8px), 0);
}

.service-dock .scroll-reveal.revealed {
  transform: translate3d(0, calc(var(--scroll-progress) * 10px), 0);
}

@media (max-width: 980px) {
  .film-loop {
    width: 760px;
    height: 760px;
    transform: translateX(18%);
  }

  .film-loop span {
    transform: rotate(calc(var(--i) * 60deg)) translateY(-230px) rotate(calc(var(--i) * -60deg));
  }

  h1 {
    font-size: 3.35rem;
  }

  .readout {
    top: auto;
    right: 16px;
    bottom: 138px;
  }

  .service-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .equipment-heading,
  .folder-grid {
    grid-template-columns: 1fr;
  }

  .equipment-heading h2 {
    font-size: 3.35rem;
  }

  .contact-panel h2 {
    font-size: 3.6rem;
  }
}

@media (max-width: 720px) {
  body {
    background-size: 48px 48px;
  }

  .topbar {
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .mode-nav {
    flex: 1;
    justify-content: flex-end;
    gap: 6px;
  }

  .brand {
    gap: 8px;
    font-size: 0.72rem;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .mode-button {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 0.66rem;
  }

  .hero-panel {
    width: min(360px, calc(100vw - 24px));
    padding: 112px 14px 0;
  }

  h1 {
    margin-bottom: 14px;
    font-size: 2.18rem;
    line-height: 0.93;
  }

  .eyebrow {
    margin-bottom: 10px;
    font-size: 0.68rem;
  }

  .hero-copy {
    max-width: 290px;
    font-size: 0.92rem;
    line-height: 1.42;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .hero-actions {
    gap: 8px;
    margin-top: 18px;
  }

  .hero-actions .button.ghost {
    display: none;
  }

  .button {
    min-height: 42px;
    padding: 11px 12px;
    font-size: 0.78rem;
  }

  .readout {
    display: none;
  }

  .service-dock {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 56svh 12px 0;
  }

  .service-dock article {
    min-height: 74px;
    padding: 12px;
  }

  .service-dock span {
    margin-bottom: 12px;
    font-size: 0.74rem;
  }

  .service-dock strong {
    font-size: 0.88rem;
  }

  .contact-panel {
    min-height: 86svh;
    padding: 110px 14px 120px;
  }

  .contact-panel h2 {
    font-size: 2.32rem;
  }

  .equipment-section {
    min-height: auto;
    padding: 84px 14px 110px;
  }

  .equipment-heading {
    gap: 18px;
    margin-bottom: 26px;
  }

  .equipment-heading h2 {
    font-size: 2.16rem;
  }

  .folder-card {
    min-height: 190px;
    padding: 18px;
  }

  .folder-card strong {
    font-size: 1.45rem;
  }

  .portrait-watermark {
    width: 330px;
    right: -64px;
    top: 62px;
  }
}

@keyframes liquid-warp {
  0% {
    transform: translateX(-24%) skewX(-16deg) scaleY(1.08);
  }
  50% {
    transform: translateX(12%) skewX(12deg) scaleY(0.94);
  }
  100% {
    transform: translateX(30%) skewX(-8deg) scaleY(1.03);
  }
}

@keyframes shock {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  28% {
    transform: translate3d(-3px, 2px, 0) rotate(-0.4deg);
  }
  56% {
    transform: translate3d(4px, -1px, 0) rotate(0.35deg);
  }
  78% {
    transform: translate3d(-2px, 1px, 0);
  }
}

@keyframes fallback-spin {
  from {
    rotate: 0deg;
  }
  to {
    rotate: 360deg;
  }
}

@keyframes loader-scan {
  0% {
    transform: translateX(-110%);
  }
  55%,
  100% {
    transform: translateX(110%);
  }
}
