/* ============================================================
   Lakkireddy Labs — Light, single-page, vector-graph aesthetic
   ============================================================ */

:root {
  /* Surface — warm cream */
  --bg-0: #f5f1ea;
  --bg-1: #efe9dd;
  --bg-2: #e8e0cf;
  --surface:        rgba(26, 24, 20, 0.04);
  --surface-strong: rgba(26, 24, 20, 0.07);

  /* Foreground — dark warm */
  --fg-0: #1a1814;
  --fg-1: #4a4640;
  --fg-2: #82786a;
  --fg-3: #a39d8e;

  /* Single warm accent — deep amber */
  --warm:      #b8884a;
  --warm-deep: #8a6532;
  --warm-soft: rgba(184, 136, 74, 0.10);

  --border:        1px solid rgba(26, 24, 20, 0.10);
  --border-strong: 1px solid rgba(26, 24, 20, 0.18);

  --max-w: 1400px;
  --gutter: 48px;

  --easing:     cubic-bezier(0.22, 1, 0.36, 1);
  --easing-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  background: var(--bg-0);
  color: var(--fg-1);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  font-feature-settings: 'ss01', 'cv11';
}

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

/* ============================================================
   Persistent particle-globe canvas
   ============================================================ */
.specimen-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

.cursor-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 136, 74, 0.06) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}

/* ============================================================
   Lab readout HUD
   ============================================================ */
.lab-readout {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 50;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  color: var(--fg-2);
  letter-spacing: 0.08em;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
  opacity: 0;
  animation: fade-up 1s var(--easing-out) 1.6s forwards;
  mix-blend-mode: multiply;
}

.lab-readout-line { display: flex; gap: 10px; }

.lab-readout-key {
  color: var(--fg-3);
  width: 38px;
}

.lab-readout-val {
  color: var(--warm-deep);
  font-weight: 500;
}

@media (max-width: 800px) { .lab-readout { display: none; } }

.frame-corners {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  animation: fade-up 1s var(--easing-out) 1.6s forwards;
}

.frame-corners .fc {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(26, 24, 20, 0.20);
}

.frame-corners .fc.tl { top: 24px; left: 24px;  border-right: none; border-bottom: none; }
.frame-corners .fc.tr { top: 24px; right: 24px; border-left: none;  border-bottom: none; }
.frame-corners .fc.bl { bottom: 24px; left: 24px;  border-right: none; border-top: none; }
.frame-corners .fc.br { bottom: 24px; right: 24px; border-left: none;  border-top: none; }

@media (max-width: 800px) { .frame-corners { display: none; } }

/* ============================================================
   Typography
   ============================================================ */
.display {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.96;
  color: var(--fg-0);
}
.display em { font-style: italic; color: var(--warm); }

h1, h2, h3, h4 { color: var(--fg-0); font-weight: 400; letter-spacing: -0.02em; }

.mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--fg-2);
}

.eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--warm);
}

/* Hero word stagger — words rise in cleanly, no blur.
   Initial state is offset + invisible; when .in is added on load,
   they slide and fade up into place. */
.word {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
}
.word.in {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 1.0s var(--easing-out),
    transform 1.0s var(--easing-out);
}

@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Layout primitives
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (max-width: 900px) {
  :root { --gutter: 24px; }
  body { font-size: 16px; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.5s var(--easing);
}

.btn-primary { background: var(--fg-0); color: var(--bg-0); }
.btn-primary:hover { background: var(--warm-deep); transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--fg-0); border: var(--border-strong); }
.btn-ghost:hover { border-color: var(--warm); color: var(--warm); transform: translateY(-2px); }

.btn-arrow { transition: transform 0.5s var(--easing); display: inline-block; }
.btn:hover .btn-arrow { transform: translateX(5px); }

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 0;
  transition: all 0.6s var(--easing);
}

.nav.scrolled {
  background: rgba(245, 241, 234, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--border);
  padding: 14px 0;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg-0); }
