/* =========================================================================
   AGENTS WELCOME — "Phosphor & Blueprint"
   Human layer: warm editorial serif (Fraunces) on deep green-black.
   Machine layer: phosphor-green mono (IBM Plex Mono), revealed by X-ray.
   ========================================================================= */

:root {
  --ink: #0a0e0b;
  --ink-2: #0d120e;
  --panel: #121811;
  --panel-2: #161d14;
  --line: #243121;
  --line-dash: #2e4128;
  --phosphor: #57f287;
  --phosphor-dim: #3aa45f;
  --phosphor-ghost: rgba(87, 242, 135, 0.08);
  --amber: #e8a33d;
  --cream: #efe9da;
  --cream-dim: #b9b4a4;
  --dim: #8d977f;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --maxw: 1180px;
  --glow: 0 0 12px rgba(87, 242, 135, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--serif);
  font-weight: 340;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--phosphor); color: var(--ink); }

a { color: var(--phosphor); text-decoration-color: var(--phosphor-dim); text-underline-offset: 3px; }
a:hover { color: var(--cream); text-decoration-color: var(--cream); }

/* Consistent, visible keyboard-focus indicator (keyboard only, not mouse). */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 2px;
  border-radius: 3px;
}

code, pre { font-family: var(--mono); }
p code, .what code, .why code, li code {
  font-size: 0.82em;
  background: var(--phosphor-ghost);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.4em;
  color: var(--phosphor);
  white-space: nowrap;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--phosphor); color: var(--ink);
  padding: 0.6rem 1rem; font-family: var(--mono); z-index: 10001;
}
.skip:focus { left: 1rem; top: 1rem; }

/* the machine voice */
.machine-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--phosphor-dim);
  margin: 0 0 0.5rem;
}
.machine-label.inline { display: inline; text-transform: none; letter-spacing: 0.04em; color: var(--phosphor); }

/* ============================== header ============================== */

.site-head {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head nav {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 2rem;
  padding: 0.85rem 1.5rem;
}
.wordmark {
  font-family: var(--mono); font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.1em; color: var(--cream); text-decoration: none;
}
.wordmark em { font-style: normal; color: var(--phosphor); }
.wm-glyph { color: var(--phosphor); text-shadow: var(--glow); }
.nav-links {
  display: flex; gap: 1.4rem; list-style: none; margin: 0 0 0 auto; padding: 0;
}
.nav-links a {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em;
  color: var(--cream-dim); text-decoration: none; text-transform: uppercase;
}
.nav-links a:hover { color: var(--phosphor); }
.nav-md { border: 1px solid var(--line-dash); padding: 0.15rem 0.5rem; border-radius: 4px; }

/* "Guides" dropdown in the primary nav — pure CSS, opens on hover and keyboard focus */
.nav-group { position: relative; }
.nav-grouptop { display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.nav-grouptop.is-active { color: var(--phosphor); }
.nav-submenu {
  list-style: none; margin: 0; padding: 0.45rem 0; position: absolute; top: calc(100% + 0.55rem); left: -0.85rem;
  min-width: 13.5rem; display: grid; gap: 0.05rem;
  background: color-mix(in srgb, var(--ink) 96%, transparent);
  border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 14px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transform: translateY(-5px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 120;
}
.nav-group:hover .nav-submenu,
.nav-group:focus-within .nav-submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-submenu li { margin: 0; }
.nav-submenu a { display: block; padding: 0.42rem 0.95rem; text-transform: none; letter-spacing: 0.01em; font-size: 0.82rem; }
.nav-submenu a[aria-current="page"] { color: var(--phosphor); }

#xray-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.18em; cursor: pointer;
  color: var(--phosphor); background: transparent;
  border: 1px solid var(--phosphor-dim); border-radius: 4px;
  padding: 0.45rem 0.9rem;
  transition: background 0.2s, box-shadow 0.2s;
}
#xray-toggle:hover { background: var(--phosphor-ghost); box-shadow: var(--glow); }
.xr-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--dim); transition: background 0.2s, box-shadow 0.2s;
}
body.xray .xr-dot { background: var(--phosphor); box-shadow: var(--glow); }
body.xray #xray-toggle { background: var(--phosphor); color: var(--ink); }
body.xray #xray-toggle .xr-dot { background: var(--ink); box-shadow: none; }

/* ============================== hero ============================== */

.hero {
  position: relative;
  min-height: 88vh;
  display: grid; align-items: center;
  max-width: var(--maxw); margin: 0 auto; padding: 4rem 1.5rem 5rem;
}
.hero-art {
  position: absolute; inset: 0 -20vw 0 32%;
  z-index: 0; overflow: hidden;
}
.hero-art img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.55;
  mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
}
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,14,11,0.1) 40%, var(--ink) 96%);
}
.hero-copy { position: relative; z-index: 1; max-width: 640px; }

.kicker { margin-bottom: 1.6rem; }

