/* ═══════════════════════════════════════════════════════
   AmbulOps — style.css
   Design system tokens + component classes
   ═══════════════════════════════════════════════════════ */

/* ── Design tokens ── */
:root {
  --color-bg:       #f2f2f3;
  --color-surface:  #e9e9ea;
  --color-text:     #1d1f20;
  --color-accent:   #5980a6;
  --color-divider:  color-mix(in srgb, #1d1f20 16%, transparent);

  /* Neutral ramp */
  --color-neutral-100: #f5f5f8;
  --color-neutral-200: #e7e7ea;
  --color-neutral-300: #d4d4d7;
  --color-neutral-400: #b7b7ba;
  --color-neutral-500: #98989b;
  --color-neutral-600: #7a7a7d;
  --color-neutral-700: #5d5d60;
  --color-neutral-800: #424244;
  --color-neutral-900: #2b2b2d;

  /* Accent ramp */
  --color-accent-100: #eef6ff;
  --color-accent-200: #d6ebff;
  --color-accent-300: #b5d9fd;
  --color-accent-400: #94bce3;
  --color-accent-500: #749dc4;
  --color-accent-600: #597ea3;
  --color-accent-700: #416180;
  --color-accent-800: #2c455d;
  --color-accent-900: #1d2d3d;

  /* Typography */
  --font-display:  "Moderat Serif", "GT Sectra", "Tiempos Headline", "Newsreader", Georgia, serif;
  --font-heading:  "Moderat Serif", "GT Sectra", "Tiempos Headline", "Newsreader", Georgia, serif;
  --font-body:     "TWK Lausanne", Inter, "IBM Plex Sans", system-ui, sans-serif;
  --font-mono:     'IBM Plex Mono', ui-monospace, monospace;

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* Shadows */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2b2b2d 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2b2b2d 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2b2b2d 22%, transparent);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-accent-700); text-decoration: none; }
a:hover { color: var(--color-accent-900); }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 300;
  line-height: 1;
}
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Typography helpers ── */
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  margin-bottom: 12px;
}
.mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.body-copy {
  font-size: 17px;
  line-height: 28px;
  color: color-mix(in srgb, var(--color-text) 80%, transparent);
  max-width: 56ch;
}
.body-small {
  font-size: 13px;
  line-height: 20px;
  margin: 0;
}
.display-h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.05;
  letter-spacing: -.025em;
  margin: 0 0 20px;
}

/* ── Layout ── */
.section-padded {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(56px, 7vw, 96px) clamp(20px, 5vw, 72px);
}
.section-bg {
  background: var(--color-neutral-100);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  width: 100%;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 56px;
  align-items: center;
}
.rule {
  height: 1px;
  border: 0;
  background: var(--color-divider);
  margin: 0 0 24px;
}

/* ── Scroll-reveal ── */
[data-rv] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}
[data-rv].rv-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-rv] { opacity: 1; transform: none; transition: none; }
}

/* ── Blueprint frame ── */
.blueprint {
  position: relative;
  border: 1px solid var(--color-divider);
  border-radius: 0;
}
[data-cards="soft"] .blueprint { border-radius: 10px; }
.blueprint > .corner {
  position: absolute;
  width: 11px;
  height: 11px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  pointer-events: none;
}
.blueprint > .corner::before,
.blueprint > .corner::after {
  content: '';
  position: absolute;
  background: currentColor;
}
.blueprint > .corner::before { left: 5px; top: 0; width: 1px; height: 100%; }
.blueprint > .corner::after  { top: 5px; left: 0; width: 100%; height: 1px; }
.blueprint > .corner.tl { top: -6px; left: -6px; }
.blueprint > .corner.tr { top: -6px; right: -6px; }
.blueprint > .corner.bl { bottom: -6px; left: -6px; }
.blueprint > .corner.br { bottom: -6px; right: -6px; }
[data-cards="soft"] .corner { display: none; }