.brand img { width: 32px; height: 32px; }

.brand-name {
  font-family: 'Instrument Serif', serif;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand-name em { font-style: italic; color: var(--warm); }

.nav-links { display: flex; align-items: center; gap: 40px; }
.nav-links a { color: var(--fg-1); text-decoration: none; font-size: 0.9rem; transition: color 0.4s var(--easing); }
.nav-links a:hover { color: var(--fg-0); }
.nav-links a.cta { color: var(--bg-0); background: var(--fg-0); padding: 10px 18px; border-radius: 999px; font-weight: 500; }
.nav-links a.cta:hover { background: var(--warm-deep); }

@media (max-width: 768px) {
  .nav-links a:not(.cta) { display: none; }
}

/* ============================================================
   THE MEGA-PAGE — single-page carousel scrollytelling
   One sticky frame. Scenes are stacked vertically inside a
   "track" that translates upward as you scroll. No opacity
   crossfades — each scene is fully sharp, transitions are pure
   motion (Apple-style).
   ============================================================ */
.mega-page {
  position: relative;
  /* height set inline */
}

.mega-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.scenes-track {
  display: flex;
  flex-direction: column;
  width: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.scene {
  width: 100%;
  height: 100vh;
  min-height: 640px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  position: relative;
}

.scene-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.scene-inner--center { text-align: center; max-width: 1100px; }

/* Anchor markers for nav links — invisible, just scroll targets */
.scroll-anchor {
  position: absolute;
  width: 1px; height: 1px;
  pointer-events: none;
  visibility: hidden;
}

/* Scroll cue at the top of the mega-page */
.scroll-cue {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-3);
  z-index: 50;
  pointer-events: none;
  transition: opacity 0.6s var(--easing);
}

.scroll-cue::after {
  content: '';
  display: block;
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, var(--fg-3) 0%, transparent 100%);
  animation: scroll-line 3s var(--easing) infinite;
}

@keyframes scroll-line {
  0%   { transform: scaleY(0); transform-origin: top; }
  40%  { transform: scaleY(1); transform-origin: top; }
  60%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ----- Scene types ----- */

/* Hero — left-aligned, bold lockup */
.scene-hero .scene-inner {
  display: flex; flex-direction: column; align-items: flex-start;
}
.scene-hero .eyebrow { margin-bottom: 36px; }
.scene-hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(3.5rem, 11vw, 13rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin-bottom: 36px;
}
.scene-hero h1 em { font-style: italic; color: var(--warm); }

.scene-hero .hero-sub {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--fg-1);
  max-width: 44ch;
  margin-bottom: 48px;
}

.scene-hero .hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* Vision — centered single statement, huge */
.scene-vision .vision-display {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 8rem);
  letter-spacing: -0.045em;
  line-height: 0.94;
  color: var(--fg-0);
}
.scene-vision .vision-display em { font-style: italic; color: var(--warm); }

/* Vision word — single italic emphasis word */
.scene-vision-word .vision-word-text {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(4rem, 14vw, 14rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--warm);
}

/* Principle — huge numeral + 3-word title */
.scene-principle .scene-inner {
  display: grid;
  grid-template-columns: minmax(auto, 0.9fr) 1fr;
  gap: 50px;
  align-items: center;
  max-width: 1200px;
  width: 100%;
}

@media (max-width: 900px) {
  .scene-principle .scene-inner { grid-template-columns: 1fr; gap: 24px; text-align: left; padding-left: 0; }
}

.scene-principle .p-num {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(8rem, 22vw, 20rem);
  line-height: 0.84;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, var(--warm) 0%, rgba(184, 136, 74, 0.35) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Italic ascenders need horizontal breathing room — these
     keep "01" / "02" etc. from clipping at the right edge */
  padding-right: 0.12em;
  margin-right: -0.06em;
  display: inline-block;
}

.scene-principle h3 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--fg-0);
}
.scene-principle h3 em { font-style: italic; color: var(--warm); }