h1 {
  margin: 0 0 1.6rem;
  display: flex; flex-direction: column; gap: 0.2rem;
}
.hello-human {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  font-weight: 320; line-height: 1.04; letter-spacing: -0.01em;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hello-human em { font-style: italic; font-weight: 430; color: var(--cream); }
.hello-agent {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  font-weight: 500; color: var(--phosphor);
  text-shadow: var(--glow);
  animation: rise 0.9s 0.18s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.cursor { animation: blink 1.1s steps(1) infinite; }

.lede {
  font-size: 1.16rem; line-height: 1.7; color: var(--cream-dim);
  max-width: 56ch; margin: 0 0 2rem;
  animation: rise 0.9s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.lede strong, .lede em { color: var(--cream); }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.6rem;
  animation: rise 0.9s 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

.btn {
  font-family: var(--mono); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  padding: 0.8rem 1.5rem; border-radius: 5px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-phosphor {
  background: var(--phosphor); color: var(--ink); border: 1px solid var(--phosphor);
}
.btn-phosphor:hover { box-shadow: 0 0 24px rgba(87, 242, 135, 0.45); color: var(--ink); }
.btn-ghost {
  background: transparent; color: var(--cream); border: 1px solid var(--line-dash);
}
.btn-ghost:hover { border-color: var(--phosphor-dim); color: var(--phosphor); }

.whoami {
  border: 1px dashed var(--line-dash); border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  padding: 1rem 1.2rem; max-width: 56ch;
  animation: rise 0.9s 0.54s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.whoami-verdict { margin: 0; font-family: var(--mono); font-size: 0.86rem; color: var(--cream-dim); }
.whoami-verdict code { font-size: 0.95em; }
.whoami-verdict .v-agent { color: var(--phosphor); }
.whoami-verdict .v-human { color: var(--amber); }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }

/* ============================== stats ============================== */

.stats { border-block: 1px solid var(--line); background: var(--ink-2); }
.stats dl {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.stat { padding: 2.2rem 1.6rem; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; padding-left: 0; }
.stat dt {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--dim); min-height: 3.2em; margin-bottom: 0.6rem;
}
.stat dd { margin: 0; font-family: var(--serif); font-weight: 360;
  font-size: 2.9rem; line-height: 1; color: var(--cream); }
.stat dd .unit { font-size: 1rem; font-style: italic; color: var(--phosphor); margin-left: 0.35rem; }
.stat dd.src { font-family: var(--mono); font-size: 0.66rem; color: var(--phosphor-dim);
  margin-top: 0.55rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* ============================== sections ============================== */

section { scroll-margin-top: 4.5rem; }

.section-head { max-width: var(--maxw); margin: 0 auto; padding: 5.5rem 1.5rem 2.5rem; }
.section-head h2 {
  margin: 0 0 1rem; font-weight: 320; letter-spacing: -0.01em;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.05;
}
.section-head h2 em { font-style: italic; font-weight: 430; color: var(--phosphor); }
.section-lede { max-width: 62ch; color: var(--cream-dim); margin: 0; font-size: 1.05rem; }
.section-lede code { white-space: nowrap; }

/* ============================== catalog ============================== */

.cards {
  list-style: none; counter-reset: card;
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 4rem;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem;
}
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2rem 2rem 1.6rem;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover { border-color: var(--phosphor-dim); transform: translateY(-3px); }
.card:nth-child(odd) { transform: translateY(0); }
.card:nth-child(even) { margin-top: 2.2rem; }
.card:nth-child(even):hover { transform: translateY(-3px); margin-top: 2.2rem; }

.card-no {
  position: absolute; top: -1.4rem; right: 0.6rem; margin: 0;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: 7rem; line-height: 1; color: var(--phosphor-ghost);
  -webkit-text-stroke: 1px var(--line-dash);
  pointer-events: none; user-select: none;
}
.card h3 {
  margin: 0 0 0.9rem; font-weight: 420; font-size: 1.45rem; line-height: 1.2;
  letter-spacing: -0.005em; max-width: 88%;
}
.card h3 em { color: var(--phosphor); font-style: italic; }
.card .what { margin: 0 0 0.7rem; color: var(--cream); }
.card .why { margin: 0 0 1.1rem; color: var(--dim); font-size: 0.93rem; }

.snippet {
  margin: 0 0 1.1rem; padding: 1rem 1.1rem;
  background: var(--ink); border: 1px solid var(--line);
  border-left: 2px solid var(--phosphor-dim);
  border-radius: 6px; overflow-x: auto;
  font-size: 0.76rem; line-height: 1.55; color: #9fd9b4;
}
.snippet code { background: none; border: none; padding: 0; color: inherit; white-space: pre; }

.proof { margin: 0; font-size: 0.85rem; color: var(--cream-dim);
  border-top: 1px dashed var(--line-dash); padding-top: 0.9rem;
  display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.proof .machine-label { margin: 0; color: var(--amber); }
.proof a, .proof code { font-family: var(--mono); font-size: 0.8rem; }

.linklike {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--phosphor); font: inherit; font-family: var(--mono); font-size: 0.8rem;
  text-decoration: underline; text-decoration-color: var(--phosphor-dim); text-underline-offset: 3px;
}
.linklike:hover { color: var(--cream); }

/* ============================== demos ============================== */

.demos { background: var(--ink-2); border-block: 1px solid var(--line); }
.curl-matrix {
  list-style: none; max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem;
  display: grid; gap: 0.6rem;
}
.curl-matrix li {
  display: grid; grid-template-columns: 200px 1fr auto; align-items: center; gap: 1.2rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.85rem 1.1rem;
}
.cm-label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--amber); }
.curl-matrix code { font-size: 0.78rem; color: #9fd9b4; overflow-x: auto; white-space: nowrap;
  scrollbar-width: thin; padding-bottom: 2px; }
.copy {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: transparent; color: var(--phosphor); border: 1px solid var(--phosphor-dim);
  border-radius: 4px; padding: 0.35rem 0.7rem; cursor: pointer; transition: background 0.15s;
}
.copy:hover { background: var(--phosphor-ghost); }
.copy.copied { background: var(--phosphor); color: var(--ink); }

.diet {
  max-width: var(--maxw); margin: 2.4rem auto 0; padding: 1.6rem 1.5rem 4.5rem;
}
.diet-bars { display: grid; gap: 0.7rem; max-width: 720px; }
.diet-row { display: grid; grid-template-columns: 110px 1fr 130px; gap: 1rem; align-items: center; }
.diet-name { font-family: var(--mono); font-size: 0.78rem; color: var(--cream-dim); }
.diet-bar { height: 22px; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.diet-bar i { display: block; height: 100%; width: 0; transition: width 1.1s cubic-bezier(0.2, 0.7, 0.2, 1); }
.diet-bar.html i { background: repeating-linear-gradient(135deg, #5a4a2e 0 8px, #6b5836 8px 16px); }
.diet-bar.md i { background: var(--phosphor); box-shadow: var(--glow); }
.diet-val { font-family: var(--mono); font-size: 0.78rem; color: var(--cream-dim); text-align: right; }
.diet-note { font-size: 0.9rem; color: var(--dim); margin: 0.9rem 0 0; max-width: 60ch; }

/* ============================== playground ============================== */

.pg-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 5rem;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.4rem; align-items: start;
}
.pg-tools { display: grid; gap: 0.8rem; }
.pg-tool {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem 1.2rem;
}
.pg-tool h4 { margin: 0 0 0.3rem; font-family: var(--mono); font-size: 0.92rem;
  font-weight: 600; color: var(--phosphor); }
.pg-tool h4 .ann { color: var(--dim); font-weight: 400; font-size: 0.72rem; margin-left: 0.5rem; }
.pg-tool p { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--cream-dim); }
.pg-tool pre { margin: 0; font-size: 0.7rem; color: var(--dim); overflow-x: auto; }

.pg-run { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }
#pg-form { display: grid; gap: 0.7rem; }
#pg-select, #pg-args input {
  width: 100%; background: var(--ink); color: var(--cream);
  border: 1px solid var(--line-dash); border-radius: 5px;
  font-family: var(--mono); font-size: 0.85rem; padding: 0.6rem 0.8rem;
}
#pg-select:focus, #pg-args input:focus, #guestbook-form input:focus, #guestbook-form textarea:focus {
  outline: 2px solid var(--phosphor-dim); outline-offset: 1px;
}
#pg-args { display: grid; gap: 0.6rem; }
#pg-args label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dim); display: grid; gap: 0.3rem; }
.pg-preview {
  margin: 0; background: var(--ink); border: 1px dashed var(--line-dash);
  border-radius: 6px; padding: 0.9rem 1rem; font-size: 0.76rem; line-height: 1.5;
  color: #9fd9b4; overflow-x: auto; min-height: 4.5em;
}
.pg-audit { margin-top: 1.4rem; }
#pg-audit { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem;
  max-height: 240px; overflow-y: auto; }
#pg-audit li {
  font-family: var(--mono); font-size: 0.74rem; color: var(--cream-dim);
  border-left: 2px solid var(--phosphor-dim); padding: 0.3rem 0 0.3rem 0.8rem;
  background: var(--phosphor-ghost); border-radius: 0 4px 4px 0;
}
#pg-audit li.pg-empty { border-left-color: var(--line-dash); background: none; color: var(--dim); }
#pg-audit li .t { color: var(--amber); }

