/* ============================================================
   OpenDev — Landing page styles
   ============================================================ */

:root {
  --bg: #02060f;
  --bg-deep: #01030a;
  --ink: #e9f3ff;
  --ink-dim: #8aa3c4;
  --ink-faint: #4a5c7a;
  --accent: #4ec3ff;
  --accent-soft: #1a6ea8;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.06);
  --panel: rgba(8, 14, 26, 0.55);
  --font-display: "Chakra Petch", "Rajdhani", system-ui, sans-serif;
  --font-body: "Rajdhani", "Chakra Petch", system-ui, sans-serif;
  --font-mono: "Share Tech Mono", "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Visually hidden but available to screen readers & search engines */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

/* Use dynamic viewport units where supported for true mobile viewport size */
@supports (height: 100dvh) {
  .scroll-spacer { height: 100dvh; }
  .section { min-height: 100dvh; }
}

/* Once the landing is revealed, allow scrolling for the About section.
   The root element (<html>) is the scroller the scroll-flight JS tracks via
   window.scrollY, so the lock must be lifted on <html> — not just <body> —
   otherwise touch/wheel scrolling stays blocked on mobile while only
   programmatic scrolls (nav buttons) work. */
html.is-explorable {
  overflow-y: auto;
  overflow-x: hidden;
}
body.is-explorable {
  overflow: visible;
}

/* Subtle scrollbar that matches the theme */
html.is-explorable::-webkit-scrollbar { width: 6px; }
html.is-explorable::-webkit-scrollbar-track { background: transparent; }
html.is-explorable::-webkit-scrollbar-thumb {
  background: rgba(78, 195, 255, 0.25);
  border-radius: 3px;
}
html.is-explorable::-webkit-scrollbar-thumb:hover {
  background: rgba(78, 195, 255, 0.45);
}

/* Custom cursor — hide native on hover-capable devices */
@media (hover: hover) and (pointer: fine) {
  html, body, * { cursor: none !important; }
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

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

/* ============================================================
   Viewport frame — thin HUD outline w/ corner ticks
   ============================================================ */

.viewport-frame {
  position: fixed;
  inset: 14px;
  z-index: 60;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 0 24px rgba(78, 195, 255, 0.06);
  opacity: 0;
  transition: opacity 0.55s ease;
}

/* Frame is only shown inside the About section */
body.in-about .viewport-frame { opacity: 1; }

/* Corner ticks — small "L" brackets in the accent color */
.vf-tick {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.vf-tick::before,
.vf-tick::after {
  content: "";
  position: absolute;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(78, 195, 255, 0.5);
}
.vf-tick::before { width: 100%; height: 1px; }
.vf-tick::after  { width: 1px; height: 100%; }

.vf-tl { top: -1px;    left: -1px;   }
.vf-tl::before { top: 0;    left: 0; }
.vf-tl::after  { top: 0;    left: 0; }

.vf-tr { top: -1px;    right: -1px;  }
.vf-tr::before { top: 0;    right: 0; }
.vf-tr::after  { top: 0;    right: 0; }

.vf-bl { bottom: -1px; left: -1px;   }
.vf-bl::before { bottom: 0; left: 0; }
.vf-bl::after  { bottom: 0; left: 0; }

.vf-br { bottom: -1px; right: -1px;  }
.vf-br::before { bottom: 0; right: 0; }
.vf-br::after  { bottom: 0; right: 0; }

/* HUD readouts in the frame corners */
.vf-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--ink-dim);
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}
.vf-label-tl { top: -6px;    left: 22px;  background: var(--bg-deep); padding: 0 8px; }
.vf-label-tr { top: -6px;    right: 22px; background: var(--bg-deep); padding: 0 8px; }
.vf-label-bl { bottom: -6px; left: 22px;  background: var(--bg-deep); padding: 0 8px; }
.vf-label-br { bottom: -6px; right: 22px; background: var(--bg-deep); padding: 0 8px; }
.vf-label-tr { color: var(--accent); }

/* Clickable email anchor on the frame */
.vf-mail {
  pointer-events: auto;
  text-decoration: none;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease, text-shadow 0.2s ease, gap 0.2s ease;
}
.vf-mail-arrow {
  color: var(--ink-dim);
  transition: transform 0.25s ease, color 0.2s ease;
}
.vf-mail:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(78, 195, 255, 0.7);
  gap: 12px;
}
.vf-mail:hover .vf-mail-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* Responsive overrides for the frame are in the main responsive section below */

