/* ============================================
   AgentForge - Global Styles
   ============================================ */

/* CSS Variables */
:root {
  --color-black: #0a0a0a;
  --color-white: #ffffff;
  --color-gray-100: #f5f5f5;
  --color-gray-200: #e5e5e5;
  --color-gray-300: #d4d4d4;
  --color-gray-400: #a3a3a3;
  --color-gray-500: #737373;
  --color-gray-600: #525252;
  --color-gray-700: #404040;
  --color-gray-800: #262626;
  --color-gray-900: #171717;
  /* Monochrome-only palette (logo-inspired) */
  --color-ink: #0a0a0a;
  --color-paper: #ffffff;
  --color-accent: #0a0a0a;
  --color-accent-soft: #404040;
  --color-accent-deep: #000000;
  /* Legacy aliases mapped to monochrome for backward compatibility */
  --color-orange: #0a0a0a;
  --color-orange-light: #404040;
  --color-orange-dark: #000000;

  --font-serif: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --cursor-size: 12px;
  --cursor-hover-size: 48px;
  --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-medium: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-white);
  color: var(--color-black);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

/* Hide default cursor on all elements */
* {
  cursor: none !important;
}

@media (pointer: coarse) {
  body, * {
    cursor: auto !important;
  }
}

/* Selection */
::selection {
  background-color: var(--color-black);
  color: var(--color-white);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-black);
}

/* ============================================
   Custom Cursor
   ============================================ */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--cursor-size);
  height: var(--cursor-size);
  margin-left: calc(var(--cursor-size) / -2);
  margin-top: calc(var(--cursor-size) / -2);
  background-color: var(--color-white);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  transition: width var(--transition-medium), height var(--transition-medium),
              margin-left var(--transition-medium), margin-top var(--transition-medium),
              background-color var(--transition-fast), opacity var(--transition-fast);
  mix-blend-mode: difference;
}

.custom-cursor.hovering {
  width: var(--cursor-hover-size);
  height: var(--cursor-hover-size);
  margin-left: calc(var(--cursor-hover-size) / -2);
  margin-top: calc(var(--cursor-hover-size) / -2);
  background-color: var(--color-white);
  opacity: 0.9;
}

.custom-cursor.clicking {
  opacity: 0.6;
}

@media (pointer: coarse) {
  .custom-cursor {
    display: none !important;
  }
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.heading-xl {
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.heading-lg {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1;
}

.heading-md {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.1;
}

.text-body {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-gray-600);
}

.text-small {
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.text-accent {
  color: var(--color-black);
  font-weight: 600;
}

/* Legacy alias */
.text-orange {
  color: var(--color-black);
  font-weight: 600;
}

/* ============================================
   Navigation
   ============================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 3rem;
  /* Grid with 3 equal side columns keeps nav-links perfectly centered
     while nav-github stays flushed to the right. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-gray-200);
  transition: padding var(--transition-medium), background var(--transition-medium);
}

.site-nav.scrolled {
  padding: 1.125rem 3rem;
  background: rgba(255, 255, 255, 0.95);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  flex-shrink: 0;
  /* Fully offset the built-in left padding inside the SVG viewBox
     (Agent text starts at x=18 within a 185 wide viewBox).
     At 52px logo height: 18 * (52/51) ≈ 18.35px */
  margin-left: -18px;
}

.nav-brand img {
  height: 52px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: height var(--transition-medium), opacity var(--transition-fast);
}

.site-nav.scrolled .nav-brand img {
  height: 44px;
}

.nav-brand:hover img {
  opacity: 0.72;
}

.nav-brand span {
  color: var(--color-black);
  font-style: italic;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  /* Middle grid column: centered horizontally */
  grid-column: 2;
  justify-self: center;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-600);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-black);
  transition: width var(--transition-fast);
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--color-black);
}

.nav-links a.active::after {
  width: 100%;
}