/* ============================== guestbook ============================== */

.guestbook { background: var(--ink-2); border-block: 1px solid var(--line); }
.gb-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 5rem;
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2.5rem; align-items: start;
}
#guestbook-form { display: grid; gap: 0.45rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 1.6rem; }
#guestbook-form label { font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin-top: 0.5rem; }
#guestbook-form label:first-child { margin-top: 0; }
.req { color: var(--phosphor); }
.opt { text-transform: none; letter-spacing: 0; }
#guestbook-form input, #guestbook-form textarea {
  background: var(--ink); color: var(--cream); border: 1px solid var(--line-dash);
  border-radius: 5px; font-family: var(--mono); font-size: 0.88rem; padding: 0.65rem 0.8rem;
  resize: vertical;
}
#guestbook-form .btn { margin-top: 0.9rem; justify-self: start; }
.gb-status { margin: 0.4rem 0 0; font-family: var(--mono); font-size: 0.78rem; color: var(--amber); min-height: 1.2em; }

#gb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.gb-entry { border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 1.1rem 1.3rem; }
.gb-msg { margin: 0 0 0.5rem; font-size: 1.02rem; line-height: 1.55; }
.gb-meta { margin: 0; font-family: var(--mono); font-size: 0.72rem; color: var(--dim);
  letter-spacing: 0.05em; }
.gb-meta span { color: var(--phosphor-dim); text-transform: uppercase; }

/* ============================== ethics ============================== */

.ethics-cols {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 5.5rem;
  columns: 2; column-gap: 3rem; max-width: 980px;
}
.ethics-cols p { margin: 0 0 1.2rem; break-inside: avoid; color: var(--cream-dim); }
.ethics-cols strong { color: var(--amber); }
.ethics-cols p:first-child::first-letter {
  font-family: var(--serif); font-style: italic; font-weight: 430;
  font-size: 3.4em; float: left; line-height: 0.8;
  padding: 0.08em 0.12em 0 0; color: var(--phosphor);
}

/* ============================== footer ============================== */

.site-foot { border-top: 1px solid var(--line); background: var(--ink-2); }
.foot-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.5rem 3.5rem;
  display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 2.5rem;
}
/* four-column variant (adds a "guides" column); collapses via the .foot-grid media queries below */
.foot-grid--4 { grid-template-columns: 1fr 1fr 1fr 1.6fr; gap: 2rem; }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.foot-links a { font-family: var(--mono); font-size: 0.8rem; text-decoration: none;
  color: var(--cream-dim); }
.foot-links a:hover { color: var(--phosphor); }
.colophon p { margin: 0 0 0.8rem; font-size: 0.92rem; color: var(--cream-dim); max-width: 48ch; }
.foot-sig { font-family: var(--mono); font-size: 0.76rem; color: var(--phosphor-dim); }

/* ============================== X-RAY MODE ============================== */

body.xray { background: #070a08; }

/* scanlines wake up */
body.xray::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background: repeating-linear-gradient(180deg,
    transparent 0 3px, rgba(87, 242, 135, 0.025) 3px 4px);
}

/* landmark annotations */
body.xray [data-agent-region] { position: relative; outline: 1px dashed var(--phosphor-dim); outline-offset: -1px; }
body.xray [data-agent-region]::before {
  content: "region: " attr(data-agent-region);
  position: absolute; top: 0; left: 0; z-index: 50;
  font-family: var(--mono); font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--phosphor); color: var(--ink);
  padding: 0.15rem 0.55rem; border-radius: 0 0 5px 0;
}
body.xray [data-agent-technique] { outline: 1px dashed var(--line-dash); }
body.xray [data-agent-technique]::after {
  content: "id: " attr(data-agent-technique);
  position: absolute; bottom: 0.5rem; right: 0.7rem;
  font-family: var(--mono); font-size: 0.62rem; color: var(--phosphor-dim);
  letter-spacing: 0.1em;
}

/* serif dims, mono glows */
body.xray .hello-human, body.xray .section-head h2, body.xray .card h3 { opacity: 0.45; }
body.xray .machine-label { color: var(--phosphor); text-shadow: var(--glow); }
body.xray .hero-art img { opacity: 0.25; filter: saturate(0.4); }

/* inspector panel */
.machine-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 10000;
  width: min(480px, 92vw);
  background: color-mix(in srgb, #070a08 94%, transparent);
  backdrop-filter: blur(14px);
  border-left: 1px solid var(--phosphor-dim);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
body.xray .machine-panel { transform: none; }
.mp-head { display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.mp-head .machine-label { margin: 0; }
#xray-close { background: none; border: 1px solid var(--line-dash); color: var(--cream-dim);
  border-radius: 4px; width: 28px; height: 28px; cursor: pointer; font-size: 0.8rem; }
#xray-close:hover { color: var(--phosphor); border-color: var(--phosphor-dim); }
.mp-tabs { display: flex; gap: 0.4rem; padding: 0.8rem 1.2rem 0; }
.mp-tabs [role="tab"] {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: none; border: 1px solid var(--line-dash); border-radius: 4px;
  color: var(--cream-dim); padding: 0.35rem 0.7rem; cursor: pointer;
}
.mp-tabs [aria-selected="true"] { background: var(--phosphor); color: var(--ink); border-color: var(--phosphor); }
.mp-body {
  flex: 1; margin: 0.9rem 1.2rem 1.2rem; padding: 1rem;
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  overflow: auto; font-size: 0.72rem; line-height: 1.55; color: #9fd9b4;
  white-space: pre-wrap; word-break: break-word;
}

/* ============================== business layer ============================== */
/* Commerce speaks amber; the machine still speaks phosphor. */

.btn-amber { background: var(--amber); color: var(--ink); border: 1px solid var(--amber); }
.btn-amber:hover { box-shadow: 0 0 24px rgba(232, 163, 61, 0.45); color: var(--ink); }
.btn-back { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cream-dim); text-decoration: none;
  border: 1px solid var(--line-dash); border-radius: 4px; padding: 0.45rem 0.9rem; }
.btn-back:hover { color: var(--amber); border-color: var(--amber); }

.hero-biz { min-height: 56vh; }
.biz-title { font-family: var(--serif); font-size: clamp(2.4rem, 5.6vw, 4.1rem);
  font-weight: 320; line-height: 1.06; letter-spacing: -0.01em; display: block; }
