/* Stageshow-inspired editorial system: frame the work, keep controls quiet,
   and let motion explain a change instead of decorating every element. */
:root {
  --editorial-paper: #fbfbf8;
  --editorial-line: #e6e7e1;
  --editorial-soft: #f1f2ed;
  --editorial-ink: #141820;
  --editorial-muted: #6b727b;
  --editorial-ease: cubic-bezier(.22, 1, .36, 1);
}
html[data-theme="light"] {
  --bg: var(--editorial-paper);
  --surface: #fff;
  --surface-alt: var(--editorial-soft);
  --text: var(--editorial-ink);
  --subtext: var(--editorial-muted);
  --border: var(--editorial-line);
  --header-bg: rgb(251 251 248 / 92%);
}
html, body { background: var(--bg); }
body {
  background-image: none;
  letter-spacing: -.018em;
}
.app-header { border: 0; background: var(--header-bg); }
.header-inner { width: min(1320px, calc(100% - 64px)); height: 88px; }
.brand { gap: 12px; }
.brand-avatar { width: 42px; height: 42px; box-shadow: none; animation: none; }
.brand-text strong { font-size: 1.18rem; letter-spacing: -.035em; }
.app-main { width: min(1320px, calc(100% - 64px)); padding: 20px 0 80px; }

/* Home: typography and the interactive research scene share one composition. */
.research-home .hero {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr);
  grid-template-areas: "eyebrow scene" "title scene" "intro scene" "tools scene" "shortcuts scene";
  align-content: center;
  align-items: center;
  column-gap: clamp(34px, 6vw, 96px);
  row-gap: 0;
  min-height: min(790px, calc(100svh - 100px));
  padding: 48px 0 72px;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.research-home .hero > .eyebrow { grid-area: eyebrow; align-self: end; margin: 0 0 20px; }