.nav-github {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background-color: var(--color-black);
  color: var(--color-white);
  font-size: 0.875rem;
  font-weight: 500;
  /* Right grid column: align to the end (right edge) */
  grid-column: 3;
  justify-self: end;
  text-decoration: none;
  border-radius: 100px;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.nav-github:hover {
  background-color: var(--color-gray-800);
  transform: translateY(-2px);
}

.nav-github svg {
  width: 18px;
  height: 18px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-black);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

@media (max-width: 768px) {
  .site-nav {
    padding: 1rem 1.5rem;
    /* Collapse grid to a simple right-aligned layout on mobile:
       nav-links becomes a fixed slide-in drawer, nav-toggle stays right */
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }

  .site-nav.scrolled {
    /* Keep the same padding when scrolled on mobile to prevent
       the nav bar (and hamburger button) from visually shifting. */
    padding: 1rem 1.5rem;
  }

  .nav-brand {
    /* At 42px logo height: 18 * (42/51) ≈ 14.8px */
    margin-left: -15px;
  }

  .nav-brand img {
    height: 42px;
  }

  .site-nav.scrolled .nav-brand img {
    height: 36px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    flex-direction: column;
    gap: 2rem;
    padding: 5rem 2rem;
    background: var(--color-white);
    transition: right var(--transition-medium);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .nav-github {
    display: none;
  }
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  padding: 6rem 3rem 3rem;
  background-color: var(--color-black);
  color: var(--color-white);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 4rem;
}

.footer-brand {
  display: block;
  margin-bottom: 2rem;
  /* At 68px logo height: 18 * (68/51) ≈ 24px
     Aligns the "A" of the logo with the text below it */
  margin-left: -24px;
  line-height: 0;
}

.footer-brand img {
  height: 68px;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  /* Invert black logo to white on the dark footer background */
  filter: invert(1);
}

.footer-brand span {
  color: var(--color-white);
  font-style: italic;
  font-weight: 400;
}

.footer-desc {
  color: var(--color-gray-400);
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-500);
  margin-bottom: 1.5rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--color-gray-300);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-white);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--color-gray-800);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-gray-500);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ============================================
   Layout Utilities
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3rem;
}

.section {
  padding: 8rem 0;
}

.section-sm {
  padding: 4rem 0;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  .section {
    padding: 4rem 0;
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--color-black);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-gray-800);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-black);
  border: 1.5px solid var(--color-black);
}

.btn-outline:hover {
  background-color: var(--color-black);
  color: var(--color-white);
}

.btn-white {
  background-color: var(--color-white);
  color: var(--color-black);
}

.btn-white:hover {
  background-color: var(--color-black);
  color: var(--color-white);
}

/* ============================================
   Code Block Styling
   ============================================ */
pre {
  background-color: var(--color-gray-900);
  color: var(--color-gray-100);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

:not(pre) > code {
  background-color: var(--color-gray-100);
  color: var(--color-black);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  border: 1px solid var(--color-gray-200);
}

.code-block {
  position: relative;
  background-color: var(--color-gray-900);
  border-radius: 8px;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-gray-800);
  border-bottom: 1px solid var(--color-gray-700);
}

.code-lang {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-400);
}