/* ============================================================
   Page-chrome reactions when the user is reading About
   ============================================================ */

body.in-about .topbar,
body.in-about .bottombar,
body.in-about .scroll-hint {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.5s ease;
}

/* ============================================================
   Page transition overlay — fires when navigating Home <-> About
   ============================================================ */

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background: radial-gradient(
    ellipse at center,
    rgba(78, 195, 255, 0.06) 0%,
    rgba(1, 3, 10, 0.6) 60%,
    rgba(1, 3, 10, 0.85) 100%
  );
}

body.is-navigating .page-transition {
  visibility: visible;
  animation: pt-fade 1.1s ease both;
}

@keyframes pt-fade {
  0%, 75% { opacity: 1; }
  100%    { opacity: 0; }
}

/* Three scan bars sweep top-to-bottom at slightly different speeds */
.pt-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent), 0 0 36px rgba(78, 195, 255, 0.45);
  transform: translateY(-4px);
  opacity: 0;
}

body.is-navigating .pt-bar-1 {
  animation: pt-sweep 0.95s cubic-bezier(0.55, 0.08, 0.45, 0.97) both;
}
body.is-navigating .pt-bar-2 {
  animation: pt-sweep 1.05s cubic-bezier(0.55, 0.08, 0.45, 0.97) 0.08s both;
  opacity: 0.5;
}
body.is-navigating .pt-bar-3 {
  height: 1px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
  animation: pt-sweep 1.15s cubic-bezier(0.55, 0.08, 0.45, 0.97) 0.18s both;
}

@keyframes pt-sweep {
  0%   { top: -4px;   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100vh;  opacity: 0; }
}

/* Reverse direction when navigating back to home — sweep bottom-up */
body.is-navigating.nav-up .pt-bar-1,
body.is-navigating.nav-up .pt-bar-2,
body.is-navigating.nav-up .pt-bar-3 {
  animation-name: pt-sweep-up;
}

@keyframes pt-sweep-up {
  0%   { top: 100vh; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: -4px;  opacity: 0; }
}

/* Faint grid wash to give it a "loading dataset" feel */
.pt-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent 39px,
      rgba(78, 195, 255, 0.08) 39px,
      rgba(78, 195, 255, 0.08) 40px
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 39px,
      rgba(78, 195, 255, 0.05) 39px,
      rgba(78, 195, 255, 0.05) 40px
    );
  opacity: 0;
}
body.is-navigating .pt-grid {
  animation: pt-grid 0.95s ease both;
}
@keyframes pt-grid {
  0%   { opacity: 0; }
  35%  { opacity: 1; }
  100% { opacity: 0; }
}

/* HUD readout — fixed line of mono text, centered */
.pt-readout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(78, 195, 255, 0.6);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
}
.pt-readout-prefix { color: var(--ink); }
.pt-readout-cursor {
  display: inline-block;
  margin-left: 2px;
  animation: pt-blink 0.5s steps(2) infinite;
}
@keyframes pt-blink {
  50% { opacity: 0; }
}
body.is-navigating .pt-readout {
  animation: pt-readout 0.95s ease both;
}
@keyframes pt-readout {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
  25%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Stage briefly blurs during the transition for the "warp" feel */
body.is-navigating .stage-video {
  transition: filter 0.4s ease;
  filter: blur(8px) brightness(0.55);
}

@media (prefers-reduced-motion: reduce) {
  body.is-navigating .pt-bar,
  body.is-navigating .pt-readout,
  body.is-navigating .pt-grid,
  body.is-navigating .stage-video {
    animation: none !important;
    transition: none !important;
    filter: none !important;
  }
}

/* ============================================================
   Intro gate
   ============================================================ */

.intro-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      ellipse at center,
      rgba(78, 195, 255, 0.08) 0%,
      transparent 60%
    ),
    var(--bg-deep);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.intro-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

