/* Proto XR — site styles. Plain CSS, no build step. */

:root {
  --bg: #06080b;
  --bg-raised: #0b0f15;
  --bg-panel: rgba(14, 20, 28, 0.72);
  --line: rgba(150, 210, 255, 0.07);
  --line-strong: rgba(150, 210, 255, 0.16);
  --text: #e6edf3;
  --text-muted: #8b98a6;
  --text-faint: #5b6774;
  --accent: #5ce1ff;
  --accent-soft: rgba(92, 225, 255, 0.14);
  --signal: #8bff9c;

  --font-sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Blueprint grid behind everything, fading out from the top. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 80%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 80%);
}

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

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

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 13px;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

.nav.is-scrolled {
  background: rgba(6, 8, 11, 0.72);
  border-bottom-color: var(--line-strong);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.24em;
  white-space: nowrap;
}

.logo-slash {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.25s, transform 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #031015;
}

.btn-primary:hover {
  box-shadow: 0 0 0 4px var(--accent-soft), 0 8px 32px rgba(92, 225, 255, 0.28);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-lg {
  min-height: 54px;
  padding: 0 28px;
  font-size: 14px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 120px 0 40px;
  overflow: hidden;
  isolation: isolate;
}

/* Receding perspective floor grid. */
.hero-floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 70%;
  z-index: -2;
  background-image:
    linear-gradient(rgba(92, 225, 255, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 225, 255, 0.28) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: perspective(520px) rotateX(72deg);
  transform-origin: 50% 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 45%);
  animation: floor-scroll 6s linear infinite;
  opacity: 0.5;
}

@keyframes floor-scroll {
  to { background-position: 0 72px, 0 0; }
}

/* Soft horizon glow where the floor meets the sky. */
.hero-horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 30%;
  height: 50%;
  z-index: -1;
  background: radial-gradient(ellipse 60% 40% at 50% 50%, rgba(92, 225, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(6, 8, 11, 0.6);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(92, 225, 255, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(92, 225, 255, 0.55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(92, 225, 255, 0); }
}

.hero-title {
  margin: 0;
  font-size: clamp(42px, 8.4vw, 112px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--text) 10%, var(--accent) 90%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.hero-lede {
  max-width: 540px;
  margin: 32px 0 0;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-muted);
}

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

.hero-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}

.hud-scroll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.hud-scroll i {
  width: 1px;
  height: 28px;
  background: linear-gradient(var(--accent), transparent);
  animation: scroll-hint 2s var(--ease) infinite;
  transform-origin: top;
}

@keyframes scroll-hint {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(72px, 11vw, 140px) 0 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.section-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
  align-self: center;
}

.section-intro {
  max-width: 560px;
  margin: -12px 0 40px;
  color: var(--text-muted);
}

/* HUD frame with corner brackets, used on media and panels. */
.frame {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

.corner {
  position: absolute;
  z-index: 3;
  width: 14px;
  height: 14px;
  border: 0 solid var(--accent);
  pointer-events: none;
  transition: transform 0.35s var(--ease);
}

.corner.tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

/* Media frames clip their overflow, so their brackets sit just inside the edge. */
.feature-media .corner,
.card-media .corner {
  margin: 10px;
  width: 18px;
  height: 18px;
  border-color: rgba(92, 225, 255, 0.9);
}

.feature-media .corner.tl,
.card-media .corner.tl { margin: 10px 0 0 10px; }
.feature-media .corner.tr { margin: 10px 10px 0 0; }
.feature-media .corner.bl { margin: 0 0 10px 10px; }
.feature-media .corner.br,
.card-media .corner.br { margin: 0 10px 10px 0; }

/* ---------- Feature ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.feature-media {
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.feature-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scanline + vignette over the feature video. */
.feature-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45));
}

.media-hud {
  position: absolute;
  top: 18px;
  left: 36px;
  right: 36px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(230, 237, 243, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.rec {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rec i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5c6c;
  animation: blink 1.6s steps(2, start) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

.sound-toggle {
  position: absolute;
  right: 36px;
  bottom: 18px;
  z-index: 2;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(6, 8, 11, 0.6);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.sound-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sound-toggle .sound-on,
.sound-toggle[aria-pressed='true'] .sound-off {
  display: none;
}

.sound-toggle[aria-pressed='true'] .sound-on {
  display: inline;
}

.tagline {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.feature-title {
  margin: 0;
  font-size: clamp(40px, 5.5vw, 68px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}

.feature-desc {
  margin: 20px 0 0;
  font-size: 18px;
  color: var(--text-muted);
}

.spec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 32px 0 0;
  border-top: 1px solid var(--line-strong);
}

.spec div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-strong);
}

.spec div:nth-child(odd) {
  padding-right: 16px;
}

.spec dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.spec dd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 15px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
}

.feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* ---------- Archive grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 32px);
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
  transition: border-color 0.3s, transform 0.4s var(--ease);
}

.card:hover {
  border-color: var(--line-strong);
}

.card-media {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
}

.card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.75) brightness(0.85);
  transform: scale(1.01);
  transition: filter 0.4s, transform 0.6s var(--ease);
}

.card:hover .card-video,
.card.is-playing .card-video {
  filter: none;
  transform: scale(1.04);
}

.card:hover .corner.tl { transform: translate(6px, 6px); }
.card:hover .corner.br { transform: translate(-6px, -6px); }

.play-chip {
  position: absolute;
  left: 36px;
  bottom: 18px;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(6, 8, 11, 0.7);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  transition: opacity 0.3s;
}

.card.is-playing .play-chip {
  opacity: 0;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.card-meta span:first-child {
  color: var(--accent);
}

.card-title {
  margin: 14px 0 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: auto 0 0;
  padding: 22px 0 0;
  list-style: none;
}

.card-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.card-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Contact ---------- */

.contact-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(32px, 5vw, 56px);
  background:
    radial-gradient(ellipse 70% 120% at 100% 50%, var(--accent-soft), transparent 60%),
    var(--bg-panel);
}

.contact-title {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.contact-copy p {
  max-width: 480px;
  margin: 14px 0 0;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */

.footer {
  margin-top: clamp(80px, 10vw, 140px);
  border-top: 1px solid var(--line-strong);
  background: rgba(6, 8, 11, 0.8);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 48px;
}

.copyright {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ---------- Sub-pages (imu-test, 404) ---------- */

.page {
  padding-block: 140px 96px;
}

.page-center {
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 96px;
}

.page-title {
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.page-lede {
  margin: 20px 0 0;
  font-size: 18px;
  color: var(--text-muted);
}

.prose {
  max-width: 65ch;
  margin-top: 28px;
  color: var(--text-muted);
}

.prose p {
  margin: 0 0 16px;
}

.page-media {
  display: grid;
  gap: 24px;
  max-width: 820px;
  margin-top: 48px;
}

.page-media .frame {
  overflow: hidden;
}

.page-media video,
.page-media img {
  width: 100%;
  height: auto;
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .feature {
    grid-template-columns: 1fr;
  }

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

  .contact-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav-links li:nth-child(2) {
    display: none;
  }

  .logo {
    font-size: 13px;
    letter-spacing: 0.2em;
  }

  .hero-actions .btn,
  .feature-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .hero-hud span:first-child,
  .hero-hud span:last-child {
    display: none;
  }

  .hero-hud {
    justify-content: center;
  }

  .contact-panel .btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .media-hud span:last-child {
    display: none;
  }
}

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

  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