.research-home .hero h1 { grid-area: title; max-width: 10ch; font-size: clamp(46px, 5.4vw, 78px); line-height: 1.08; }
.research-home .intro { grid-area: intro; max-width: 28rem; margin: 22px 0 24px; font-size: clamp(16px, 1.45vw, 19px); line-height: 1.7; }
.research-home .hero-stage { grid-area: scene; width: 100%; max-width: none; aspect-ratio: 720 / 360; min-height: 340px; max-height: 420px; margin: 0; }
.research-home .editorial { overflow: hidden; border-radius: 0; background: transparent; box-shadow: none; }
.research-home .editorial-scene { background: transparent; }
.research-home .editorial-scene.scene-prices { background: transparent; }
.research-home .editorial-scene.scene-earnings { background: transparent; }
.research-home .paper { box-sizing: border-box; padding: 20px; border-radius: 10px; box-shadow: 0 18px 46px rgb(20 24 32 / 13%); }
.research-home .paper-front {
  left: 22%; top: 32%; width: 118%; height: 134%; overflow: hidden;
  transform: none; background: #fff; color: var(--editorial-ink);
}
.research-home .paper-front::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 25%;
  background: #f6f7f5; border-right: 1px solid var(--editorial-line);
}
.research-home .paper-front > * { position: relative; width: 60%; margin-left: 31%; }
.research-home .paper-front span { font-size: 9px; line-height: 1.4; letter-spacing: .1em; }
.research-home .paper-front b { margin-top: 12px; margin-bottom: 12px; font-size: clamp(19px, 2vw, 25px); line-height: 1.3; }
.research-home .paper-front p { line-height: 1.55; }
.research-home .paper-front .paper-lines { height: 42px; margin-top: 14px; }
.research-home .paper-front small { display: block; margin-top: 10px; line-height: 1.45; }
.research-home .paper-back {
  z-index: 2; left: 4%; top: 44%; width: 42%; height: 50%; padding: 15px;
  transform: none; border-radius: 9px; background: #e8eee9;
  box-shadow: 0 22px 50px rgb(20 24 32 / 18%);
}
.research-home .paper-back span { font-size: 8px; line-height: 1.4; }
.research-home .paper-back b { margin: 8px 0; font-size: clamp(15px, 1.5vw, 19px); line-height: 1.25; }
.research-home .paper-back svg { height: 66px; }
.research-home .paper-back small { display: block; margin-top: 4px; font-size: 10px; line-height: 1.4; }
.research-home .visual-caption { display: none; }
.research-home .landing-composer { z-index: 4; inset: 7% 4% auto 0; min-height: 76px; padding: 11px 12px 11px 22px; border: 1px solid rgb(20 24 32 / 9%); border-radius: 24px; box-shadow: 0 16px 44px rgb(20 24 32 / 10%); }
.research-home .landing-composer textarea { font-size: 16px; }
.research-home .send { width: 50px; height: 50px; transition: transform 220ms var(--editorial-ease), background-color 180ms ease; }
.research-home .send:hover { transform: translateX(3px); }
.research-home .hero-tools { grid-area: tools; justify-content: flex-start; gap: 10px; margin: 18px 0 10px; font-size: 13px; }
.research-home .hero-tools button { width: 38px; height: 38px; background: transparent; color: var(--subtext); font-size: 18px; }
.research-home .hero-tools button:hover:not(:disabled) { background: var(--surface-alt); color: var(--text); }
.research-home .hero-tools #exampleText { min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; }
.research-home .home-shortcuts { grid-area: shortcuts; justify-content: flex-start; flex-wrap: wrap; gap: 20px; margin-top: 10px; font-size: 13px; }
.research-home .home-shortcuts button { display: inline-flex; align-items: center; min-height: 36px; border-bottom: 1px solid transparent; transition: border-color 180ms ease, color 180ms ease; }
.research-home .home-shortcuts button:hover { color: var(--blue); border-color: currentColor; }
.research-home .home-shortcuts span { margin-left: 8px; }
.research-home .manifesto { max-width: 980px; margin: 50px auto 130px; font-size: clamp(26px, 4vw, 52px); line-height: 1.3; }
.research-home .feature { max-width: 1120px; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .75fr); gap: clamp(44px, 9vw, 132px); margin-bottom: 150px; }
.research-home .feature:nth-of-type(odd) { grid-template-columns: minmax(280px, .75fr) minmax(0, 1.05fr); }
.research-home .feature-art { aspect-ratio: 1.15 / 1; padding: clamp(24px, 4vw, 48px); border-radius: 2px 2px 2px 42px; background: var(--surface-alt); }
.research-home .feature:nth-of-type(odd) .feature-art { order: 2; }
.research-home .art-label { top: 24px; left: 26px; font-size: 10px; letter-spacing: .16em; }
.research-home .folder { padding: 17px 2px; border: 0; border-bottom: 1px solid var(--editorial-line); border-radius: 0; background: transparent; }
.research-home .folder:nth-child(2) { transform: translateX(-12px); }
.research-home .folder:nth-child(4) { transform: translateX(16px); }
.research-home .feature-copy h2 { font-size: clamp(34px, 4vw, 52px); line-height: 1.12; }
.research-home .feature-copy > p:not(.eyebrow) { max-width: 35rem; line-height: 1.8; }
.research-home .text-link { display: inline-flex; gap: 8px; align-items: center; min-height: 40px; border-bottom: 1px solid var(--editorial-line); transition: border-color 180ms ease, color 180ms ease; }
.research-home .text-link:hover { color: var(--blue); border-color: currentColor; }
.research-home .closing { padding: 20px 0 120px; }
.research-home .closing h2 { font-size: clamp(38px, 5vw, 60px); }

