/* ============================================================
   ATI — Automation Technologies Inc.
   Calm SaaS layout language: stone canvas, dark pill nav,
   teal accent, Plus Jakarta Sans + JetBrains Mono.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-var.woff2') format('woff2');
}

:root {
  color-scheme: light;

  --bg: #F3F2EE;
  --surface: #FFFEFB;
  --border: rgba(18, 24, 22, 0.09);
  --border-strong: rgba(18, 24, 22, 0.16);

  --ink: #121816;
  --ink-2: #3A423E;
  --muted: #5C6560;
  --faint: #8A928C;

  --accent: #0E7C6B;
  --accent-dark: #0A5F52;
  --accent-soft: #E6F4F0;
  --accent-glow: #2BB89A;

  --nav: #161A18;
  --nav-chip: rgba(255, 255, 255, 0.12);
  --nav-muted: rgba(255, 255, 255, 0.55);

  --green: #0E7C6B;
  --green-dark: #0A5F52;
  --green-text: #0A5F52;
  --green-soft: rgba(14, 124, 107, 0.1);
  --green-vivid: #2BB89A;
  --green-glow: #2BB89A;

  --amber: #C4841D;
  --amber-soft: rgba(196, 132, 29, 0.12);
  --amber-glow: #E8B04A;
  --red: #C94B3A;

  --panel: #121816;
  --panel-line: rgba(255, 255, 255, 0.08);
  --panel-text: #7A8580;

  --radius: 16px;
  --radius-lg: 28px;
  --sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(18, 24, 22, 0.11) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #c5e8df; color: #0a3d34; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid rgba(14, 124, 107, 0.65);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }
strong { color: var(--ink); font-weight: 600; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ------------------------------------------------------------
   Pill navigation — same placement on every page
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 20px 0 0;
  background: transparent;
  pointer-events: none;
}
.site-header .header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 44px;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}
.site-header .nav-pill { pointer-events: auto; }

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--nav);
  border-radius: 12px;
  padding: 6px 8px 6px 10px;
  box-shadow: 0 10px 40px -18px rgba(18, 24, 22, 0.45);
  position: relative;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.02em;
  padding: 6px 10px;
  border-radius: 8px;
}
.logo:hover { text-decoration: none; color: #fff; }
.logo .logo-text { line-height: 1.2; white-space: nowrap; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13.5px;
  font-weight: 500;
}
.nav-links a {
  color: var(--nav-muted);
  padding: 7px 12px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
}
.nav-links a.active {
  color: #fff;
  background: var(--nav-chip);
}
.nav-links .btn.sm.ghost {
  color: var(--nav-muted);
  border-color: transparent;
  background: transparent;
}
.nav-links .btn.sm.ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 7px 10px;
  cursor: pointer;
  color: #fff;
  margin-left: 4px;
}

/* ------------------------------------------------------------
   Buttons — soft rectangle like the reference
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -12px rgba(14, 124, 107, 0.55);
  color: #fff;
}
.btn:active { transform: translateY(0); }
.btn .arrow { transition: transform 0.2s ease; font-family: var(--mono); font-size: 12px; letter-spacing: -0.05em; }
.btn:hover .arrow { transform: translateX(3px); }

.btn.sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.nav-pill .btn.sm {
  background: transparent;
  border-color: transparent;
  color: var(--nav-muted);
  font-weight: 500;
}
.nav-pill .btn.sm:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
  transform: none;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn.ghost:hover {
  background: rgba(18, 24, 22, 0.04);
  border-color: rgba(18, 24, 22, 0.22);
  box-shadow: none;
  color: var(--ink);
}

/* ------------------------------------------------------------
   Hero — Luma-style split: nav+copy left, full-height image right
   ------------------------------------------------------------ */
.hero {
  padding: 12px 20px 28px;
  position: relative;
  min-height: calc(100vh - 64px);
  box-sizing: border-box;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.2fr);
  gap: 36px;
  align-items: stretch;
  min-height: calc(100vh - 92px);
  max-width: 1440px;
  margin: 0 auto;
}

.hero-left {
  display: flex;
  flex-direction: column;
  padding: 0 12px 24px 24px;
  min-height: 0;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  max-width: 460px;
  padding: 48px 0 64px;
}

