/* ============================================================
   OpenClaw 2.0 — Multiuser mode explainer
   Adventure-print house style: ink on warm paper, decisive
   contrast, hard offset shadows, clipped clipped corners.
   ============================================================ */

:root {
  /* Palette */
  --ink: #11151C;
  --cream: #F1D7A2;
  --gold: #F2B705;
  --red: #A92D32;
  --blue: #214B78;
  --smoke: #59616B;
  --paper: #F7EAC4;      /* raised paper for panels */
  --paper-lite: #FBF3D8;

  /* Type roles */
  --font-display: 'Arial Black', 'Impact', 'Franklin Gothic Heavy', sans-serif;
  --font-body: Georgia, 'Times New Roman', serif;
  --font-mono: 'Courier New', Courier, monospace;
  --font-label: Verdana, Geneva, sans-serif;

  /* Rhythm */
  --maxw: 1120px;
  --pad: clamp(1.1rem, 4vw, 3rem);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(242,183,5,0.12), transparent 45%),
    var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Paper grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image:
    repeating-linear-gradient(0deg, rgba(17,21,28,0.5) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--ink);
  color: var(--cream);
  padding: 0.6rem 1rem;
  text-decoration: none;
  font-family: var(--font-label);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.1; margin: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--blue);
  color: var(--cream);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 3px 0 rgba(17,21,28,0.25);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--cream);
  text-decoration: none;
}
.brand-mark {
  font-family: var(--font-display);
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 0.15rem 0.5rem;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.brand-name em { font-style: normal; color: var(--gold); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}
.site-nav a {
  font-family: var(--font-label);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 7vw, 5rem);
  border-bottom: 3px solid var(--ink);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}
.eyebrow {
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--red);
  margin: 0 0 1rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 6vw, 4rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.02;
  margin-block-end: 1.2rem;
  text-shadow: 3px 3px 0 rgba(17,21,28,0.15);
}
.hero-title .gold { color: var(--gold); }
.hero-lede {
  font-size: 1.12rem;
  max-width: 34ch;
  color: var(--ink);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-block: 1.6rem;
}
.btn {
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.3rem;
  border: 2px solid var(--ink);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}
.btn-solid {
  background: var(--gold);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: var(--paper-lite);
  color: var(--ink);
}
.btn:hover,
.btn:focus-visible { transform: translate(-2px,-2px); }
.btn-solid:hover, .btn-solid:focus-visible { box-shadow: 8px 8px 0 var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { box-shadow: var(--shadow); background: var(--paper); }

.hero-facts {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1.4rem;
}
.hero-facts li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: baseline;
}
.hero-facts strong {
  font-family: var(--font-label);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--red);
}
.hero-facts span { font-size: 0.92rem; color: var(--ink); }

/* hero diagram */
.hero-diagram { display: flex; justify-content: center; }
.diagram-panel {
  margin: 0;
  width: 100%;
  max-width: 480px;
  background: var(--paper-lite);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: clamp(0.8rem, 2vw, 1.4rem);
}
.diagram-panel svg { display: block; width: 100%; height: auto; }
.flow-node rect, .gateway {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2;
}
.flow-node text {
  font-family: var(--font-label);
  font-size: 13px;
  fill: var(--ink);
  text-anchor: middle;
  font-weight: 600;
}
.gateway rect { fill: var(--blue); }
.gateway-label {
  font-family: var(--font-display);
  font-size: 15px;
  fill: var(--cream);
  text-anchor: middle;
  letter-spacing: 0.05em;
}
.gateway line { stroke: var(--gold); stroke-width: 2; }
.gateway-sub {
  font-family: var(--font-label);
  font-size: 11px;
  fill: var(--cream);
  text-anchor: middle;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.channel-1 rect { fill: var(--red); } .channel-1 text { fill: var(--cream); }
.channel-2 rect { fill: var(--gold); }
.channel-3 rect { fill: var(--blue); } .channel-3 text { fill: var(--cream); }
.channel-4 rect { fill: var(--ink); } .channel-4 text { fill: var(--cream); }
.agent-1 rect, .agent-2 rect, .agent-3 rect { fill: var(--paper-lite); }
.memory rect { fill: var(--smoke); } .memory text { fill: var(--cream); }
.wires path { fill: none; stroke: var(--ink); stroke-width: 2; }
.caption {
  margin-top: 0.8rem;
  font-family: var(--font-label);
  font-size: 0.78rem;
  color: var(--smoke);
  line-height: 1.5;
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-alt {
  background: var(--paper);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
}
.section-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: 0.01em;
  margin-block-end: 1.4rem;
}
.section-lede {
  font-size: 1.05rem;
  max-width: 52ch;
  margin-block: 0 1.8rem;
  color: var(--ink);
}

.lead-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.prose p { margin: 0 0 1rem; font-size: 1.02rem; }
.prose strong { color: var(--ink); }

.callout {
  background: var(--ink);
  color: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem;
}
.callout-red { background: var(--red); }
.callout-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.05rem;
  margin-block-end: 0.6rem;
  color: var(--gold);
}
.callout-red .callout-title { color: var(--paper-lite); }
.callout p { margin: 0; font-size: 0.95rem; line-height: 1.55; }

