/* ==========================================================================
   iCodeAI — Design System
   Display: Space Grotesk / Body: Inter / Data & code accents: IBM Plex Mono
   Palette: charcoal ink, warm paper, deep teal signal, gold accent
   ========================================================================== */

:root{
  --ink: #14161B;
  --ink-soft: #1D2027;
  --ink-softer: #262A33;
  --paper: #F5F6F2;
  --paper-dim: #EBEDE6;
  --paper-line: #DBDDD4;
  --line-on-ink: #343948;

  --signal: #235C4C;       /* deep teal-green — primary brand */
  --signal-bright: #2FA98A;/* brighter teal for dark-bg accents */
  --gold: #D69A3C;         /* warm gold — sparing CTA accent */
  --gold-bright: #E8B565;

  --text-primary: #15171C;
  --text-muted: #565B54;
  --text-muted-2: #7A7F76;
  --text-inverse: #F2F3EE;
  --text-inverse-muted: #A7ACA0;

  --radius-sm: 3px;
  --radius-md: 6px;

  --container: 1280px;
  --pad: clamp(20px, 4vw, 64px);

  --ease: cubic-bezier(.22,.61,.36,1);
}

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

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--paper);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  animation: pageFade .5s var(--ease) both;
}
@keyframes pageFade{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}
body.leaving{
  animation: none;
  opacity: 0;
  transition: opacity .22s var(--ease);
}

h1,h2,h3,h4{
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
button{ font-family: inherit; cursor: pointer; }

.mono{
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}

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

.eyebrow{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before{
  content: "";
  width: 18px; height: 1px;
  background: var(--signal);
  display: inline-block;
}
.eyebrow.on-dark{ color: var(--signal-bright); }
.eyebrow.on-dark::before{ background: var(--signal-bright); }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all .25s var(--ease);
  white-space: nowrap;
}
.btn-primary, .btn-gold{ position: relative; overflow: hidden; }
.btn-primary::after, .btn-gold::after{
  content: "";
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-20deg);
  transition: left .55s var(--ease);
}
.btn-primary:hover::after, .btn-gold:hover::after{ left: 130%; }
.btn-primary{
  background: var(--ink);
  color: var(--text-inverse);
}
.btn-primary:hover{ background: var(--signal); }
.btn-gold{
  background: var(--gold);
  color: #201404;
}
.btn-gold:hover{ background: var(--gold-bright); }
.btn-ghost{
  background: transparent;
  border-color: var(--paper-line);
  color: var(--text-primary);
}
.btn-ghost:hover{ border-color: var(--ink); }
.btn-ghost.on-dark{
  border-color: var(--line-on-ink);
  color: var(--text-inverse);
}
.btn-ghost.on-dark:hover{ border-color: var(--signal-bright); }
.btn-arrow{ transition: transform .25s var(--ease); }
.btn:hover .btn-arrow{ transform: translateX(3px); }