.hero h1 {
  font-size: clamp(38px, 4.8vw, 54px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin: 0 0 22px;
  color: var(--ink);
}

.hero h1 .stipple {
  display: inline;
  color: var(--ink);
  background-image: linear-gradient(
    180deg,
    var(--ink) 0%,
    var(--ink) 42%,
    rgba(18, 24, 22, 0.45) 70%,
    rgba(18, 24, 22, 0.2) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero h1 .stipple {
    background-image:
      radial-gradient(circle, rgba(18, 24, 22, 0.7) 0.5px, transparent 0.65px),
      linear-gradient(180deg, var(--ink) 0%, var(--ink) 40%, transparent 95%);
    background-size: 2.4px 2.4px, 100% 100%;
    background-position: center 70%, 0 0;
    background-repeat: repeat, no-repeat;
  }
}

.hero .lede {
  max-width: 400px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 28px;
}
.hero .lede strong { color: var(--ink-2); font-weight: 600; }

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-visual {
  position: relative;
  min-height: calc(100vh - 92px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: none;
  background: #121816;
  cursor: crosshair;
}
.hero-visual canvas,
.hero-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: none;
  padding: 6px 12px;
  border-radius: 999px;
}
.kicker::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ------------------------------------------------------------
   Mimic display
   ------------------------------------------------------------ */
.mimic-wrap { padding: 8px 0 20px; }

.mimic {
  background: var(--panel);
  border: 1px solid #1c2220;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 28px 70px -36px rgba(18, 24, 22, 0.4);
}
.mimic-head, .mimic-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--panel-text);
  flex-wrap: wrap;
}
.mimic-head { border-bottom: 1px solid var(--panel-line); }
.mimic-foot { border-top: 1px solid var(--panel-line); }

.mimic-live { display: inline-flex; align-items: center; gap: 8px; color: #a8b5ac; }
.mimic-live .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-vivid);
  box-shadow: 0 0 8px var(--green-vivid);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.25; } }

.mimic:not(.vmodel) svg { display: block; width: 100%; height: auto; }

.mimic.vmodel { max-width: 100%; margin: 0 auto; }
.mimic pre.ascii {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

/* Modern SVG V-model diagram */
.vmodel-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.vmodel-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--mono);
}
.vmodel-svg--wide { display: block; }
.vmodel-svg--narrow { display: none; }
.vmodel-svg .tie-line {
  stroke: rgba(43, 184, 154, 0.55);
  stroke-width: 1.2;
  stroke-dasharray: 3 6;
  stroke-linecap: round;
  animation: vm-dash 1.1s linear infinite;
}
@keyframes vm-dash { to { stroke-dashoffset: -9; } }
@media (prefers-reduced-motion: reduce) {
  .vmodel-svg .tie-line { animation: none; }
}
.vmodel-svg .vn rect { transition: stroke 0.2s ease; }
.vmodel-svg .vn:hover rect { stroke: var(--green-vivid); }

/* Homepage lifecycle teaser — copy left, diagram right (slightly wider) */
.lifecycle-split {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.28fr);
  gap: 40px;
  align-items: center;
}
.lifecycle-split h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.035em;
  margin: 14px 0;
}
.lifecycle-split p { color: var(--muted); margin-bottom: 1.25em; }
.lifecycle-split .mimic.vmodel { width: 100%; margin: 0; }

