/* ============================================================
   Factory Intelligence — root (stealth)
   Design system mirrored from the launch site (v2 / warm editorial).
   Palette: parchment + charcoal + terracotta.
   Type: Cormorant Garamond (display), Inter (body), IBM Plex Mono (labels).
   ============================================================ */

:root {
  --bg: #F1ECE6;
  --nav-bg: #F7F4ED;
  --text: #16170F;
  --body: #6C6962;
  --muted: #8F8A7D;
  --rule: #ECE8DC;
  --surface: #F1ECE6;
  --invert-bg: #423E32;
  --invert-text: #FFFFFF;
  --accent: #B25323;

  --serif: "Cormorant Garamond", "Playfair Display", "Times New Roman", Georgia, serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --max: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
  --section-y: clamp(72px, 10vw, 144px);
}

html[data-theme="dark"] {
  --bg: #1A1816;
  --nav-bg: #161412;
  --text: #EAE9E3;
  --body: #9A9995;
  --muted: #605E5A;
  --rule: #272421;
  --surface: #232120;
  --invert-bg: #D4D4CC;
  --invert-text: #161412;
  --accent: #E16F39;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 180ms linear, color 180ms linear;
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--text); color: var(--bg); }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav__wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  white-space: nowrap;
}
.nav__logo {
  color: var(--text);
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: block;
}
.nav__right {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}
.nav__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
.nav__status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  transform: translateY(-1px);
}
.nav__toggle {
  background: transparent;
  border: 0;
  padding: 0;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  cursor: pointer;
  text-transform: uppercase;
}
.nav__toggle:hover { color: var(--text); }

@media (max-width: 640px) {
  .nav__inner { padding: 14px var(--gutter); }
  .nav__wordmark span { font-size: 10px; }
  .nav__label { display: none; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  background: var(--bg);
  padding-top: clamp(40px, 5vw, 80px);
  padding-bottom: clamp(48px, 6vw, 96px);
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
}
@media (max-width: 899px) {
  .hero { min-height: 0; display: block; }
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  width: 100%;
}
@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(48px, 6vw, 96px);
  }
}
.hero__kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 clamp(20px, 2.2vw, 32px) 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero__kicker-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.hero__headline {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.02;
  margin: 0 0 clamp(20px, 2vw, 32px) 0;
  font-size: clamp(44px, 6.2vw, 96px);
  max-width: 12ch;
  text-wrap: balance;
  color: var(--text);
}
.hero__headline em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}
.hero__headline-sub {
  display: block;
  font-size: 0.5em;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.005em;
  line-height: 1.2;
  margin-top: 0.4em;
  color: var(--body);
}
.hero__sub {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(14px, 0.95vw, 16px);
  line-height: 1.55;
  color: var(--muted);
  margin: clamp(14px, 1.4vw, 20px) 0 clamp(20px, 2vw, 28px) 0;
  max-width: 44ch;
}
.hero__meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* spec row — three labeled items like a stats band */
.hero__spec {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 0;
}
.hero__spec-item {
  padding: 20px 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero__spec-item + .hero__spec-item {
  border-left: 1px solid var(--rule);
  padding-left: clamp(16px, 2vw, 28px);
}
.hero__spec-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.hero__spec-val {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  font-weight: 500;
}
@media (max-width: 640px) {
  .hero__spec { grid-template-columns: 1fr; }
  .hero__spec-item + .hero__spec-item { border-left: 0; border-top: 1px solid var(--rule); padding-left: 0; padding-top: 16px; }
  .hero__spec-item { padding-bottom: 16px; }
}

/* hero figure */
.hero__figure {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--nav-bg);
  border: 1px solid var(--rule);
  overflow: hidden;
  isolation: isolate;
}
.hero__figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: contrast(1.02) saturate(0.92);
}
html[data-theme="dark"] .hero__figure img {
  filter: contrast(1.05) saturate(0.85) brightness(0.92);
}
.hero__figure-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: clamp(16px, 2vw, 24px) clamp(18px, 2.5vw, 28px);
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  color: #FFFFFF;
  pointer-events: none;
}
.hero__figure-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.4;
}
.hero__figure-sub {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-align: right;
}
@media (max-width: 520px) {
  .hero__figure-sub { display: none; }
}

/* ---------- HERO SCHEMATIC variant ---------- */
.hero__figure--schematic {
  background: var(--nav-bg);
  color: var(--text);
}
.schematic {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,  transparent, transparent calc(100% - 1px), var(--rule) 100%),
    var(--nav-bg);
  overflow: hidden;
}
.schematic__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--rule) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.55;
  pointer-events: none;
}
.schematic__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--text);
}
.hero__figure--schematic .hero__figure-caption {
  background: linear-gradient(to top, var(--invert-bg) 0%, rgba(66,62,50,0.0) 100%);
}
html[data-theme="dark"] .hero__figure--schematic .hero__figure-caption {
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 100%);
}

