@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Canvas & surfaces — depth via lightness, not borders everywhere */
  --bg: #08080b;
  --surface: #101015;
  --surface-2: #16161d;
  --hairline: rgba(255, 255, 255, 0.08);

  /* Text */
  --text: #f5f5f7;
  --text-muted: #a1a1aa;
  --text-faint: #6b6b76;

  /* Luminous accent (violet) — the one signature color */
  --accent: #8b7cff;
  --accent-strong: #6d5ef5;
  --accent-glow: rgba(139, 124, 255, 0.35);

  /* Semantic (belief states) */
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #fb7185;

  /* Depth */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px var(--accent-glow);

  --content: min(1120px, calc(100vw - 48px));

  --ui: "Inter", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
}

body {
  min-height: 100vh;
  font-family: var(--ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--content);
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 112px 0 80px;
}

/* App-page layout: stacked sections that breathe */
.page-shell {
  display: grid;
  gap: 40px;
}

/* Surface panel — used only where content needs containment (app pages) */
.section-shell {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}

/* Marketing section rhythm — no border, whitespace does the work */
.section {
  padding-block: 112px;
}

.section--divider {
  border-top: 1px solid var(--hairline);
}

.section-heading h1,
.section-heading h2 {
  margin: 0 0 12px;
  line-height: 1.1;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  margin-top: 0;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--ui);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0;
}

h1 {
  font-size: clamp(48px, 8vw, 88px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(30px, 4vw, 44px);
}

h3 {
  font-size: 21px;
}

p {
  margin: 0 0 14px;
}

.eyebrow,
.tiny,
.small {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.muted {
  color: var(--text-muted);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.tiny {
  font-size: 12px;
  line-height: 1.3;
}

.small {
  font-size: 10px;
}

a {
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav,
.main-nav,
.btn,
button,
select,
input,
textarea,
a,
label {
  font-family: var(--ui);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.nav-brand {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-brand:hover,
.nav-brand:focus-visible {
  color: var(--accent);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  cursor: pointer;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  fill: none;
}

.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  height: 44px;
  line-height: 44px;
  text-decoration: none;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-muted);
  transition: color 150ms ease, background 150ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  background: var(--surface);
}

.nav-link.is-active {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease,
    border-color 150ms ease, background 150ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 0 0 transparent;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent);
  box-shadow: var(--shadow-glow);
  border-color: transparent;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
}

.btn:disabled,
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
details:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 10;
  background: var(--accent);
  color: #0a0a0f;
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 8px;
}

/* ---------- Landing hero ---------- */
.hero {
  position: relative;
  padding-block: 128px 96px;
  display: grid;
  gap: 28px;
  align-items: start;
  grid-template-columns: 1.4fr 1fr;
}

.hero::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 8%;
  width: 620px;
  max-width: 90%;
  height: 620px;
  background: radial-gradient(
    circle at center,
    var(--accent-glow),
    transparent 68%
  );
  filter: blur(30px);
  opacity: 0.75;
  z-index: -1;
  pointer-events: none;
}

.hero-copy {
  position: relative;
}

.hero-copy > p {
  margin: 0;
  color: var(--text-muted);
  max-width: 52ch;
  font-size: 18px;
}

.hero-copy h1 {
  margin: 0 0 22px;
  max-width: 16ch;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-teaser {
  display: grid;
  gap: 14px;
  align-content: start;
}

.result-panel {
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-md);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.result-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-glow);
}

.result-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.result-panel__header h2 {
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.result-text,
.result-ref {
  color: var(--text-muted);
}

.result-text {
  color: var(--text);
}

.result-ref {
  word-break: break-all;
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- Grids ---------- */
.section-heading + .feature-grid {
  margin-top: 8px;
}

.feature-grid,
.verb-grid,
.briefing-grid,
.timeline-grid,
.metric-grid,
.link-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.feature-grid,
.verb-grid,
.metric-grid {
  margin-top: 32px;
}

/* Marketing feature/verb grids: 3-up looks better than forced 4 */
.section .feature-grid,
.section .verb-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section .verb-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.panel {
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--surface);
  padding: 22px;
}

.panel {
  background: var(--surface-2);
}

.card {
  transition: transform 150ms ease, box-shadow 150ms ease,
    border-color 150ms ease;
}

.card p:last-child {
  margin-bottom: 0;
}

.tile-link {
  text-decoration: none;
  display: block;
}

.card.tile-link:hover,
.card.tile-link:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-glow);
}

.card h3,
.panel h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.card h3 {
  margin-top: 10px;
}