/* Layout / button utilities */
.btn.block { width: 100%; justify-content: center; }
.section-pad-bottom { padding-bottom: 110px; }
.split-wide { gap: 56px; }
.split-copy h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.035em;
  margin: 14px 0;
}
.split-copy p { color: var(--muted); }
.text-ink-2 { color: var(--ink-2); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px -36px rgba(18, 24, 22, 0.2);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  background: rgba(18, 24, 22, 0.03);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.panel-body { padding: 30px 32px; }

.legend { display: inline-flex; gap: 18px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend .l-green { background: var(--green-vivid); box-shadow: 0 0 6px var(--green-vivid); }
.legend .l-amber { background: var(--amber-glow); box-shadow: 0 0 6px var(--amber-glow); }
.legend .l-red { background: #ff6a55; box-shadow: 0 0 6px #ff6a55; }

/* ------------------------------------------------------------
   Marquee
   ------------------------------------------------------------ */
.marquee {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 16px 0;
  background: rgba(255, 254, 251, 0.55);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 46s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track ul {
  display: flex;
  align-items: center;
  gap: 44px;
  list-style: none;
  margin: 0;
  padding: 0 22px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.marquee-track li::after {
  content: '·';
  margin-left: 44px;
  color: rgba(14, 124, 107, 0.5);
}
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
}

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */
.section { padding: 96px 0; }
.section.tight { padding: 64px 0; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 {
  font-size: clamp(28px, 3.8vw, 40px);
  font-weight: 650;
  letter-spacing: -0.035em;
  margin: 16px 0 14px;
  color: var(--ink);
}
.section-head p { color: var(--muted); font-size: 16px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ------------------------------------------------------------
   Cards / grids
   ------------------------------------------------------------ */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 40px -24px rgba(18, 24, 22, 0.18);
}
.card .card-index {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.card h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin: 14px 0 10px; }
.card p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}
.card ul li {
  padding: 8px 0 8px 18px;
  position: relative;
  border-top: 1px solid rgba(18, 24, 22, 0.06);
}
.card ul li::before {
  content: '›';
  position: absolute;
  left: 2px;
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------------------------------------
   Stats
   ------------------------------------------------------------ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.stat {
  padding: 36px 28px;
  border-left: 1px solid var(--border);
}
.stat:first-child { border-left: none; }
.stat .num {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat .label {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}
table.data th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 24, 22, 0.03);
  white-space: nowrap;
}
table.data td {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(18, 24, 22, 0.06);
  vertical-align: top;
  color: var(--ink-2);
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 0.15s ease; }
table.data tbody tr:hover { background: var(--accent-soft); }
table.data td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge i { width: 6px; height: 6px; border-radius: 50%; }
.badge.green { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid rgba(14, 124, 107, 0.2); }
.badge.green i { background: var(--accent); }
.badge.amber { background: #fbf1dd; color: #8f5f08; border: 1px solid rgba(196, 132, 29, 0.28); }
.badge.amber i { background: var(--amber); animation: pulse-dot 1.4s ease-in-out infinite; }

/* ------------------------------------------------------------
   ASCII
   ------------------------------------------------------------ */
pre.ascii {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  color: #949ba2;
  background: var(--panel);
  border: 1px solid #1c2220;
  border-radius: var(--radius);
  padding: 30px 28px;
  overflow-x: auto;
  margin: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
pre.ascii.center {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 34px 48px;
}
pre.ascii .g { color: var(--green-vivid); font-weight: 600; }
pre.ascii .m { color: #565c63; }
pre.ascii .b { color: #e8ebee; font-weight: 600; }

/* ------------------------------------------------------------
   Quote / principle
   ------------------------------------------------------------ */
.principle {
  border-left: 2px solid var(--accent);
  padding: 10px 0 10px 36px;
  max-width: 820px;
}
.principle blockquote {
  margin: 0;
  font-size: clamp(21px, 2.6vw, 28px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.45;
  color: var(--ink);
}
.principle blockquote em { color: var(--accent-dark); font-style: normal; }
.principle .attribution {
  margin-top: 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ------------------------------------------------------------
   CTA band
   ------------------------------------------------------------ */
.cta-band {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-lg);
  padding: 64px 56px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 60px -40px rgba(18, 24, 22, 0.2);
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(560px 280px at 18% -10%, rgba(14, 124, 107, 0.1), transparent 62%);
  pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 650;
  letter-spacing: -0.035em;
  max-width: 640px;
  color: var(--ink);
}
.cta-band p { color: var(--muted); max-width: 540px; margin-bottom: 28px; }
.cta-band .kicker { color: var(--accent-dark); }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
footer.site {
  margin-top: 32px;
  background: rgba(255, 254, 251, 0.7);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
}
footer.site .foot-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 56px 0 44px;
}
footer.site h4 {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin-bottom: 10px; color: var(--muted); }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--ink); text-decoration: none; }
footer.site .foot-brand .logo {
  color: var(--ink);
  margin-bottom: 14px;
  padding: 0;
}
footer.site .foot-brand .logo .logo-text { color: var(--ink); }
footer.site .foot-brand p { max-width: 300px; font-size: 13px; color: var(--faint); }
footer.site .foot-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--faint);
}

/* ------------------------------------------------------------
   Page hero (sub-pages)
   ------------------------------------------------------------ */
.page-hero {
  padding: 56px 0 28px;
  position: relative;
}
.page-hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin: 18px 0 16px;
  color: var(--ink);
}
.page-hero .lede { max-width: 640px; color: var(--muted); font-size: 16.5px; }

/* ------------------------------------------------------------
   Profile
   ------------------------------------------------------------ */
.profile {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  position: sticky;
  top: 92px;
  box-shadow: 0 18px 44px -30px rgba(18, 24, 22, 0.2);
}
.portrait {
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(14, 124, 107, 0.45);
  box-shadow: 0 0 0 6px rgba(14, 124, 107, 0.08);
}
.profile-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.profile-card .role {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 18px;
}
.profile-card .meta {
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
  text-align: left;
}
.profile-card .meta div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.profile-card .meta span { color: var(--faint); }
.profile-card .meta strong { color: var(--ink); font-weight: 550; }

.profile-body h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; }
.profile-body h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 36px 0 12px;
}
.profile-body ul.checks { list-style: none; padding: 0; margin: 0; }
.profile-body ul.checks li {
  padding: 10px 0 10px 28px;
  position: relative;
  border-top: 1px solid rgba(18, 24, 22, 0.06);
  color: var(--ink-2);
  font-size: 14px;
}
.profile-body ul.checks li::before {
  content: '✓';
  position: absolute;
  left: 2px;
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------------------------------------
   Timeline
   ------------------------------------------------------------ */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: rgba(18, 24, 22, 0.12);
}
.timeline li { position: relative; padding: 0 0 28px 36px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .node {
  position: absolute;
  left: 0;
  top: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(14, 124, 107, 0.1);
}
.timeline li.amber .node { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(196, 132, 29, 0.12); }
.timeline .t-title { font-weight: 600; color: var(--ink); font-size: 15px; }
.timeline .t-sub {
  font-size: 12px;
  color: var(--faint);
  margin-top: 5px;
}

/* ------------------------------------------------------------
   Contact form
   ------------------------------------------------------------ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 56px;
  align-items: start;
}
.contact-info h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 32px 0 10px;
}
.contact-info ul { list-style: none; padding: 0; margin: 0; font-size: 14px; color: var(--ink-2); }
.contact-info ul li {
  padding: 8px 0 8px 20px;
  position: relative;
  border-top: 1px solid rgba(18, 24, 22, 0.06);
}
.contact-info ul li::before { content: '›'; position: absolute; left: 2px; color: var(--accent); font-weight: 600; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -40px rgba(18, 24, 22, 0.25);
}
.form-card .form-head {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(18, 24, 22, 0.03);
  border-bottom: 1px solid var(--border);
  padding: 13px 24px;
}
.form-card .form-body { padding: 28px 32px 34px; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.field label .req { color: var(--red); }
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: rgba(18, 24, 22, 0.03);
  border: 1px solid rgba(18, 24, 22, 0.12);
  border-radius: 12px;
  padding: 11px 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.field ::placeholder { color: #a5adb6; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: rgba(14, 124, 107, 0.55);
  box-shadow: 0 0 0 3px rgba(14, 124, 107, 0.12);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-success { text-align: center; padding: 30px 10px; }
.form-success .check-ring { width: 84px; height: 84px; margin: 0 auto 24px; }
.form-success h3 { font-size: 21px; font-weight: 600; }
.form-success p { color: var(--muted); font-size: 14px; max-width: 380px; margin: 0 auto 8px; }
.form-success .ref {
  display: inline-block;
  margin: 16px 0 22px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px dashed rgba(14, 124, 107, 0.35);
  padding: 8px 16px;
  border-radius: 9px;
}

.check-ring circle {
  stroke: var(--accent);
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 252;
  stroke-dashoffset: 252;
  animation: draw 0.7s ease forwards;
}
.check-ring path {
  stroke: var(--accent);
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw 0.45s ease 0.55s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ------------------------------------------------------------
   Blog
   ------------------------------------------------------------ */
.post-list { border-top: 1px solid var(--border); }
.post-row {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 26px 6px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
  animation: post-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.post-row:hover { background: rgba(14, 124, 107, 0.05); text-decoration: none; }
@keyframes post-in { from { opacity: 0; transform: translateY(10px); } }
.post-row .post-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faint);
  white-space: nowrap;
}
.post-row .post-title { font-weight: 600; font-size: 17px; letter-spacing: -0.02em; color: var(--ink); }
.post-row .post-excerpt { color: var(--muted); font-size: 14px; margin-top: 5px; max-width: 620px; }
.post-row .post-arrow { color: var(--faint); transition: transform 0.2s ease, color 0.2s ease; }
.post-row:hover .post-arrow { transform: translateX(3px); color: var(--accent); }
.post-empty { padding: 48px 6px; color: var(--muted); border-bottom: 1px solid var(--border); }

.post-hero { padding: 56px 0 20px; }
.post-hero .post-meta {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin: 18px 0 16px;
}
.post-hero .post-meta b { color: var(--accent-dark); font-weight: 600; }
.post-hero h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  max-width: 760px;
}
.article-body { max-width: 720px; padding-bottom: 40px; }
.back-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.prose { font-size: 16px; line-height: 1.75; color: var(--ink-2); }
.prose h2 { font-size: 24px; letter-spacing: -0.02em; margin: 2em 0 0.6em; }
.prose h3 { font-size: 19px; letter-spacing: -0.015em; margin: 1.8em 0 0.5em; }
.prose p { margin: 0 0 1.25em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 1.25em; }
.prose li { margin: 6px 0; }
.prose blockquote {
  border-left: 2px solid var(--accent);
  margin: 1.6em 0;
  padding: 2px 0 2px 22px;
  color: var(--muted);
}
.prose code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: rgba(18, 24, 22, 0.05);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
}
.prose pre {
  background: var(--panel);
  color: #d3dad5;
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 0 0 1.4em;
  font-size: 13.5px;
  line-height: 1.6;
}
.prose pre code { background: transparent; border: none; padding: 0; color: inherit; }
.prose img { max-width: 100%; border-radius: 12px; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose strong { color: var(--ink); }

/* ------------------------------------------------------------
   Admin
   ------------------------------------------------------------ */
.admin-main { padding: 48px 0 90px; }
.admin-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}
.admin-list { list-style: none; margin: 0; padding: 6px; max-height: 640px; overflow-y: auto; }
.admin-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 9px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s ease;
}
.admin-list button:hover { background: rgba(18, 24, 22, 0.04); }
.admin-list button.selected { background: var(--accent-soft); }
.admin-list .item-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.admin-list .item-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-list .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.admin-list .dot.live { background: var(--accent); }
.admin-list .dot.draft { background: var(--amber); }