.biz-title em { font-style: italic; font-weight: 430; color: var(--amber); }
.biz .kicker { color: #b8842f; }

.svc { border-top: 1px solid var(--line); }
.svc-alt { background: var(--ink-2); }
.svc .section-head { padding-top: 4.5rem; }
.svc .machine-label { color: #b8842f; }
.svc .section-head h2 em { color: var(--amber); }
.svc-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 3rem;
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2rem; align-items: start;
}
.svc-note { font-size: 0.9rem; color: var(--dim); margin: 0.6rem 0 1rem; }
.svc-note.center { text-align: center; max-width: 64ch; margin: 1.4rem auto 0; }
.snippet.wide { max-width: var(--maxw); margin: 0 auto 4rem; display: block;
  margin-left: auto; margin-right: auto; width: calc(100% - 3rem); }

#audit-form, #dir-form {
  display: grid; gap: 0.5rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 1.6rem;
}
#audit-form label, #dir-form label { font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
#audit-form input, #dir-form input {
  background: var(--ink); color: var(--cream); border: 1px solid var(--line-dash);
  border-radius: 5px; font-family: var(--mono); font-size: 0.88rem; padding: 0.65rem 0.8rem;
}
#audit-form input:focus, #dir-form input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
#audit-form .btn, #dir-form .btn { margin-top: 0.7rem; justify-self: start; }

.audit-report { background: var(--panel-2); border: 1px dashed var(--line-dash);
  border-radius: 10px; padding: 1.4rem 1.6rem; min-height: 200px; }
.ar-empty { color: var(--dim); font-size: 0.95rem; }
.ar-head { display: flex; gap: 1.2rem; align-items: center; margin-bottom: 1rem; }
.score-ring {
  width: 84px; height: 84px; border-radius: 50%; flex: none;
  display: grid; place-items: center; position: relative;
}
.score-ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--panel-2); }
.score-ring span { position: relative; z-index: 1; font-family: var(--serif);
  font-size: 1.7rem; font-weight: 420; color: var(--cream); }
.ar-grade { margin: 0 0 0.25rem; font-family: var(--serif); font-style: italic;
  font-size: 1.25rem; color: var(--cream); }
.ar-next { margin: 0; font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }
.ar-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.ar-checks li { display: grid; grid-template-columns: 1.4rem 1fr auto; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.76rem; align-items: baseline;
  padding: 0.3rem 0.5rem; border-radius: 4px; }
.check-pass { color: var(--cream-dim); background: var(--phosphor-ghost); }
.check-pass .ck { color: var(--phosphor); }
.check-fail { color: var(--cream-dim); background: rgba(232, 163, 61, 0.07); }
.check-fail .ck { color: var(--amber); }
.ck-w { color: var(--dim); }
.ck-fix { grid-column: 2 / -1; color: var(--amber); font-size: 0.7rem; }

.stepper { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.step { display: flex; gap: 1rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 1rem 1.2rem; transition: border-color 0.25s; }
.step-no { font-family: var(--serif); font-style: italic; font-size: 1.6rem;
  color: var(--line-dash); flex: none; width: 1.4rem; transition: color 0.25s; }
.step strong { display: block; font-family: var(--mono); font-size: 0.82rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--cream); margin-bottom: 0.2rem; }
.step code { font-size: 0.74rem; color: var(--dim); background: none; border: none; padding: 0; white-space: normal; }
.step-out { margin: 0.4rem 0 0; font-size: 0.72rem; color: var(--dim); white-space: pre-wrap; word-break: break-all; }
.step-done { border-color: var(--amber); }
.step-done .step-no { color: var(--amber); }
.step-done .step-out { color: #e9c98c; }
.step-fail { border-color: #b3502e; }
#playbook-box { margin-top: 1rem; }
#playbook-box summary { cursor: pointer; }
#playbook-content { max-height: 340px; overflow-y: auto; margin-top: 0.6rem; }

.licensing { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 4.5rem; }
.licensing p:last-child { max-width: 72ch; color: var(--cream-dim); margin: 0;
  border-left: 2px solid var(--amber); padding-left: 1.2rem; }

.dir-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.dir-row { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem 1.2rem; display: grid; gap: 0.5rem; justify-items: start; }
.dir-url { font-family: var(--mono); font-size: 0.9rem; color: var(--cream); }
.dir-meta { font-family: var(--mono); font-size: 0.7rem; color: var(--dim); letter-spacing: 0.05em; }

.pricing-table {
  width: calc(100% - 3rem); max-width: var(--maxw); margin: 0 auto;
  border-collapse: collapse; font-size: 0.92rem;
}
.pricing-table th, .pricing-table td { text-align: left; padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line); }
.pricing-table thead th { font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: #b8842f; border-bottom-color: var(--line-dash); }
.pricing-table tbody th { font-family: var(--serif); font-weight: 420; color: var(--cream); }
.pricing-table td { font-family: var(--mono); font-size: 0.8rem; color: var(--cream-dim); }
.pricing-table tbody tr:hover { background: rgba(232, 163, 61, 0.04); }

/* teaser strip on the homepage */
.biz-teaser { border-top: 1px solid var(--line); background: var(--ink-2); }
.biz-teaser-inner { max-width: var(--maxw); margin: 0 auto; padding: 3.2rem 1.5rem;
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.biz-teaser h2 { margin: 0 0 0.5rem; font-weight: 320; font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.biz-teaser h2 em { font-style: italic; font-weight: 430; color: var(--amber); }
.biz-teaser p { margin: 0; color: var(--cream-dim); max-width: 56ch; }
.biz-teaser .machine-label { color: #b8842f; }

/* ===================== almanac feature (homepage) ===================== */
.almanac-feature { border-block: 1px solid var(--line); background:
  radial-gradient(120% 120% at 80% 0%, rgba(87,242,135,0.06), transparent 60%), var(--ink-2); }
.almanac-feature-inner { max-width: var(--maxw); margin: 0 auto; padding: 4.5rem 1.5rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.aff-copy h2 { margin: 0 0 1rem; font-weight: 320; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
.aff-copy h2 em { font-style: italic; font-weight: 430; color: var(--phosphor); }
.aff-copy p { margin: 0 0 1.8rem; color: var(--cream-dim); max-width: 52ch; }
.aff-copy em { color: var(--cream); font-style: italic; }
.aff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.aff-list a { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto;
  column-gap: 1rem; text-decoration: none; padding: 1rem 1.2rem; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); transition: border-color 0.2s, transform 0.2s; }
.aff-list a:hover { border-color: var(--phosphor-dim); transform: translateX(4px); }
.aff-n { grid-row: span 2; align-self: center; font-family: var(--serif); font-weight: 300;
  font-size: 2.1rem; color: var(--phosphor); text-align: center; }
.aff-t { font-weight: 460; color: var(--cream); }
.aff-d { font-family: var(--mono); font-size: 0.74rem; color: var(--dim); }

/* ============================== the almanac ============================== */

.alm-head { padding-top: 4.5rem; }
.alm-head h1 { margin: 0 0 1rem; font-weight: 320; letter-spacing: -0.01em;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.05; }
.alm-head h1 em { font-style: italic; font-weight: 430; color: var(--phosphor); }

/* dataset-page hero artwork (right-anchored, masked, text stays legible) */
.alm-head.has-hero { position: relative; overflow: hidden; padding-top: 5rem; padding-bottom: 3.5rem; }
.alm-hero-art { position: absolute; inset: 0 0 0 38%; z-index: 0; pointer-events: none; }
.alm-hero-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5;
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%); }
.alm-hero-veil { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,14,11,0.15) 50%, var(--ink) 98%); }
.alm-head.has-hero .alm-head-copy { position: relative; z-index: 1; max-width: 60ch; }

.hero-alm { min-height: 60vh; }
.hero-alm .biz-title em { color: var(--phosphor); }

/* hub search */
.alm-search { margin-top: 1.6rem; max-width: 56ch; position: relative; }
.alm-search input {
  width: 100%; background: var(--ink); color: var(--cream);
  border: 1px solid var(--line-dash); border-radius: 8px;
  font-family: var(--mono); font-size: 0.95rem; padding: 0.85rem 1rem;
}
.alm-search input:focus { outline: 2px solid var(--phosphor-dim); outline-offset: 1px; }
.alm-results { display: grid; gap: 0.35rem; margin-top: 0.6rem; }
.alm-result {
  display: grid; grid-template-columns: 86px 1fr; gap: 0.2rem 0.8rem;
  text-decoration: none; padding: 0.6rem 0.8rem; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--line);
}
.alm-result:hover { border-color: var(--phosphor-dim); }
.alm-result-type { grid-row: span 2; font-family: var(--mono); font-size: 0.64rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--phosphor-dim);
  align-self: center; }
