@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #06090E;
  --bg-surface: #0B111A;
  --bg-card: rgba(13, 20, 32, 0.85);
  --bg-card-hover: rgba(18, 28, 46, 0.95);
  --brand-green: #00A859;
  --brand-green-light: #00E676;
  --brand-green-glow: rgba(0, 168, 89, 0.35);
  --accent-cyan: #00E5FF;
  --accent-amber: #F59E0B;
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 168, 89, 0.45);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', "SFMono-Regular", Consolas, Menlo, monospace;
  --container-max: 1280px;
  --space-section: clamp(2.5rem, 6vw, 4.5rem);
  --space-container-x: clamp(1.25rem, 4vw, 2rem);
}

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

/* Fluid root type scale: every rem-based size in this file scales smoothly
   with viewport width instead of jumping at fixed breakpoints. This is the
   base of the whole responsive system — see README note in footer of file. */
html {
  scroll-behavior: smooth;
  font-size: clamp(15px, 0.55vw + 13px, 18px);
}

img, svg { max-width: 100%; height: auto; display: block; }

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 168, 89, 0.16) 0%, transparent 55%),
    radial-gradient(circle at 85% 35%, rgba(0, 229, 255, 0.04) 0%, transparent 40%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4 { font-weight: 700; color: #FFFFFF; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.1rem, 2.4vw + 1.8rem, 2.85rem); line-height: 1.18; margin-bottom: 1.25rem; }
h2 { font-size: 1.95rem; line-height: 1.25; margin-bottom: 0.85rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
h4 { font-size: 1rem; margin-bottom: 0.5rem; font-family: var(--font-mono); color: #E2E8F0; }
p { margin-bottom: 1.25rem; color: var(--text-secondary); font-size: 1rem; }
strong { color: #FFFFFF; }

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--brand-green-light);
  background: rgba(0, 168, 89, 0.08);
  border: 1px solid rgba(0, 168, 89, 0.25);
  padding: 5px 14px;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green-light);
  box-shadow: 0 0 10px var(--brand-green);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border: 1px solid var(--border-active);
  color: var(--brand-green-light);
  background: rgba(0, 168, 89, 0.1);
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
  border-radius: 4px;
}

/* =======================================================
   HARMONIZED DARK TOP NAVBAR — MODERN & STREAMLINED
   ======================================================= */
header.site-header {
  background: rgba(6, 9, 14, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background 0.3s ease;
}

.header-container {
  position: relative;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.6rem var(--space-container-x);
  min-height: clamp(4rem, 9vw, 5.25rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Logo — single real asset (icon + wordmark baked in by the designer), sized
   with clamp() so it scales smoothly with the viewport instead of jumping at
   a breakpoint. No text is re-created in HTML/CSS. */
.brand-wrapper {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
  flex-shrink: 0;
}

.brand-wrapper:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 12px var(--brand-green-glow));
}

.brand-logo {
  height: clamp(2.35rem, 5vw, 3.25rem);
  width: auto;
}

/* Mobile nav toggle (hamburger) — hidden on desktop, shown under the nav
   breakpoint below */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #E2E8F0;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Navigation Links */
nav.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.2vw, 1.85rem);
  flex-wrap: wrap;
}

nav.main-nav a {
  text-decoration: none;
  color: #CBD5E1;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
}

nav.main-nav a:hover {
  color: #FFFFFF;
  transform: translateY(-1px);
}

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: #CBD5E1;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease;
}

.dropdown-trigger:hover {
  color: #FFFFFF;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 280px;
  max-width: 88vw;
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  border-radius: 6px;
  overflow: hidden;
}

.dropdown-content a {
  display: block;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover {
  background: rgba(0, 168, 89, 0.12);
  color: var(--brand-green-light);
}

/* Hover-to-open only on devices that actually have a mouse/pointer.
   Touch devices rely on the JS click-toggle (adds/removes .is-open) below. */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .dropdown-content { display: block; }
}

.dropdown-content.is-open { display: block; }

/* Clean Labs Menu Link (No Brackets, Sleek Subtitle Tag) */
.nav-labs-link {
  color: var(--brand-green-light) !important;
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-labs-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 6px;
  background: rgba(0, 168, 89, 0.15);
  border: 1px solid rgba(0, 168, 89, 0.4);
  border-radius: 3px;
  color: var(--brand-green-light);
  text-transform: uppercase;
}

/* Streamlined, Smooth Contact Button */
.btn-nav-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  height: 38px;
  background: var(--brand-green);
  color: #FFFFFF !important;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--brand-green);
  border-radius: 9999px;
  box-shadow: 0 0 18px var(--brand-green-glow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-nav-contact:hover {
  background: #00BF63;
  border-color: #00BF63;
  box-shadow: 0 0 26px rgba(0, 168, 89, 0.6);
  transform: translateY(-2px);
}

/* Regular Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.65rem;
  height: 48px;
  background: var(--brand-green);
  color: #FFFFFF;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--brand-green);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 24px var(--brand-green-glow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  background: #00BF63;
  border-color: #00BF63;
  box-shadow: 0 0 34px rgba(0, 168, 89, 0.6);
  transform: translateY(-3px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.4rem;
  height: 48px;
  background: rgba(255, 255, 255, 0.04);
  color: #FFFFFF;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--brand-green-light);
  transform: translateY(-3px);
}

/* Layout Containers */
.page-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-section) var(--space-container-x);
  flex: 1;
  width: 100%;
}