.editor-body { padding: 26px 28px 30px; }
.editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.editor-split textarea {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  min-height: 420px;
}
.preview-pane {
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  padding: 18px 22px;
  min-height: 420px;
  max-height: 640px;
  overflow-y: auto;
  background: var(--surface);
}
.preview-pane .prose { font-size: 14.5px; }
.editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 22px;
}
.editor-actions .spacer { flex: 1; }
.btn.danger { background: var(--surface); color: #b2402f; border-color: rgba(201, 75, 58, 0.4); }
.btn.danger:hover { background: #fdf1ef; border-color: rgba(201, 75, 58, 0.6); box-shadow: none; }
.admin-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.admin-status.ok { color: var(--accent-dark); }
.admin-status.err { color: #b2402f; }
.login-card { max-width: 420px; margin: 60px auto; }
.admin-toolbar { padding: 12px 12px 4px; }

/* ------------------------------------------------------------
   Scroll reveal
   ------------------------------------------------------------ */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(4px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .reveal.in { opacity: 1; transform: none; filter: none; }
.js .reveal.d1 { transition-delay: 0.08s; }
.js .reveal.d2 { transition-delay: 0.16s; }
.js .reveal.d3 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 960px) {
  .hero {
    padding: 16px 16px 28px;
    min-height: 0;
  }
  .hero-shell {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: 0;
  }
  .hero-left { padding: 0 4px; }
  .hero-visual {
    min-height: min(52vh, 480px);
    height: min(52vh, 480px);
    border-radius: 14px;
  }
  .hero-copy {
    max-width: none;
    padding: 20px 0 32px;
    flex: none;
  }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: none; }
  .stat { border-top: 1px solid var(--border); }
  .stat:nth-child(-n+2) { border-top: none; }
  .profile { grid-template-columns: 1fr; }
  .profile-card { position: static; max-width: 420px; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  footer.site .foot-main { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .editor-split { grid-template-columns: 1fr; }
  .lifecycle-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 760px) {
  .container { padding: 0 20px; }
  .grid-3, .grid-2, .field-row, .lifecycle-split, .split-wide { grid-template-columns: 1fr; }
  .split-wide { gap: 28px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .section { padding: 60px 0; }
  .section.tight { padding: 44px 0; }
  .section-pad-bottom { padding-bottom: 64px; }
  .section-head { margin-bottom: 36px; }
  .cta-band { padding: 44px 28px; }

  /* nav collapses to a full-width pill with MENU toggle */
  .site-header { padding: 14px 0 0; }
  .site-header .header-inner {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .site-header .nav-pill {
    width: 100%;
    justify-content: space-between;
  }
  .logo { font-size: 12px; padding: 6px 8px; }
  .logo .logo-text { white-space: normal; max-width: 13rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--nav);
    border-radius: 12px;
    padding: 10px;
    gap: 2px;
    box-shadow: 0 16px 40px -16px rgba(18, 24, 22, 0.5);
    z-index: 120;
  }
  .nav-links.open { display: flex; }
  .nav-links a,
  .nav-links button.btn {
    padding: 13px 14px;
    border-radius: 8px;
  }
  .nav-links button.btn {
    width: 100%;
    text-align: left;
    margin: 0;
  }
  .nav-toggle { display: inline-block; padding: 10px 12px; min-height: 44px; }

  footer.site .foot-main { grid-template-columns: 1fr; gap: 30px; padding: 44px 0 36px; }
  footer.site .foot-bottom {
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }
  .hero { padding: 12px 12px 24px; }
  .hero-visual { height: min(46vh, 400px); min-height: 300px; border-radius: 12px; }
  .hero .lede { font-size: 15px; }
  .hero-ctas .btn { width: 100%; justify-content: center; }

  .post-row { grid-template-columns: 1fr; gap: 8px; padding: 22px 6px; }
  .post-row .post-arrow { display: none; }
  .page-hero { padding: 36px 0 18px; }
  .post-hero { padding: 36px 0 14px; }
  .article-body { padding-bottom: 48px; }

  /* 16px inputs prevent iOS Safari zoom-on-focus */
  .field input, .field select, .field textarea { font-size: 16px; }

  .panel-body { padding: 24px 22px; }
  .form-card .form-body { padding: 22px 20px 28px; }
  .form-card .form-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 20px;
  }
  .editor-split textarea { min-height: 300px; }
  .preview-pane { min-height: 200px; }
  .editor-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .editor-actions .spacer { display: none; }
  .editor-actions .btn { width: 100%; justify-content: center; }
  .editor-actions .admin-status { text-align: center; order: 10; }
  pre.ascii { font-size: 11.5px; padding: 22px 18px; }
  pre.ascii.center { padding: 22px 18px; }
  .principle { padding-left: 24px; }
  .principle blockquote { font-size: clamp(18px, 5vw, 24px); }
  .mimic-head, .mimic-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    font-size: 9.5px;
    line-height: 1.45;
  }
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 18px;
  }
  /* compact mobile diagram — no sideways scroll */
  .vmodel-svg--wide { display: none !important; }
  .vmodel-svg--narrow { display: block !important; min-width: 0; }
  .vmodel-scroll { overflow-x: hidden; }
  .mimic.vmodel .vmodel-svg { min-width: 0; }
  .mimic.vmodel .vmodel-scroll { padding: 2px 0 6px; }
  .mimic:not(.vmodel) .mimic-foot > span:last-child { display: none; }
  .admin-main { padding: 32px 0 64px; }
  .login-card { margin: 32px auto; max-width: none; }
  .profile-body h2 { font-size: 21px; }
  table.data { font-size: 13px; }
  table.data th, table.data td { padding: 12px 16px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 28px; }

  .hero h1 { font-size: clamp(30px, 9vw, 38px); margin-bottom: 18px; }
  .hero-visual { height: min(42vh, 340px); min-height: 260px; }

  .page-hero h1 { font-size: clamp(28px, 8.5vw, 36px); }
  .section-head h2 { font-size: clamp(24px, 7vw, 32px); }
  .cta-band { padding: 36px 22px; border-radius: 20px; }
  .cta-band h2 { font-size: clamp(23px, 6.5vw, 30px); }
  .cta-band .btn { width: 100%; justify-content: center; }

  .stats { grid-template-columns: 1fr; }
  .stat { border-left: none; padding: 26px 22px; }
  .stat:first-child { border-top: none; }
  .stat + .stat { border-top: 1px solid var(--border); }

  .card { padding: 22px 20px; }
  .marquee-track ul { gap: 28px; }
  .marquee-track li::after { margin-left: 28px; }
  .profile-card { max-width: none; }
  .lifecycle-split { gap: 24px; }
  .split-wide { gap: 24px; }

  footer.site .foot-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .prose { font-size: 15px; }
  .prose h2 { font-size: 21px; }
  .prose h3 { font-size: 18px; }
}
