/* Lattice — public site. Theme: "One graph, refracted."
   Dark engineered canvas; persona hues = lens projections of one graph. */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plex-mono-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --bg: #0b0e17;
  --bg-2: #0e1220;
  --surface: #121627;
  --surface-2: #171c31;
  --line: rgba(148, 163, 216, 0.14);
  --line-strong: rgba(148, 163, 216, 0.28);
  --text: #e8ecf7;
  --muted: #9aa5c3;
  --faint: #6b7699;

  --c-consumer: #59d8ff;
  --c-front: #a78bfa;
  --c-back: #fb7ba2;
  --c-operator: #e8b45c;

  --grad: linear-gradient(92deg, #59d8ff 0%, #a78bfa 52%, #fb7ba2 100%);

  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r: 14px;
  --maxw: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(167, 139, 250, 0.35); }

a { color: var(--c-consumer); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.015em; }
h2 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.15; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }

.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
}
.eyebrow b { color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text; }

section { padding: 92px 0; position: relative; }
section + section { border-top: 1px solid var(--line); }
.sec-head { max-width: 720px; margin-bottom: 42px; }
.sec-head p { color: var(--muted); margin-top: 14px; font-size: 17.5px; }
.sec-head .eyebrow { display: block; margin-bottom: 14px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 23, 0.78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 26px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 700; letter-spacing: 0.22em; font-size: 14px; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 9px 16px; font-size: 14.5px; font-weight: 600; color: var(--text);
  background: var(--surface); cursor: pointer; font-family: var(--body);
}
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--grad); color: #0a0c14; border: none; }
.btn.primary:hover { filter: brightness(1.08); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
#lattice-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-inner { position: relative; z-index: 2; padding-top: 120px; padding-bottom: 84px; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 2; color: var(--muted); opacity: 0.65; line-height: 0;
  animation: cue-float 2.4s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--text); opacity: 1; }
