/* ==========================================================================
   Legacy Lane Ventures — Experimental / Crypto-native
   Dark base, neon accents, mode-based sections
   ========================================================================== */

:root {
  --bg: #08080c;
  --bg-soft: #0c0c12;
  --surface: #12121a;
  --text: #e8e8ec;
  --text-muted: #8888a0;
  --accent: #00ff9d;
  --accent-dim: #00cc7d;
  --accent-cyan: #00d4ff;
  --accent-magenta: #ff00aa;
  --glow: rgba(0, 255, 157, 0.35);
  --glow-cyan: rgba(0, 212, 255, 0.25);
  --border: rgba(255, 255, 255, 0.06);
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 6px;

  /* Layer 2: calmer firm palette */
  --firm-bg: #0d0e12;
  --firm-bg-alt: #13141a;
  --firm-text: #d8d8dc;
  --firm-text-muted: #7a7a8c;
  --firm-accent: #5cb8a0;
  --firm-border: rgba(255, 255, 255, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

/* Only entry modes snap; transition and firm layer do not */
.transition,
.layer--firm,
.firm-section {
  scroll-snap-align: none;
}

/* Disable scroll-snap in firm layer so page scrolls normally */
html.in-firm-layer {
  scroll-snap-type: none;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------------- */
/* Noise overlay */
/* -------------------------------------------------------------------------- */

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* -------------------------------------------------------------------------- */
/* Canvas background (fullscreen, behind content) */
/* -------------------------------------------------------------------------- */

.canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

/* -------------------------------------------------------------------------- */
/* Site ID (logo) */
/* -------------------------------------------------------------------------- */

.site-id {
  position: fixed;
  top: 1.25rem;
  left: 1.5rem;
  z-index: 100;
}

.site-id__logo {
  display: block;
  opacity: 0.9;
  transition: opacity 0.2s var(--ease);
}

.site-id__logo:hover {
  opacity: 1;
}

.site-id__logo img {
  height: 2rem;
  width: auto;
  display: block;
  filter: brightness(1.1);
}

/* -------------------------------------------------------------------------- */
/* Mode navigation (vertical dots + labels) */
/* -------------------------------------------------------------------------- */

.mode-nav {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.mode-nav__track {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mode-nav__dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--text-muted);
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}

.mode-nav__dot:hover {
  background: var(--text);
  transform: scale(1.2);
}

.mode-nav__dot.is-active {
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
  transform: scale(1.3);
}

.mode-nav__dot span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mode-nav__hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0;
}

.mode-nav__hint kbd {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin: 0 0.1rem;
}

/* -------------------------------------------------------------------------- */
/* Modes container */
/* -------------------------------------------------------------------------- */

.modes {
  position: relative;
  z-index: 1;
}

/* -------------------------------------------------------------------------- */
/* Mode section (full viewport, snap) */
/* -------------------------------------------------------------------------- */

.mode {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 5rem 1.5rem 4rem;
}

.mode__inner {
  max-width: 42rem;
  width: 100%;
  position: relative;
  z-index: 2;
}

.mode__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.mode__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.mode__title--hero {
  font-size: clamp(3rem, 10vw, 5.5rem);
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 50%, var(--accent-cyan) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 8s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.mode__statement,
.mode__line {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  max-width: 32rem;
}

.mode__statement {
  margin-bottom: 1.5rem;
}

.mode__line:last-of-type {
  margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------------------- */
/* Buttons / CTAs */
/* -------------------------------------------------------------------------- */

.btn-cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn-cta:hover {
  background: var(--accent-dim);
  color: var(--bg);
  box-shadow: 0 0 24px var(--glow);
}

.btn-cta--outline {
  background: transparent;
  color: var(--accent);
}

.btn-cta--outline:hover {
  background: rgba(0, 255, 157, 0.08);
  box-shadow: 0 0 20px var(--glow);
}

.btn-cta--glow {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 20px var(--glow);
}

.btn-cta--glow:hover {
  background: rgba(0, 255, 157, 0.1);
  box-shadow: 0 0 32px var(--glow);
}

.btn-cta:focus-visible,
.mode-nav__dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.mode__links {
  margin-top: 1.5rem;
}

.mode__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s var(--ease);
}

.mode__links a:hover {
  color: var(--accent-cyan);
}

/* -------------------------------------------------------------------------- */
/* Mode-specific atmospheres */
/* -------------------------------------------------------------------------- */

.mode--enter {
  background:
    radial-gradient(ellipse 100% 80% at 50% 20%, rgba(0, 255, 157, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse 60% 60% at 80% 80%, rgba(0, 212, 255, 0.04) 0%, transparent 45%);
}

.mode__grid--enter {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 0%, transparent 70%);
}

.mode--thesis {
  background: radial-gradient(ellipse 70% 70% at 80% 30%, rgba(0, 212, 255, 0.03) 0%, transparent 50%);
}

.mode__viz--nodes {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 400px);
  height: 120px;
  color: var(--accent);
  opacity: 0.5;
}

.mode__viz--nodes .nodes-svg {
  width: 100%;
  height: 100%;
}

.mode--build {
  background: radial-gradient(ellipse 60% 80% at 20% 60%, rgba(0, 255, 157, 0.03) 0%, transparent 50%);
}

.canvas-lines {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  opacity: 0.4;
}

.mode--play {
  background: radial-gradient(ellipse 70% 60% at 50% 80%, rgba(255, 0, 170, 0.03) 0%, transparent 50%);
}

.flywheel-viz {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.flywheel-viz__node {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  opacity: 0.8;
}

.flywheel-viz__arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.mode--network {
  background: radial-gradient(ellipse 80% 50% at 50% 50%, rgba(0, 212, 255, 0.04) 0%, transparent 60%);
}

.canvas-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

/* -------------------------------------------------------------------------- */
/* Transition (gate: emotion → structure) */
/* -------------------------------------------------------------------------- */

.transition {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 4rem 1.5rem;
  background: linear-gradient(180deg, var(--bg) 0%, var(--firm-bg) 50%, var(--firm-bg) 100%);
}

.transition__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(13, 14, 18, 0.6) 40%, var(--firm-bg) 100%);
  pointer-events: none;
}

.transition__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 28rem;
}

