/* ============================================
   A Personal AI Context Layer — stylesheet
   ============================================ */

:root {
  --bg: #f7f4ed;
  --bg-tinted: #efe9da;
  --text: #1f1d1a;
  --text-soft: #4a463f;
  --text-muted: #847d6e;
  --accent: #2a5f5a;
  --accent-warm: #8d7b48;
  --border: #d8d0bd;
  --code-bg: #e8e2d0;

  --font-serif: "Iowan Old Style", "Charter", "Georgia", "Cambria", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Menlo", "Consolas", "Monaco", monospace;

  --measure: 70ch;
}

* { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================
   Header
   ============================================ */

.site-header {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 24px;
}

.site-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1.1;
  font-weight: 600;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lede {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--text-soft);
  font-style: italic;
  margin: 0;
  max-width: 36ch;
}

/* ============================================
   Sections
   ============================================ */

.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border);
}

.section-tinted {
  background: var(--bg-tinted);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  font-weight: 600;
}

.section h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  font-weight: 600;
  margin: 0 0 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.section h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--text);
}

.section p {
  margin: 0 0 18px;
  max-width: var(--measure);
}

.standfirst {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 24px !important;
}

/* ============================================
   Lists
   ============================================ */

.problem-list,
.agent-list,
.scope-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
}

.problem-list li,
.agent-list li,
.scope-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.problem-list li::before,
.agent-list li::before,
.scope-list li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0.7em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

/* ============================================
   Benefits (numbered visual blocks)
   ============================================ */

.benefit {
  margin: 28px 0;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.55);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  max-width: var(--measure);
}

.benefit h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--accent);
  font-family: var(--font-sans);
  font-weight: 600;
}

.benefit p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
}

/* ============================================
   Build steps
   ============================================ */

.build-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 32px 0;
}

.build-steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 56px;
  margin-bottom: 32px;
  max-width: var(--measure);
}

.build-steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  width: 40px;
}

.build-steps h3 {
  margin: 0 0 6px;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.build-steps p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text-soft);
}

.build-note {
  margin-top: 32px;
  padding: 18px 22px;
  background: var(--bg-tinted);
  border-radius: 4px;
  font-size: 0.98rem;
  max-width: var(--measure);
}

.section-tinted .build-note {
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Inline elements
   ============================================ */

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text);
}

em {
  font-family: var(--font-serif);
  font-style: italic;
}

strong {
  font-weight: 600;
  color: var(--text);
}

/* ============================================
   Diagrams (SVG)
   ============================================ */

.diagram {
  margin: 40px 0;
  max-width: 100%;
}

.diagram svg {
  width: 100%;
  height: auto;
  background: var(--bg);
  padding: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.section-tinted .diagram svg {
  background: var(--bg);
}

.diagram figcaption {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
  max-width: var(--measure);
}

/* SVG text classes */
.diagram-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  fill: var(--accent);
  text-anchor: middle;
}

.source-box rect,
.ai-box rect,
.team-box rect {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 1.2;
}

.source-box text,
.ai-box text {
  font-family: var(--font-sans);
  font-size: 13px;
  fill: var(--text);
}

.team-box text {
  font-family: var(--font-sans);
  font-size: 11px;
  fill: var(--text);
}

.server-title {
  font-family: var(--font-sans);
  font-size: 13px;
  fill: var(--text-muted);
  font-style: italic;
}

.tier-text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  fill: var(--text);
}

.server-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  fill: var(--text-soft);
}

.tier-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  fill: var(--text);
  letter-spacing: 0.05em;
}

.tier-desc {
  font-family: var(--font-sans);
  font-size: 13px;
  fill: var(--text);
}

.tier-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  fill: var(--text-soft);
  font-style: italic;
}

.depth-arrow {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
  letter-spacing: 0.1em;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  fill: var(--accent);
  font-weight: 700;
}

.step-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  fill: var(--text);
}

.step-detail {
  font-family: var(--font-sans);
  font-size: 12px;
  fill: var(--text-soft);
}

.step-code {
  font-family: var(--font-mono);
  font-size: 13px;
  fill: var(--accent);
  font-weight: 600;
}

.diagram-note {
  font-family: var(--font-sans);
  font-size: 12px;
  fill: var(--text-muted);
  font-style: italic;
}

.arch-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  fill: var(--text);
}

.arch-title-sm {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  fill: var(--text);
}

.arch-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  fill: var(--text-muted);
  font-style: italic;
}

.arch-detail {
  font-family: var(--font-sans);
  font-size: 12px;
  fill: var(--text-soft);
}

.arch-detail-em {
  font-family: var(--font-sans);
  font-size: 12px;
  fill: var(--accent);
  font-weight: 600;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  padding: 40px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 720px) {
  html { font-size: 16px; }

  .site-header { padding: 64px 0 40px; }
  .section { padding: 56px 0; }

  .build-steps > li {
    padding-left: 48px;
  }

  .diagram svg {
    padding: 12px;
  }
}

@media (max-width: 500px) {
  .container { padding: 0 20px; }
  .lede { font-size: 1.15rem; }
}