.alm-result-title { font-weight: 460; color: var(--cream); }
.alm-result-snip { font-size: 0.82rem; color: var(--dim); }
.alm-noresult { font-family: var(--mono); font-size: 0.82rem; color: var(--dim); padding: 0.6rem 0; }

/* hub grid */
.alm-grid-wrap { max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.5rem; }
.alm-grid { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(2, 1fr); gap: 1.4rem; counter-reset: alm; }
.alm-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color 0.25s, transform 0.25s; }
.alm-card:hover { border-color: var(--phosphor-dim); transform: translateY(-3px); }
.alm-card a { display: block; padding: 1.8rem 1.8rem 1.4rem; text-decoration: none; color: inherit; }
.alm-count { margin: 0 0 0.6rem; font-family: var(--serif); font-weight: 300;
  font-size: 2.6rem; line-height: 1; color: var(--phosphor); }
.alm-count span { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--dim); margin-left: 0.5rem; }
.alm-card h2 { margin: 0 0 0.5rem; font-weight: 440; font-size: 1.4rem; color: var(--cream); }
.alm-card p { margin: 0 0 0.8rem; color: var(--cream-dim); font-size: 0.96rem; }
.alm-links { margin: 0; color: var(--phosphor-dim); }

/* hub verify */
.alm-verify { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 4rem; }
.alm-verify-form { display: flex; gap: 0.8rem; flex-wrap: wrap; max-width: 760px; }
.alm-verify-form input { flex: 1; min-width: 280px; background: var(--ink); color: var(--cream);
  border: 1px solid var(--line-dash); border-radius: 6px; font-family: var(--mono);
  font-size: 0.85rem; padding: 0.7rem 0.9rem; }
.alm-verify-out { margin-top: 1rem; max-width: 760px; }
.alm-verify-out.wide { max-width: var(--maxw); margin-left: auto; margin-right: auto;
  padding: 0 1.5rem; width: 100%; }
.verify-card { border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.3rem;
  background: var(--panel); }
.verify-hit { border-left: 2px solid var(--phosphor); }
.verify-miss { border-left: 2px solid var(--amber); }
.verify-verdict { margin: 0 0 0.7rem; color: var(--cream); }
.verify-hit .verify-verdict { color: var(--phosphor); }
.verify-miss .verify-verdict { color: var(--amber); }
.verify-detail { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem 1.4rem;
  margin: 0 0 0.7rem; }
.verify-detail dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dim); }
.verify-detail dd { margin: 0.1rem 0 0; font-size: 0.88rem; color: var(--cream-dim); }
.verify-caveat { margin: 0; }

/* almanac filter chips + inline verify */
.alm-tools { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 1rem;
  display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.alm-filter { display: flex; gap: 0.4rem; align-items: center; }
.alm-filter .machine-label { margin: 0 0.4rem 0 0; }
.chip { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  background: transparent; color: var(--cream-dim); border: 1px solid var(--line-dash);
  border-radius: 20px; padding: 0.3rem 0.85rem; cursor: pointer; transition: all 0.15s; }
.chip:hover { border-color: var(--phosphor-dim); color: var(--phosphor); }
.chip.active { background: var(--phosphor); color: var(--ink); border-color: var(--phosphor); }
.alm-verify-inline { display: flex; gap: 0.5rem; }
.alm-verify-inline input { background: var(--ink); color: var(--cream); border: 1px solid var(--line-dash);
  border-radius: 6px; font-family: var(--mono); font-size: 0.78rem; padding: 0.45rem 0.7rem; min-width: 260px; }
.alm-verify-inline .btn { padding: 0.45rem 1rem; }

/* almanac tables */
.alm-table-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 3rem; overflow-x: auto; }
.alm-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 720px; }
.alm-table thead th { text-align: left; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--phosphor-dim);
  padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line-dash); position: sticky; top: 0;
  background: var(--ink); }
.alm-table tbody th { text-align: left; padding: 0.85rem 0.9rem; vertical-align: top; }
.alm-table tbody td { padding: 0.85rem 0.9rem; vertical-align: top; color: var(--cream-dim); }
.alm-table tbody tr[data-agent-record] { border-top: 1px solid var(--line); }
.alm-table tbody tr[data-agent-record]:hover { background: var(--phosphor-ghost); }
.c-name { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--cream); }
.c-op { display: block; font-family: var(--mono); font-size: 0.68rem; color: var(--dim);
  letter-spacing: 0.05em; margin-top: 0.15rem; }
.c-verify { font-size: 0.8rem; max-width: 32ch; }
.c-robots .yes { color: var(--phosphor); }
.c-robots .no { color: var(--amber); }
.c-note-row td { padding-top: 0; padding-bottom: 1rem; font-size: 0.8rem; color: var(--dim);
  border-top: none; }
.c-note-row .machine-label { display: inline; margin-right: 0.4rem; }

