﻿/* Shared layout and accessibility styles. */

/* Avoid permanent 3D transforms on text to keep it sharp in Chromium. */
html {
  scroll-behavior: auto; /* Lenis handles smooth scrolling */
  scroll-padding-top: 112px;
  scrollbar-gutter: stable;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}


img {
  image-rendering: auto;
}

/* Allow flex items to shrink so wide diagrams scroll within their containers. */
main,
#main-content,
.content-layer {
  min-width: 0;
}

main,
#main-content {
  width: 100%;
}

.overflow-x-auto {
  min-width: 0;
  max-width: 100%;
}

/* Increase contrast for small metadata text on dark backgrounds. */
.text-zinc-500 {
  color: #92929d !important;
}

.tilt-card {
  transform: none;
  transform-style: preserve-3d;
  will-change: transform;
}

.tilt-content {
  transform: none;
}

/* Limit expensive backdrop sampling and permanent promotion while scrolling. */
.glass-panel,
.spotlight-content {
  -webkit-backdrop-filter: blur(14px) !important;
  backdrop-filter: blur(14px) !important;
}

.bento-bg-img {
  will-change: auto;
}

@media (max-width: 767px) {
  .glass-panel,
  .spotlight-content,
  #main-nav > div,
  #mobile-menu-overlay {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* Keyboard skip link. */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10001;
  padding: .8rem 1rem;
  border-radius: .5rem;
  color: #000;
  background: #fff;
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* Home hero. */
#hero::before {
  content: "";
  position: absolute;
  inset: 7% 18% 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 55% 36%, rgba(99,102,241,.12), transparent 58%);
  filter: blur(18px);
}

#hero .hero-grid {
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px) !important;
  background-size: 72px 72px !important;
  -webkit-mask-image: radial-gradient(70% 65% at 50% 45%, #000 15%, transparent 100%);
  mask-image: radial-gradient(70% 65% at 50% 45%, #000 15%, transparent 100%);
}

.home-hero-layout {
  gap: clamp(3rem, 6vw, 6rem);
}

.home-hero-copy {
  max-width: 700px;
}

.home-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: #a5b4fc;
  font: 700 .68rem "JetBrains Mono", monospace;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.home-hero-kicker > span {
  width: 24px;
  height: 1px;
  background: #818cf8;
  box-shadow: 0 0 14px rgba(129,140,248,.6);
}

.home-hero-title {
  margin: 0 0 28px;
  color: #fff;
  font-size: clamp(3.6rem, 5.6vw, 5rem);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.075em;
}

.home-hero-title > span {
  color: transparent;
  background: linear-gradient(105deg, #818cf8, #e879f9 48%, #67e8f9);
  background-clip: text;
  -webkit-background-clip: text;
}

.home-hero-intro {
  max-width: 610px;
  margin: 0 0 38px;
  color: #c5c5ca;
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.72;
}

.home-hero-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 15px 22px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 10px;
  color: #09090b;
  background: #fff;
  font-size: .92rem;
  font-weight: 800;
  transition: color .25s, background .25s, transform .25s, box-shadow .25s;
}

.home-hero-primary:hover {
  color: #fff;
  background: transparent;
  transform: translateY(-2px);
  box-shadow: 0 18px 48px rgba(0,0,0,.28);
}

.home-system-diagram {
  width: min(100%, 540px);
  isolation: isolate;
}

.home-system-diagram::before {
  content: "SYSTEM";
  position: absolute;
  right: -2%;
  top: -16%;
  z-index: -2;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.055);
  font-size: clamp(5rem, 8vw, 8rem);
  font-weight: 900;
  letter-spacing: -.08em;
}

.home-system-diagram::after {
  content: "";
  position: absolute;
  inset: -14% -20%;
  z-index: -3;
  pointer-events: none;
  background: radial-gradient(circle at 48% 50%, rgba(99,102,241,.14), transparent 62%);
}

#hero .home-diagram-shell.glass-panel,
#hero .home-diagram-shell.glass-panel:hover {
  position: relative;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.home-diagram-header,
.home-diagram-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #71717a;
  font: 700 .62rem "JetBrains Mono", monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.home-diagram-header {
  padding: 15px 0;
  border-block: 1px solid rgba(255,255,255,.12);
}

.home-diagram-header span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d4d4d8;
}

.home-diagram-header i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #67e8f9;
  box-shadow: 0 0 16px rgba(103,232,249,.75);
}

.home-diagram-layer {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 28px;
  align-items: start;
  padding: 42px 0;
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.home-diagram-index {
  color: transparent;
  -webkit-text-stroke: 1px rgba(165,180,252,.72);
  font-size: 3.4rem;
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.08em;
}

.home-diagram-infrastructure .home-diagram-index {
  -webkit-text-stroke-color: rgba(103,232,249,.7);
}

.home-diagram-layer p:first-child {
  margin: 0 0 10px;
  color: #a5b4fc;
  font: 700 .64rem "JetBrains Mono", monospace;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.home-diagram-infrastructure p:first-child {
  color: #67e8f9;
}

.home-diagram-layer h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(1.8rem, 2.8vw, 2.65rem);
  font-weight: 820;
  line-height: .98;
  letter-spacing: -.055em;
}

.home-diagram-layer p:last-child {
  max-width: 370px;
  margin: 0;
  color: #a1a1aa;
  font-size: .92rem;
  line-height: 1.65;
}

.home-diagram-bridge {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: -8px 0;
  transform: translateX(102px);
}

.home-diagram-bridge span {
  color: #d4d4d8;
  font: 700 .57rem "JetBrains Mono", monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-diagram-bridge i {
  width: 84px;
  height: 1px;
  background: linear-gradient(90deg, #818cf8, #67e8f9);
}

.home-diagram-footer {
  justify-content: flex-start;
  padding-top: 18px;
  color: #52525b;
}

.home-diagram-footer span:nth-child(2) {
  color: #818cf8;
}

@media (min-width: 1024px) {
  .home-hero-layout {
    grid-template-columns: minmax(0, 1.12fr) minmax(430px, .88fr);
  }

  .home-hero-title {
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  #hero {
    min-height: 100svh;
  }

  #hero::before {
    inset: 10% -20% 10%;
  }

  .home-hero-copy {
    align-items: flex-start !important;
    text-align: left !important;
  }

  .home-hero-kicker {
    margin-bottom: 24px;
    font-size: .6rem;
  }

  .home-hero-title {
    font-size: clamp(3.25rem, 16vw, 4.6rem);
  }

  .home-hero-intro {
    font-size: 1rem;
  }

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

/* Support both reveal state classes set by the shared runtime. */
.reveal.active,
.reveal.in-view,
.story-scene.active,
.story-scene.in-view,
.service-chapter.active,
.service-chapter.in-view {
  opacity: 1;
}

.reveal.active,
.reveal.in-view {
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .reveal,
  .story-scene,
  .service-chapter,
  .tilt-card,
  .tilt-content,
  .animate-float,
  .marquee-content,
  .bento-bg-img {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }
  #hero .hero-grid,
  #hero .hero-copy > *,
  #hero .hero-panel,
  #hero .hero-panel .glass-panel > *,
  #hero .hero-scroll-cue {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
  }
  #hero .hero-scroll-cue { opacity: .5 !important; }
}



/* Lenis Recommended Base CSS */
html.lenis, html.lenis body { height: auto; width: 100%; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