.code-copy {
  background: none;
  border: none;
  color: var(--color-gray-400);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.code-copy:hover {
  color: var(--color-white);
}

.code-block pre {
  margin: 0;
  border-radius: 0;
}

/* Syntax highlighting colors */
.code-keyword { color: #ff7b72; }
.code-string { color: #a5d6ff; }
.code-comment { color: #8b949e; }
.code-function { color: #d2a8ff; }
.code-number { color: #79c0ff; }

/* ============================================
   Reveal Animation
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================
   Index Page - Hero Section
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 10rem 3rem 6rem;
  position: relative;
  overflow: hidden;
  background-color: var(--color-white);
}

.hero-content {
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
  /* Two-column layout: hero copy on the left, deploy command on the right */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 4rem;
  align-items: center;
}

.hero-main {
  min-width: 0;
}

.hero-code {
  min-width: 0;
  width: 100%;
}

.hero-code .code-block {
  box-shadow: 0 30px 60px -15px rgba(10, 10, 10, 0.25),
              0 10px 20px -10px rgba(10, 10, 10, 0.15);
}

.hero-code pre {
  background-color: transparent;
  color: var(--color-gray-100);
  padding: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.75;
}

.hero-label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-gray-500);
  margin-bottom: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-label::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background-color: var(--color-black);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--color-black);
  margin-bottom: 2rem;
}

/* Hero title rendered as the AgentForge logo.
   Parallax/reveal transforms are applied on the <h1> parent;
   the img keeps its own transform for precise alignment. */
.hero-title-logo {
  display: block;
  height: clamp(3rem, 6.5vw, 6rem);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  /* Precisely cancel the SVG viewBox's built-in left padding
     (Agent text starts at x=18 within 185 wide viewBox ≈ 9.73%) */
  transform: translateX(-9.73%);
}

.hero-subtitle {
  /* font-size: clamp(1.125rem, 2vw, 0.5rem); */
  line-height: 1.6;
  color: var(--color-gray-500);
  max-width: 560px;
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-decoration {
  position: absolute;
  right: -5%;
  top: 15%;
  width: 45vw;
  height: 45vw;
  max-width: 600px;
  max-height: 600px;
  border: 1px solid var(--color-gray-200);
  border-radius: 50%;
  opacity: 0.5;
  pointer-events: none;
}

.hero-decoration::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 70%;
  border: 1px solid var(--color-gray-200);
  border-radius: 50%;
}

.hero-decoration::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  height: 40%;
  border: 1px solid var(--color-gray-300);
  border-radius: 50%;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .hero {
    padding: 8rem 1.5rem 4rem;
  }

  .hero-code pre {
    font-size: 0.8125rem;
    padding: 1.25rem;
  }

  .hero-decoration {
    display: none;
  }
}

/* Collapse hero two-column layout to single column on tablets */
@media (max-width: 960px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-code {
    max-width: 600px;
  }
}

/* ============================================
   Index Page - Features Showcase
   ============================================ */
.features-section {
  padding: 8rem 0;
  background-color: var(--color-gray-100);
}

.features-header {
  text-align: center;
  margin-bottom: 6rem;
}

.features-header .text-small {
  margin-bottom: 1rem;
  display: block;
}

.features-header .heading-lg {
  max-width: 700px;
  margin: 0 auto;
}

.features-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}

.feature-card {
  position: relative;
  background: var(--color-white);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.feature-card-inner {
  transform-style: preserve-3d;
}

.feature-card:hover .feature-card-inner {
  will-change: transform;
}

.feature-image {
  /* Clickable div acting as a zoom trigger (role=button, tabindex=0) */
  cursor: zoom-in;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 1.25rem;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 20% 10%, rgba(10,10,10,0.05), transparent 55%),
    linear-gradient(135deg, var(--color-gray-100) 0%, var(--color-gray-200) 100%);
  border-bottom: 1px solid var(--color-gray-200);
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

/* Shine sweep overlay on hover */
.feature-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 60%,
    transparent 100%
  );
  transform: translateX(-120%);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}

.feature-card:hover .feature-image::before {
  transform: translateX(120%);
}

.feature-image img {
  /* Fill the padded area of the container */
  position: absolute;
  inset: 1.25rem;
  width: calc(100% - 2.5rem);
  height: calc(100% - 2.5rem);
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(10, 10, 10, 0.12));
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.4s ease;
}

.feature-card:hover .feature-image img {
  transform: scale(1.04) translateY(-2px);
  filter: drop-shadow(0 18px 32px rgba(10, 10, 10, 0.18));
  will-change: transform;
}

/* Floating zoom-in indicator */
.feature-image-zoom {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.82);
  color: var(--color-white);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.35s ease,
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.25s ease;
  pointer-events: none;
  z-index: 3;
}

.feature-image-zoom svg {
  width: 18px;
  height: 18px;
}

.feature-card:hover .feature-image-zoom,
.feature-image:focus-visible .feature-image-zoom {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.feature-image:hover .feature-image-zoom {
  background: var(--color-black);
}

.feature-image:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 3px;
}

.feature-info {
  padding: 2rem;
}

.feature-info h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-black);
}

.feature-info p {
  color: var(--color-gray-500);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.feature-number {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  font-style: italic;
  color: var(--color-black);
  opacity: 0.08;
  line-height: 1;
  z-index: 2;
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
    padding: 0 1.5rem;
  }

  .features-section {
    padding: 4rem 0;
  }
}

/* ============================================
   Index Page - Tech Stack
   ============================================ */
.tech-section {
  padding: 8rem 0;
  background-color: var(--color-white);
}