.pill { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.18rem 0.55rem; border-radius: 4px; border: 1px solid; white-space: nowrap; }
.pill-training { color: #e8a33d; border-color: rgba(232,163,61,0.4); background: rgba(232,163,61,0.08); }
.pill-search { color: var(--phosphor); border-color: var(--phosphor-dim); background: var(--phosphor-ghost); }
.pill-inference { color: #6db5ff; border-color: rgba(109,181,255,0.4); background: rgba(109,181,255,0.08); }
.pill-agent { color: var(--cream); border-color: var(--line-dash); }

.models-table .num { font-family: var(--mono); font-size: 0.82rem; color: var(--cream); white-space: nowrap; }
.models-table .m-strength { font-size: 0.82rem; max-width: 30ch; }

.alm-foot-note { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 4rem; }
.alm-foot-note p { color: var(--dim); font-size: 0.88rem; max-width: 70ch; }
.alm-foot-note .machine-label { display: inline; margin-right: 0.4rem; color: var(--amber); }

/* protocols */
.proto-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 3rem; }
.proto-layer { margin-bottom: 2.6rem; }
.layer-h { font-family: var(--serif); font-weight: 360; font-size: 1.3rem; color: var(--cream);
  margin: 0 0 1.1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.layer-h .machine-label { display: inline; margin: 0 0.5rem 0 0; }
.proto-cards { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.proto-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.4rem 1.5rem; transition: border-color 0.2s; }
.proto-card:hover { border-color: var(--phosphor-dim); }
.proto-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.proto-top h3 { margin: 0; font-weight: 480; font-size: 1.3rem; color: var(--cream); }
.proto-status { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--phosphor); border: 1px solid var(--phosphor-dim);
  border-radius: 4px; padding: 0.15rem 0.5rem; white-space: nowrap; }
.proto-full { margin: 0.3rem 0 0.8rem; font-size: 0.82rem; color: var(--cream-dim); }
.proto-meta { color: var(--dim); }
.proto-one { margin: 0 0 1rem; color: var(--cream); }
.proto-card .snippet { font-size: 0.72rem; margin-bottom: 0.9rem; }
.proto-card .proof { border-top: 1px dashed var(--line-dash); padding-top: 0.8rem; margin: 0; }

/* glossary */
.gloss-wrap { max-width: 880px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.gloss-search { width: 100%; background: var(--ink); color: var(--cream); border: 1px solid var(--line-dash);
  border-radius: 8px; font-family: var(--mono); font-size: 0.9rem; padding: 0.75rem 1rem; margin-bottom: 1.6rem; }
.gloss-search:focus { outline: 2px solid var(--phosphor-dim); outline-offset: 1px; }
.gloss-list { margin: 0; }
.gloss-item { border-top: 1px solid var(--line); padding: 1.4rem 0; }
.gloss-item dt { font-family: var(--serif); font-weight: 440; font-size: 1.3rem; color: var(--cream);
  margin-bottom: 0.5rem; display: flex; align-items: baseline; gap: 0.7rem; }
.gloss-cat { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--phosphor-dim); border: 1px solid var(--line-dash); border-radius: 4px; padding: 0.12rem 0.45rem; }
.gloss-item dd { margin: 0; }
.gloss-short { margin: 0 0 0.6rem; color: var(--cream); font-size: 1.02rem; }
.gloss-long { margin: 0 0 0.6rem; color: var(--cream-dim); font-size: 0.93rem; }
.gloss-see { margin: 0; }
.gloss-see a { font-family: var(--mono); color: var(--phosphor-dim); text-decoration: none; }
.gloss-see a:hover { color: var(--phosphor); }

/* ----------------------------- legal pages ----------------------------- */
.legal-wrap { max-width: 760px; margin: 0 auto; padding: 0 1.5rem 4.5rem; }
.legal-wrap h2 { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; color: var(--cream); margin: 2.2rem 0 0.6rem; }
.legal-wrap p { color: var(--cream-dim); line-height: 1.7; margin: 0 0 0.9rem; }
.legal-wrap strong { color: var(--cream); }
.legal-wrap code { white-space: normal; }
.legal-banner { border: 1px solid var(--amber); border-left-width: 3px; border-radius: 8px;
  background: rgba(232, 163, 61, 0.07); padding: 1rem 1.2rem; color: var(--cream-dim); margin-bottom: 1.5rem; }
.legal-banner strong { color: var(--amber); }
.legal-meta { margin-top: 2.2rem; font-family: var(--mono); font-size: 0.8rem; color: var(--dim);
  border-top: 1px dashed var(--line-dash); padding-top: 1rem; }
.foot-legal { margin-top: 0.6rem; }
.foot-legal a { font-family: var(--mono); font-size: 0.74rem; color: var(--cream-dim); text-decoration: none; }
.foot-legal a:hover { color: var(--phosphor); }

/* Topical-map pillar pages (/agent-readiness, /commerce, /geo, /access-economics, /tools) */
.pillar-wrap { max-width: 820px; margin: 0 auto; padding: 0 1.5rem 4.5rem; }
.pillar-wrap h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; color: var(--cream); margin: 2.6rem 0 0.7rem; }
.pillar-wrap h3 { font-family: var(--mono); font-weight: 600; font-size: 0.95rem; letter-spacing: .01em; color: var(--phosphor); margin: 1.6rem 0 0.5rem; }
.pillar-wrap p { color: var(--cream-dim); line-height: 1.7; margin: 0 0 0.95rem; }
.pillar-wrap strong { color: var(--cream); }
.pillar-wrap a { color: var(--cream); text-decoration: none; border-bottom: 1px dotted var(--line-dash); }
.pillar-wrap a:hover { color: var(--phosphor); border-bottom-color: var(--phosphor); }
.pillar-wrap ul, .pillar-wrap ol { color: var(--cream-dim); line-height: 1.7; margin: 0 0 1rem; padding-left: 1.3rem; }
.pillar-wrap li { margin: 0.25rem 0; }
.pillar-wrap code { font-family: var(--mono); font-size: 0.85em; background: rgba(255,255,255,.04); padding: .08em .35em; border-radius: 4px; white-space: normal; }
.pillar-wrap table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.4rem; font-size: 0.9rem; }
.pillar-wrap th, .pillar-wrap td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.pillar-wrap th { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--phosphor); }
.pillar-wrap td { color: var(--cream-dim); }
.pillar-bridges { margin-top: 2.4rem; font-family: var(--mono); font-size: 0.8rem; color: var(--dim);
  border-top: 1px dashed var(--line-dash); padding-top: 1.1rem; line-height: 1.9; }

/* Single-record (item) pages: /<dataset>/<id> */
.item-crumb { max-width: 820px; margin: 1.5rem auto 0; padding: 0 1.5rem; font-family: var(--mono); font-size: 0.78rem; color: var(--dim); }
.item-crumb a { color: var(--cream-dim); text-decoration: none; }
.item-crumb a:hover { color: var(--phosphor); }

/* decorative hero banner on cluster + sub-topic pages (between crumb and content) */
.page-hero { position: relative; max-width: 820px; margin: 1.1rem auto 0.3rem; height: clamp(170px, 26vw, 280px); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.page-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.page-hero-veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, transparent 55%, color-mix(in srgb, var(--ink) 78%, transparent) 100%); }