.transition__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--firm-text-muted);
  margin: 0 0 1rem;
}

.transition__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--firm-text);
  margin: 0 0 1rem;
}

.transition__copy {
  font-size: 0.9375rem;
  color: var(--firm-text-muted);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.btn-cta--transition {
  background: var(--firm-accent);
  color: var(--firm-bg);
  border-color: var(--firm-accent);
}

.btn-cta--transition:hover {
  background: #6ec9b3;
  box-shadow: 0 0 20px rgba(92, 184, 160, 0.3);
}

/* -------------------------------------------------------------------------- */
/* Layer 2: Firm (structure & trust) */
/* -------------------------------------------------------------------------- */

.layer--firm {
  background: var(--firm-bg);
  position: relative;
  z-index: 2;
}

/* Hide entry-layer UI when in firm layer */
body.in-firm-layer .mode-nav,
body.in-firm-layer .site-id {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.firm-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 0.875rem 1.5rem;
  background: rgba(13, 14, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--firm-border);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

body.in-firm-layer .firm-header {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.firm-header__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.firm-header__logo {
  display: block;
}

.firm-header__logo img {
  height: 1.75rem;
  width: auto;
  display: block;
  filter: brightness(1.05);
}

.firm-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.firm-header__nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--firm-text-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.firm-header__nav a:hover {
  color: var(--firm-text);
}

.firm-main {
  padding-top: 5rem;
}

.firm-section {
  padding: clamp(3rem, 8vw, 5rem) 1.5rem;
  scroll-margin-top: 5rem;
}

.firm-section--alt {
  background: var(--firm-bg-alt);
}

.firm-section--contact {
  padding-bottom: 4rem;
}

.firm-container {
  max-width: 48rem;
  margin: 0 auto;
}

.firm-container--narrow {
  max-width: 36rem;
}

.firm-section__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--firm-text);
  margin: 0 0 0.75rem;
}

.firm-section__lead {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--firm-text-muted);
  margin: 0 0 2rem;
}

.firm-blocks {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.firm-block__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--firm-accent);
  margin-bottom: 0.35rem;
}

.firm-block__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--firm-text);
  margin: 0 0 0.5rem;
}

.firm-block__body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--firm-text-muted);
  margin: 0;
}

.firm-cards {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 48rem) {
  .firm-cards {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  }
}

.firm-card {
  padding: 1.5rem;
  background: var(--firm-bg-alt);
  border: 1px solid var(--firm-border);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease);
}

.firm-card:hover {
  border-color: rgba(92, 184, 160, 0.3);
}

.firm-card__cat {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--firm-accent);
  margin-bottom: 0.5rem;
}

.firm-card__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--firm-text);
  margin: 0 0 0.5rem;
}

.firm-card__body {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--firm-text-muted);
  margin: 0;
}

.firm-contact__email {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.firm-contact__email a {
  color: var(--firm-accent);
  text-decoration: none;
}

.firm-contact__email a:hover {
  text-decoration: underline;
}

.firm-contact__links {
  margin: 0;
}

.firm-contact__links a {
  color: var(--firm-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.firm-contact__links a:hover {
  color: var(--firm-text);
}

.firm-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--firm-border);
  background: var(--firm-bg-alt);
}

.firm-footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.firm-footer__logo img {
  height: 1.5rem;
  width: auto;
  display: block;
  opacity: 0.8;
}

.firm-footer__tagline {
  font-size: 0.8125rem;
  color: var(--firm-text-muted);
  margin: 0;
}

/* -------------------------------------------------------------------------- */
/* Canvas viz containers */
/* -------------------------------------------------------------------------- */

.mode__viz {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Responsive */
/* -------------------------------------------------------------------------- */

@media (max-width: 48rem) {
  .mode-nav {
    right: 1rem;
  }

  .mode-nav__hint {
    display: none;
  }

  .site-id {
    left: 1rem;
  }

  .mode {
    padding: 4rem 1rem 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .mode__title--hero {
    animation: none;
  }
}