/* ---------- Loading sequence (intro gate) ---------- */

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 460px;
}

.loader-percent {
  align-self: flex-end;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--ink);
}

.loader-bar {
  display: flex;
  gap: 14px;
  width: 100%;
  justify-content: space-between;
}

.loader-pip {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.loader-pip.is-on {
  background: var(--ink);
  box-shadow: 0 0 10px rgba(78, 195, 255, 0.5);
}

.loader-label {
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.enter-btn {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.enter-btn.is-ready {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 560px) {
  .loader { min-width: 0; width: calc(100vw - 48px); }
  .loader-bar { gap: 8px; }
}

/* ---------- Custom cursor ---------- */

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cursor-dot.is-active,
.cursor-ring.is-active {
  opacity: 1;
}

/* Hide the custom cursor while the intro video plays */
body.is-playing-intro .cursor-dot,
body.is-playing-intro .cursor-ring {
  opacity: 0 !important;
}

body.is-playing-intro,
body.is-playing-intro * {
  cursor: none !important;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(78, 195, 255, 0.8);
}

.cursor-ring {
  --size: 32px;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  border: 1px solid rgba(78, 195, 255, 0.55);
  background: transparent;
  clip-path: polygon(
    8px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 8px
  );
  transition:
    width 0.22s ease,
    height 0.22s ease,
    margin 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease;
}

.cursor-ring.is-hover {
  --size: 52px;
  background: rgba(78, 195, 255, 0.08);
  border-color: var(--accent);
}

.cursor-ring.is-press {
  --size: 24px;
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ============================================================
   Stage (video + landing share this)
   ============================================================ */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg-deep);
  z-index: 1;
}

.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-deep);
  /* Scroll-driven "fly into the landscape" transform */
  --zoom: 1;
  --rise: 0;
  transform: scale(var(--zoom)) translateY(var(--rise));
  transform-origin: 50% 58%;
  transition: filter 0.25s ease;
  will-change: transform, filter;
}

/* Soft cinematic fade over the mountains as we travel inward */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at 50% 62%,
      rgba(78, 195, 255, 0.08) 0%,
      rgba(1, 3, 10, 0) 35%
    ),
    linear-gradient(
      to bottom,
      rgba(1, 3, 10, 0) 0%,
      rgba(1, 3, 10, calc(var(--veil, 0) * 0.85)) 100%
    );
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* ============================================================
   Landing — revealed after video
   ============================================================ */

.landing {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-rows: auto 1fr auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1s ease 0.1s, visibility 1s ease 0.1s;
}

.landing.is-revealed {
  pointer-events: auto;
}

.landing.is-revealed {
  opacity: 1;
  visibility: visible;
}

/* Gentle vignette so text stays readable over the mountain frame */
.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at 50% 60%,
      transparent 0%,
      rgba(1, 3, 10, 0.55) 70%,
      rgba(1, 3, 10, 0.85) 100%
    );
  z-index: -1;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  padding-top: max(22px, env(safe-area-inset-top));
  padding-left: max(32px, env(safe-area-inset-left));
  padding-right: max(32px, env(safe-area-inset-right));
  position: relative;
  z-index: 4;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  height: 26px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(78, 195, 255, 0.3));
  transition: filter 0.25s ease, transform 0.25s ease;
}

.brand:hover img {
  filter: drop-shadow(0 0 16px rgba(78, 195, 255, 0.5));
  transform: translateY(-1px);
}

@media (max-width: 560px) {
  .brand img { height: 22px; }
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
  text-transform: uppercase;
  transition: color 0.2s ease;
  padding: 12px 8px;
  min-height: 44px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
}

.nav-dot {
  width: 6px;
  height: 6px;
  background: var(--ink-faint);
  display: inline-block;
  transform: rotate(45deg);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.nav-link.active .nav-dot,
.nav-link:hover .nav-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.nav-cta {
  margin-left: 6px;
}

/* ---------- Side index ---------- */

.side-index {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 6;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--ink-faint);
  text-transform: uppercase;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 4px 0;
  text-align: left;
  transition: color 0.2s ease;
}

.side-item:hover {
  color: var(--ink);
}

.side-item:hover .side-marker {
  border-color: var(--accent);
  background: var(--accent);
}

