/* Layout: one column, 72ch max, hero flush left over a live node field; record sections stacked with mono labels. */
:root {
  color-scheme: dark;
  --bg: #0b0f14;          /* ink, blue-biased */
  --bg-2: #10161e;        /* raised panel */
  --line: #1f2a36;        /* hairline */
  --fg: #e9eef4;          /* primary text */
  --fg-2: #97a4b4;        /* secondary */
  --fg-3: #5f6d7d;        /* dim */
  --gold: #e8b44a;        /* accent: gauge amber, camp gold */
  --gold-2: #f3d58a;      /* accent highlight */
  --live: #5fd38a;        /* status green */

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --measure: 72ch;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  padding-block: env(safe-area-inset-top, 0px) env(safe-area-inset-bottom, 0px);
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--gold-2); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
p { margin: 0; max-width: var(--measure); }
.muted { color: var(--fg-2); }
.dim { color: var(--fg-3); font-weight: 400; }
.mono { font-family: var(--mono); font-size: .85rem; }
.sep { color: var(--fg-3); padding: 0 .35em; }

#field {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.top, main, .foot { position: relative; z-index: 1; }

.top {
  max-width: 1120px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding-block: 1.25rem;
  font-family: var(--mono); font-size: .85rem; letter-spacing: .02em;
}
.mark { display: inline-flex; align-items: center; gap: .6rem; color: var(--fg); }
.mark svg { fill: var(--gold); stroke: var(--gold); }
.links { display: flex; gap: 1.5rem; }
.links a { color: var(--fg-2); }

main { max-width: 1120px; margin: 0 auto; display: grid; gap: 6rem; padding-block: 4rem 6rem; }

/* Hero */
.hero { display: grid; gap: 1.75rem; padding-block: 3rem 2rem; }
.eyebrow {
  font-family: var(--mono); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-2); display: flex; align-items: center; gap: .6rem;
}
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(95,211,138,.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(95,211,138,0); } 100% { box-shadow: 0 0 0 0 rgba(95,211,138,0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
h1 {
  font-size: clamp(3.5rem, 12.5vw, 10.5rem);
  font-weight: 800; line-height: .88; letter-spacing: -.045em;
  font-variation-settings: "opsz" 96;
  display: flex; flex-direction: column;
}
h1 .first { color: var(--fg); }
h1 .last { color: var(--gold); margin-left: .08em; }
.thesis { font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.45; max-width: 34ch; color: var(--fg); font-weight: 400; }
.cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: .9rem; color: var(--fg); background: rgba(16,22,30,.6);
  backdrop-filter: blur(6px);
  transition: border-color .2s, transform .2s;
}
.btn:hover { border-color: var(--gold); transform: translateY(-1px); color: var(--fg); }
.btn.primary { background: var(--gold); color: #1a1205; border-color: var(--gold); font-weight: 500; }
.btn.primary:hover { background: var(--gold-2); border-color: var(--gold-2); }

/* Section heads */
.record-head { display: grid; gap: .35rem; margin-bottom: 1.5rem; }
.record-head h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 600; letter-spacing: -.02em; }
.record-head h2::before {
  content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .5em; vertical-align: .1em;
  background: var(--gold); border-radius: 2px;
}

/* Attribute table */
.attrs {
  margin: 0; display: grid;
  border-top: 1px solid var(--line);
  background: rgba(11,15,20,.55);
}
.attrs > div {
  display: grid; grid-template-columns: 12rem 1fr; gap: 1rem; align-items: baseline;
  padding: .85rem 0; border-bottom: 1px solid var(--line);
}
.attrs dt { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-2); }
.attrs dd { margin: 0; }
.attrs dd a { color: var(--gold); border-bottom: 1px solid transparent; }
.attrs dd a:hover { border-bottom-color: var(--gold); }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .15rem .65rem; border-radius: 999px; font-family: var(--mono); font-size: .8rem; border: 1px solid var(--line); }
.chip.live { color: var(--live); border-color: rgba(95,211,138,.35); }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
@media (max-width: 560px) { .attrs > div { grid-template-columns: 1fr; gap: .2rem; } }

/* Now */
.now-card {
  display: grid; gap: 1rem;
  padding: 2rem; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(160deg, rgba(232,180,74,.10), rgba(16,22,30,.85) 45%);
  max-width: 760px;
}
.label { font-family: var(--mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.now-card h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -.03em; }
.now-card q { color: var(--gold-2); font-style: italic; }
.arrow { font-family: var(--mono); font-size: .9rem; color: var(--gold); margin-top: .5rem; }

/* Change log */
.log { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.log li {
  display: grid; grid-template-columns: 12rem 1fr; gap: 1rem;
  padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.when { font-family: var(--mono); font-size: .85rem; color: var(--fg-2); font-variant-numeric: tabular-nums; padding-top: .35rem; }
.dash { color: var(--fg-3); }
.what { display: grid; gap: .4rem; }
.what h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.015em; }
.what h3 .dim { font-family: var(--body); font-size: .95rem; margin-left: .5rem; }
.what p { color: var(--fg-2); }
@media (max-width: 560px) { .log li { grid-template-columns: 1fr; gap: .3rem; } }

/* Agent */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat {
  display: grid; gap: 1rem; max-width: 760px;
  padding: 1.25rem; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(16,22,30,.85); backdrop-filter: blur(8px);
}
.chat-log { display: grid; gap: .85rem; max-height: 28rem; overflow-y: auto; padding-right: .25rem; scroll-behavior: smooth; }
.msg { display: grid; gap: .35rem; max-width: 60ch; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-msg { justify-self: start; }
.agent-msg p { color: var(--fg); }
.user-msg { justify-self: end; }
.user-msg p { background: rgba(232,180,74,.12); border: 1px solid rgba(232,180,74,.25); border-radius: 12px 12px 2px 12px; padding: .55rem .85rem; }
.msg .status { font-family: var(--mono); font-size: .78rem; color: var(--fg-2); display: inline-flex; align-items: center; gap: .5rem; }
.msg .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: blink 1s infinite; }
@media (prefers-reduced-motion: reduce) { .msg .status::before { animation: none; } }
@keyframes blink { 50% { opacity: .2; } }
.msg .error { color: #f08c8c; font-family: var(--mono); font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-btn {
  font: inherit; font-family: var(--mono); font-size: .8rem; color: var(--fg-2);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .75rem; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.chip-btn:hover, .chip-btn:focus-visible { border-color: var(--gold); color: var(--fg); }
.chat-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.chat-form input {
  flex: 1 1 16rem; min-width: 0; font: inherit; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: .65rem 1rem;
}
.chat-form input:focus { outline: 2px solid var(--gold); outline-offset: 2px; border-color: var(--gold); }
.chat-form input::placeholder { color: var(--fg-3); }
.chat-form .btn[disabled] { opacity: .6; cursor: wait; }
.chat-foot { font-size: .78rem; }

.foot {
  max-width: 1120px; margin: 0 auto; padding-block: 2rem 3rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--line); color: var(--fg-2); font-size: .95rem;
}
