/* ===========================================================
   ZeinLabs — design tokens
   Concept: systems schematic. Cool mint-paper / teal-dusk grounds,
   one amber accent. Monospace display (engineering register),
   Archivo body (humanist warmth). Hairline modules, not soft cards.
=========================================================== */

@font-face {
  font-family: 'JetBrains Mono';
  src: local('JetBrains Mono');
}

:root {
  --ink: #12211c;
  --paper: #f5f7f1;
  --paper-raised: #eceee4;
  --teal: #1c6d57;
  --teal-strong: #0c4a3a;
  --amber: #f2860f;
  --amber-ink: #2b1400;
  --sage: #6c8577;
  --line: rgba(18, 33, 28, 0.14);
  --shadow-line: rgba(18, 33, 28, 0.08);

  --font-display: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, 'Cascadia Code', 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-body: 'Archivo', 'Archivo Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --measure: 62ch;
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eaf3ec;
    --paper: #0a1815;
    --paper-raised: #11251f;
    --teal: #2fb589;
    --teal-strong: #6bf0bf;
    --amber: #ffab35;
    --amber-ink: #251100;
    --sage: #6fa08c;
    --line: rgba(234, 243, 236, 0.15);
    --shadow-line: rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  --ink: #eaf3ec;
  --paper: #0a1815;
  --paper-raised: #11251f;
  --teal: #2fb589;
  --teal-strong: #6bf0bf;
  --amber: #ffab35;
  --amber-ink: #251100;
  --sage: #6fa08c;
  --line: rgba(234, 243, 236, 0.15);
  --shadow-line: rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] {
  --ink: #12211c;
  --paper: #f5f7f1;
  --paper-raised: #eceee4;
  --teal: #1c6d57;
  --teal-strong: #0c4a3a;
  --amber: #f2860f;
  --amber-ink: #2b1400;
  --sage: #6c8577;
  --line: rgba(18, 33, 28, 0.14);
  --shadow-line: rgba(18, 33, 28, 0.08);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

/* ---------- Type scale ---------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 3.6vw + 1rem, 4.4rem); line-height: 1.04; }
h2 { font-size: clamp(1.7rem, 1.8vw + 1rem, 2.5rem); line-height: 1.12; }
h3 { font-size: 1.15rem; line-height: 1.3; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-strong);
}

p.lede {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--ink);
  opacity: 0.82;
  max-width: 46ch;
}

.container {
  width: min(1180px, 100% - 3rem);
  margin-inline: auto;
}

.section {
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
  border-bottom: 1px solid var(--line);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-mark {
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
}
.brand-mark circle { fill: var(--amber); }
.brand-mark path { stroke: var(--teal-strong); stroke-width: 1.6; fill: none; stroke-linecap: round; }

nav.primary-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
nav.primary-nav a {
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.75;
  transition: opacity 0.15s ease;
}
nav.primary-nav a:hover { opacity: 1; }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
}
.theme-toggle svg { width: 1.05rem; height: 1.05rem; stroke: var(--ink); }
.theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  .theme-toggle .icon-sun { display: none; }
  .theme-toggle .icon-moon { display: block; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  place-items: center;
}
.nav-toggle svg { width: 1.1rem; height: 1.1rem; stroke: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-amber {
  background: var(--amber);
  color: var(--amber-ink);
}
.btn-amber:hover { filter: brightness(1.06); }
.btn-line {
  border-color: var(--line);
  color: var(--ink);
}
.btn-line:hover { border-color: var(--teal); }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}
.hero-copy .eyebrow { margin-bottom: 1rem; display: block; }
.hero-copy h1 { margin-bottom: 1.25rem; }
.hero-copy h1 em {
  font-style: normal;
  color: var(--teal-strong);
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.hero-note {
  font-size: 0.85rem;
  color: var(--sage);
}
.hero-diagram {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--teal) 7%, transparent), transparent 60%),
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 32px),
    var(--paper-raised);
  background-blend-mode: normal, soft-light, soft-light, normal;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.15rem;
  box-shadow: 0 1.5rem 3rem -1.75rem var(--shadow-line), inset 0 0 0 1px transparent;
}
.hero-diagram canvas {
  width: 100%;
  flex: 1;
  min-height: 0;
}
.diagram-corner {
  position: absolute;
  width: 0.85rem;
  height: 0.85rem;
  z-index: 2;
  pointer-events: none;
}
.diagram-corner::before,
.diagram-corner::after {
  content: "";
  position: absolute;
  background: var(--teal);
}
.diagram-corner::before { width: 100%; height: 1.5px; }
.diagram-corner::after { width: 1.5px; height: 100%; }
.diagram-corner.tl { top: 0.55rem; left: 0.55rem; }
.diagram-corner.tr { top: 0.55rem; right: 0.55rem; }
.diagram-corner.bl { bottom: 0.55rem; left: 0.55rem; }
.diagram-corner.br { bottom: 0.55rem; right: 0.55rem; }
.diagram-corner.tl::before, .diagram-corner.tl::after { top: 0; left: 0; }
.diagram-corner.tr::before { top: 0; right: 0; }
.diagram-corner.tr::after { top: 0; right: 0; }
.diagram-corner.bl::before { bottom: 0; left: 0; }
.diagram-corner.bl::after { bottom: 0; left: 0; }
.diagram-corner.br::before { bottom: 0; right: 0; }
.diagram-corner.br::after { bottom: 0; right: 0; }

.diagram-readout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.15rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
  position: relative;
  z-index: 1;
}
.diagram-readout.top span:first-child { color: var(--ink); opacity: 0.7; }
.diagram-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.diagram-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 25%, transparent);
}

/* ---------- Stat strip ---------- */
.stat-strip {
  border-bottom: 1px solid var(--line);
}
.stat-strip .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 1.6rem clamp(0.75rem, 2vw, 1.75rem);
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; }
.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--teal-strong);
}
.stat-label {
  font-size: 0.82rem;
  color: var(--sage);
  margin-top: 0.3rem;
}