.card .eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
}

.ladder {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  display: grid;
  gap: 0;
}

.ladder li {
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
  font-size: 17px;
}

.ladder li:last-child {
  border-bottom: 1px solid var(--hairline);
}

.ladder strong {
  color: var(--text);
  font-weight: 600;
}

.proof-band {
  display: grid;
  gap: 14px;
}

.metric-card {
  text-align: center;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--surface);
  padding: 26px 18px;
}

.metric {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1;
  margin: 10px 0;
  color: var(--accent);
  letter-spacing: 0;
}

.inline-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  margin: 20px 0 0;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.inline-link:hover {
  text-decoration: underline;
}

.site-footer {
  max-width: var(--content);
  width: min(100%, var(--content));
  margin: 0 auto 40px;
  padding: 28px 0 0;
  color: var(--text-faint);
  border-top: 1px solid var(--hairline);
  font-size: 14px;
}

.site-footer a {
  color: var(--text-muted);
}

/* ---------- App-page interactive layout ---------- */
.ask-grid,
.briefing-grid,
.timeline-grid {
  display: grid;
  gap: 18px;
}

.ask-grid {
  grid-template-columns: 1.1fr 1fr 1fr;
}

.timeline-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel-kicker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-kicker h2 {
  margin: 0;
  font-family: var(--ui);
  font-size: 18px;
  font-weight: 600;
}

.question-box,
input,
select,
textarea,
.timeline-controls {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  font-size: 16px;
}

.question-box {
  min-height: 95px;
  padding: 12px;
  resize: vertical;
  margin-bottom: 12px;
}

input,
select {
  min-height: 44px;
  padding: 10px 12px;
}

.timeline-controls {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 2fr auto;
  gap: 10px;
  align-items: center;
  padding: 16px;
}

.inline-label {
  font-size: 14px;
  color: var(--text-muted);
}

.retract-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.feedback-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.timeline {
  min-height: 164px;
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
}

.timeline-time,
.timeline-event {
  font-size: 14px;
}

.timeline-time {
  color: var(--text-faint);
  font-family: var(--mono);
}

.event-log {
  min-height: 96px;
}

.event-log .empty {
  color: var(--text-muted);
  border: 1px dashed var(--hairline);
  border-radius: 12px;
  padding: 14px;
}

.empty {
  color: var(--text-muted);
}

.refs {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ref-card {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-2);
}

.ref-title {
  color: var(--text-faint);
  margin-bottom: 6px;
}

.ref-basis {
  color: var(--text);
}

/* ---------- State badges ---------- */
.state-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.state-badge svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
}

.state-badge--ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
}

.state-badge--warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}

.state-badge--danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.state-badge--muted {
  color: var(--text-muted);
  border-color: var(--hairline);
}

/* ---------- Briefing / contested lists ---------- */
.briefing-list,
.contested-list,
.event-log,
.link-list {
  display: grid;
  gap: 10px;
}

.briefing-item,
.contested-item {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-2);
}

/* ---------- Skeleton / error ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
  min-height: 18px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  animation: shimmer 1.6s infinite;
}

.skeleton-line {
  height: 18px;
  margin-bottom: 10px;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.error-panel {
  border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--danger);
  border-radius: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.mt-2 {
  margin-top: 10px;
}

details {
  margin-top: 12px;
}

details summary {
  color: var(--text-muted);
  cursor: pointer;
}

/* ---------- Scroll reveal (JS opts in; content visible by default) ---------- */
:root.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

:root.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ask-grid,
  .timeline-grid,
  .timeline-grid--four,
  .feature-grid,
  .verb-grid,
  .metric-grid,
  .section .feature-grid,
  .section .verb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-controls {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .section {
    padding-block: 88px;
  }

  .hero {
    padding-block: 104px 72px;
  }
}

@media (max-width: 768px) {
  .site-nav {
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .main-nav {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav .nav-link {
    height: auto;
    line-height: 1.4;
    padding: 10px 12px;
  }

  .hero,
  .ask-grid,
  .feature-grid,
  .verb-grid,
  .timeline-grid,
  .timeline-grid--four,
  .metric-grid,
  .briefing-grid,
  .section .feature-grid,
  .section .verb-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding-block: 64px;
  }

  .hero {
    padding-block: 88px 56px;
  }

  .timeline-controls {
    gap: 10px;
  }

  main {
    padding-top: 128px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  :root.reveal-ready .reveal {
    opacity: 1;
    transform: none;
  }
}
