/* ============================================================
   MEMORA SYSTEMS — site stylesheet
   Editorial language: warm paper, deep ink, oxblood accent.
   Built on the Memora Apple Design System rhythm (alternating
   full-bleed tiles, generous whitespace, single accent).
   ============================================================ */

:root {
  /* paper & ink */
  --paper:        #f4ede0;   /* warm cream */
  --paper-deep:   #ebe2d0;   /* alternation tile */
  --paper-soft:   #f9f4e9;   /* hero / lightest */
  --ink:          #1c1612;   /* deep warm near-black */
  --ink-80:       #3a312a;
  --ink-60:       #6b5d50;
  --ink-40:       #9a8c7d;

  /* accent — oxblood / deep terracotta */
  --accent:       #8b3a2a;
  --accent-deep:  #6d2c20;
  --accent-tint:  rgba(139, 58, 42, 0.08);
  --accent-line:  rgba(139, 58, 42, 0.28);

  /* dark surfaces (warm, not blue-black) */
  --dark:         #1c1612;
  --dark-2:       #221b16;
  --on-dark:      #f4ede0;
  --on-dark-60:   #b8ad9b;

  /* hairlines */
  --hairline:        rgba(28, 22, 18, 0.12);
  --hairline-soft:   rgba(28, 22, 18, 0.06);
  --hairline-on-dark: rgba(244, 237, 224, 0.14);

  /* fonts */
  --serif:   "EB Garamond", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans:    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* spacing rhythm */
  --space-xxs: 4px;
  --space-xs:  8px;
  --space-sm:  12px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-xxl: 64px;
  --space-section: 120px;
  --space-section-tight: 88px;

  /* radii — restrained */
  --r-sm: 4px;
  --r-md: 8px;
  --r-pill: 9999px;

  /* timing */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ============================================================
   Reset & baseline
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--paper-soft); }

/* ============================================================
   Typography — serif editorial
   ============================================================ */
.serif { font-family: var(--serif); }
.sans  { font-family: var(--sans); }
.mono  { font-family: var(--mono); }

h1, h2, h3, h4, h5 { margin: 0; font-weight: 400; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}
.eyebrow.no-rule::before { display: none; }

.h-hero {
  font-family: var(--serif);
  font-size: clamp(48px, 7.2vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 400;
  font-feature-settings: "liga", "dlig", "kern";
}
.h-hero em { font-style: italic; color: var(--accent); font-feature-settings: "liga", "dlig", "kern", "swsh"; }

.h-display {
  font-family: var(--serif);
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  font-weight: 400;
}
.h-display em { font-style: italic; color: var(--accent); }

.h-section {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.012em;
  font-weight: 400;
}
.h-section em { font-style: italic; color: var(--accent); }

.h-title {
  font-family: var(--serif);
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.22;
  letter-spacing: -0.008em;
  font-weight: 500;
}

.lead {
  font-family: var(--serif);
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.42;
  letter-spacing: -0.005em;
  font-weight: 400;
  color: var(--ink-80);
}

p, .body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  letter-spacing: -0.005em;
  color: var(--ink-80);
  margin: 0;
  text-wrap: pretty;
}

.body-lg {
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.58;
  color: var(--ink-80);
}

.body-sm {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-60);
}

.caption {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--ink-60);
}

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-60);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms var(--ease);
}
a:hover { color: var(--accent-deep); }
.inline-link {
  border-bottom: 1px solid var(--accent-line);
  padding-bottom: 1px;
  transition: border-color 160ms var(--ease);
}
.inline-link:hover { border-bottom-color: var(--accent-deep); }