/* ---------- Architecture ---------- */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.arch-card {
  background: var(--paper-lite);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 1.3rem 1.2rem;
  position: relative;
}
.arch-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--red);
  display: block;
  margin-block-end: 0.4rem;
}
.arch-card h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.02rem;
  margin-block-end: 0.5rem;
}
.arch-card p { margin: 0; font-size: 0.92rem; }
.arch-card code, .iso-list code { font-family: var(--font-mono); font-size: 0.85em; }

/* ---------- Journey ---------- */
.journey {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  max-width: 720px;
}
.journey::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--ink);
}
.journey-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.2rem;
  padding-block: 1.2rem;
  align-items: start;
}
.journey-step {
  font-family: var(--font-display);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  z-index: 1;
  font-size: 1.1rem;
}
.journey-item:nth-child(even) .journey-step { background: var(--blue); color: var(--cream); }
.journey-item h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.02rem;
  margin-block-end: 0.35rem;
}
.journey-item p { margin: 0; font-size: 0.95rem; max-width: 56ch; }

/* ---------- Isolation ---------- */
.iso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.iso-card {
  background: var(--paper-lite);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 1.3rem 1.3rem;
}
.iso-card-b { box-shadow: 10px 10px 0 var(--blue); }
.iso-head {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.05rem;
  margin-block-end: 0.8rem;
  border-bottom: 2px solid var(--ink);
  padding-block-end: 0.5rem;
}
.iso-list { list-style: none; margin: 0; padding: 0; }
.iso-list li {
  padding-block: 0.45rem;
  border-bottom: 1px dashed var(--smoke);
  font-size: 0.92rem;
}
.iso-list li:last-child { border-bottom: none; }
.iso-note {
  grid-column: 1 / -1;
  background: var(--blue);
  color: var(--cream);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.3rem;
}
.iso-note p { margin: 0; font-size: 0.95rem; }
.iso-note strong { color: var(--gold); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.role-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-lite);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
}
.role-table th, .role-table td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-right: 1px solid var(--paper);
}
.role-table th:last-child, .role-table td:last-child { border-right: none; }
.role-table thead th {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
}
.role-table tbody tr { border-top: 1px solid var(--paper); }
.role-table tbody tr:nth-child(even) { background: var(--paper); }
.role-table code { font-family: var(--font-mono); background: var(--paper-lite); padding: 0.1rem 0.35rem; border: 1px solid var(--smoke); }
.fine-print { margin-block-start: 1.2rem; font-size: 0.95rem; color: var(--ink); }
.fine-print strong { color: var(--red); }

/* ---------- Configure ---------- */
.conf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.4rem, 4vw, 2.6rem);
  align-items: start;
}
.conf-steps { margin: 0; padding-left: 1.2rem; font-size: 0.98rem; }
.conf-steps li { margin-block-end: 0.5rem; }
.conf-steps strong { color: var(--red); }
.code-block {
  background: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.4rem;
}
.code-caption {
  font-family: var(--font-label);
  font-size: 0.76rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-block: 0 0.8rem;
}
.code-block pre { margin: 0; overflow-x: auto; }
.code-block code {
  font-family: var(--font-mono);
  color: var(--paper-lite);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ---------- Security ---------- */
.security-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.sec-item {
  background: var(--paper-lite);
  border-left: 6px solid var(--red);
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem 1.2rem;
}
.sec-item h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1rem;
  margin-block-end: 0.5rem;
}
.sec-item p { margin: 0; font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  border-top: 3px solid var(--ink);
  padding-block: 2rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}
.footer-note { margin: 0; font-size: 0.9rem; max-width: 52ch; }
.footer-meta { margin: 0; font-family: var(--font-label); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--smoke); }
.site-footer .footer-meta { color: #8a93a0; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Screen reader / accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-diagram { order: -1; }
  .arch-grid { grid-template-columns: 1fr 1fr; }
  .security-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .site-header .header-inner { flex-direction: column; align-items: flex-start; }
  .site-nav { gap: 0.4rem 0.9rem; }
  .hero-facts { grid-template-columns: 1fr; }
  .lead-cols, .conf-grid { grid-template-columns: 1fr; }
  .arch-grid, .security-grid, .iso-grid { grid-template-columns: 1fr; }
  .iso-note { grid-column: auto; }
  .journey { max-width: none; }
  .journey-item { grid-template-columns: 44px 1fr; gap: 0.9rem; }
  .journey-step { width: 44px; height: 44px; font-size: 0.95rem; }
  .journey::before { left: 21px; }
  .footer-inner { flex-direction: column; }
}