.section-block {
  padding: var(--space-section) 0;
  border-bottom: 1px solid var(--border-hairline);
  position: relative;
}

.section-block:last-child { border-bottom: none; }

/* Hero split: two fluid tracks that keep the 7:5 ratio as long as each has
   room to be at least 320px, then wrap to a single column automatically —
   no breakpoint needed for this one. */
.grid-split-7-5 {
  display: grid;
  grid-template-columns: minmax(320px, 7fr) minmax(300px, 5fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

/* Card grids reflow by available space (ratio-based), not a fixed column
   count — 3-up on wide screens, 2-up on medium, 1-up on narrow, and
   everything in between, with no hardcoded breakpoint jump. */
.grid-3-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

.grid-2-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

/* Glassmorphism Cards */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-hairline);
  padding: 2.25rem;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.panel-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 168, 89, 0.15);
}

.panel-card.dashed-border { border-style: dashed; }

/* Visual Viewports */
.visual-card {
  background: #090E17;
  border: 1px solid rgba(0, 168, 89, 0.35);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 168, 89, 0.12);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.visual-card:hover {
  border-color: var(--brand-green-light);
  transform: translateY(-2px);
}

.visual-card-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-hairline);
  padding: 0.95rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.8vw, 0.78rem);
  color: var(--text-muted);
}

.visual-card-body { padding: 1.5rem; }

.flow-diagram-panel {
  background: #080C14;
  border: 1px solid var(--border-hairline);
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border-radius: 6px;
}

/* Forms */
.form-group { margin-bottom: 1.75rem; }
.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
  font-weight: 600;
  color: #E2E8F0;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.95rem 1.25rem;
  background: rgba(13, 19, 31, 0.85);
  border: 1px solid var(--border-hairline);
  font-family: inherit;
  font-size: 0.95rem;
  color: #FFFFFF;
  outline: none;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 16px var(--brand-green-glow);
}

.dynamic-field { display: none; }

/* Interactive Footer */
footer.site-footer {
  border-top: 1px solid var(--border-hairline);
  background: #04070C;
  padding: 4rem 2rem 2.5rem;
  margin-top: auto;
}

.footer-container { max-width: 1280px; margin: 0 auto; }

.footer-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 10px 20px;
  background: rgba(13, 20, 32, 0.9);
  border: 1px solid rgba(0, 168, 89, 0.25);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  color: #E2E8F0;
  margin-bottom: 3rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

.footer-meta-pill:hover {
  transform: translateY(-3px);
  border-color: var(--brand-green-light);
  box-shadow: 0 8px 30px rgba(0, 168, 89, 0.25);
  color: #FFFFFF;
}

.footer-meta-pill .node {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green-light);
  box-shadow: 0 0 10px var(--brand-green);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: clamp(1.75rem, 4vw, 2.5rem);
  font-size: 0.88rem;
}

.footer-links strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-bottom: 1rem;
  color: #E2E8F0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links a {
  display: block;
  text-decoration: none;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
  transition: color 0.2s, transform 0.2s;
}

.footer-links a:hover {
  color: var(--brand-green-light);
  transform: translateX(2px);
}

/* =======================================================
   RESPONSIVE MEDIA QUERIES (DESKTOP, TABLET, MOBILE)
   ======================================================= */
/* Below this width the hero's two fluid tracks can no longer both honor
   their min-width, so we collapse to a single column explicitly. Card
   grids and the footer need no equivalent rule — their auto-fit tracks
   already reflow continuously at any width. */
@media (max-width: 700px) {
  .grid-split-7-5 {
    grid-template-columns: 1fr;
  }
}

/* Nav breakpoint: swap the inline nav for a collapsible hamburger panel.
   Everything else on the page keeps reflowing fluidly regardless of this
   breakpoint — this one is purely about the nav's own interaction model. */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  nav.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-hairline);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    padding: 0.5rem 0;
  }

  nav.main-nav.is-open { display: flex; }

  nav.main-nav a, .dropdown-trigger {
    width: 100%;
    padding: 0.9rem var(--space-container-x);
    font-size: 1rem;
  }

  .btn-nav-contact {
    margin: 0.5rem var(--space-container-x);
    width: calc(100% - 2 * var(--space-container-x));
  }

  .nav-dropdown { width: 100%; }

  .dropdown-content {
    position: static;
    min-width: 0;
    max-width: none;
    width: 100%;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.02);
  }

  .dropdown-content a { padding-left: calc(var(--space-container-x) + 1rem); }
}
