:root {
  color-scheme: dark;
  --ink: #f7f1e6;
  --muted: #cfc5b4;
  --dim: #968d80;
  --night: #101315;
  --coal: #171b1f;
  --panel: rgba(20, 24, 27, 0.88);
  --panel-strong: rgba(247, 241, 230, 0.09);
  --line: rgba(247, 241, 230, 0.18);
  --gold: #d8b15f;
  --teal: #62b8ad;
  --clay: #bc6d58;
  --blue: #7a9fd8;
  --green: #84a86f;
  --shadow: 0 24px 84px rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(16, 19, 21, 0), rgba(16, 19, 21, 0.96) 42rem),
    repeating-linear-gradient(
      90deg,
      rgba(247, 241, 230, 0.035) 0,
      rgba(247, 241, 230, 0.035) 1px,
      transparent 1px,
      transparent 72px
    ),
    var(--night);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3.5rem);
  background: linear-gradient(180deg, rgba(8, 10, 11, 0.86), rgba(8, 10, 11, 0));
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.7rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 780;
  letter-spacing: 0;
}

.brand-mark {
  position: relative;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid rgba(216, 177, 95, 0.92);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0.82rem;
  height: 1px;
  content: "";
  background: var(--gold);
  transform: translate(-50%, -50%);
}

.brand-mark::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem;
}

.nav-links a {
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  color: rgba(247, 241, 230, 0.74);
  font-size: 0.86rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: rgba(247, 241, 230, 0.09);
  color: var(--ink);
  outline: none;
}

.hero {
  position: relative;
  min-height: min(920px, 98svh);
  overflow: hidden;
  padding: 7.5rem clamp(1rem, 4.7vw, 5rem) 3rem;
  isolation: isolate;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(9, 11, 13, 0.96) 0%, rgba(9, 11, 13, 0.78) 46%, rgba(9, 11, 13, 0.45) 100%),
    linear-gradient(0deg, rgba(16, 19, 21, 1) 0%, rgba(16, 19, 21, 0.28) 42%, rgba(16, 19, 21, 0.64) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.74fr);
  align-items: end;
  width: min(1420px, 100%);
  min-height: calc(min(920px, 98svh) - 10.5rem);
  margin: 0 auto;
  gap: clamp(2rem, 5vw, 5rem);
}