.tech-header {
  text-align: center;
  margin-bottom: 4rem;
}

.tech-grid {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 3rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  border: 1px solid var(--color-gray-200);
  border-radius: 4px;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
  color: var(--color-black);
}

.tech-item:hover {
  border-color: var(--color-black);
  background-color: var(--color-black);
  color: var(--color-white);
  transform: translateY(-4px);
}

.tech-item:hover .tech-icon svg path,
.tech-item:hover .tech-icon svg circle,
.tech-item:hover .tech-icon svg rect {
  stroke: var(--color-white);
}

.tech-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tech-icon svg {
  width: 100%;
  height: 100%;
}

.tech-name {
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

.tech-cat {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--color-gray-400);
  text-align: center;
  text-transform: uppercase;
  transition: color var(--transition-fast);
  margin-top: -0.5rem;
}

.tech-item:hover .tech-cat {
  color: rgba(255, 255, 255, 0.7);
}

.tech-item-more {
  border-style: dashed;
  background-color: var(--color-gray-50, #fafafa);
}

.tech-item-more:hover {
  border-style: solid;
}

.tech-item-more .tech-cat {
  color: var(--color-gray-600, #525252);
  text-transform: none;
  letter-spacing: 0.02em;
}

.tech-item-more:hover .tech-icon svg circle {
  fill: var(--color-white);
}

@media (max-width: 768px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 1.5rem;
  }
}

/* ============================================
   Index Page - Install Section
   ============================================ */
.install-section {
  padding: 8rem 0;
  background-color: var(--color-black);
  color: var(--color-white);
}

.install-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 3rem;
  text-align: center;
}

.install-section .heading-lg {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.install-section .text-body {
  color: var(--color-gray-400);
  margin-bottom: 3rem;
}

.install-code {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
}

.install-code .code-block {
  background-color: var(--color-gray-900);
  border: 1px solid var(--color-gray-800);
}

.install-code .code-header {
  background-color: var(--color-gray-800);
}

.install-code pre {
  background-color: transparent;
  color: var(--color-gray-100);
}

@media (max-width: 768px) {
  .install-content {
    padding: 0 1.5rem;
  }
}

/* ============================================
   Index Page - CTA Section
   ============================================ */
.cta-section {
  padding: 8rem 0;
  background-color: var(--color-white);
  text-align: center;
}

.cta-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 3rem;
}

.cta-section .heading-lg {
  margin-bottom: 1.5rem;
}

.cta-section .text-body {
  margin-bottom: 2.5rem;
}

/* ============================================
   Docs Page Styles
   ============================================ */
.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 80px;
}

.docs-sidebar {
  position: fixed;
  top: 80px;
  left: 0;
  width: 280px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 2rem;
  border-right: 1px solid var(--color-gray-200);
  background-color: var(--color-white);
}

.docs-sidebar-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.docs-nav {
  list-style: none;
}

.docs-nav li {
  margin-bottom: 0.25rem;
}

.docs-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--color-gray-600);
  text-decoration: none;
  font-size: 0.9375rem;
  border-radius: 4px;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.docs-nav a:hover {
  color: var(--color-black);
  background-color: var(--color-gray-100);
}

.docs-nav a.active {
  color: var(--color-black);
  background-color: var(--color-gray-100);
  font-weight: 600;
  border-left: 2px solid var(--color-black);
  padding-left: calc(0.75rem - 2px);
}

.docs-nav-group {
  margin-bottom: 1.5rem;
}

.docs-nav-heading {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gray-400);
  margin-bottom: 0.5rem;
  padding: 0 0.75rem;
}

.docs-main {
  margin-left: 280px;
  flex: 1;
  padding: 3rem;
  max-width: 900px;
}

.docs-section {
  margin-bottom: 4rem;
}

.docs-section h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-gray-200);
}

.docs-section h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.docs-section h4 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

.docs-section p {
  margin-bottom: 1rem;
  color: var(--color-gray-600);
}

.docs-section ul,
.docs-section ol {
  margin: 1rem 0 1rem 1.5rem;
  color: var(--color-gray-600);
}

.docs-section li {
  margin-bottom: 0.5rem;
}

.docs-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.docs-section th,
.docs-section td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-gray-200);
}