.on-dark { color: var(--on-dark); }
.on-dark p,
.on-dark .body,
.on-dark .body-lg { color: var(--on-dark-60); }
.on-dark .caption { color: var(--on-dark-60); }
.on-dark .eyebrow { color: #d97b66; }
.on-dark .eyebrow::before { background: #d97b66; }
.on-dark h1 em,
.on-dark h2 em,
.on-dark h3 em { color: #d97b66; }
.on-dark a { color: #d97b66; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 14px 26px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 140ms var(--ease), background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn .arrow { transition: transform 200ms var(--ease); display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary {
  background: var(--accent);
  color: var(--paper-soft);
}
.btn-primary:hover { background: var(--accent-deep); color: var(--paper-soft); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--paper-soft); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
}
.btn-ghost:hover { color: var(--accent); }

.btn.on-dark.btn-secondary {
  color: var(--on-dark);
  border-color: var(--on-dark);
}
.btn.on-dark.btn-secondary:hover { background: var(--on-dark); color: var(--ink); }

/* ============================================================
   Layout primitives
   ============================================================ */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
.container-narrow {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 32px;
}
.container-wide {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}
.section-tight {
  padding-top: var(--space-section-tight);
  padding-bottom: var(--space-section-tight);
}

.surface-paper      { background: var(--paper); color: var(--ink); }
.surface-paper-deep { background: var(--paper-deep); color: var(--ink); }
.surface-paper-soft { background: var(--paper-soft); color: var(--ink); }
.surface-dark       { background: var(--dark); color: var(--on-dark); }
.surface-dark-2     { background: var(--dark-2); color: var(--on-dark); }

/* ============================================================
   Header — sticky editorial nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: transparent;
  transition: background 240ms var(--ease), border-color 240ms var(--ease), backdrop-filter 240ms var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(244, 237, 224, 0.86);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom-color: var(--hairline-soft);
}
.site-header.on-dark.is-scrolled {
  background: rgba(28, 22, 18, 0.78);
  border-bottom-color: var(--hairline-on-dark);
}
.site-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 500;
}
.site-header.on-dark .brand { color: var(--on-dark); }
.brand .brand-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-1px);
}
.brand-tag {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
  font-weight: 500;
}
.site-header.on-dark .brand-tag { color: var(--on-dark-60); }

.site-nav {
  display: flex;
  gap: 36px;
  align-items: center;
}
.site-nav a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-80);
  font-weight: 500;
  letter-spacing: -0.005em;
  position: relative;
  padding: 4px 0;
}
.site-header.on-dark .site-nav a { color: var(--on-dark-60); }
.site-nav a:hover { color: var(--accent); }
.site-nav a.is-active { color: var(--ink); }
.site-header.on-dark .site-nav a.is-active { color: var(--on-dark); }
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  /* BUG-03: sit above the nav overlay so it's always tappable */
  position: relative;
  z-index: 70;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* BUG-07: lower breakpoint from 880px → 768px so tablets (768px+) get the full nav */
@media (max-width: 768px) {
  .site-nav {
    position: fixed;
    inset: 0;
    height: 100vh;        /* BUG-01: explicit full-viewport height so translateY(-100%) = -100vh */
    overflow: hidden;     /* BUG-01: clip overflowing links when nav is off-screen */
    background: var(--paper);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    transform: translateY(-100%);
    transition: transform 320ms var(--ease);
    z-index: 60;
  }
  .site-nav.is-open { transform: translateY(0); }
  .site-nav a { font-size: 28px; font-family: var(--serif); }
  .nav-toggle { display: inline-flex; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--paper-deep);
  border-top: 1px solid var(--hairline-soft);
  padding: 80px 0 40px;
}
.site-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 64px;
}
.footer-brand .brand { font-size: 26px; }
.footer-brand .tagline {
  margin-top: 16px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-60);
}
.footer-col h4 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 10px; }
.footer-col a {
  color: var(--ink-80);
  font-size: 15px;
  font-family: var(--sans);
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1240px;
  margin: 64px auto 0;
  padding: 24px 32px 0;
  border-top: 1px solid var(--hairline-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--ink-60);
  font-size: 13px;
  font-family: var(--sans);
}