/* Keep tools calm: borders mark grouping, surfaces are reserved for interaction. */
.blue-button, .secondary-button { border-radius: 999px; box-shadow: none; }
.secondary-button { border-color: transparent; background: var(--surface-alt); }
.secondary-button:hover:not(:disabled) { background: color-mix(in srgb, var(--surface-alt) 70%, var(--blue-soft)); }
#archiveView, #vizView { width: min(1320px, calc(100% - 64px)); }
#archiveView .stage { border-block-color: var(--editorial-line); }
#archiveView .archive-list { border-top-color: var(--editorial-line); }
#archiveView .archive-item { border-bottom-color: var(--editorial-line); }
#archiveView .archive-item > summary { transition: padding 220ms var(--editorial-ease), color 180ms ease; }
#archiveView .archive-item > summary:hover { padding-inline: 10px; }
#archiveView .document-list li { border-color: var(--editorial-line); }
#archiveView .report-note textarea,
#vizView .viz-field input,
#vizView .chart-tools input { transition: background-color 180ms ease, border-color 180ms ease; }
#vizView .viz-chart-panel { border-color: var(--editorial-line); }
#analystView .message-user .message-body { border-radius: 24px 24px 6px 24px; }
#analystView .composer { box-shadow: 0 12px 36px rgb(20 24 32 / 8%); }
.research-menu .menu-surface { box-shadow: 0 24px 72px rgb(20 24 32 / 16%); }
.research-menu[open].is-open .menu-surface { background: var(--surface); }
.research-footer { border-color: var(--editorial-line); }

@media (max-width: 900px) {
  .header-inner, .app-main, #archiveView, #vizView { width: calc(100% - 40px); }
  .research-home .hero { column-gap: 28px; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr); }
  .research-home .hero-stage { min-height: 320px; }
}
@media (max-width: 700px) {
  .header-inner, .app-main, #archiveView, #vizView { width: calc(100% - 32px); }
  .header-inner { height: 72px; }
  .app-main { padding-top: 0; }
  .research-home { padding: 0; }
  .research-home .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "eyebrow" "title" "intro" "scene" "tools" "shortcuts";
    min-height: 0; padding: 52px 0 36px; text-align: left;
  }
  .research-home .hero > .eyebrow { margin-bottom: 14px; }
  .research-home .hero h1 { max-width: 11ch; font-size: clamp(42px, 11vw, 58px); }
  .research-home .intro { margin: 16px 0 24px; font-size: 16px; }
  .research-home .hero-stage { min-height: 0; max-height: none; aspect-ratio: 358 / 360; margin-top: 8px; }
  .research-home .paper-front { left: 4%; top: 30%; width: 150%; height: 110%; padding: 17px; border-radius: 10px; }
  .research-home .paper-front::before { display: none; }
  .research-home .paper-front > * { width: auto; margin-left: 0; }
  .research-home .paper-front span { font-size: 9px; }
  .research-home .paper-front b { margin-top: 10px; margin-bottom: 10px; font-size: 19px; }
  .research-home .paper-front p, .research-home .paper-front small { font-size: 11px; }
  .research-home .paper-front .paper-lines { height: 30px; margin-top: 10px; }
  .research-home .paper-back { display: none; }
  .research-home .paper { padding: 17px; }
  .research-home .landing-composer { inset: 5% 3% auto 0; min-height: 70px; padding: 9px 9px 9px 16px; border-radius: 22px; }
  .research-home .landing-composer textarea { height: auto; min-height: 46px; max-height: 78px; font-size: 15px; overflow-wrap: anywhere; }
  .research-home .send { width: 44px; height: 44px; }
  .research-home .hero-tools { justify-content: center; margin-top: 16px; }
  .research-home .home-shortcuts { justify-content: center; }
  .research-home .manifesto { margin: 68px 0 84px; font-size: clamp(25px, 7vw, 34px); }
  .research-home .feature, .research-home .feature:nth-of-type(odd) { grid-template-columns: 1fr; gap: 24px; margin: 0 0 84px; }
  .research-home .feature:nth-of-type(odd) .feature-art { order: 0; }
  .research-home .feature-art { aspect-ratio: 1.12 / 1; border-bottom-left-radius: 30px; }
  .research-home .feature-copy h2 { font-size: 34px; }
  .research-home .closing { padding-bottom: 72px; }
  #archiveView, #vizView { margin-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .research-home .send, .research-home .home-shortcuts button, .research-home .text-link,
  #archiveView .archive-item > summary { transition: none !important; }
}