.side-item.active {
  color: var(--ink);
}

.side-marker {
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink-faint);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.side-item.active .side-marker {
  background: var(--ink);
  border-color: var(--ink);
}

/* ---------- Bottom bar ---------- */

.bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  padding-bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  padding-left: max(32px, env(safe-area-inset-left));
  padding-right: max(32px, env(safe-area-inset-right));
  border-top: 1px solid var(--line-soft);
  position: relative;
  z-index: 4;
  background: linear-gradient(
    to top,
    rgba(1, 3, 10, 0.6) 0%,
    transparent 100%
  );
  pointer-events: none;
  gap: 12px;
  flex-wrap: wrap;
}

.bottombar > * {
  pointer-events: auto;
}

.chat-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
}

.meta-tag,
.chat-btn,
.scroll-hint {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--ink-dim);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 7;
  pointer-events: none;
}

.bottombar {
  padding-bottom: 44px;
}

.meta-tag {
  color: var(--ink-faint);
}

.chat-btn {
  cursor: pointer;
  transition: color 0.2s ease;
}

.chat-btn:hover {
  color: var(--ink);
}

.scroll-chev {
  color: var(--accent);
  animation: bounce 1.8s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(3px); opacity: 1; }
}

.chat-dot {
  color: var(--accent);
  font-size: 8px;
}

/* ============================================================
   Notched (clip-path) buttons — Hubtown-style
   ============================================================ */

.btn-clip {
  --notch: 12px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 14px 22px;
  cursor: pointer;
  border: 0;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
  clip-path: polygon(
    var(--notch) 0,
    100% 0,
    100% calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%,
    0 100%,
    0 var(--notch)
  );
}

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

.btn-primary {
  background: #f5fbff;
  color: #02060f;
}

.btn-primary:hover {
  background: #ffffff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-outline:hover {
  background: rgba(78, 195, 255, 0.08);
  color: #ffffff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  padding: 10px 16px;
  font-size: 11px;
  letter-spacing: 0.3em;
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-icon {
  color: var(--accent);
  font-size: 11px;
}

.btn-primary .btn-icon {
  color: var(--accent-soft);
}

/* Responsive bar/nav adjustments are consolidated at the bottom of this file. */

/* ============================================================
   Scroll-host — sections that flow above the fixed stage
   ============================================================ */

.scroll-host {
  position: relative;
  z-index: 6;
  display: block;
  /* Host itself never captures pointer events — only real sections do.
     Otherwise the 100vh spacer floats above the topbar and eats clicks. */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.is-explorable .scroll-host {
  opacity: 1;
}

/* First viewport-height block keeps the hero stage visible at top */
.scroll-spacer {
  height: 100vh;
  pointer-events: none;
}

/* Real sections receive clicks; spacer does not */
.scroll-host .section {
  pointer-events: auto;
}

/* The bottombar/scroll-hint should fade as the user scrolls inward */
.landing.is-traveling .bottombar,
.landing.is-traveling .scroll-hint {
  opacity: var(--ui-opacity, 1);
  transition: opacity 0.3s ease;
}

/* Generic section shell — sits over the stage backdrop */
.section {
  position: relative;
  min-height: 100vh;
  padding: 140px 56px 160px;
  display: flex;
  align-items: center;
  isolation: isolate;
}

/* Glassy backdrop + faint HUD dot-grid so the section feels like a panel */
.section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 1px 1px,
      rgba(78, 195, 255, 0.07) 1px,
      transparent 1.5px
    ),
    radial-gradient(
      ellipse at 50% 30%,
      rgba(78, 195, 255, 0.07) 0%,
      transparent 55%
    ),
    linear-gradient(
      to bottom,
      rgba(1, 3, 10, 0.72) 0%,
      rgba(1, 3, 10, 0.92) 45%,
      rgba(1, 3, 10, 0.97) 100%
    );
  background-size: 28px 28px, 100% 100%, 100% 100%;
  background-position: 0 0, 0 0, 0 0;
  z-index: -1;
}

/* Thin top edge — matches the bottombar divider language */
.section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 56px;
  right: 56px;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--line) 20%,
    var(--line) 80%,
    transparent
  );
}