/* BUG-07: keep footer breakpoint aligned with new 768px nav breakpoint */
@media (max-width: 768px) {
  .site-footer-inner { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ============================================================
   Hero block
   ============================================================ */
.hero {
  position: relative;
  padding: 140px 0 var(--space-section);
  overflow: hidden;
}
.hero-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}
.hero-eyebrow { margin-bottom: 32px; }
.hero-headline { margin-bottom: 32px; max-width: 18ch; }
.hero-sub {
  max-width: 56ch;
  margin-bottom: 48px;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================================
   Section header — eyebrow + title pattern
   ============================================================ */
.section-head {
  margin-bottom: var(--space-xxl);
  max-width: 56ch;
}
.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head .eyebrow { margin-bottom: 24px; }
.section-head .lead { margin-top: 24px; }

/* ============================================================
   Card / column patterns
   ============================================================ */
.cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.cols-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 980px) {
  .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  .cols-3, .cols-2, .cols-4 { grid-template-columns: 1fr; gap: 32px; }
}

.text-block {
  padding: 32px 0;
  border-top: 1px solid var(--hairline);
}
.text-block .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}
.text-block h3 {
  font-family: var(--serif);
  font-size: 30px;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  font-weight: 400;
}

/* feature card (with bigger surface) */
.feature {
  padding: 36px 32px;
  background: var(--paper-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
}
.feature.on-dark {
  background: rgba(244, 237, 224, 0.04);
  border-color: var(--hairline-on-dark);
}
.feature .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 4px;
}
.feature h3 {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.01em;
  font-weight: 500;
  line-height: 1.2;
}

/* ============================================================
   Trail — the recurring associative line motif
   A subtle hand-drawn curve with numbered nodes that
   appears across pages, evoking Bush's "trails of association".
   ============================================================ */
.trail {
  position: absolute;
  pointer-events: none;
  opacity: 0.55;
}
.trail svg { width: 100%; height: 100%; }
.trail path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: draw 2.4s var(--ease) 0.3s forwards;
}
.trail circle {
  fill: var(--paper);
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0;
  animation: fadeIn 0.4s var(--ease) forwards;
}
@keyframes draw {
  to { stroke-dashoffset: 0; }
}
@keyframes fadeIn { to { opacity: 1; } }

/* ============================================================
   Quote block
   ============================================================ */