.docs-section th {
  font-weight: 600;
  color: var(--color-black);
  background-color: var(--color-gray-100);
}

.docs-section td {
  color: var(--color-gray-600);
}

.docs-section td code {
  font-size: 0.8em;
}

.docs-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-black);
  color: var(--color-white);
  border: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Docs footer layout (desktop: aligned with main content 280px offset).
   MUST be declared BEFORE the responsive media queries below,
   otherwise later rules with the same specificity will override the
   mobile (margin-left: 0) overrides inside @media blocks. */
.docs-footer {
  margin-left: 280px;
}

.docs-footer-bottom {
  max-width: 900px;
  margin: 0 auto;
  border: none;
  padding: 2rem 3rem;
}

@media (max-width: 1024px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-medium);
    z-index: 99;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  }

  .docs-sidebar.open {
    transform: translateX(0);
  }

  .docs-main {
    margin-left: 0;
    padding: 2rem 1.5rem;
    max-width: 100%;
  }

  .docs-sidebar-toggle {
    display: flex;
  }

  .docs-footer {
    margin-left: 0;
    padding: 3rem 1.5rem 2rem;
  }

  .docs-footer-bottom {
    max-width: 100%;
    padding: 1.5rem 0 0;
  }
}

/* Mobile docs content adjustments */
@media (max-width: 768px) {
  .docs-main {
    padding: 1.5rem 1rem;
  }

  .docs-section h2 {
    font-size: 1.5rem;
  }

  .docs-section h3 {
    font-size: 1.25rem;
  }

  .docs-section table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    font-size: 0.875rem;
  }

  .docs-section th,
  .docs-section td {
    padding: 0.6rem 0.75rem;
  }

  .docs-section pre {
    padding: 1rem;
    font-size: 0.8125rem;
  }

  .docs-section p code,
  .docs-section li code,
  .docs-section td code {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .docs-footer {
    padding: 2.5rem 1rem 1.5rem;
  }

  .docs-footer-bottom {
    padding: 1rem 0 0;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
  }
}

/* ============================================
   About Page Styles
   ============================================ */
.about-hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10rem 3rem 4rem;
  background-color: var(--color-white);
}

.about-hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-hero .heading-xl {
  margin-bottom: 1.5rem;
}

.about-hero .text-body {
  max-width: 600px;
  margin: 0 auto;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 3rem 6rem;
}

.about-content h3 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin: 3rem 0 1rem;
}

.about-content p {
  color: var(--color-gray-600);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.about-content a {
  color: var(--color-black);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--color-gray-400);
  transition: border-color var(--transition-fast);
}

.about-content a:hover {
  border-bottom-color: var(--color-black);
  border-bottom-width: 2px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 3rem 0;
  padding: 2rem;
  background-color: var(--color-gray-100);
  border-radius: 4px;
}

.about-stat {
  text-align: center;
}

.about-stat-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-black);
  line-height: 1;
}