/* ---------- DEPLOYMENT BAND ---------- */
.deploy {
  padding: clamp(36px, 4vw, 56px) 0;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.deploy__wrap {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.deploy__dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.deploy__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-right: 14px;
}
.deploy__line {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--text);
  max-width: 48ch;
}
@media (max-width: 620px) {
  .deploy__label {
    display: block;
    margin-right: 0;
    margin-bottom: 6px;
  }
}

/* ---------- PRINCIPLES ---------- */
.principles {
  padding: var(--section-y) 0;
  border-bottom: 1px solid var(--rule);
}
.principles__head {
  max-width: 880px;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.principles__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 4vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 clamp(20px, 2vw, 28px) 0;
  color: var(--text);
  text-wrap: balance;
}
.principles__title em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}
.principles__sub {
  font-family: var(--sans);
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.6;
  color: var(--body);
  max-width: 58ch;
  margin: 0;
}
.principles__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
@media (max-width: 820px) {
  .principles__grid { grid-template-columns: 1fr; }
}
.principle {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.principle__fig {
  margin: 0;
  padding: clamp(24px, 2.6vw, 36px) clamp(24px, 2.6vw, 36px) 0;
  color: var(--text);
  background:
    linear-gradient(to bottom, var(--nav-bg), var(--nav-bg));
  border-bottom: 1px solid var(--rule);
}
.principle__fig svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  margin: 0 auto;
}
.principle__body {
  padding: clamp(28px, 3vw, 40px) clamp(24px, 2.6vw, 36px) clamp(32px, 3.5vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.principle__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
}
.principle__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.principle__copy {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
  margin: 0;
  max-width: 42ch;
}

/* ---------- SECTION wrapper ---------- */
.section { padding: var(--section-y) 0; }
.section--tight { padding: clamp(56px, 7vw, 112px) 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px 0;
}

.h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 clamp(20px, 2vw, 32px) 0;
  color: var(--text);
}
.h2 em { font-style: italic; font-weight: 500; color: var(--accent); }

.body {
  font-family: var(--sans);
  font-size: clamp(17px, 1.25vw, 20px);
  line-height: 1.6;
  color: var(--body);
  max-width: 62ch;
  margin: 0;
}
.body em { font-style: italic; color: var(--accent); font-weight: 500; }
.body + .body { margin-top: 0.9em; }

/* ---------- THESIS section (two-line call and response) ---------- */
.thesis {
  padding: clamp(96px, 12vw, 176px) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.thesis__wrap { max-width: 1080px; }
.thesis__eyebrow {
  margin: 0 0 clamp(40px, 5vw, 72px) 0;
}
.thesis__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.thesis__line {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: clamp(16px, 2vw, 28px);
  align-items: baseline;
  padding: clamp(22px, 2.4vw, 34px) 0;
}
.thesis__line + .thesis__line {
  border-top: 1px solid var(--rule);
}
.thesis__line--a { padding-top: 0; }
.thesis__line--b { padding-bottom: 0; }
.thesis__line em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.thesis__line--b { color: var(--text); }
.thesis__index {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  transform: translateY(-0.35em);
}
@media (max-width: 640px) {
  .thesis__line {
    grid-template-columns: 32px 1fr;
    gap: 12px;
  }
  .thesis__index { font-size: 10px; }
}

/* ---------- PROOF (three abstract tiles) ---------- */
.proof { padding: var(--section-y) 0; }
.proof__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 820px) {
  .proof__grid { grid-template-columns: 1fr; }
}
.proof__item {
  padding: clamp(36px, 4vw, 56px) clamp(24px, 2.6vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.proof__item + .proof__item {
  border-left: 1px solid var(--rule);
}
@media (max-width: 820px) {
  .proof__item + .proof__item {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}
.proof__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
}
.proof__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}
.proof__body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--body);
  margin: 0;
  max-width: 34ch;
}

/* ---------- CONTACT ---------- */
.contact {
  padding: var(--section-y) 0;
  background: var(--nav-bg);
  border-top: 1px solid var(--rule);
}
.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}
@media (min-width: 860px) {
  .contact__grid { grid-template-columns: 1fr 1fr; }
}
.contact__lead {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 clamp(16px, 1.5vw, 20px) 0;
  max-width: 16ch;
}
.contact__lead em { font-style: italic; color: var(--accent); font-weight: 500; }
.contact__sub {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
  max-width: 40ch;
}
.contact__list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.contact__row {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact__row-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.contact__row-value {
  font-family: var(--sans);
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.005em;
}
.contact__row-value:hover { color: var(--accent); }

.contact__hiring {
  margin-top: clamp(24px, 2.5vw, 36px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- FOOTER ---------- */
.footer { margin-top: 0; }
.footer__inner {
  padding: 40px var(--gutter) 56px;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  align-items: center;
}
.footer__logo {
  width: 20px; height: 20px;
  color: var(--muted);
  flex: 0 0 auto;
}
.footer__right { margin-left: auto; }
.footer__note {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 400;
  text-transform: none;
}
.footer__note span { margin-right: 2px; }

@media (max-width: 640px) {
  .footer__inner { flex-direction: column; gap: 10px; align-items: flex-start; }
  .footer__right { margin-left: 0; }
}

/* ---------- Motion reduction ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
