/* ============================================================
   MARUT-X LABS — Design Tokens
   ============================================================ */
:root {
  /* Color */
  --ink: #0F1410;           /* canopy-shadow black, dark sections */
  --paper: #F7F5EF;         /* warm paper, light sections */
  --paper-dim: #EFEBE0;     /* slightly deeper paper for cards */
  --canopy: #2E5339;        /* primary brand green */
  --canopy-light: #5B7553;  /* secondary green */
  --amber: #9C7A2E;         /* spectral "stress" band */
  --deficit: #C9504A;       /* spectral "deficit" band, sparing use */
  --soil: #D9D4C4;          /* dividers, borders on paper */
  --soil-dark: #2A332B;     /* dividers, borders on ink */
  --ink-muted: rgba(15, 20, 16, 0.62);
  --paper-muted: rgba(247, 245, 239, 0.66);

  /* Type */
  --font-display: "Marut Grotesk", "Neue Haas Grotesk Display", "Inter", -apple-system, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* Scale */
  --step-hero: clamp(2.75rem, 7vw, 6.5rem);
  --step-h1: clamp(2.25rem, 4.5vw, 3.75rem);
  --step-h2: clamp(1.5rem, 2.6vw, 2.25rem);
  --step-h3: clamp(1.125rem, 1.6vw, 1.375rem);
  --step-body: 1.0625rem;
  --step-small: 0.875rem;
  --step-micro: 0.75rem;

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root { --color-scheme: dark; }
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--canopy);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--canopy);
  color: var(--paper);
  padding: 0.6em 1em;
  z-index: 1000;
  font-family: var(--font-mono);
  font-size: var(--step-small);
}
.skip-link:focus { left: var(--gutter); top: var(--gutter); }

/* ============================================================
   Typography helpers
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--canopy);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.section-ink .eyebrow { color: var(--canopy-light); }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.04;
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}
.section-ink .section-label { color: var(--paper-muted); }

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 38em;
}
.section-ink .lede { color: var(--paper-muted); }

/* spectral divider — the page's recurring signature, used between sections */
.spectral-rule {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--canopy) 0%, var(--canopy) 38%, var(--amber) 64%, var(--deficit) 100%);
  opacity: 0.85;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-mono);
  font-size: var(--step-small);
  letter-spacing: 0.03em;
  padding: 0.85em 1.4em;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--canopy);
  color: var(--paper);
}
.btn-primary:hover { background: #244a31; }
.btn-ghost {
  background: transparent;
  border-color: var(--soil);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--canopy); color: var(--canopy); }
.section-ink .btn-ghost { border-color: var(--soil-dark); color: var(--paper); }
.section-ink .btn-ghost:hover { border-color: var(--canopy-light); color: var(--canopy-light); }
.btn-arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  background: rgba(247, 245, 239, 0);
  backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), backdrop-filter 0.3s var(--ease), color 0.3s var(--ease);
  color: var(--paper);
}
.site-header.is-scrolled {
  background: rgba(247, 245, 239, 0.82);
  backdrop-filter: blur(10px) saturate(140%);
  border-bottom-color: var(--soil);
  color: var(--ink);
}
.site-header:not(.is-scrolled) .main-nav a,
.site-header:not(.is-scrolled) .nav-links > a:not(.btn) { color: var(--paper-muted); }
.site-header:not(.is-scrolled) .nav-toggle span { background: var(--paper); }
.site-header.is-scrolled .nav-toggle span { background: var(--ink); }
.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 26px; height: 26px;
  flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 2.1rem;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 0.3em;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%; height: 1px;
  background: var(--canopy);
  transition: width 0.25s var(--ease);
}
.nav-links a:not(.btn):hover::after { width: 100%; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 2.1rem;
}
.nav-links ul {
  display: flex;
  gap: 2.1rem;
  margin: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 34px; height: 34px;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 6px; right: 6px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 12px; }