.section-grid {
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 80px;
  align-items: start;
}

.section-meta {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 140px;
  padding-left: 18px;
  border-left: 1px solid var(--line-soft);
}

.section-index {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--ink-faint);
  text-transform: uppercase;
  position: relative;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.35em;
  color: var(--ink);
  text-transform: uppercase;
}

.kicker-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--accent);
}

/* Contact block in the meta sidebar */
.meta-contact {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-contact-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.meta-email {
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 0 12px rgba(78, 195, 255, 0.18);
  position: relative;
  display: inline-block;
  width: max-content;
  padding-bottom: 2px;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.meta-email::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 0.85, 0.25, 1);
}

.meta-email:hover {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(78, 195, 255, 0.55);
}

.meta-email:hover::after {
  transform: scaleX(1);
}


.section-body {
  max-width: 720px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.04;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: clamp(24px, 3vw, 40px);
  max-width: 12ch;
}

.title-accent {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(78, 195, 255, 0.35);
}

.section-lead {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-bottom: 22px;
  max-width: 640px;
}

.section-copy {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.015em;
  color: var(--ink-dim);
  max-width: 620px;
  margin-bottom: 56px;
}

/* Pillars row — three core values */
.pillars {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.pillar {
  --notch: 12px;
  position: relative;
  padding: 26px 24px 28px;
  background: rgba(8, 14, 26, 0.58);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(
    var(--notch) 0,
    100% 0,
    100% calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%,
    0 100%,
    0 var(--notch)
  );
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 168px;
}

.pillar::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 20px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  opacity: 0.7;
  animation: pillar-pulse 2.4s ease-in-out infinite;
}

@keyframes pillar-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.25); }
}

.pillar:hover {
  background: rgba(78, 195, 255, 0.10);
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgba(78, 195, 255, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.4);
}

.pillar:hover .pillar-name {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(78, 195, 255, 0.4);
}

.pillar-num {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--accent);
}

.pillar-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.pillar-line {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--ink-dim);
}

/* ============================================================
   "Going-inside" reveal — character-level fax/HUD print
   ============================================================ */

/* Pillar cards fade-up as containers; their text reveals per-char inside */
.pillar {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease, background 0.25s ease;
}
.section.is-in-view .pillar { opacity: 1; transform: translateY(0); }
.section.is-in-view .pillar:nth-child(1) { transition-delay: 0.55s; }
.section.is-in-view .pillar:nth-child(2) { transition-delay: 0.70s; }
.section.is-in-view .pillar:nth-child(3) { transition-delay: 0.85s; }

/* Words stay intact — they're the unit that line-wraps */
.word {
  display: inline-block;
  white-space: nowrap;
}

/* Each character starts hidden + blurred + accent-tinted (HUD print) */
.ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.16em);
  filter: blur(5px);
  color: inherit;
  will-change: opacity, transform, filter;
}

/* When the section comes into view, characters print one-by-one */
.section.is-in-view .ch {
  animation: char-in 0.42s cubic-bezier(0.22, 0.85, 0.25, 1) both;
  animation-delay: min(calc(var(--i, 0) * 14ms), 1400ms);
}

@keyframes char-in {
  0% {
    opacity: 0;
    transform: translateY(0.16em);
    filter: blur(5px) brightness(2);
    color: var(--accent);
    text-shadow: 0 0 8px rgba(78, 195, 255, 0.7);
  }
  55% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0) brightness(1.6);
    color: var(--accent);
    text-shadow: 0 0 6px rgba(78, 195, 255, 0.5);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0) brightness(1);
    color: inherit;
    text-shadow: none;
  }
}