/* Tools scene */
.scene-tools .scene-inner { max-width: 1100px; }

/* The tools head gets its own frosted panel so the headline reads
   cleanly even with particles drifting behind it. */
.scene-tools .tools-head {
  display: inline-block;
  padding: 26px 36px 30px;
  margin-bottom: 36px;
  background: rgba(245, 241, 234, 0.62);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border: 1px solid rgba(26, 24, 20, 0.10);
  border-radius: 18px;
}
.scene-tools .tools-head .eyebrow { margin-bottom: 22px; display: inline-flex; }
.scene-tools .tools-head h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  letter-spacing: -0.035em;
  line-height: 1.0;
  color: var(--fg-0);
}
.scene-tools .tools-head h2 em { font-style: italic; color: var(--warm); }

.scene-tools .tools-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

@media (max-width: 800px) { .scene-tools .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  position: relative;
  display: block;
  padding: 36px 36px 42px;
  background: rgba(239, 233, 221, 0.78);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid rgba(26, 24, 20, 0.18);
  border-radius: 22px;
  text-decoration: none;
  color: var(--fg-0);
  overflow: hidden;
  transition: all 0.6s var(--easing);
  box-shadow: 0 20px 50px -20px rgba(26, 24, 20, 0.12);
}

.tool-card--feature {
  background: linear-gradient(135deg, rgba(184, 136, 74, 0.18), rgba(239, 233, 221, 0.82));
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.tool-card--feature:hover {
  border-color: var(--warm);
  transform: translateY(-4px);
}

.tool-card-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--fg-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.tool-card-tag .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warm);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

.tool-card h3 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
  color: var(--fg-0);
  margin-bottom: 8px;
}

.tool-card-tagline {
  font-size: 1.05rem;
  color: var(--fg-1);
  margin-bottom: 28px;
}

.tool-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--warm-deep);
}

.tool-card--soon { opacity: 0.85; background: var(--bg-1); }
.tool-card--soon h3 { font-style: normal; font-size: clamp(1.3rem, 2vw, 1.7rem); }

/* Contact scene */
.scene-contact .scene-inner--center { max-width: 900px; }
.scene-contact .eyebrow { margin-bottom: 36px; }
.scene-contact h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(4rem, 13vw, 14rem);
  letter-spacing: -0.05em;
  line-height: 0.9;
  margin-bottom: 56px;
  color: var(--fg-0);
}
.scene-contact h2 em { font-style: italic; color: var(--warm); }
.scene-contact .contact-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: var(--border);
  padding: 50px 0 60px;
  position: relative;
  z-index: 10;
  /* No background — blends with the page so there's no visible
     section break above it. */
  background: transparent;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-inner p {
  color: var(--fg-3);
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}

.footer-inner .fg-warm { color: var(--warm); }

/* ============================================================
   CATO PAGE — kept (its own layout)
   These styles still apply on cato.html.
   ============================================================ */
.scroll-stage { position: relative; }

.stage-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.stage-pin-inner {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cato hero */
.cato-hero {
  min-height: 100vh;
  position: relative;
  padding: 160px 0 100px;
  display: flex;
  align-items: center;
}

.cato-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

@media (max-width: 1000px) {
  .cato-hero-inner { grid-template-columns: 1fr; gap: 40px; }
}

.cato-hero-eyebrow {
  margin-bottom: 36px;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 1s var(--easing-out) 0.2s forwards;
}

.cato-hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(4.5rem, 14vw, 16rem);
  margin-bottom: 36px;
  line-height: 0.9;
  font-weight: 400;
  letter-spacing: -0.045em;
  color: var(--fg-0);
}
.cato-hero h1 em { font-style: italic; color: var(--warm); }

/* The bold middle line that sells what Cato is in 4 words. */
.cato-hero-tagline {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--fg-0);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 1.2s var(--easing-out) 1.2s forwards;
}
.cato-hero-tagline em { font-style: italic; color: var(--warm); }