.nav-toggle span:nth-child(2) { top: 18px; }
.nav-toggle span:nth-child(3) { top: 24px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  padding-top: 6rem;
}
.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
#spectral-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,20,16,0.35) 0%, rgba(15,20,16,0.55) 55%, rgba(15,20,16,0.92) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #BFD4C2;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.7em;
}
.hero-eyebrow::before {
  content: "";
  width: 0.5em; height: 0.5em;
  border-radius: 50%;
  background: var(--canopy-light);
  box-shadow: 0 0 0 4px rgba(91,117,83,0.25);
  flex-shrink: 0;
}
.hero h1 {
  font-size: var(--step-hero);
  max-width: 16ch;
  color: var(--paper);
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #7FA587, #C9A24E);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede {
  margin-top: 1.6rem;
  max-width: 34em;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: var(--paper-muted);
}
.hero-actions {
  margin-top: 2.4rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero .btn-ghost {
  border-color: rgba(247,245,239,0.3);
  color: var(--paper);
}
.hero .btn-ghost:hover { border-color: var(--canopy-light); color: var(--canopy-light); }

.hero-readout {
  position: absolute;
  bottom: 2.4rem;
  left: 0; right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 var(--gutter);
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  color: var(--paper-muted);
}
.hero-readout dl {
  display: flex;
  gap: 2.2rem;
}
.hero-readout-item dt {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
  margin-bottom: 0.3em;
}
.hero-readout-item dd { margin: 0; color: var(--paper); font-size: 0.95rem; }
.hero-scroll-cue {
  display: flex;
  align-items: center;
  gap: 0.6em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero-scroll-cue svg { width: 12px; height: 16px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

@media (max-width: 720px) {
  .hero-readout { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .hero-readout dl { gap: 1.4rem; flex-wrap: wrap; }
}

/* ============================================================
   Sections (generic)
   ============================================================ */
section { position: relative; }
.section-pad { padding: clamp(4.5rem, 9vw, 8rem) 0; }
.section-ink { background: var(--ink); color: var(--paper); }
.section-paper { background: var(--paper); color: var(--ink); }
.section-paper-dim { background: var(--paper-dim); color: var(--ink); }

.section-head {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  max-width: 56em;
}
.section-head h2 { font-size: var(--step-h1); margin-top: 0.6rem; }
.section-head .lede { margin-top: 1rem; }

/* ============================================================
   Problem / Solution
   ============================================================ */
.ps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.ps-card h3 {
  font-size: var(--step-h3);
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-bottom: 1.2rem;
}
.ps-card .tag {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  color: var(--canopy);
  border: 1px solid var(--soil);
  padding: 0.25em 0.6em;
  border-radius: 2px;
}
.ps-card.deficit .tag { color: var(--deficit); }
.ps-list { display: flex; flex-direction: column; gap: 1.1rem; }
.ps-list li {
  display: flex;
  gap: 0.85em;
  font-size: 0.98rem;
  color: var(--ink-muted);
  line-height: 1.55;
}
.ps-list li::before {
  content: "";
  width: 6px; height: 6px;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--soil);
  flex-shrink: 0;
}
.ps-card.solution .ps-list li::before { background: var(--canopy); }

@media (max-width: 800px) {
  .ps-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ============================================================
   Focus Areas (R&D domains)
   ============================================================ */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--soil-dark);
  border: 1px solid var(--soil-dark);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.focus-card {
  background: var(--ink);
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 200px;
  transition: background 0.3s var(--ease);
}
.focus-card:hover { background: #161D17; }
.focus-index {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  color: var(--canopy-light);
}
.focus-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.focus-card p {
  font-size: 0.92rem;
  color: var(--paper-muted);
  line-height: 1.55;
}

@media (max-width: 980px) {
  .focus-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .focus-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Why Now / Why Us / Model — triptych
   ============================================================ */
.triptych {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.trip-card {
  padding: clamp(1.6rem, 2.5vw, 2.2rem);
  background: var(--paper);
  border: 1px solid var(--soil);
  border-radius: 4px;
}
.trip-card h3 {
  font-size: 1.05rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--canopy);
  margin-bottom: 1.1rem;
}
.trip-card ul { display: flex; flex-direction: column; gap: 0.9rem; }
.trip-card li {
  font-size: 0.95rem;
  color: var(--ink-muted);
  padding-left: 1.1em;
  position: relative;
  line-height: 1.5;
}
.trip-card li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--soil);
}

@media (max-width: 860px) {
  .triptych { grid-template-columns: 1fr; }
}

/* ============================================================
   Team
   ============================================================ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.team-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.team-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--paper-dim);
  border: 1px solid var(--soil);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.team-photo svg { width: 56px; height: 56px; color: var(--soil); }
.team-photo .initials {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--soil);
}
.team-name { font-size: 1.2rem; font-family: var(--font-display); font-weight: 650; }
.team-role {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--canopy);
}
.team-bio { font-size: 0.95rem; color: var(--ink-muted); max-width: 32em; }

@media (max-width: 720px) {
  .team-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ============================================================
   Contact / CTA
   ============================================================ */
.cta-section {
  text-align: left;
}
.cta-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: end;
}
.cta-grid h2 { font-size: var(--step-h1); }
.cta-meta {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}
.cta-meta dt { color: var(--paper-muted); text-transform: uppercase; letter-spacing: 0.07em; font-size: var(--step-micro); margin-bottom: 0.3em; }
.cta-meta dd { margin: 0; }
.cta-meta a { border-bottom: 1px solid var(--soil-dark); transition: border-color 0.25s var(--ease), color 0.25s var(--ease); }
.cta-meta a:hover { color: var(--canopy-light); border-color: var(--canopy-light); }
.cta-actions { margin-top: 2.2rem; display: flex; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 860px) {
  .cta-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: var(--paper-muted);
  padding: 2.4rem 0 2.8rem;
  border-top: 1px solid var(--soil-dark);
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: 0.85rem;
}
.footer-links { display: flex; gap: 1.6rem; }
.footer-links a:hover { color: var(--paper); }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-weight: 650;
  color: var(--paper);
}
.footer-brand .brand-mark svg { color: var(--canopy-light); }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Responsive nav (mobile)
   ============================================================ */
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 0;
    background: var(--ink);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateY(-100%);
    transition: transform 0.4s var(--ease);
    z-index: 90;
  }
  .nav-links.is-open { transform: translateY(0); }
  .nav-links ul {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  .nav-links a { color: var(--paper) !important; font-size: 1.05rem; }
  .nav-links .btn { margin-top: 0.5rem; }
}

/* Simple pages (privacy/terms/404) */
.simple-page {
  min-height: 70vh;
  padding-top: 9rem;
}
.simple-page h1 { font-size: var(--step-h1); margin-bottom: 1.5rem; }
.simple-page h2 { font-size: 1.3rem; margin: 2.2rem 0 0.8rem; }
.simple-page p, .simple-page li { color: var(--ink-muted); max-width: 60em; }
.simple-page ul { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.6rem; padding-left: 1.2rem; list-style: disc; }
.simple-page .updated { font-family: var(--font-mono); font-size: var(--step-small); color: var(--ink-muted); margin-bottom: 2.5rem; }
