:root {
  --ink: #1c1712;
  --night: #241c16;
  --night-2: #31281f;
  --cream: #f7f1e6;
  --cream-2: #efe4d2;
  --copper: #c4622d;
  --copper-soft: #e7b08a;
  --jade: #2f6f5e;
  --gold: #e4b15a;
  --muted: #b3a28c;
  --line: rgba(247, 241, 230, 0.14);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1000px 480px at 10% -10%, rgba(228, 177, 90, 0.16), transparent 55%),
    radial-gradient(800px 500px at 100% 0%, rgba(196, 98, 45, 0.12), transparent 50%),
    var(--night);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: 0.01em;
  padding-bottom: 108px;
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.55'/></svg>");
  mix-blend-mode: overlay;
}

.top {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 28px 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(var(--night), rgba(36, 28, 22, 0.92) 70%, transparent);
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.brand strong { display: block; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.mark {
  width: 36px; height: 36px; border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, var(--gold), var(--copper) 62%, transparent 63%),
    var(--night-2);
  box-shadow: 0 0 0 6px rgba(228, 177, 90, 0.08);
}
.you {
  background: none; border: 0; color: var(--muted); padding: 0; font: inherit; cursor: pointer;
}
.nav { display: flex; gap: 6px; flex: 1; min-width: 0; }
.nav button, .dock button, .texty, .chip {
  font: inherit; color: inherit; cursor: pointer;
}
.nav button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
}
.nav button.on {
  color: var(--ink);
  background: var(--cream);
  border-color: var(--cream);
}
.nav a {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
}
.dot.plug { background: #c47b2b; }
.pills { display: flex; gap: 8px; align-items: center; }
.pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(247, 241, 230, 0.08);
  color: var(--cream-2);
  font-size: 13px;
}
.pill.warm { background: rgba(196, 98, 45, 0.25); color: #ffd7bf; }
.pill.live { background: rgba(47, 111, 94, 0.28); color: #d7f3ea; }

.hero { padding: 8px 28px 0; max-width: 820px; }
.eyebrow { margin: 0; color: var(--gold); letter-spacing: 0.14em; text-transform: uppercase; font-size: 12px; }
h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.95;
  margin: 8px 0 10px;
  letter-spacing: -0.03em;
}
#hero-sub { margin: 0; color: var(--cream-2); font-size: 18px; max-width: 46ch; }

.stage { padding: 22px 28px 12px; }
.loading { color: var(--muted); }

.atlas-wrap { position: relative; }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.wire { fill: none; stroke: rgba(228, 177, 90, 0.45); stroke-width: 1.4; }
.wire.shadow { stroke: var(--copper-soft); stroke-dasharray: 4 6; }
.atlas {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.island {
  background: linear-gradient(180deg, rgba(247, 241, 230, 0.06), rgba(247, 241, 230, 0.02));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 14px 14px 16px;
  animation: rise 0.6s ease both;
}
.island[data-team="people"] { grid-column: 1 / -1; }
.island h2 { margin: 0 0 4px; font-size: 16px; font-family: var(--serif); font-weight: 520; }
.island p { margin: 0 0 12px; color: var(--muted); font-size: 13px; min-height: 2.4em; }
.nodes { display: flex; flex-wrap: wrap; gap: 8px; }
.node {
  width: 104px;
  border: 0;
  border-radius: 18px;
  padding: 10px 8px 8px;
  text-align: left;
  background: #2a231c;
  color: var(--cream);
  position: relative;
  animation: pop 0.45s ease both;
}
.node.human { background: var(--cream); color: var(--ink); }
.node.plug { background: transparent; border: 1px dashed rgba(228, 176, 138, 0.7); }
.node.selected { outline: 2px solid var(--copper); outline-offset: 2px; }
.node .face {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(228, 177, 90, 0.18);
  font-size: 12px; margin-bottom: 8px;
}
.node.human .face { background: rgba(196, 98, 45, 0.16); }
.node b { display: block; font-size: 13px; font-weight: 600; }
.node small { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; }
.node.human small { color: #7c6b58; }
.node.working::after {
  content: "";
  position: absolute; inset: -5px;
  border-radius: 22px;
  border: 1px solid rgba(47, 111, 94, 0.8);
  animation: pulse 1.8s ease-out infinite;
}
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 13px; margin-top: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.person { background: var(--cream); }
.dot.bot { background: #6d5c49; }
.dot.work { background: var(--jade); }

.sheet, .card, .audit, .lane {
  background: rgba(247, 241, 230, 0.05);
  border: 1px solid var(--line);
  border-radius: 24px;
}
.sheet { margin-top: 14px; padding: 16px 18px; display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.sheet h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 28px; }
.sheet p { margin: 0; color: var(--cream-2); }
.quiet { display: flex; gap: 8px; flex-wrap: wrap; }

.form-grid, .split { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
input, select {
  width: 100%; margin-top: 6px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  color: var(--cream);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.check { display: flex; gap: 8px; align-items: center; color: var(--cream-2); }
.check input { width: auto; }
.lanes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lane { padding: 10px; min-height: 120px; }
.lane h3 { margin: 0 0 8px; font-size: 13px; color: var(--gold); font-weight: 500; }
.ticket {
  background: var(--cream);
  color: var(--ink);
  border-radius: 14px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 13px;
  animation: pop 0.4s ease both;
}
.ticket b { display: block; }
.ticket span { color: #7c6b58; }
.ticket.house { background: transparent; color: var(--cream); border: 1px dashed var(--line); }
.note { color: var(--muted); font-size: 13px; }

.gate { max-width: 720px; }
.card { padding: 22px; background: var(--cream); color: var(--ink); }
.card .who { color: #7c6b58; margin-bottom: 0; }
.card h2 { font-family: var(--serif); font-size: 36px; line-height: 1.05; margin: 8px 0; }
.evidence {
  background: #f3eadc;
  border-radius: 16px;
  padding: 12px 14px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.evidence b { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #8a6a48; }
.how { color: #5c4d3d; }
.card .fine { color: #6d5c49; font-size: 14px; }
.card .texty { color: var(--ink); border-color: rgba(28, 23, 18, 0.2); margin-top: 8px; }
.card.on { outline: 2px solid var(--copper); outline-offset: 4px; }
.filters select { background: transparent; color: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border-radius: 999px; border: 1px solid var(--line); background: transparent; padding: 6px 12px; color: var(--cream-2); }
.chip.on { background: var(--cream); color: var(--ink); }
.scrub { display: flex; gap: 12px; align-items: center; margin: 8px 0 14px; }
.scrub input { accent-color: var(--copper); }
.event {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.event time { color: var(--muted); font-size: 13px; }
.kind {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(247, 241, 230, 0.08);
}

.spine {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 2px 16px;
  scroll-behavior: smooth;
}
.seal {
  flex: 0 0 auto;
  width: 74px;
  height: 88px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #2a231c;
  color: var(--cream);
  padding: 8px;
  text-align: left;
}
.seal b { display: block; font-size: 11px; font-family: ui-monospace, monospace; }
.seal small { color: var(--muted); font-size: 10px; }
.seal.wait { box-shadow: inset 0 0 0 1px rgba(196, 98, 45, 0.7); }
.seal.ok { box-shadow: inset 0 0 0 1px rgba(47, 111, 94, 0.7); }
.seal.shadow { background: #3a2a22; }
.seal.open { outline: 2px solid var(--gold); }
.audit { margin-top: 8px; padding: 16px 18px 18px; }
.audit h2 { font-family: var(--serif); margin: 0 0 8px; }
.rows { display: grid; gap: 6px; }
.rows div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.rows span { color: var(--muted); }

.dock {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px 12px 18px;
  background: rgba(28, 23, 18, 0.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  z-index: 6;
}
.dock p { margin: 0; color: var(--cream-2); }
.primary, .texty {
  border-radius: 999px;
  padding: 12px 18px;
  border: 0;
}
.primary { background: var(--copper); color: #fff8f3; font-weight: 600; }
.primary:disabled { opacity: 0.45; cursor: default; }
.texty { background: transparent; color: var(--cream-2); border: 1px solid var(--line); }
.toast {
  position: fixed;
  top: 18px; right: 18px;
  background: var(--cream);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 16px;
  z-index: 8;
  animation: pop 0.3s ease;
}

.modal {
  position: fixed; inset: 0;
  background: rgba(20, 15, 10, 0.62);
  display: grid; place-items: center;
  z-index: 9;
}
.modal form { width: min(440px, calc(100% - 32px)); padding: 20px; }
.modal h2 { font-family: var(--serif); margin-top: 0; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 900px) {
  .top { flex-wrap: wrap; padding: 14px; }
  .atlas, .lanes, .form-grid, .split, .event { grid-template-columns: 1fr; }
  .hero, .stage { padding-left: 14px; padding-right: 14px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav button, .nav a { flex: 0 0 auto; padding: 8px 10px; }
  body { padding-bottom: 148px; }
  .brand { min-width: 0; }
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0% { transform: scale(0.98); opacity: 0.9; }
  100% { transform: scale(1.06); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