/* Tiny scan-line tick that sweeps across the title — gaming loader vibe */
.section-title {
  position: relative;
  overflow: visible;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--accent),
    transparent
  );
  opacity: 0;
  pointer-events: none;
}
.section.is-in-view .section-title::after {
  animation: scan-line 1.1s ease 0.2s both;
}
@keyframes scan-line {
  0%   { width: 0;   opacity: 0; }
  30%  { opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* About-section responsive rules are consolidated at the bottom of this file. */

@media (prefers-reduced-motion: reduce) {
  .stage-video { transform: none !important; }
  .section-body > *, .section-meta {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================
   Comprehensive responsive layer
   Breakpoints:
     ≤ 1100px  — small desktop (tighten section grid)
     ≤ 900px   — tablet portrait (stack meta + body, keep 3 pillars)
     ≤ 640px   — large phone (1 pillar col, condensed nav)
     ≤ 420px   — small phone (extra-tight, drop optional HUD bits)
     hover:none / pointer:coarse — disable sticky-hover
     landscape short — reduce vertical padding
   ============================================================ */

/* Small desktop — slightly tighter grid */
@media (max-width: 1100px) {
  .section { padding: 120px 44px 140px; }
  .section::after { left: 44px; right: 44px; }
  .section-grid { grid-template-columns: 220px 1fr; gap: 56px; }
}

/* Tablet portrait — stack meta on top of body; keep pillars in 3 cols */
@media (max-width: 900px) {
  .topbar { padding: 18px 22px; padding-top: max(18px, env(safe-area-inset-top)); }
  .bottombar { padding: 16px 22px; padding-bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px)); }
  .top-nav { gap: 18px; }
  .nav-link { font-size: 11px; letter-spacing: 0.22em; padding: 10px 6px; }
  .nav-cta { padding: 10px 14px; }

  .section { padding: 110px 32px 120px; }
  .section::after { left: 32px; right: 32px; }
  .section-grid { grid-template-columns: 1fr; gap: 32px; }

  .section-meta {
    position: static;
    flex-direction: column;
    gap: 18px;
    padding-left: 16px;
    border-left: 1px solid var(--line);
  }
  .meta-contact { margin-top: 14px; padding-top: 16px; }

  /* Pillars stay 3-col on tablet — plenty of room */
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .pillar { padding: 22px 20px 24px; min-height: 156px; }
  .pillar-name { font-size: 17px; }
}

/* Large phone — single-column pillars, condensed nav */
@media (max-width: 640px) {
  .topbar { padding: 14px 18px; padding-top: max(14px, env(safe-area-inset-top)); gap: 8px; }
  .brand img { height: 22px; }
  .top-nav { gap: 10px; }
  .nav-link { font-size: 10.5px; letter-spacing: 0.18em; padding: 10px 4px; gap: 6px; }
  .nav-link .nav-dot { width: 5px; height: 5px; }
  .nav-cta { padding: 9px 12px; font-size: 10px; letter-spacing: 0.18em; gap: 6px; }
  .nav-cta .btn-icon { font-size: 11px; }

  .bottombar { padding: 14px 18px; padding-bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); }
  .meta-tag, .chat-btn { font-size: 10px; letter-spacing: 0.25em; }

  .section { padding: 96px 22px 110px; }
  .section::after { left: 22px; right: 22px; }

  .section-meta { padding-left: 14px; gap: 14px; }
  .section-index { font-size: 10px; padding-bottom: 10px; letter-spacing: 0.36em; }
  .section-kicker { font-size: 11px; letter-spacing: 0.3em; }
  .meta-contact-label { font-size: 9px; letter-spacing: 0.35em; }
  .meta-email { font-size: clamp(14px, 4.2vw, 17px); }

  .section-lead { font-size: 16px; line-height: 1.45; }
  .section-copy { font-size: 14px; line-height: 1.55; margin-bottom: 40px; }

  .pillars { grid-template-columns: 1fr; gap: 12px; }
  .pillar { padding: 20px 18px 22px; min-height: 0; }
  .pillar-name { font-size: 16px; }
  .pillar-line { font-size: 13px; }
  .pillar::after { top: 14px; right: 14px; }

  /* Frame: tighter inset and labels */
  .viewport-frame { inset: 10px; }
  .vf-label { font-size: 9px; letter-spacing: 0.2em; }
  .vf-label-tl, .vf-label-bl { left: 14px; }
  .vf-label-tr, .vf-label-br { right: 14px; }
  .vf-label-bl { display: none; }     /* drop EST tag — keep email visible */
  .vf-mail { gap: 6px; }

  /* Page transition readout — fit narrow viewport */
  .pt-readout { font-size: 11px; letter-spacing: 0.18em; max-width: calc(100vw - 40px); white-space: normal; text-align: center; }

  /* Intro loader pip count is fine; just shrink gaps */
  .loader { min-width: 0; width: calc(100vw - 40px); }
  .loader-bar { gap: 6px; }
  .loader-pip { height: 6px; }
  .enter-btn { padding: 16px 24px; font-size: 11px; }
}

/* Small phone — extra-tight */
@media (max-width: 420px) {
  .top-nav { gap: 6px; }
  .nav-link { font-size: 10px; letter-spacing: 0.14em; padding: 10px 3px; gap: 5px; }
  .nav-cta { padding: 8px 10px; letter-spacing: 0.14em; }

  .section { padding: 88px 18px 100px; }
  .section::after { left: 18px; right: 18px; }
  .section-title { letter-spacing: 0.005em; }
  .section-meta { padding-left: 12px; }

  .vf-label { font-size: 8px; letter-spacing: 0.16em; }
  .vf-label-tr { display: none; } /* drop SECTION 01 — keep brand + email */
  .vf-mail-arrow { display: none; }

  .pt-readout { font-size: 10px; letter-spacing: 0.14em; }
}

/* Landscape phone (short viewport) — let the section breathe vertically */
@media (max-height: 540px) and (orientation: landscape) {
  .section { padding: 72px 32px 80px; min-height: auto; }
  .scroll-spacer { height: 100vh; }
  @supports (height: 100dvh) { .scroll-spacer { height: 100dvh; } }
  .topbar { padding-top: 10px; padding-bottom: 10px; }
  .bottombar { padding-top: 8px; padding-bottom: 8px; }
}

/* Touch / coarse-pointer devices — neutralize sticky :hover states */
@media (hover: none), (pointer: coarse) {
  .pillar:hover {
    transform: none;
    background: rgba(8, 14, 26, 0.58);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .pillar:hover .pillar-name {
    color: var(--ink);
    text-shadow: none;
  }
  .meta-email:hover { color: var(--ink); text-shadow: 0 0 12px rgba(78, 195, 255, 0.18); }
  .meta-email:hover::after { transform: scaleX(0); }
  .vf-mail:hover { color: var(--accent); gap: 8px; text-shadow: none; }
  .vf-mail:hover .vf-mail-arrow { color: var(--ink-dim); transform: none; }
  .btn-clip:hover { transform: none; }
  .brand:hover img { transform: none; filter: drop-shadow(0 0 10px rgba(78, 195, 255, 0.3)); }
  .nav-link:hover { color: var(--ink-dim); }
  .nav-link:hover .nav-dot {
    background: var(--ink-faint);
    box-shadow: none;
  }
  .nav-link.active:hover { color: var(--ink); }
  .nav-link.active:hover .nav-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
}

/* ============================================================
   Mobile nav — hamburger toggle + collapsible panel (≤640px)
   The toggle is hidden on tablet/desktop; the full nav shows inline there.
   ============================================================ */

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(
    8px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 8px
  );
  transition: background 0.2s ease;
}

.nav-toggle-bar {
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }

  /* Collapse the inline nav into a dropdown panel anchored under the bar */
  .top-nav {
    position: absolute;
    top: calc(100% - 4px);
    right: 12px;
    left: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px;
    background: rgba(2, 6, 15, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow:
      inset 0 0 0 1px var(--line),
      0 18px 40px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
    pointer-events: none;
    z-index: 8;
  }

  body.nav-open .top-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  body.nav-open .nav-toggle { background: rgba(78, 195, 255, 0.10); }
  body.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
  body.nav-open .nav-toggle-bar:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

  .top-nav .nav-link {
    width: 100%;
    padding: 15px 12px;
    font-size: 12px;
    letter-spacing: 0.22em;
    gap: 10px;
    border-bottom: 1px solid var(--line-soft);
  }
  .top-nav .nav-link:last-of-type { border-bottom: 0; }
  .top-nav .nav-link .nav-dot { width: 6px; height: 6px; }

  .nav-cta {
    margin: 6px 2px 2px;
    justify-content: center;
    width: calc(100% - 4px);
    padding: 14px;
    font-size: 11px;
    letter-spacing: 0.22em;
    gap: 8px;
  }
}