.hero-copy {
  padding-bottom: clamp(1rem, 4vw, 3.5rem);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
button,
textarea {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 10.4ch;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.35rem, 8.4vw, 7.2rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.9;
}

.hero-copy p:not(.eyebrow) {
  max-width: 48rem;
  margin: 1.35rem 0 0;
  color: rgba(247, 241, 230, 0.82);
  font-size: clamp(1.04rem, 1.8vw, 1.32rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.82rem 1.08rem;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button span {
  color: inherit;
  font-weight: 900;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.button.primary {
  border-color: rgba(216, 177, 95, 0.85);
  background: var(--gold);
  color: #17130b;
}

.button.ghost {
  background: rgba(247, 241, 230, 0.08);
  color: var(--ink);
}

.agent-panel,
.agent-plan,
.question-output,
.atlas-detail,
.letter-inner {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.agent-panel {
  display: grid;
  max-height: 740px;
  min-height: 590px;
  grid-template-rows: auto auto minmax(230px, 1fr) auto auto;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.panel-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 1rem;
}

.panel-topline h2,
.panel-topline h3 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.05;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(98, 184, 173, 0.38);
  border-radius: 999px;
  padding: 0.38rem 0.62rem;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill.thinking {
  color: var(--gold);
  border-color: rgba(216, 177, 95, 0.42);
}

.status-pill.fallback {
  color: var(--clay);
  border-color: rgba(188, 109, 88, 0.42);
}

.context-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 241, 230, 0.035);
}

.context-strip span {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 0.7rem 0.55rem;
  color: rgba(247, 241, 230, 0.78);
  font-size: 0.78rem;
  font-weight: 760;
  text-align: center;
}

.context-strip span:last-child {
  border-right: 0;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1rem;
  scrollbar-color: rgba(247, 241, 230, 0.32) transparent;
}

.message {
  width: min(92%, 34rem);
  border: 1px solid rgba(247, 241, 230, 0.14);
  border-radius: 8px;
  padding: 0.78rem 0.85rem;
  background: rgba(247, 241, 230, 0.055);
}

.message.user {
  align-self: flex-end;
  border-color: rgba(122, 159, 216, 0.35);
  background: rgba(122, 159, 216, 0.13);
}

.message.assistant {
  align-self: flex-start;
}

.message-role {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message p,
.message ul {
  margin: 0;
  color: rgba(247, 241, 230, 0.86);
  font-size: 0.94rem;
  line-height: 1.52;
}

.message ul {
  padding-left: 1.1rem;
}

.message li + li {
  margin-top: 0.35rem;
}

.prompt-chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  padding: 0.75rem 1rem;
}

.prompt-chips button {
  flex: 0 0 auto;
  border: 1px solid rgba(247, 241, 230, 0.15);
  border-radius: 999px;
  background: rgba(247, 241, 230, 0.07);
  color: rgba(247, 241, 230, 0.78);
  padding: 0.56rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 730;
}

.prompt-chips button:hover,
.prompt-chips button:focus-visible {
  border-color: rgba(98, 184, 173, 0.48);
  color: var(--ink);
  outline: none;
}

.ask-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3rem;
  gap: 0.65rem;
  border-top: 1px solid var(--line);
  padding: 0.85rem 1rem 1rem;
  background: rgba(9, 11, 13, 0.52);
}

.ask-form textarea {
  min-height: 5.6rem;
  max-height: 10rem;
  resize: vertical;
  border: 1px solid rgba(247, 241, 230, 0.16);
  border-radius: 8px;
  background: rgba(247, 241, 230, 0.06);
  color: var(--ink);
  padding: 0.82rem;
  line-height: 1.45;
}

.ask-form textarea:focus {
  border-color: rgba(98, 184, 173, 0.72);
  outline: none;
}

.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  align-self: end;
  border: 1px solid rgba(216, 177, 95, 0.75);
  border-radius: 8px;
  background: var(--gold);
  color: #17130b;
}

.send-button svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.send-button:disabled {
  cursor: wait;
  filter: saturate(0.45);
  opacity: 0.7;
}

.intro-band {
  border-block: 1px solid var(--line);
  background: rgba(247, 241, 230, 0.055);
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 5vw, 5rem);
}

.intro-band p {
  width: min(1040px, 100%);
  margin: 0 auto;
  color: rgba(247, 241, 230, 0.84);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.28rem, 3vw, 2.25rem);
  line-height: 1.36;
}

.section {
  padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 5vw, 5rem);
}

.section-heading {
  width: min(900px, 100%);
  margin: 0 auto 2rem;
}

.section-heading.compact {
  width: min(1180px, 100%);
}

.section-heading h2,
.letter h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.05rem, 5vw, 4.45rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(1180px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(247, 241, 230, 0.035);
}

.signal-card {
  min-height: 18rem;
  border-right: 1px solid var(--line);
  padding: 1.2rem;
  background:
    linear-gradient(180deg, rgba(247, 241, 230, 0.065), rgba(247, 241, 230, 0.015)),
    rgba(16, 19, 21, 0.48);
}

.signal-card:last-child {
  border-right: 0;
}

.signal-index {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 850;
}

.signal-card h3 {
  margin: 3.7rem 0 0.8rem;
  color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.05;
}

.signal-card p {
  margin: 0;
  color: rgba(247, 241, 230, 0.76);
  line-height: 1.55;
}

.lab {
  background:
    linear-gradient(180deg, rgba(247, 241, 230, 0.045), rgba(247, 241, 230, 0.02)),
    var(--coal);
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(330px, 1fr) minmax(280px, 0.78fr);
  width: min(1180px, 100%);
  margin: 0 auto;
  gap: 1rem;
  align-items: stretch;
}

.forge-controls {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.segmented label {
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: flex;
  justify-content: center;
  min-height: 3rem;
  border-right: 1px solid var(--line);
  background: rgba(247, 241, 230, 0.055);
  color: rgba(247, 241, 230, 0.76);
  padding: 0.92rem 0.45rem;
  font-size: 0.85rem;
  font-weight: 780;
  text-align: center;
}

.segmented label:last-child span {
  border-right: 0;
}

.segmented input:checked + span {
  background: var(--teal);
  color: #071112;
}

.field-label,
.range-label {
  display: grid;
  gap: 0.45rem;
  color: rgba(247, 241, 230, 0.72);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 241, 230, 0.08);
  color: var(--ink);
  padding: 0 0.8rem;
}