.pullquote {
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.22;
  letter-spacing: -0.012em;
  font-style: italic;
  color: var(--ink);
  position: relative;
  padding-left: 0;
  text-wrap: balance;
}
.pullquote::before {
  content: "“";
  font-family: var(--serif);
  font-size: 1.4em;
  line-height: 0.8;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.pullquote-attr {
  margin-top: 32px;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.pullquote-attr strong { color: var(--ink); font-weight: 600; }

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

/* ============================================================
   Iris chat demo
   ============================================================ */
.iris-demo {
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 280px 1fr;
  box-shadow: 0 30px 80px -40px rgba(28, 22, 18, 0.25);
  min-height: 560px;
}
.iris-demo-side {
  background: var(--paper-deep);
  padding: 24px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.iris-demo-side h4 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 8px;
}
.iris-question {
  background: var(--paper-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-80);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
}
.iris-question:hover { border-color: var(--accent-line); color: var(--ink); }
.iris-question.is-active {
  background: var(--accent);
  color: var(--paper-soft);
  border-color: var(--accent);
}
.iris-demo-main {
  display: flex;
  flex-direction: column;
  background: var(--paper-soft);
  position: relative;
}
.iris-bar {
  padding: 18px 28px;
  border-bottom: 1px solid var(--hairline-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.iris-bar-id {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
}
.iris-bar-id .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2c8a4a;
  box-shadow: 0 0 0 4px rgba(44, 138, 74, 0.15);
}
.iris-bar small {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-60);
  letter-spacing: 0.06em;
}
.iris-conv {
  padding: 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 380px;
}
.iris-msg-user {
  align-self: flex-end;
  max-width: 80%;
  background: var(--ink);
  color: var(--paper-soft);
  padding: 14px 18px;
  border-radius: 14px 14px 4px 14px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}
.iris-msg-iris {
  align-self: flex-start;
  max-width: 92%;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
}
.iris-msg-iris .iris-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.iris-msg-iris .citations {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.iris-citation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-deep);
  border: 1px solid var(--hairline);
  padding: 5px 10px 5px 8px;
  border-radius: var(--r-pill);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-80);
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.iris-citation:hover { background: var(--accent); color: var(--paper-soft); border-color: var(--accent); }
.iris-citation .num {
  font-family: var(--mono);
  background: var(--accent-tint);
  color: var(--accent);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.iris-citation:hover .num { background: var(--paper-soft); color: var(--accent); }

.iris-input {
  border-top: 1px solid var(--hairline-soft);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.iris-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  outline: none;
}
.iris-input input::placeholder { color: var(--ink-40); }
.iris-input button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

@media (max-width: 760px) {
  .iris-demo { grid-template-columns: 1fr; }
  .iris-demo-side { border-right: none; border-bottom: 1px solid var(--hairline); }
}

/* ============================================================
   Architecture diagram
   ============================================================ */
.arch {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  align-items: stretch;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper-soft);
}
.arch-step {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  border-right: 1px solid var(--hairline-soft);
}
.arch-step:last-child { border-right: none; }
.arch-step .step-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.arch-step .step-title {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.arch-step .step-body {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-60);
  line-height: 1.45;
}
.arch-step .arrow-bridge {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--paper);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 12px;
  z-index: 2;
}
.arch-step:last-child .arrow-bridge { display: none; }
@media (max-width: 980px) {
  .arch { grid-template-columns: 1fr 1fr; }
  .arch-step { border-right: 1px solid var(--hairline-soft); border-bottom: 1px solid var(--hairline-soft); }
  .arch-step .arrow-bridge { display: none; }
}
@media (max-width: 640px) {
  .arch { grid-template-columns: 1fr; }
  .arch-step { border-right: none; }
}

/* ============================================================
   Timeline (deployment / how it works)
   ============================================================ */
.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.timeline-step {
  padding: 40px 32px;
  border-right: 1px solid var(--hairline-soft);
  position: relative;
}
.timeline-step:last-child { border-right: none; }
.timeline-step .week {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.timeline-step h3 {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.008em;
  margin-bottom: 10px;
  font-weight: 400;
}
.timeline-step .marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 1.2s var(--ease);
}
.timeline-step.is-in .marker { width: 100%; }

@media (max-width: 760px) {
  .timeline { grid-template-columns: 1fr; }
  .timeline-step { border-right: none; border-bottom: 1px solid var(--hairline-soft); }
  .timeline-step:last-child { border-bottom: none; }
}

/* ============================================================
   Form (contact)
   ============================================================ */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.form-field label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.form-field input,
.form-field textarea {
  font-family: var(--sans);
  font-size: 17px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink-40);
  padding: 8px 0;
  outline: none;
  resize: vertical;
  width: 100%;
  transition: border-color 160ms var(--ease);
}
.form-field input:focus,
.form-field textarea:focus { border-bottom-color: var(--accent); }
.form-field textarea { min-height: 110px; line-height: 1.5; }

/* ============================================================
   Case study editorial
   ============================================================ */
.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-xxl);
}
.case-meta dt {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 8px;
}
.case-meta dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
}
@media (max-width: 760px) {
  .case-meta { grid-template-columns: 1fr 1fr; gap: 24px; }
}

.case-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 64px;
  padding: 56px 0;
  border-top: 1px solid var(--hairline-soft);
}
.case-section .case-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.case-section h3 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.case-section p + p { margin-top: 14px; }
@media (max-width: 760px) {
  .case-section { grid-template-columns: 1fr; gap: 20px; padding: 40px 0; }
}