.item-wrap { max-width: 820px; margin: 0 auto; padding: 0.5rem 1.5rem 4.5rem; }
.item-title { font-family: var(--serif); font-weight: 400; font-size: 2.4rem; color: var(--cream); margin: 1rem 0 0.4rem; }
.item-summary { color: var(--cream-dim); font-size: 1.05rem; line-height: 1.6; margin: 0 0 1.8rem; }
.item-attrs { margin: 0; border-top: 1px solid var(--line); }
.item-attr { display: grid; grid-template-columns: 13rem 1fr; gap: 0.6rem 1.2rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.item-attr dt { font-family: var(--mono); font-size: 0.78rem; color: var(--phosphor); margin: 0; word-break: break-word; }
.item-attr dd { margin: 0; color: var(--cream-dim); line-height: 1.55; word-break: break-word; }
.item-attr dd code { font-family: var(--mono); font-size: 0.82em; background: rgba(255,255,255,.04); padding: .06em .3em; border-radius: 4px; }
.item-na { color: var(--dim); }
.item-flag { font-family: var(--mono); font-size: 0.7rem; color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); border-radius: 4px; padding: .04em .35em; margin-left: .3rem; }
.item-src { font-family: var(--mono); font-size: 0.72rem; color: var(--dim); }
.item-src:hover { color: var(--phosphor); }
.item-meta { margin-top: 2rem; font-family: var(--mono); font-size: 0.8rem; color: var(--dim); }
.item-meta a { color: var(--cream-dim); text-decoration: none; }
.item-meta a:hover { color: var(--phosphor); }
@media (max-width: 640px) { .item-attr { grid-template-columns: 1fr; gap: 0.15rem; } }

/* Cluster-hub pages: /protocols/<layer>, /crawlers/<taxonomy> */
.cluster-wrap { max-width: 820px; margin: 0 auto; padding: 0.5rem 1.5rem 4.5rem; }
.cluster-wrap h1 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; color: var(--cream); margin: 1rem 0 0.5rem; }
.cluster-intro { color: var(--cream-dim); font-size: 1.05rem; line-height: 1.6; margin: 0 0 0.6rem; }
.cluster-count { font-family: var(--mono); font-size: 0.78rem; color: var(--dim); margin: 0 0 1.5rem; }
.cluster-list { list-style: none; margin: 0; padding: 0; }
.cluster-item { padding: 0.8rem 0; border-bottom: 1px solid var(--line); line-height: 1.5; }
.cluster-item > a { color: var(--cream); text-decoration: none; border-bottom: 1px dotted var(--line-dash); }
.cluster-item > a:hover { color: var(--phosphor); border-bottom-color: var(--phosphor); }
.cluster-sum { display: block; color: var(--cream-dim); font-size: 0.9rem; margin-top: 0.2rem; }

/* "browse by cluster" navigation on hub pages */
.cluster-nav { max-width: 60rem; margin: 0 auto 1.2rem; padding: 0 1.5rem; display: flex; flex-wrap: wrap; gap: .45rem .9rem; align-items: baseline; font-family: var(--mono); font-size: 0.82rem; }
.cluster-nav a { color: var(--cream-dim); text-decoration: none; border-bottom: 1px dotted var(--line-dash); padding-bottom: 1px; }
.cluster-nav a:hover { color: var(--phosphor); border-bottom-color: var(--phosphor); }
.layer-h a { color: inherit; text-decoration: none; border-bottom: 1px dotted transparent; }
.layer-h a:hover { color: var(--phosphor); border-bottom-color: var(--phosphor); }

/* guestbook: untrusted-content notice + injection flag */
.gb-notice { color: var(--amber); font-size: 0.72rem; line-height: 1.5; margin: 0 0 1rem;
  border: 1px dashed rgba(232, 163, 61, 0.45); border-radius: 6px; padding: 0.55rem 0.75rem; }
.gb-notice strong { color: var(--amber); }
.gb-entry.gb-suspicious { border-color: rgba(232, 163, 61, 0.55); }
.gb-flag { margin: 0 0 0.5rem; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.04em;
  color: var(--amber); text-transform: uppercase; }

.rec-source { margin: 0.5rem 0 0; font-size: 0.76rem; color: var(--dim); line-height: 1.45; }
.rec-source .machine-label { display: inline; margin: 0 0.4rem 0 0; color: var(--amber); }
.proto-card .rec-source { border-top: 1px dashed var(--line-dash); padding-top: 0.6rem; }

/* ----------------------------- /ask ----------------------------- */
.ask-wrap { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }
#ask-form { display: flex; gap: 0.8rem; }
#ask-q { flex: 1; background: var(--ink); color: var(--cream); border: 1px solid var(--line-dash);
  border-radius: 8px; font-family: var(--mono); font-size: 1rem; padding: 0.9rem 1.1rem; }
#ask-q:focus { outline: 2px solid var(--phosphor-dim); outline-offset: 1px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.9rem; }
.ask-chips .machine-label { margin: 0 0.3rem 0 0; }
.ask-chip { font-family: var(--mono); font-size: 0.74rem; background: transparent; color: var(--cream-dim);
  border: 1px solid var(--line-dash); border-radius: 20px; padding: 0.35rem 0.8rem; cursor: pointer; transition: all 0.15s; }
.ask-chip:hover { border-color: var(--phosphor-dim); color: var(--phosphor); }
.ask-answer { margin-top: 1.6rem; }
.ask-card { background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--phosphor);
  border-radius: 10px; padding: 1.5rem 1.7rem; }
.ask-card.ask-empty { border-left-color: var(--amber); }
.ask-q { margin: 0 0 0.8rem; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--cream-dim); }
.ask-a { margin: 0 0 1.1rem; font-size: 1.08rem; line-height: 1.65; color: var(--cream); }
.ask-cites { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.9rem; }
.ask-cites .machine-label { margin: 0 0.3rem 0 0; }
.ask-cite { display: inline-flex; align-items: baseline; gap: 0.4rem; text-decoration: none;
  font-family: var(--mono); font-size: 0.76rem; color: var(--cream-dim);
  border: 1px solid var(--line-dash); border-radius: 5px; padding: 0.3rem 0.6rem; }
.ask-cite:hover { border-color: var(--phosphor-dim); color: var(--phosphor); }
.ask-cite-type { color: var(--phosphor-dim); text-transform: uppercase; font-size: 0.64rem; letter-spacing: 0.08em; }
.ask-conf { margin: 0; }
.ask-empty-note { font-family: var(--mono); font-size: 0.85rem; color: var(--dim); }
.ask-how { max-width: 820px; margin: 3rem auto 0; padding: 0 1.5rem 4rem; }
.ask-how p { color: var(--cream-dim); max-width: 70ch; }
.ask-how .snippet.wide { width: 100%; margin-top: 1.2rem; }