.about-stat-label {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .about-hero {
    padding: 8rem 1.5rem 3rem;
  }

  .about-content {
    padding: 0 1.5rem 4rem;
  }

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

/* ============================================
   Image Lightbox (feature screenshots zoom)
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(10, 10, 10, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  visibility: hidden;
  transition: background 0.35s ease,
              backdrop-filter 0.35s ease,
              -webkit-backdrop-filter 0.35s ease,
              opacity 0.35s ease,
              visibility 0s linear 0.35s;
}

.lightbox.open {
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 1;
  visibility: visible;
  transition: background 0.35s ease,
              backdrop-filter 0.35s ease,
              -webkit-backdrop-filter 0.35s ease,
              opacity 0.35s ease,
              visibility 0s linear 0s;
}

.lightbox-stage {
  position: relative;
  max-width: min(1280px, 92vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.35s ease;
}

.lightbox.open .lightbox-stage {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(255, 255, 255, 0.08);
  background: var(--color-white);
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 720px;
  line-height: 1.5;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease,
              transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.2s ease;
  z-index: 10000;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
  transform: rotate(90deg);
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
}

.lightbox-hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .lightbox {
    padding: 3vh 3vw;
  }
  .lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
  }
  .lightbox-hint { display: none; }
}

/* ============================================
   Hero Visual - Data Flow Diagram
   ============================================ */
.hero-visual {
  min-width: 0;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.hero-flow {
  width: 100%;
  height: auto;
  display: block;
  max-width: 1000px;
  margin-left: auto;
  filter: drop-shadow(0 24px 48px rgba(10, 10, 10, 0.05));
  overflow: visible;
}

/* Concentric decorative rings */
.hero-flow .ring {
  stroke: var(--color-gray-200);
  stroke-width: 1;
}
.hero-flow .ring-solid {
  stroke: var(--color-gray-200);
}
.hero-flow .ring-dashed {
  stroke: var(--color-gray-300);
  stroke-dasharray: 2 6;
}
.hero-flow .ring-dashed-lg {
  stroke: var(--color-gray-200);
  stroke-dasharray: 1 8;
}

/* Beam tracks (faint base line) */
.hero-flow .beam-track {
  stroke: rgba(10, 10, 10, 0.08);
  stroke-width: 1;
  fill: none;
}

/* Beam flows (short bright segment sliding) */
.hero-flow .beam-flow {
  stroke: var(--color-black);
  stroke-width: 1.5;
  stroke-dasharray: 14 180;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 0 3px rgba(10, 10, 10, 0.35));
}
.hero-flow .beam-flow-out {
  stroke-dasharray: 18 180;
}

/* Nodes (source & agent) */
.hero-flow .node-ring {
  fill: #ffffff;
  stroke: var(--color-black);
  stroke-width: 1.5;
}
.hero-flow .node-dot {
  fill: var(--color-black);
  animation: herofx-blink 2.2s ease-in-out infinite;
}
.hero-flow .node-agent .node-ring {
  fill: var(--color-black);
}
.hero-flow .node-agent .node-dot {
  fill: #ffffff;
}
.hero-flow .node-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  fill: var(--color-black);
  letter-spacing: 0.02em;
}
.hero-flow .node-agent .node-label {
  font-weight: 600;
}

/* Stagger the blink on each node */
.hero-flow .nodes-left .node:nth-child(2) .node-dot { animation-delay: 0.3s; }
.hero-flow .nodes-left .node:nth-child(3) .node-dot { animation-delay: 0.6s; }
.hero-flow .nodes-left .node:nth-child(4) .node-dot { animation-delay: 0.9s; }
.hero-flow .nodes-left .node:nth-child(5) .node-dot { animation-delay: 1.2s; }
.hero-flow .nodes-left .node:nth-child(6) .node-dot { animation-delay: 1.5s; }
.hero-flow .nodes-right .node:nth-child(1) .node-dot { animation-delay: 0.4s; }
.hero-flow .nodes-right .node:nth-child(2) .node-dot { animation-delay: 0.9s; }
.hero-flow .nodes-right .node:nth-child(3) .node-dot { animation-delay: 1.4s; }

@keyframes herofx-blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Core */
.hero-flow .core-bg {
  fill: var(--color-black);
}
.hero-flow .core-outer {
  stroke: var(--color-gray-400);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.hero-flow .core-f {
  pointer-events: none;
}
.hero-flow .scan-line {
  stroke: #ffffff;
  stroke-width: 1;
  stroke-opacity: 0.55;
  stroke-linecap: round;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-visual { max-width: 640px; margin: 0 auto; }
  .hero-flow {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}
@media (max-width: 640px) {
  /* SVG viewBox is 640x480; at 375px screen width, 1 SVG unit ≈ 0.586 px.
     Bump label font-size so the final rendered size stays ≥ 9-10 px. */
  .hero-flow .node-label { font-size: 17px; }
  .hero-flow .node-agent .node-label { font-size: 17px; }
}
@media (max-width: 420px) {
  .hero-flow .node-label,
  .hero-flow .node-agent .node-label { font-size: 19px; }
}

/* Reduced motion: stop animations */
@media (prefers-reduced-motion: reduce) {
  .hero-flow .beam-flow,
  .hero-flow .node-dot,
  .hero-flow .ring,
  .hero-flow .core-outer {
    animation: none;
  }
  .hero-flow .pulse,
  .hero-flow .beam-flow,
  .hero-flow .core-scanner {
    display: none;
  }
}