select:focus,
input[type="range"]:focus {
  outline: 2px solid rgba(98, 184, 173, 0.42);
  outline-offset: 2px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.question-output {
  display: grid;
  align-content: space-between;
  min-height: 24rem;
  padding: 1.2rem;
  background:
    linear-gradient(180deg, rgba(98, 184, 173, 0.11), transparent 44%),
    var(--panel);
}

.output-label {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.question-output strong {
  display: block;
  margin: 2rem 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  font-weight: 500;
  line-height: 1.08;
}

.question-output small {
  display: block;
  color: rgba(247, 241, 230, 0.72);
  font-size: 0.95rem;
  line-height: 1.5;
}

.agent-plan {
  align-self: stretch;
  box-shadow: none;
}

.plan-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-list li {
  border-top: 1px solid var(--line);
  padding: 1rem;
  color: rgba(247, 241, 230, 0.76);
  line-height: 1.45;
}

.plan-list span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.atlas {
  overflow: hidden;
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(980px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.atlas-tile {
  display: grid;
  min-height: 8.8rem;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: rgba(247, 241, 230, 0.05);
  color: rgba(247, 241, 230, 0.78);
  font-weight: 850;
}

.atlas-tile:last-child {
  border-right: 0;
}

.atlas-tile:hover,
.atlas-tile:focus-visible,
.atlas-tile.active {
  background: var(--gold);
  color: #17130b;
  outline: none;
}

.atlas-detail {
  width: min(980px, 100%);
  margin: 1rem auto 0;
  padding: clamp(1.2rem, 4vw, 2rem);
  box-shadow: none;
}

.room-kicker {
  margin: 0 0 0.5rem;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.atlas-detail h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
}

.atlas-detail p:last-child {
  max-width: 58rem;
  margin: 1rem 0 0;
  color: rgba(247, 241, 230, 0.76);
  font-size: 1.03rem;
  line-height: 1.6;
}

.letter {
  padding-top: 1rem;
}

.letter-inner {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(1.4rem, 5vw, 3rem);
  background:
    linear-gradient(90deg, rgba(216, 177, 95, 0.1), transparent 34%),
    var(--panel);
}

.letter p:not(.eyebrow) {
  margin: 1.15rem 0 0;
  color: rgba(247, 241, 230, 0.78);
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 1.3rem clamp(1rem, 5vw, 5rem);
  color: rgba(247, 241, 230, 0.62);
  font-size: 0.86rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--gold);
  font-weight: 780;
}

@media (max-width: 1120px) {
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  .agent-panel {
    min-height: 560px;
  }

  .signal-grid,
  .lab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question-output {
    grid-column: 1 / -1;
    order: 3;
  }

  .signal-card:nth-child(2) {
    border-right: 0;
  }

  .signal-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .site-header {
    position: absolute;
    align-items: flex-start;
  }

  .brand {
    max-width: 12rem;
  }

  .nav-links {
    gap: 0;
  }

  .nav-links a {
    padding: 0.45rem 0.46rem;
    font-size: 0.78rem;
  }

  .hero {
    min-height: auto;
    padding-top: 6.6rem;
  }

  .hero-grid {
    min-height: 0;
  }

  .agent-panel {
    min-height: 620px;
  }

  .context-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .context-strip span:nth-child(2) {
    border-right: 0;
  }

  .context-strip span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .ask-form {
    grid-template-columns: 1fr;
  }

  .send-button {
    width: 100%;
  }

  .signal-grid,
  .lab-grid,
  .atlas-grid {
    grid-template-columns: 1fr;
  }

  .signal-card,
  .signal-card:nth-child(2),
  .atlas-tile {
    border-right: 0;
  }

  .signal-card,
  .signal-card:nth-child(-n + 2),
  .atlas-tile {
    border-bottom: 1px solid var(--line);
  }

  .signal-card:last-child,
  .atlas-tile:last-child {
    border-bottom: 0;
  }

  .signal-card {
    min-height: 14rem;
  }

  .signal-card h3 {
    margin-top: 2.5rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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