/* ---------- Header ---------- */
header.site{
  position: sticky; top: 0; z-index: 100;
  background: rgba(245,246,242,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--paper-line);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
}
header.site::before{
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--signal) 0%, var(--signal-bright) 55%, var(--gold) 100%);
}
header.site.scrolled{
  background: rgba(245,246,242,0.96);
  box-shadow: 0 14px 34px -22px rgba(20,22,27,0.35);
}
.nav-row{
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
  gap: 18px;
}
.logo{
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 19px;
  display: flex; align-items: baseline; gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.logo .dot{ color: var(--signal); transition: color .3s var(--ease), text-shadow .3s var(--ease); }
.logo:hover .dot{ color: var(--signal-bright); text-shadow: 0 0 18px rgba(47,169,138,0.45); }
.logo small{
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted-2);
  letter-spacing: 0.06em;
  white-space: nowrap;
  display: none;
}
.nav-links{
  display: flex; align-items: center; gap: 22px;
  font-size: 14px; font-weight: 500;
  flex-shrink: 1;
  min-width: 0;
}
.nav-links a{
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
  transition: color .2s var(--ease);
}
.nav-links a::after{
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .28s var(--ease);
}
.nav-links a:hover{ color: var(--text-primary); }
.nav-links a:hover::after, .nav-links a.active::after{ transform: scaleX(1); }
.nav-links a.active{ color: var(--text-primary); }
.nav-cta{ display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-cta .btn{ padding: 12px 20px; font-size: 13.5px; }
.nav-toggle{ display: none; font-size: 20px; background: none; border: none; color: var(--text-primary); transition: transform .2s var(--ease); }
.nav-toggle.is-open{ transform: rotate(90deg); }

@media (min-width: 1500px){
  .logo small{ display: inline; }
}

@media (max-width: 1180px){
  .nav-cta .btn-ghost{ display: none; }
}

@media (max-width: 900px){
  .nav-links{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute; top: 76px; left: 0; right: 0;
    background: var(--paper);
    padding: 22px var(--pad) 26px;
    border-bottom: 1px solid var(--paper-line);
    gap: 16px;
    opacity: 0; visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .28s var(--ease), transform .28s var(--ease), visibility .28s;
  }
  .nav-links.is-open{ opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-toggle{ display: block; }
  .nav-cta .btn-ghost{ display: none; }
}

/* ---------- Sections ---------- */
section{ padding: clamp(64px, 9vw, 128px) 0; }
.section-tight{ padding: clamp(40px, 6vw, 72px) 0; }
.on-ink{ background: var(--ink); color: var(--text-inverse); }
.on-ink h2, .on-ink h3, .on-ink h4{ color: var(--text-inverse); }
.on-ink p{ color: var(--text-inverse-muted); }
.on-dim{ background: var(--paper-dim); }

.section-head{ max-width: 680px; margin-bottom: 56px; }
.section-head h2{ font-size: clamp(30px, 4vw, 44px); }
.section-head p{ margin-top: 16px; font-size: 17px; color: var(--text-muted); }

hr.rule{ border: none; border-top: 1px solid var(--paper-line); margin: 0; }
.on-ink hr.rule{ border-top-color: var(--line-on-ink); }

/* ---------- Grid utilities ---------- */
.grid{ display: grid; gap: 28px; }
.grid-2{ grid-template-columns: repeat(2, 1fr); }
.grid-3{ grid-template-columns: repeat(3, 1fr); }
.grid-4{ grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px){
  .grid-3{ grid-template-columns: repeat(2, 1fr); }
  .grid-4{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .grid-2, .grid-3, .grid-4{ grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.card{
  background: #fff;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover{
  transform: translateY(-4px);
  border-color: var(--signal);
  box-shadow: 0 16px 40px -20px rgba(20,22,27,0.25);
}
.card .tag{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--signal);
  background: rgba(35,92,76,0.08);
  padding: 4px 9px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 18px;
}
.card h3{ font-size: 19px; margin-bottom: 10px; }
.card p{ color: var(--text-muted); font-size: 14.5px; margin: 0; }
.card ul{ margin: 14px 0 0; padding-left: 18px; color: var(--text-muted); font-size: 14px; }
.card ul li{ margin-bottom: 6px; }

.on-ink .card{
  background: var(--ink-soft);
  border-color: var(--line-on-ink);
}
.on-ink .card p{ color: var(--text-inverse-muted); }
.on-ink .card .tag{ background: rgba(47,169,138,0.14); color: var(--signal-bright); }

/* ---------- Hero terminal (signature element) ---------- */
.terminal{
  background: var(--ink-soft);
  border: 1px solid var(--line-on-ink);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.5);
}
.terminal-bar{
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-on-ink);
}
.terminal-bar span{ width: 10px; height: 10px; border-radius: 50%; background: #454A58; }
.terminal-label{
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-inverse-muted);
}
.terminal-body{
  padding: 26px 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13.5px;
  line-height: 1.9;
  min-height: 190px;
}
.t-line{ display: block; }
.t-user{ color: var(--text-inverse-muted); }
.t-user::before{ content: "▸ "; color: var(--gold-bright); }
.t-agent{ color: var(--signal-bright); }
.t-sys{ color: #6B7280; font-style: italic; }
.t-cursor{
  display: inline-block; width: 7px; height: 15px; background: var(--signal-bright);
  vertical-align: text-bottom; margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink{ 50%{ opacity: 0; } }

/* ---------- Hero ---------- */
.hero{
  padding-top: clamp(48px, 7vw, 84px);
  padding-bottom: clamp(40px, 5vw, 64px);
}
.hero-grid{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 980px){ .hero-grid{ grid-template-columns: 1fr; } }
.hero h1{ font-size: clamp(32px, 4.4vw, 52px); }
.hero .lead{ font-size: 17px; color: var(--text-muted); margin-top: 18px; max-width: 520px; }
.hero-ctas{ display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.page-hero{
  padding: clamp(56px, 8vw, 90px) 0 clamp(40px, 6vw, 60px);
  border-bottom: 1px solid var(--paper-line);
}
.page-hero h1{ font-size: clamp(32px, 4.6vw, 50px); max-width: 800px; }
.page-hero .lead{ font-size: 17px; color: var(--text-muted); max-width: 640px; margin-top: 18px; }

/* ---------- Stats strip ---------- */
.stats-strip{
  display: flex; flex-wrap: wrap; gap: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
}
.stat{ flex: 1; min-width: 140px; }
.stat .num{
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px; font-weight: 600; color: var(--signal);
}
.stat .label{ font-size: 13px; color: var(--text-muted-2); margin-top: 4px; }

/* ---------- Process steps (genuine sequence → numbered) ---------- */
.process{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 28px; }
@media (max-width: 900px){ .process{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .process{ grid-template-columns: 1fr; } }
.step{
  padding-top: 20px;
  border-top: 2px solid var(--paper-line);
  transition: border-color .25s var(--ease);
}
.step:hover{ border-top-color: var(--signal); }
.step .step-num{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px; color: var(--signal);
  margin-bottom: 14px;
}
.step h4{ font-size: 17px; margin-bottom: 8px; }
.step p{ font-size: 14px; color: var(--text-muted); }

/* ---------- Logo / trust strip (auto-scrolling marquee) ---------- */
.trust-marquee{
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.trust-strip{
  display: flex; align-items: center; gap: 48px;
  width: max-content;
  opacity: 0.75; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--text-muted-2);
  animation: trustScroll 32s linear infinite;
}
.trust-marquee:hover .trust-strip{ animation-play-state: paused; }
.trust-strip span{ white-space: nowrap; }
@keyframes trustScroll{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

/* ---------- Compliance badges ---------- */
.badge-row{ display: flex; flex-wrap: wrap; gap: 14px; }
.badge{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  border: 1px solid var(--paper-line);
  border-radius: 3px;
  padding: 8px 14px;
  color: var(--text-muted);
  transition: border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.badge:hover{
  border-color: var(--signal);
  color: var(--signal);
  transform: translateY(-2px);
}
.on-ink .badge, .on-dim .badge{ background: rgba(255,255,255,0.02); }

/* ---------- Stagger reveal for grids ---------- */
.grid > .reveal:nth-child(2), .grid > .card:nth-child(2){ transition-delay: .06s; }
.grid > .reveal:nth-child(3), .grid > .card:nth-child(3){ transition-delay: .12s; }
.grid > .reveal:nth-child(4), .grid > .card:nth-child(4){ transition-delay: .18s; }
.grid > .reveal:nth-child(5), .grid > .card:nth-child(5){ transition-delay: .24s; }
.grid > .reveal:nth-child(6), .grid > .card:nth-child(6){ transition-delay: .30s; }
.grid > .reveal:nth-child(7), .grid > .card:nth-child(7){ transition-delay: .36s; }
.grid > .reveal:nth-child(8){ transition-delay: .42s; }

/* ---------- CTA band ---------- */
.cta-band{
  background: var(--signal);
  color: #fff;
  border-radius: 10px;
  padding: clamp(40px, 6vw, 70px);
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.cta-band h3{ color: #fff; font-size: clamp(24px,3vw,32px); max-width: 480px; }
.cta-band p{ color: rgba(255,255,255,0.8); margin-top: 10px; }
.cta-band .btn-primary{ background: #fff; color: var(--ink); }
.cta-band .btn-primary:hover{ background: var(--gold); color: #201404; }

/* ---------- Footer ---------- */
footer.site{
  background: var(--ink);
  color: var(--text-inverse-muted);
  padding: 64px 0 28px;
  font-size: 14px;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 44px;
}
@media (max-width: 900px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .footer-grid{ grid-template-columns: 1fr; } }
footer.site h5{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-inverse); margin-bottom: 18px;
}
footer.site ul{ list-style: none; padding: 0; margin: 0; }
footer.site li{ margin-bottom: 10px; }
footer.site a:hover{ color: var(--signal-bright); }
.footer-bottom{
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 26px; border-top: 1px solid var(--line-on-ink);
  font-size: 13px; color: var(--text-muted-2); flex-wrap: wrap; gap: 12px;
}
.footer-brand-line{ display: flex; align-items: center; gap: 10px; color: var(--text-inverse-muted); }

/* ---------- Reveal on scroll ---------- */
.reveal{ opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* ---------- Misc ---------- */
.split{ display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
@media (max-width: 900px){ .split{ grid-template-columns: 1fr; } }
.pill{
  display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  border: 1px solid var(--paper-line); border-radius: 20px; padding: 6px 14px; color: var(--text-muted);
}
.industry-icon{
  width: 42px; height: 42px; border-radius: 8px;
  background: rgba(35,92,76,0.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--signal); margin-bottom: 18px; font-size: 19px;
}