.cato-hero-sub {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--fg-1);
  max-width: 42ch;
  margin-bottom: 36px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 1.2s var(--easing-out) 1.4s forwards;
}

.cato-badges {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 44px;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 1.2s var(--easing-out) 1.6s forwards;
}

.cato-badges span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--fg-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  background: var(--surface);
  border: var(--border);
  border-radius: 999px;
}

.cato-hero-cta {
  display: flex; gap: 14px; flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 1.2s var(--easing-out) 1.8s forwards;
}

.cato-hero-visual {
  position: relative;
  height: 70vh;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cato-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Cato scroll-stage panels */
.cato-stage .stage-pin-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 100px var(--gutter) 60px;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  align-items: center;
}

@media (max-width: 1000px) {
  .cato-stage .stage-pin-inner { grid-template-columns: 1fr; padding: 100px var(--gutter) 40px; }
}

.cato-copy {
  position: relative;
  height: 70vh;
  min-height: 380px;
  display: flex; align-items: center;
}

.c-panel {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0;
  will-change: opacity, transform;
  pointer-events: none;
}

.c-panel .c-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--warm);
  letter-spacing: 0.18em;
  margin-bottom: 28px;
}

.c-panel .c-display {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--fg-0);
  margin-bottom: 28px;
}
.c-panel .c-display em { font-style: italic; color: var(--warm); }

.c-panel p {
  color: var(--fg-1);
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 38ch;
  margin-bottom: 32px;
}

.c-panel .c-cta { display: inline-flex; align-self: flex-start; }

.cato-visual {
  position: relative;
  height: 80vh;
  min-height: 480px;
  display: flex; align-items: center; justify-content: center;
}

.v-card {
  position: absolute;
  width: 100%;
  max-width: 540px;
  will-change: transform, opacity;
}

/* Permissions card (kept dark for terminal feel) */
.v-perms {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.06), var(--bg-1));
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: 16px;
  padding: 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--fg-0);
  box-shadow: 0 20px 40px -20px rgba(26, 24, 20, 0.15);
}

.v-perms-title {
  font-size: 0.72rem;
  color: #c54040;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 10px;
}

.v-perms-title::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #c54040;
  box-shadow: 0 0 8px rgba(197, 64, 64, 0.5);
}

.v-perms ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.v-perms ul li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: 8px;
  color: var(--fg-0);
  font-size: 0.85rem;
}

.v-perms ul li span:last-child {
  font-size: 0.7rem;
  color: #c54040;
  letter-spacing: 0.05em;
}

/* Code/terminal cards keep dark styling for readability */
.code-card {
  background: #1a1814;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  box-shadow: 0 30px 60px -20px rgba(26, 24, 20, 0.25);
}

.code-card-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.code-card-bar .icon { width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; }
.code-card-bar .icon svg { width: 13px; height: 13px; stroke: rgba(255, 255, 255, 0.5); fill: none; stroke-width: 1.8; }
.code-card-bar .title { font-size: 0.78rem; color: rgba(255, 255, 255, 0.5); letter-spacing: 0.04em; }

.code-card-body {
  padding: 22px 22px 24px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
  white-space: pre;
  overflow-x: auto;
}

/* Each <span class="code-line"> is a logical line of code — without
   this, all the spans render inline and the whole config collapses
   onto a single row. */
.code-card-body .code-line {
  display: block;
}