/* ---------- Section heads ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.section-head h2 { max-width: 20ch; }
.section-head p.lede { margin-bottom: 0; }

/* ---------- Services grid (schematic modules) ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.service-module {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}
.service-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber-ink);
  background: var(--amber);
  align-self: flex-start;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
}
.service-module h3 { margin-top: 0.25rem; }
.service-module p {
  font-size: 0.94rem;
  color: var(--ink);
  opacity: 0.78;
}
.service-module ul {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.service-module li {
  font-size: 0.85rem;
  padding-left: 1rem;
  position: relative;
  opacity: 0.85;
}
.service-module li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  background: var(--teal);
}

/* ---------- Audience split ---------- */
.audience-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.audience-panel {
  background: var(--paper);
  padding: clamp(1.75rem, 3vw, 2.75rem);
}
.audience-panel.enterprise { background: var(--paper-raised); }
.audience-panel .eyebrow { display: block; margin-bottom: 0.75rem; }
.audience-panel h3 { font-size: 1.4rem; margin-bottom: 0.9rem; }
.audience-panel ul { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.25rem; }
.audience-panel li {
  font-size: 0.92rem;
  padding-left: 1.1rem;
  position: relative;
  opacity: 0.85;
}
.audience-panel li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--teal);
}

/* ---------- Process (real sequence) ---------- */
.process-line {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
}
.process-line::before {
  content: "";
  position: absolute;
  top: 0.65rem;
  left: 2%;
  right: 2%;
  height: 1px;
  background: var(--line);
}
.process-step {
  padding-right: 1.5rem;
  position: relative;
}
.process-index {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--paper);
  background: var(--teal-strong);
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
}
.process-step h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.process-step p { font-size: 0.86rem; opacity: 0.78; }

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.pricing-panel {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.pricing-panel.featured { background: var(--paper-raised); }
.pricing-panel .eyebrow { display: block; }
.pricing-panel h3 { font-size: 1.3rem; }
.pricing-panel .pricing-desc { font-size: 0.9rem; opacity: 0.78; }
.pricing-panel ul { display: flex; flex-direction: column; gap: 0.55rem; flex-grow: 1; }
.pricing-panel li {
  font-size: 0.86rem;
  padding-left: 1.1rem;
  position: relative;
  opacity: 0.85;
}
.pricing-panel li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--teal-strong);
  font-size: 0.8rem;
}
.pricing-panel .btn { justify-content: center; margin-top: 0.5rem; }

/* ---------- FAQ ---------- */
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 0;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.02rem;
}
.faq-question .plus {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--teal);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.faq-item[data-open="true"] .plus { transform: rotate(45deg); }
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.faq-item[data-open="true"] .faq-answer { grid-template-rows: 1fr; }
.faq-answer-inner { overflow: hidden; }
.faq-answer p {
  padding-bottom: 1.35rem;
  max-width: var(--measure);
  font-size: 0.95rem;
  opacity: 0.8;
}

/* ---------- Final CTA ---------- */
.cta-band {
  padding-block: clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.cta-band .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-band h2 { max-width: 18ch; }
.cta-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---------- Footer ---------- */
footer.site-footer { padding-block: 2.5rem; }
footer.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 700; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { text-decoration: none; font-size: 0.85rem; opacity: 0.7; }
.footer-links a:hover { opacity: 1; }
.footer-meta { font-size: 0.8rem; color: var(--sage); }

/* ---------- Mobile nav ---------- */
.mobile-nav {
  position: fixed;
  inset: 4.5rem 0 0 0;
  background: var(--paper);
  z-index: 30;
  display: none;
  flex-direction: column;
  padding: 2rem;
  gap: 1.5rem;
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--ink);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  nav.primary-nav { display: none; }
  .nav-toggle { display: grid; }
  .header-actions .btn-amber { display: none; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-diagram { order: -1; max-width: 420px; margin: 0 auto; }
  .stat-strip .container { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .audience-grid { grid-template-columns: 1fr; }
  .process-line { grid-template-columns: repeat(2, 1fr); row-gap: 2rem; }
  .process-line::before { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: start; }
}
@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
  .stat-strip .container { grid-template-columns: repeat(2, 1fr); }
}