/* ============================================================
   Memex diagram (SVG container)
   ============================================================ */
.memex-illustration {
  background: var(--paper-deep);
  border: 1px solid var(--hairline);
  padding: 48px;
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Knowledge graph hero visual
   ============================================================ */
.kg-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 540px;
  margin-left: auto;
}
.kg-stage svg { width: 100%; height: 100%; }

/* ============================================================
   Two-column hero
   ============================================================ */
.hero-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero-split { grid-template-columns: 1fr; gap: 40px; }
  .kg-stage { margin: 0 auto; }
}

/* ============================================================
   Trust strip
   ============================================================ */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.trust-item {
  padding: 28px 24px;
  border-right: 1px solid var(--hairline-on-dark);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trust-item:last-child { border-right: none; }
.trust-item .trust-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #d97b66;
  text-transform: uppercase;
}
.trust-item h4 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--on-dark);
  letter-spacing: -0.005em;
}
.trust-item p { color: var(--on-dark-60); font-size: 14px; }
/* BUG-07: aligned to 768px breakpoint */
@media (max-width: 768px) {
  .trust-strip { grid-template-columns: 1fr 1fr; }
  .trust-item { border-bottom: 1px solid var(--hairline-on-dark); }
  .trust-item:nth-last-child(-n+2) { border-bottom: none; }
}
@media (max-width: 540px) {
  .trust-strip { grid-template-columns: 1fr; }
  .trust-item { border-right: none; }
}

/* ============================================================
   Final CTA block
   ============================================================ */
.final-cta {
  text-align: center;
  padding: 140px 32px;
}
.final-cta h2 { margin-bottom: 24px; max-width: 22ch; margin-left: auto; margin-right: auto; }
.final-cta p { max-width: 56ch; margin: 0 auto 40px; font-size: 19px; }

/* ============================================================
   Misc utilities
   ============================================================ */
.divider-rule {
  width: 64px;
  height: 1px;
  background: var(--accent);
  display: block;
}
.spacer-sm { height: 32px; }
.spacer-md { height: 64px; }
.spacer-lg { height: 96px; }
.text-center { text-align: center; }
.muted { color: var(--ink-60); }
.italic { font-style: italic; }

@media (max-width: 640px) {
  .container, .container-narrow, .container-wide { padding: 0 20px; }
  .hero { padding: 52px 0 64px; } /* BUG-06: was 96px — reduces dead zone above fold on mobile */
  .section, .section-tight { padding-top: 80px; padding-bottom: 80px; }
  .site-header-inner { padding: 14px 20px; }
}

/* BUG-11: contact.html two-paths layout responsive override (moved from inline <style>) */
@media (max-width: 768px) {
  section[data-screen-label="02 Two paths"] .cols-2 { grid-template-columns: 1fr !important; }
  section[data-screen-label="02 Two paths"] .cols-2 > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--hairline) !important;
  }
}

/* BUG-11: iris.html architecture grid responsive overrides (moved from inline <style>) */
@media (max-width: 980px) {
  .arch-cell { border-right: 1px solid rgba(244,237,224,0.12) !important; border-bottom: 1px solid rgba(244,237,224,0.12); }
  section[data-screen-label="04 Architecture"] [style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: 1fr 1fr !important;
  }
}
@media (max-width: 640px) {
  section[data-screen-label="04 Architecture"] [style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* BUG-04: portrait grid on about.html — responsive 2→1 column */
.portrait-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 640px) {
  .portrait-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* BUG-02: iris hero-split modifier — respects responsive collapse */
.hero-split--iris { grid-template-columns: 1fr 1.1fr; }
@media (max-width: 980px) {
  .hero-split--iris { grid-template-columns: 1fr; }
}

/* BUG-14: disabled input in iris demo — communicate non-interactive state */
.iris-demo input:disabled {
  cursor: default;
  opacity: 0.6;
}