.tok-comment { color: rgba(255, 255, 255, 0.4); }
.tok-key     { color: #ffffff; }
.tok-section { color: var(--warm); }
.tok-string  { color: #a3c8e5; }
.tok-number  { color: var(--warm); }

.terminal {
  background: #1a1814;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  box-shadow: 0 30px 70px -20px rgba(26, 24, 20, 0.25);
}

.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dots { display: flex; gap: 6px; margin-right: 10px; }
.terminal-dots span { width: 11px; height: 11px; border-radius: 50%; }
.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }
.terminal-title { color: rgba(255, 255, 255, 0.5); font-size: 0.78rem; }

.terminal-body {
  padding: 22px;
  min-height: 280px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.85;
}

.terminal-line { display: block; white-space: pre-wrap; }
.term-prompt { color: var(--warm); }
.term-cmd    { color: #ffffff; }
.term-block  { color: #f87171; }
.term-ok     { color: #6ee7b7; }
.term-info   { color: rgba(255, 255, 255, 0.5); }

.terminal-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--warm);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1.2s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* Anywhere */
.v-anywhere {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 540px;
}

.v-env {
  padding: 24px 18px;
  background: var(--bg-1);
  border: var(--border-strong);
  border-radius: 14px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

.v-env svg {
  width: 32px; height: 32px;
  stroke: var(--warm); fill: none; stroke-width: 1.5;
}

.v-env .nm {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--fg-1);
  letter-spacing: 0.06em;
}

.v-env .file {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--warm);
  margin-top: 2px;
}

/* Cato demo */
.cato-demo {
  padding: 160px 0;
  border-top: var(--border);
  position: relative;
}

.cato-demo-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: 60px;
}

.cato-demo .eyebrow { margin-bottom: 32px; }

.cato-demo h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.035em;
  line-height: 1.0;
  color: var(--fg-0);
  max-width: 16ch;
  margin-bottom: 24px;
}

.cato-demo h2 em { font-style: italic; color: var(--warm); }

.cato-demo p {
  color: var(--fg-1);
  font-size: 1.08rem;
  line-height: 1.65;
  max-width: 56ch;
}

.terminal-large .terminal { font-size: 0.92rem; }
.terminal-large .terminal-body { min-height: 360px; padding: 28px 30px; }

/* Install */
.install-section {
  padding: 160px 0;
  border-top: var(--border);
  position: relative;
}

.install-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.install-head { margin-bottom: 60px; max-width: 720px; }
.install-head .eyebrow { margin-bottom: 32px; }
.install-head h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4rem);
  letter-spacing: -0.035em;
  line-height: 1.0;
  color: var(--fg-0);
}
.install-head h2 em { font-style: italic; color: var(--warm); }

.install-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 80px;
}

@media (max-width: 900px) { .install-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .install-grid { grid-template-columns: 1fr; } }

.install-card {
  padding: 24px 22px;
  background: var(--bg-1);
  border: var(--border);
  border-radius: 14px;
  transition: border-color 0.5s var(--easing);
}

.install-card:hover { border-color: var(--warm); }

.install-tag {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 14px;
}

.install-cmd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--fg-0);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.install-quickstart {
  background: #1a1814;
  border: var(--border);
  border-radius: 16px;
  padding: 36px 36px 30px;
}

.install-quickstart .eyebrow { margin-bottom: 18px; color: rgba(255,255,255,0.6); }
.install-quickstart .eyebrow::before { background: var(--warm); }

.install-quickstart .install-cmd {
  font-size: 0.92rem;
  line-height: 1.85;
  color: rgba(255,255,255,0.85);
}

/* Cato page contact section (separate from index's scene-contact) */
.cato-hero ~ .contact-section,
.install-section ~ .contact-section {
  padding: 200px 0 240px;
  position: relative;
  text-align: center;
  border-top: var(--border);
}

.contact-section .eyebrow { margin-bottom: 40px; }

.contact-section h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(3.5rem, 12vw, 14rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--fg-0);
  margin-bottom: 60px;
}

.contact-section h2 em { font-style: italic; color: var(--warm); }

.contact-section .contact-cta {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}