@keyframes cue-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}
.hero .eyebrow { display: block; margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(40px, 6.4vw, 72px); line-height: 1.04; font-weight: 700;
  max-width: 820px;
}
.hero h1 .refract {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { margin-top: 26px; max-width: 640px; color: var(--muted); font-size: 19px; }
.hero-ctas { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badges { margin-top: 52px; display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  background: rgba(18, 22, 39, 0.6);
}

/* ---------- thesis cards ---------- */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
#roadmap .cards3 { grid-template-columns: repeat(2, 1fr); } /* four roadmap cards read as 2×2 */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 24px;
}
.card .k { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 12px; display: block; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15.5px; }
.k.cyan { color: var(--c-consumer); } .k.violet { color: var(--c-front); } .k.rose { color: var(--c-back); } .k.gold { color: var(--c-operator); }

pre.code {
  margin-top: 26px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px 24px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: #c7d0ea;
}
pre.code .cm { color: var(--faint); }
pre.code .key { color: var(--c-consumer); }
pre.code .val { color: #ffd9a0; }

/* ---------- diagram ---------- */
.diagram-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); padding: 26px 18px; }
.diagram-wrap svg { min-width: 860px; display: block; margin: 0 auto; }
.diagram-cap { margin-top: 16px; color: var(--faint); font-size: 14px; max-width: 760px; }
.dg-box { fill: var(--surface-2); stroke: var(--line-strong); rx: 10; }
.dg-box.core { stroke: var(--c-operator); }
.dg-label { fill: var(--text); font-family: var(--display); font-size: 14px; font-weight: 700; }
.dg-sub { fill: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.dg-flow { stroke: var(--faint); stroke-width: 1.4; fill: none; marker-end: url(#arr); }
.dg-tag { fill: var(--faint); font-family: var(--mono); font-size: 10.5px; }

/* ---------- demo ---------- */
.demo-shell { border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); overflow: hidden; }
.demo-ribbon {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  padding: 10px 20px; border-bottom: 1px solid var(--line);
  background: rgba(232, 180, 92, 0.06);
}
.demo-ribbon b { color: var(--c-operator); font-weight: 600; }

.demo-controls { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.ctrl-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctrl-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-right: 6px; }

.pkg-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px;
  font-size: 13.5px; color: var(--muted); background: var(--surface); cursor: pointer; user-select: none;
  font-family: var(--body); font-weight: 600;
}
.pkg-toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pkg-toggle.on { color: var(--text); border-color: var(--faint); }
.pkg-toggle.on .dot { background: var(--grad); }
.persona-tab {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
  border-radius: 10px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: var(--body);
}
.persona-tab.on { color: #0a0c14; }
[data-persona="resident"] .persona-tab.on { background: var(--c-consumer); border-color: var(--c-consumer); }
[data-persona="front"] .persona-tab.on { background: var(--c-front); border-color: var(--c-front); }
[data-persona="back"] .persona-tab.on { background: var(--c-back); border-color: var(--c-back); }
[data-persona="operator"] .persona-tab.on { background: var(--c-operator); border-color: var(--c-operator); }

.demo-main { display: grid; grid-template-columns: 1.25fr 1fr; min-height: 540px; }
.graph-pane { border-right: 1px solid var(--line); padding: 10px; position: relative; }
.graph-pane svg { width: 100%; height: auto; display: block; }
.graph-cap {
  position: absolute; left: 20px; bottom: 14px; right: 20px;
  font-size: 13px; color: var(--faint); font-family: var(--mono);
}
.graph-cap b { color: var(--muted); font-weight: 600; }

.panel-pane { padding: 20px; overflow-y: auto; max-height: 640px; }
.panel-title { font-family: var(--display); font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.panel-sub { color: var(--faint); font-size: 13px; margin-bottom: 16px; }
.pcard {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 14px 16px; margin-bottom: 10px;
}
.pcard .t { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.pcard .d { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.pcard .m { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 8px; word-break: break-all; }
.pcard .hint { margin-top: 8px; font-size: 12.5px; }
.pcard.accent { border-color: var(--line-strong); }
[data-persona="resident"] .pcard .t::before,
[data-persona="front"] .pcard .t::before,
[data-persona="back"] .pcard .t::before,
[data-persona="operator"] .pcard .t::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px; flex: none;
}
[data-persona="resident"] .pcard .t::before { background: var(--c-consumer); }
[data-persona="front"] .pcard .t::before { background: var(--c-front); }
[data-persona="back"] .pcard .t::before { background: var(--c-back); }
[data-persona="operator"] .pcard .t::before { background: var(--c-operator); }
.pill { font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--muted); }
.pill.glow { color: #0a0c14; background: var(--grad); border: none; font-weight: 600; }

.emergence {
  border-top: 1px solid var(--line); padding: 16px 20px; background: rgba(167, 139, 250, 0.05);
}
.emergence .et { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-front); margin-bottom: 8px; }
.emergence ul { list-style: none; }
.emergence li { font-size: 14px; color: var(--muted); padding: 3px 0; }
.emergence li b { color: var(--text); font-weight: 600; }
.emergence li .m { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.emergence li.capstone { color: var(--text); }
.emergence li.capstone b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.ticker {
  border-top: 1px solid var(--line); background: #0a0d16;
  font-family: var(--mono); font-size: 12px; padding: 12px 20px; min-height: 88px;
}
.ticker .tk-label { color: var(--faint); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.ticker .line { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 0; }
.ticker .line .op { color: var(--c-consumer); }
.ticker .line .lens { color: var(--c-operator); }
.ticker .line.new { animation: tick-in 0.45s ease; }
@keyframes tick-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* graph SVG nodes/links */
.g-link { stroke: var(--line-strong); stroke-width: 1.3; }
.g-link.dim { stroke: rgba(148, 163, 216, 0.08); }
.g-link.emergent { stroke: var(--c-front); stroke-dasharray: 5 4; stroke-width: 1.6; }
.g-node circle { fill: var(--surface-2); stroke: var(--faint); stroke-width: 1.4; }
.g-node.person circle { stroke-width: 2; }
.g-node text { fill: var(--muted); font-family: var(--body); font-size: 11.5px; font-weight: 600; }
.g-node .gkey { fill: var(--faint); font-family: var(--mono); font-size: 9px; font-weight: 400; }
.g-node.hi circle { stroke: var(--pcol, var(--text)); fill: var(--surface-2); }
.g-node.hi text { fill: var(--text); }
.g-node.dim { opacity: 0.28; }
.g-node.pulse circle { animation: npulse 2.4s ease-in-out infinite; }
@keyframes npulse { 0%, 100% { stroke-width: 1.6; } 50% { stroke-width: 3.4; } }

/* ---------- agent org ---------- */
.loop-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 30px 0 26px; font-family: var(--mono); font-size: 13px; }
.loop-step { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 9px 14px; color: var(--text); }
.loop-step.human { border-color: var(--c-operator); color: var(--c-operator); }
.loop-arrow { color: var(--faint); }
.stat-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* ---------- status ---------- */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.status-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.status-list h3 { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.status-list ul { list-style: none; }
.status-list li { padding: 6px 0 6px 22px; position: relative; color: var(--muted); font-size: 15px; }
.status-list li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px; border-radius: 50%; }
.status-list.now li::before { background: var(--c-consumer); }
.status-list.next li::before { background: var(--faint); }

/* ---------- run it ---------- */
.run-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; align-items: start; }
.run-note { color: var(--muted); font-size: 15px; }
.run-note ul { margin: 12px 0 0 18px; }
.run-note li { padding: 2px 0; }

/* ---------- footer / licensing ---------- */
.license-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 30px; max-width: 760px; }
.license-box p { color: var(--muted); font-size: 15.5px; }
.license-box p + p { margin-top: 12px; }
.license-box .contact { margin-top: 20px; }
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--faint); font-size: 13.5px; }
.foot-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* ---------- component strip ---------- */
.strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 44px 0 16px; }
.strip-head h3 { font-size: 19px; }
.strip-head .hint { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.strip {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 4px 2px 18px; margin: 0 -2px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.strip::-webkit-scrollbar { height: 8px; }
.strip::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.strip::-webkit-scrollbar-track { background: transparent; }
.comp-card {
  scroll-snap-align: start; flex: 0 0 240px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px 13px;
  display: flex; flex-direction: column; gap: 7px; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.comp-card:hover { border-color: var(--faint); text-decoration: none; transform: translateY(-2px); }
.comp-card .top { display: flex; align-items: center; gap: 8px; }
.comp-card .dotc { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.comp-card .cat { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.comp-card .nm { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--text); }
.comp-card .ds { color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.comp-card .lk { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.comp-card:hover .lk { color: var(--c-consumer); }
.cat.core, .dotc.core { color: var(--c-consumer); } .dotc.core { background: var(--c-consumer); }
.cat.orch, .dotc.orch { color: var(--c-operator); } .dotc.orch { background: var(--c-operator); }
.cat.sec,  .dotc.sec  { color: var(--c-front); }    .dotc.sec  { background: var(--c-front); }
.cat.plat, .dotc.plat { color: var(--c-back); }     .dotc.plat { background: var(--c-back); }

/* ---------- team cards (Meet the team) ---------- */
.cat.human, .dotc.human { color: var(--c-operator); } .dotc.human { background: var(--c-operator); }
.cat.ai,    .dotc.ai    { color: var(--c-consumer); } .dotc.ai    { background: var(--c-consumer); }
.comp-card.principal { border-color: rgba(232, 180, 92, 0.4); background: rgba(232, 180, 92, 0.05); }
.team-lead { color: var(--muted); max-width: 780px; margin-top: 2px; }

/* ---------- positioning callout ---------- */
.positioning {
  margin-top: 26px; padding: 16px 22px; max-width: 800px;
  border-left: 2px solid var(--c-operator); border-radius: 0 10px 10px 0;
  background: rgba(232, 180, 92, 0.06); color: var(--text); font-size: 17px;
}

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .cards3, #roadmap .cards3 { grid-template-columns: 1fr; }
  .scroll-cue { display: none; } /* small screens: the fold already cuts mid-content */
  .demo-main { grid-template-columns: 1fr; }
  .graph-pane { border-right: none; border-bottom: 1px solid var(--line); }
  .cols2 { grid-template-columns: 1fr; }
  .run-grid { grid-template-columns: 1fr; }
  .nav-links a.hide-sm { display: none; }
  section { padding: 64px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .g-node.pulse circle, .ticker .line.new, .scroll-cue { animation: none; }
}