/* ── amb-card ── */
.amb-card {
  border: 1px solid var(--color-divider);
}
[data-cards="soft"] .amb-card {
  border-color: color-mix(in srgb, var(--color-accent-200) 72%, transparent);
  background: linear-gradient(158deg, var(--color-accent-100) 0%, color-mix(in srgb, var(--color-accent-100) 62%, transparent) 100%);
}
[data-cards="soft"] .amb-card:nth-child(2) {
  background: linear-gradient(158deg, color-mix(in srgb, var(--color-accent-200) 62%, var(--color-accent-100)) 0%, color-mix(in srgb, var(--color-accent-100) 58%, transparent) 100%);
}
[data-cards="soft"] .amb-card:hover {
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-accent-900) 8%, transparent), 0 10px 26px -14px color-mix(in srgb, var(--color-accent-900) 22%, transparent);
}
[data-cards="soft"] .amb-card { transition: box-shadow .3s ease; }

/* ── Buttons ── */
.btn, .btn-hero-primary, .btn-hero-ghost, button[type="submit"], a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.btn-primary, button[type="submit"].btn {
  background: var(--color-accent-800);
  color: #f2f2f3;
  border: 1px solid var(--color-accent-800);
  padding: 12px 20px;
}
.btn-primary:hover, button[type="submit"].btn:hover {
  background: var(--color-accent-900);
  border-color: var(--color-accent-900);
  color: #f2f2f3;
}
.btn-ghost {
  background: transparent;
  color: var(--color-accent-700);
  border: 1px solid var(--color-accent-400);
  padding: 12px 16px;
}
.btn-ghost:hover {
  background: var(--color-accent-100);
}
.btn-hero-primary {
  background: #f2f2f3;
  color: var(--color-accent-900);
  border: 1px solid #f2f2f3;
  padding: 13px 22px;
}
.btn-hero-primary:hover {
  background: #fff;
  color: var(--color-accent-900);
}
.btn-hero-ghost {
  border: 1px solid color-mix(in srgb, #f2f2f3 40%, transparent);
  color: #f2f2f3;
  padding: 13px 18px;
}
.btn-hero-ghost:hover {
  background: color-mix(in srgb, #f2f2f3 8%, transparent);
  color: #f2f2f3;
}

/* ── Input ── */
.input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--color-text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
  border-color: var(--color-accent-600);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent-400) 24%, transparent);
}
.input::placeholder { color: var(--color-neutral-500); }

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 72px);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}
.nav-logo:hover { color: var(--color-text); }
.logo-icon-container {
  display: flex;
  align-items: center;
}
.logo-icon-img {
  height: 24px;
  width: auto;
  object-fit: contain;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
}
.nav-links a:hover { color: var(--color-text); }
.nav-cta {
  padding: 8px 16px !important;
  font-size: 13px !important;
  color: #ffffff !important;
}
.nav-cta:hover {
  color: #ffffff !important;
  background: var(--color-accent-900) !important;
}

/* ── Hero ── */
.amb-dark {
  background: linear-gradient(160deg, #16222e 0%, var(--color-accent-900) 45%, var(--color-accent-800) 100%);
  color: #f2f2f3;
  border-bottom: 1px solid var(--color-accent-800);
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(72px, 9vw, 132px) clamp(20px, 5vw, 72px) 0;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-rows: auto auto;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.hero-text { display: flex; flex-direction: column; }
.hero-text h1 {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: clamp(32px, 4.2vw, 44px);
  line-height: 1.15;
  letter-spacing: -.025em;
  max-width: 32ch;
}
.hero-text h1 .block { display: block; }
.hero-body {
  font-size: 17px;
  line-height: 28px;
  max-width: 58ch;
  margin: 32px 0 0;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 36px;
  align-items: center;
}
.hero-image-wrap {
  position: relative;
  border: 1px solid color-mix(in srgb, #f2f2f3 26%, transparent);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  aspect-ratio: 4/5;
  align-self: end;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero-tags {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 20px;
  padding-bottom: 40px;
}
.hero-tag { padding: 0 24px; }
.hero-tag:first-child { padding-left: 0; }
.hero-tag:last-child { padding-right: 0; }

/* ── Feature list ── */
.feature-list { display: flex; flex-direction: column; gap: 24px; margin-top: 32px; }
.feature-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.feature-num {
  color: var(--color-accent-700);
  flex-shrink: 0;
  margin-top: 2px;
}
.feature-list strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--color-text);
  margin-bottom: 4px;
}
.feature-list p {
  font-size: 15px;
  line-height: 24px;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
}

/* ── Workflows ── */
.workflow-tabs {
  display: flex;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 40px;
  width: fit-content;
}
.workflow-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--color-divider);
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
  transition: background .18s ease, color .18s ease;
}
.workflow-tab:last-child { border-right: 0; }
.workflow-tab.active, .workflow-tab:hover {
  background: var(--color-accent);
  color: #f2f2f3;
}
.workflow-panel { display: none; }
.workflow-panel.active { display: block; }
.workflow-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: start; gap: 48px; }
.wf-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat-num {
  font-family: var(--font-heading);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
  color: var(--color-accent-800);
  margin: 12px 0 4px;
  line-height: 1;
}
.stat-label {
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
  line-height: 18px;
}
.check-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-list li {
  font-size: 15px;
  line-height: 22px;
  color: color-mix(in srgb, var(--color-text) 80%, transparent);
  padding-left: 20px;
  position: relative;
}
.check-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-accent-600);
  font-family: var(--font-mono);
  font-size: 10px;
  top: 4px;
}