/* ============================================================
   Reveal helper (hero & cato page)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.4s var(--easing-out), transform 1.4s var(--easing-out);
}
.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.4s var(--easing-out), transform 1.4s var(--easing-out);
}

.reveal-stagger.in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 0.24s; }

/* ============================================================
   MOBILE (≤ 800px) — comprehensive responsive overrides
   - Carousel disabled, scenes flow naturally
   - Heavy 3D globe hidden (the JS also bails out early)
   - Display typography scaled for small screens
   - Buttons stack & go full-width where it makes sense
   - Cato scroll-stage and visuals stack vertically
   ============================================================ */
@media (max-width: 800px) {
  /* --- Mega-page carousel disabled --- */
  .mega-page { height: auto !important; }
  .mega-pin {
    position: static; height: auto; overflow: visible;
  }
  .scenes-track { transform: none !important; }
  .scene {
    height: auto;
    min-height: auto;
    padding: 80px var(--gutter);
  }
  .scroll-cue { display: none; }

  /* --- Hide the persistent particle globe on mobile ---
     The fixed full-viewport canvas + scroll-driven camera
     fly-through don't translate well to small screens. Hiding
     it gives mobile a fast, clean text-driven layout. */
  .specimen-canvas { display: none; }

  /* --- Hero scene typography --- */
  .scene-hero .eyebrow { margin-bottom: 24px; }
  .scene-hero h1 {
    font-size: clamp(2.6rem, 11vw, 4.5rem);
    margin-bottom: 24px;
  }
  .scene-hero .hero-sub {
    font-size: 1rem;
    margin-bottom: 28px;
  }
  .scene-hero .hero-cta { flex-wrap: wrap; gap: 10px; }

  /* --- Vision setup --- */
  .scene-vision .vision-display {
    font-size: clamp(2rem, 9vw, 3.2rem);
  }

  /* --- Vision word --- */
  .scene-vision-word .vision-word-text {
    font-size: clamp(3rem, 14vw, 5rem);
  }

  /* --- Principles: stack numeral above title --- */
  .scene-principle .scene-inner {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: left;
    padding-left: 0;
  }
  .scene-principle .p-num {
    font-size: clamp(5rem, 22vw, 9rem);
    line-height: 0.92;
  }
  .scene-principle h3 {
    font-size: clamp(1.8rem, 7vw, 3rem);
  }

  /* --- Tools section --- */
  .scene-tools .tools-head {
    padding: 18px 22px 22px;
    margin-bottom: 24px;
  }
  .scene-tools .tools-head h2 {
    font-size: clamp(2rem, 7.5vw, 3rem);
  }
  .scene-tools .tools-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .tool-card { padding: 26px 22px 30px; }
  .tool-card h3 { font-size: clamp(1.5rem, 5vw, 2rem); }

  /* --- Contact scene: stacked full-width buttons --- */
  .scene-contact h2 {
    font-size: clamp(3.5rem, 16vw, 6rem);
    margin-bottom: 36px;
  }
  .scene-contact .contact-cta {
    flex-direction: column;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }
  .scene-contact .contact-cta .btn {
    width: 100%;
    justify-content: center;
  }

  /* --- Buttons & nav --- */
  .btn {
    padding: 14px 22px;
    font-size: 0.92rem;
  }
  .nav { padding: 16px 0; }
  .nav.scrolled { padding: 12px 0; }
  .nav-links { gap: 14px; }
  .nav-links a:not(.cta) { display: none; }
  .brand-name { font-size: 1.05rem; }
  .brand img { width: 28px; height: 28px; }

  /* ============================================================
     CATO PAGE
     ============================================================ */

  /* --- Cato hero --- */
  .cato-hero { padding: 110px 0 70px; min-height: auto; }
  .cato-hero-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .cato-hero h1 { font-size: clamp(3.5rem, 18vw, 7rem); }
  .cato-hero-tagline { font-size: clamp(1.3rem, 5vw, 1.8rem); }
  .cato-hero-sub {
    font-size: 0.98rem;
    max-width: none;
    margin-bottom: 28px;
  }
  .cato-hero-cta { flex-wrap: wrap; gap: 10px; }
  .cato-badges { gap: 6px; margin-bottom: 28px; }
  .cato-badges span { font-size: 0.65rem; padding: 5px 10px; }
  .cato-hero-visual {
    height: 46vh;
    min-height: 280px;
    max-height: 420px;
  }

  /* --- Cato scroll-stage panels (stacked) --- */
  .scroll-stage { height: auto !important; }
  .stage-pin {
    position: static; height: auto; overflow: visible;
    padding: 40px 0;
  }
  .cato-stage .stage-pin-inner {
    display: block;
    padding: 40px var(--gutter);
  }
  .cato-copy {
    height: auto; min-height: 0; display: block;
    margin-bottom: 24px;
  }
  .c-panel {
    position: static;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    padding: 36px 0;
    border-bottom: var(--border);
  }
  .c-panel:last-child { border-bottom: none; }
  .c-panel .c-display {
    font-size: clamp(1.8rem, 6.5vw, 2.6rem);
  }
  .c-panel p { font-size: 1rem; }
  .cato-visual {
    position: relative;
    height: auto;
    min-height: 0;
    display: block;
    padding: 8px 0 32px;
  }
  .v-card {
    position: static;
    opacity: 1 !important;
    transform: none !important;
    margin: 0 auto 18px;
    max-width: 100%;
  }
  .v-perms { padding: 22px; font-size: 0.78rem; }
  .v-perms ul li { padding: 8px 12px; font-size: 0.75rem; }
  .v-anywhere {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 100%;
  }
  .v-env { padding: 16px 8px; }
  .v-env svg { width: 26px; height: 26px; }
  .v-env .nm { font-size: 0.65rem; }
  .v-env .file { font-size: 0.6rem; }

  /* --- Cato demo (terminal showcase) --- */
  .cato-demo { padding: 80px 0; }
  .cato-demo-inner { gap: 36px; }
  .cato-demo h2 {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
  }
  .cato-demo p { font-size: 0.98rem; }
  .terminal-large .terminal { font-size: 0.78rem; }
  .terminal-large .terminal-body { padding: 20px 18px; min-height: 260px; }

  /* --- Code & terminal cards (general) --- */
  .terminal-body { padding: 18px; min-height: 220px; }
  .code-card-body { padding: 18px; font-size: 0.78rem; line-height: 1.7; }
  .terminal { font-size: 0.8rem; }
  .terminal-bar { padding: 10px 14px; }

  /* --- Install --- */
  .install-section { padding: 80px 0; }
  .install-head { margin-bottom: 40px; }
  .install-head h2 {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
  }
  .install-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 56px;
  }
  .install-card { padding: 20px 18px; }
  .install-cmd { font-size: 0.78rem; }
  .install-quickstart { padding: 26px 22px; }
  .install-quickstart .install-cmd {
    font-size: 0.82rem;
    line-height: 1.7;
  }

  /* --- Cato bottom contact section --- */
  .contact-section { padding: 100px 0 120px; }
  .contact-section h2 {
    font-size: clamp(3.5rem, 16vw, 6rem);
    margin-bottom: 36px;
  }
  .contact-section .contact-cta {
    flex-direction: column;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }
  .contact-section .contact-cta .btn {
    width: 100%;
    justify-content: center;
  }

  /* --- Footer --- */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}

/* ============================================================
   VERY SMALL PHONES (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  :root { --gutter: 16px; }
  body { font-size: 14px; }

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

  .scene-hero h1   { font-size: clamp(2.4rem, 12vw, 4rem); }
  .cato-hero h1    { font-size: clamp(3rem, 18vw, 5.5rem); }

  .v-anywhere { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .v-env { padding: 14px 6px; }
}

/* ============================================================
   TOUCH DEVICES — disable hover transforms
   On tap, hover state would stick & block click feedback.
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .tool-card:hover,
  .tool-card--feature:hover,
  .install-card:hover {
    transform: none;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
  .word { opacity: 1; transform: none; filter: none; }
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; }
}