/* ----------------------------- /updates ----------------------------- */
.up-wrap { max-width: 820px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.up-list { list-style: none; margin: 0; padding: 0; }
.up-item { border-left: 2px solid var(--line); padding: 0 0 1.6rem 1.6rem; position: relative; }
.up-item::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--phosphor); box-shadow: var(--glow); }
.up-meta { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 0.4rem; }
.up-meta time { font-family: var(--mono); font-size: 0.78rem; color: var(--cream-dim); }
.up-badge { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.12rem 0.5rem; border-radius: 4px; border: 1px solid; }
.up-added { color: var(--phosphor); border-color: var(--phosphor-dim); background: var(--phosphor-ghost); }
.up-fixed { color: var(--amber); border-color: rgba(232,163,61,0.4); background: rgba(232,163,61,0.08); }
.up-changed { color: #6db5ff; border-color: rgba(109,181,255,0.4); }
.up-area { font-family: var(--mono); font-size: 0.68rem; color: var(--dim); letter-spacing: 0.05em; }
.up-summary { margin: 0; color: var(--cream-dim); line-height: 1.6; }

/* ----------------------------- /analytics ----------------------------- */
.an-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem 4rem; }
.an-scorecards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-bottom: 2.4rem; }
.an-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.6rem 1.8rem; }
.an-big { margin: 0 0 0.4rem; font-family: var(--serif); font-weight: 300; font-size: 3rem; line-height: 1; color: var(--phosphor); }
.an-big span { font-family: var(--mono); font-size: 1rem; color: var(--dim); margin-left: 0.2rem; }
.an-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2.4rem; }
.an-bars { display: grid; gap: 0.5rem; margin-top: 0.6rem; }
.an-row { display: grid; grid-template-columns: 160px 1fr 44px; gap: 0.8rem; align-items: center; }
.an-label { font-family: var(--mono); font-size: 0.74rem; color: var(--cream-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar { height: 18px; background: var(--ink); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.an-bar i { display: block; height: 100%; transition: width 0.5s; }
.an-bar.an-green i { background: var(--phosphor); }
.an-bar.an-amber i { background: var(--amber); }
.an-val { font-family: var(--mono); font-size: 0.76rem; color: var(--cream-dim); text-align: right; }
.an-recent { font-size: 0.82rem; }
.an-recent td { padding: 0.45rem 0.7rem; border-top: 1px solid var(--line); color: var(--cream-dim); font-family: var(--mono); font-size: 0.74rem; }
.an-recent .an-path { color: var(--cream); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-dash); margin-left: 0.3rem; transition: background 0.2s, box-shadow 0.2s; }
.an-dot.on { background: var(--phosphor); box-shadow: var(--glow); }

.alm-flash { animation: almflash 1.6s ease-out; }
@keyframes almflash { 0%, 30% { background: var(--phosphor-ghost); box-shadow: -4px 0 0 var(--phosphor); } 100% { background: transparent; box-shadow: none; } }

/* ====================== Field Guides (topical-map hub) ====================== */
.guides { max-width: var(--maxw); margin: 0 auto; padding: 4rem 1.5rem; }
.guides-head { margin-bottom: 2.4rem; }
.guides-head h2 { margin: 0.3rem 0 0.8rem; font-weight: 320; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
.guides-head h2 em { font-style: italic; color: var(--phosphor); }
.guides-head p { color: var(--cream-dim); font-size: 1rem; max-width: 62ch; }
.guides-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.guide-card { border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem 1.6rem; background: rgba(255,255,255,0.015); display: flex; flex-direction: column; transition: border-color 0.18s ease; }
.guide-card:hover { border-color: color-mix(in srgb, var(--phosphor) 38%, var(--line)); }
.guide-title { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; line-height: 1.2; color: var(--cream); text-decoration: none; }
.guide-title:hover { color: var(--phosphor); }
.guide-desc { color: var(--cream-dim); font-size: 0.92rem; margin: 0.6rem 0 1rem; }
.guide-subs { list-style: none; margin: auto 0 0; padding: 0.95rem 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.4rem 0.55rem; }
.guide-subs li { margin: 0; }
.guide-subs a { font-family: var(--mono); font-size: 0.72rem; color: var(--cream-dim); text-decoration: none; border: 1px solid var(--line-dash); border-radius: 5px; padding: 0.2rem 0.55rem; transition: color 0.15s, border-color 0.15s; }
.guide-subs a:hover { color: var(--phosphor); border-color: var(--phosphor); }
@media (max-width: 760px) { .guides-grid { grid-template-columns: 1fr; } }

/* ============================== responsive ============================== */

@media (max-width: 980px) {
  .stats dl { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: none; border-top: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: none; }
  .cards { grid-template-columns: 1fr; }
  .card:nth-child(even), .card:nth-child(even):hover { margin-top: 0; }
  .pg-grid, .gb-grid { grid-template-columns: 1fr; }
  .ethics-cols { columns: 1; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .hero-art { inset: 0 -40vw 0 10%; opacity: 0.6; }
  .svc-grid { grid-template-columns: 1fr; }
  .biz-teaser-inner { grid-template-columns: 1fr; }
  .pricing-table { display: block; overflow-x: auto; }
  .alm-grid { grid-template-columns: 1fr; }
  .almanac-feature-inner { grid-template-columns: 1fr; gap: 2rem; }
  .proto-cards { grid-template-columns: 1fr; }
  .an-scorecards { grid-template-columns: 1fr; }
  .an-cols { grid-template-columns: 1fr; }
  .an-row { grid-template-columns: 110px 1fr 38px; }
  #ask-form { flex-direction: column; }
  .alm-tools { flex-direction: column; align-items: stretch; }
  .verify-detail { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .curl-matrix li { grid-template-columns: 1fr auto; }
  .cm-label { grid-column: 1 / -1; }
  .foot-grid { grid-template-columns: 1fr; }
  .stats dl { grid-template-columns: 1fr; }
  .stat:nth-child(-n+2) { border-top: 1px solid var(--line); }
  .stat:first-child { border-top: none; }
}

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

/* State of the Agentic Web — adoption-data page */
.state-wrap { max-width: 60rem; margin: 0 auto; padding: 0 1.5rem 4rem; }
.state-fam { margin: 2.5rem 0; }
.state-fam h2 { font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; color: var(--phosphor); border-bottom: 1px solid var(--line); padding-bottom: .5rem; margin-bottom: 1rem; }
.state-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.state-item { display: grid; grid-template-columns: auto 1fr; gap: .15rem 1rem; align-items: baseline; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.015); }
.state-value { grid-row: span 2; font-family: var(--mono, monospace); font-size: 1.5rem; font-weight: 600; color: var(--phosphor); align-self: center; }
.state-metric { font-weight: 600; color: var(--cream); }
.state-unit { font-weight: 400; color: var(--muted, #9aa); font-size: .85em; }
.state-meta { font-size: .8rem; color: var(--muted, #9aa); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.state-item .rec-source { grid-column: 2; font-size: .72rem; opacity: .65; word-break: break-word; }
.state-kind { font-family: var(--mono, monospace); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; padding: .1rem .45rem; border-radius: 4px; border: 1px solid; }
.state-cited { color: var(--phosphor); border-color: color-mix(in srgb, var(--phosphor) 45%, transparent); }
.state-ours { color: var(--cream); border-color: var(--line); }
.state-flag { color: var(--amber, #e6a23c); border-color: color-mix(in srgb, var(--amber, #e6a23c) 50%, transparent); }
.state-pillar { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.state-pillar:hover { color: var(--phosphor); }
@media (max-width: 640px) {
  .state-item { grid-template-columns: 1fr; }
  .state-value { grid-row: auto; font-size: 1.25rem; }
  .state-item .rec-source { grid-column: 1; }
}