/* ── How it works ── */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.how-card { padding: 28px 24px; }
.step-num {
  display: block;
  color: var(--color-accent-700);
  margin-bottom: 12px;
}
.how-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
}
.how-body {
  font-size: 15px;
  line-height: 24px;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
}

/* ── About ── */
.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.amb-dark .about-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.amb-dark section.section-padded { max-width: 100%; }
.about-image-col figure { position: relative; }
.founder-img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.founder-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, #f2f2f3 7%, transparent) 10px 11px);
}
.about-text-col h2.display-h2 { color: #f2f2f3; }
.about-text-col .rule { background: color-mix(in srgb, #f2f2f3 22%, transparent); }

/* ── Contact ── */
.contact-card { background: var(--color-surface); }
.form-fields { display: flex; flex-direction: column; gap: 16px; }
.form-label { display: flex; flex-direction: column; gap: 6px; }
.form-label-text {
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
  display: block;
}
button[type="submit"].btn.btn-primary {
  width: 100%;
  justify-content: center;
  border-radius: var(--radius-lg);
}
button[type="submit"].btn.btn-primary:disabled {
  opacity: .6;
  cursor: wait;
}
.form-status {
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}
.form-status:empty { display: none; }
.form-status--ok { color: #2e7d32; }
.form-status--err { color: #c62828; }

/* ── Triage ── */
.triage-section { margin-top: 40px; }
.triage-buttons { display: flex; flex-direction: column; gap: 10px; }
.triage-btn {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--color-text) 28%, transparent);
  background: transparent;
  color: var(--color-text);
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.triage-btn:hover {
  border-color: var(--color-accent-600);
  background: var(--color-accent-100);
  color: var(--color-accent-800);
}
.triage-btn.active {
  border-color: var(--color-accent-800);
  background: var(--color-accent-900);
  color: #f2f2f3;
}
.triage-note {
  margin-top: 14px;
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
  font-style: italic;
}

/* ── Footer ── */
footer { border-top: 1px solid var(--color-divider); }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px clamp(20px, 5vw, 72px);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: baseline;
}
.footer-copy {
  font-size: 14px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.footer-nav { display: flex; gap: 20px; }
.footer-nav a { font-size: 13px; }

/* ── Flow diagram animation ── */
@keyframes amb-flow {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -24; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .two-col,
  .hero-inner,
  .about-inner {
    grid-template-columns: 1fr;
  }
  .hero-image-wrap {
    max-height: 340px;
    aspect-ratio: unset;
    border-radius: 10px;
  }
  .hero-tags { grid-column: 1; }
  .how-grid { grid-template-columns: 1fr; }
  .wf-stat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .workflow-tabs {
    flex-direction: column;
    width: 100%;
  }
  .workflow-tab { border-right: 0; border-bottom: 1px solid var(--color-divider); }
  .workflow-tab:last-child { border-bottom: 0; }
  .nav-links a:not(.nav-cta) { display: none; }
}
@media (max-width: 560px) {
  .footer-inner { flex-direction: column; gap: 16px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
}
