/* ============================================
   AEI Door Experience — Shared Styles
   ============================================ */

:root {
  --black: #0a0a0a;
  --white: #f2f0eb;
  --cream: #e8e4db;
  --warm-gray: #c4bdb0;
  --mid-gray: #6b6359;
  --rust: #c44b28;
  --rust-glow: rgba(196, 75, 40, 0.15);
  --serif: 'Source Serif 4', Georgia, serif;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--black); }

body {
  background: var(--black); color: var(--white); font-family: var(--serif);
  font-size: 19px; line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  overflow-wrap: break-word; word-break: break-word;
}

::selection { background: var(--rust); color: var(--white); }

/* ---- INTAKE (the "door") ---- */
.intake {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 3rem 2rem; position: relative; overflow: hidden;
}
.intake::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 50%, rgba(196,75,40,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 80% 30%, rgba(196,75,40,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.intake-inner { max-width: 580px; width: 100%; position: relative; z-index: 1; }
.intake-label {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--rust); margin-bottom: 3rem; text-align: center;
}
.intake-heading {
  font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700;
  line-height: 1.1; letter-spacing: -0.02em; color: var(--white); text-align: center; margin-bottom: 3rem;
}
.intake-progress { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 3rem; }
.intake-progress-bar {
  width: 40px; height: 3px; background: rgba(107, 99, 89, 0.3); border-radius: 2px;
  transition: background 0.4s ease;
}
.intake-progress-bar.filled { background: var(--rust); }
.intake-question {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  position: absolute; width: 100%; left: 0; pointer-events: none;
}
.intake-question.active {
  opacity: 1; transform: translateY(0); position: relative; pointer-events: auto;
}
.intake-question-text {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--white);
  text-align: center; margin-bottom: 0.6rem;
}
.intake-question-sub {
  font-family: var(--sans); font-size: 0.9rem; color: var(--mid-gray);
  text-align: center; margin-bottom: 2rem;
}
.intake-options { display: flex; flex-direction: column; gap: 0.7rem; }
.intake-option {
  background: transparent; border: 1px solid rgba(107, 99, 89, 0.3);
  border-radius: 3px; padding: 1rem 1.3rem; cursor: pointer;
  font-family: var(--sans); font-size: 0.95rem; color: var(--cream);
  text-align: left; transition: all 0.3s ease; line-height: 1.5;
  overflow-wrap: break-word;
}
.intake-option:hover {
  border-color: var(--rust); background: rgba(196, 75, 40, 0.06); color: var(--white);
}
.intake-option.selected {
  border-color: var(--rust); background: rgba(196, 75, 40, 0.12); color: var(--white);
}
.intake-ready {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  position: absolute; width: 100%; left: 0;
  pointer-events: none; text-align: center;
}
.intake-ready.active {
  opacity: 1; transform: translateY(0); position: relative; pointer-events: auto;
}
.ready-message {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: var(--white); margin-bottom: 1.5rem; line-height: 1.3;
}
.ready-sub {
  font-family: var(--sans); font-size: 1.05rem; line-height: 1.7;
  color: var(--cream); margin-bottom: 2.5rem; text-align: left;
}
.ready-btn {
  display: inline-block; font-family: var(--mono); font-size: 0.75rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--white);
  background: var(--rust); border: none; padding: 1rem 2.5rem;
  cursor: pointer; border-radius: 2px; transition: all 0.3s;
}
.ready-btn:hover { background: #d4562f; }

/* ---- LAYOUT ---- */
.section { max-width: 680px; margin: 0 auto; padding: 0 2rem; }
.section-break { padding: 6rem 0; }
.section-break-large { padding: 8rem 0 6rem; }

/* ---- HERO ---- */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 3rem 2rem; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 50%, rgba(196,75,40,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 80% 30%, rgba(196,75,40,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.hero-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--rust); margin-bottom: 2.5rem; opacity: 0; animation: fadeUp 1s 0.3s forwards; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.8rem, 7vw, 5.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; color: var(--white); max-width: 14ch; margin-bottom: 2rem; opacity: 0; animation: fadeUp 1s 0.5s forwards; }
.hero-sub { font-family: var(--sans); font-size: 1.15rem; line-height: 1.6; color: var(--warm-gray); max-width: 38ch; opacity: 0; animation: fadeUp 1s 0.8s forwards; }
.hero-scroll { position: absolute; bottom: 2.5rem; left: 2rem; font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mid-gray); opacity: 0; animation: fadeUp 1s 1.2s forwards; }
.hero-scroll span { display: inline-block; animation: pulse 2s ease-in-out infinite; }
.door-number { position: absolute; top: 2rem; right: 2rem; font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mid-gray); opacity: 0; animation: fadeUp 1s 0.3s forwards; }

/* ---- TEXT STYLES ---- */
.setup p { font-size: 1.15rem; line-height: 1.8; color: var(--cream); margin-bottom: 1.6rem; }
.setup p.accent { color: var(--white); font-weight: 600; font-size: 1.25rem; }
.setup p.dim { color: var(--warm-gray); }

.divider { max-width: 680px; margin: 0 auto; padding: 0 2rem; height: 1px; }
.divider-line { height: 1px; background: linear-gradient(90deg, transparent, var(--mid-gray) 30%, var(--mid-gray) 70%, transparent); opacity: 0.3; }

.depth { max-width: 680px; margin: 0 auto; padding: 0 2rem; }
.depth-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.5rem; }
.depth-num { font-family: var(--mono); font-size: 0.7rem; color: var(--rust); letter-spacing: 0.15em; white-space: nowrap; position: relative; top: 0.15em; }
.depth-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--white); line-height: 1.3; }
.depth-body p { font-size: 1.05rem; line-height: 1.8; color: var(--cream); margin-bottom: 1.4rem; }
.depth-body p.instruction { color: var(--white); font-family: var(--sans); font-weight: 500; font-size: 1rem; border-left: 2px solid var(--rust); padding-left: 1.25rem; margin: 2rem 0; line-height: 1.7; }
.depth-body p strong { color: var(--white); font-weight: 600; }
.depth-body p em { font-style: italic; color: var(--warm-gray); }

.pull-quote { max-width: 680px; margin: 0 auto; padding: 4rem 2rem; }
.pull-quote blockquote { font-family: var(--serif); font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 300; line-height: 1.4; color: var(--white); font-style: italic; padding-left: 1.5rem; border-left: 3px solid var(--rust); }

.closer { max-width: 680px; margin: 0 auto; padding: 0 2rem; }
.closer p { font-size: 1.1rem; line-height: 1.8; color: var(--cream); margin-bottom: 1.5rem; }
.closer p.accent { color: var(--white); font-weight: 600; font-size: 1.2rem; }

/* ---- INLINE CHAT ---- */
.chat-zone { max-width: 680px; margin: 0 auto; padding: 0 2rem; }
.chat-container {
  border: 1px solid rgba(196, 75, 40, 0.2);
  border-radius: 3px; overflow: hidden; margin: 2rem 0;
  transition: all 0.4s ease;
}
.chat-trigger {
  background: rgba(196, 75, 40, 0.06);
  border: none; width: 100%; text-align: left;
  padding: 1.2rem 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.3s; user-select: none;
}
.chat-trigger:hover { background: rgba(196, 75, 40, 0.1); }
.chat-trigger-text {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--rust);
}
.chat-trigger-arrow {
  color: var(--rust); font-size: 1.2rem; transition: transform 0.3s;
}
.chat-trigger.open .chat-trigger-arrow { transform: rotate(180deg); }

.chat-panel {
  max-height: 0; overflow: hidden; transition: max-height 0.5s ease;
  background: rgba(0,0,0,0.3);
}
.chat-panel.open { max-height: 2000px; }

.chat-messages {
  padding: 1.5rem; max-height: 400px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1rem;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--mid-gray); border-radius: 2px; }

.chat-msg {
  max-width: 88%; padding: 0.8rem 1.1rem; border-radius: 3px;
  font-family: var(--sans); font-size: 0.9rem; line-height: 1.6;
  animation: msgFade 0.3s ease; overflow-wrap: break-word; min-width: 0;
}
.chat-msg.user {
  background: rgba(196, 75, 40, 0.12); color: var(--white);
  align-self: flex-end; border: 1px solid rgba(196, 75, 40, 0.2);
}
.chat-msg.assistant {
  background: rgba(255, 255, 255, 0.04); color: var(--cream);
  align-self: flex-start; border: 1px solid rgba(107, 99, 89, 0.15);
}
.chat-msg.assistant p { margin-bottom: 0.6rem; }
.chat-msg.assistant p:last-child { margin-bottom: 0; }
.chat-msg.assistant strong { color: var(--white); font-weight: 600; }
.chat-msg.assistant em { font-style: italic; color: var(--warm-gray); }
.chat-msg.assistant ul, .chat-msg.assistant ol { margin: 0.4rem 0 0.6rem 1.2rem; }
.chat-msg.assistant li { margin-bottom: 0.3rem; }
.chat-msg.assistant code { font-family: var(--mono); font-size: 0.82rem; background: rgba(255,255,255,0.06); padding: 0.15rem 0.35rem; border-radius: 2px; }
.chat-msg.system-note {
  background: rgba(196, 75, 40, 0.06); color: var(--rust);
  align-self: center; text-align: center;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; max-width: 100%; border: none;
}
.chat-typing {
  align-self: flex-start; color: var(--mid-gray);
  font-family: var(--sans); font-size: 0.85rem; padding: 0.5rem 0;
}
.chat-typing span { animation: blink 1.2s infinite; }
@keyframes blink { 0%,60% { opacity: 1; } 30% { opacity: 0.2; } }

.chat-input-area {
  display: flex; gap: 0.5rem; padding: 1rem 1.5rem;
  border-top: 1px solid rgba(107, 99, 89, 0.15);
  background: rgba(0,0,0,0.2);
}
.chat-input {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(107, 99, 89, 0.25);
  border-radius: 2px; padding: 0.7rem 1rem;
  color: var(--cream); font-family: var(--sans); font-size: 0.9rem;
  line-height: 1.5; resize: none; min-height: 2.625rem; max-height: 120px;
}
.chat-input:focus { outline: none; border-color: var(--rust); box-shadow: 0 0 0 2px rgba(196, 75, 40, 0.25); }
*:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }
button:focus-visible { outline: 2px solid var(--rust); outline-offset: 2px; }
.chat-msg-role { font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 0.3rem; }
.chat-msg.user .chat-msg-role { color: var(--rust); }
.chat-msg.assistant .chat-msg-role { color: var(--mid-gray); }
.chat-input::placeholder { color: var(--mid-gray); }
.chat-send {
  background: var(--rust); border: none; color: var(--white);
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.15em;
  text-transform: uppercase; padding: 0 1.2rem; cursor: pointer;
  border-radius: 2px; transition: background 0.2s; white-space: nowrap;
  align-self: flex-end; min-height: 2.625rem;
}
.chat-send:hover { background: #d4562f; }
.chat-send:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---- INSIGHT BLOCKS ---- */
.insight-block { max-width: 680px; margin: 0 auto; padding: 0 2rem; }
.insight-box {
  background: rgba(196, 75, 40, 0.04);
  border-left: 3px solid var(--rust);
  padding: 2rem 2.5rem; margin: 2rem 0;
}
.insight-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 1rem;
}
.insight-box p { font-size: 1.05rem; line-height: 1.8; color: var(--cream); margin-bottom: 1rem; }
.insight-box p:last-child { margin-bottom: 0; }
.insight-box p strong { color: var(--white); font-weight: 600; }

/* ---- READING INTERSTITIAL ---- */
.reading-block { max-width: 680px; margin: 0 auto; padding: 0 2rem; }
.reading-box {
  background: rgba(242, 240, 235, 0.03);
  border: 1px solid rgba(107, 99, 89, 0.2);
  padding: 2.5rem 2.5rem 2rem; margin: 2rem 0;
}
.reading-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--mid-gray); margin-bottom: 1.5rem;
}
.reading-source {
  font-family: var(--sans); font-size: 0.8rem; color: var(--mid-gray);
  margin-top: 1.5rem; padding-top: 1rem;
  border-top: 1px solid rgba(107, 99, 89, 0.15);
}
.reading-box blockquote {
  font-family: var(--serif); font-size: 1.1rem; line-height: 1.75;
  color: var(--cream); font-style: italic; margin-bottom: 1.2rem;
}
.reading-box blockquote:last-of-type { margin-bottom: 0; }
.reading-bridge {
  font-family: var(--sans); font-size: 0.95rem; line-height: 1.7;
  color: var(--warm-gray); margin-top: 1.5rem;
}
.reading-bridge strong { color: var(--white); font-weight: 500; }

/* ---- DATA COLLECTION ---- */
.artifact-section { max-width: 680px; margin: 0 auto; padding: 0 2rem; }
.artifact-box { background: rgba(196,75,40,0.06); border: 1px solid rgba(196,75,40,0.2); border-radius: 2px; padding: 2.5rem; margin: 2rem 0; }
.artifact-box h3 { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--rust); margin-bottom: 1.5rem; }
.artifact-box p { font-family: var(--sans); font-size: 1rem; line-height: 1.7; color: var(--cream); margin-bottom: 1rem; }
.artifact-box .question { color: var(--white); font-weight: 500; font-size: 1.05rem; margin-bottom: 1.2rem; }
.artifact-textarea {
  width: 100%; min-height: 120px; padding: 1rem; margin-top: 0.5rem;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(107,99,89,0.3);
  border-radius: 2px; color: var(--cream); font-family: var(--sans); font-size: 0.95rem;
  line-height: 1.6; resize: vertical;
}
.artifact-textarea:focus { outline: none; border-color: var(--rust); }
.artifact-textarea::placeholder { color: var(--mid-gray); }
.submit-btn {
  display: inline-block; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--white); background: var(--rust); border: none;
  padding: 0.9rem 2rem; cursor: pointer; border-radius: 2px; transition: all 0.3s; margin-top: 1.5rem;
}
.submit-btn:hover { background: #d4562f; }
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.submit-success { font-family: var(--sans); font-size: 0.9rem; color: var(--rust); margin-top: 1rem; display: none; }

.next-door { max-width: 680px; margin: 0 auto; padding: 6rem 2rem 8rem; text-align: center; }
.next-door p { font-family: var(--sans); font-size: 0.95rem; color: var(--mid-gray); margin-bottom: 1rem; }
.next-door .door-link { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--rust); text-decoration: none; cursor: pointer; }

.footer { max-width: 680px; margin: 0 auto; padding: 3rem 2rem 4rem; border-top: 1px solid rgba(107,99,89,0.2); }
.footer p { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.15em; color: var(--mid-gray); line-height: 2; }

/* ---- MARGIN NOTES ---- */
.noted {
  color: var(--white); font-weight: 600;
  border-bottom: 1px solid rgba(196, 75, 40, 0.4);
  cursor: default; position: relative;
  transition: color 0.3s, border-color 0.3s;
}
.noted:hover, .noted.touched {
  color: var(--rust); border-bottom-color: var(--rust);
}
.noted .note {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #1a1714; border: 1px solid rgba(196, 75, 40, 0.3);
  padding: 0.8rem 1.1rem; border-radius: 3px;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 400; font-style: normal;
  line-height: 1.6; color: var(--warm-gray);
  width: max-content; max-width: 320px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s; z-index: 10;
}
.noted .note a { color: var(--rust); cursor: pointer; text-decoration: none; border-bottom: 1px solid rgba(196, 75, 40, 0.3); }
.noted .note a:hover { border-bottom-color: var(--rust); }
.noted .note strong { color: var(--cream); font-weight: 500; }
.noted:hover .note, .noted.touched .note {
  opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto;
}
.noted .note::after {
  content: ''; position: absolute; top: 100%; left: 0; right: 0;
  height: 20px;
}

/* ---- CHAT REDO ---- */
.chat-redo-bar {
  display: flex; justify-content: flex-end; padding: 0.4rem 1.5rem 0.2rem;
  background: rgba(0,0,0,0.2);
}
.chat-redo-btn {
  background: none; border: 1px solid rgba(107, 99, 89, 0.25);
  border-radius: 2px; padding: 0.35rem 0.8rem;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mid-gray);
  cursor: pointer; transition: all 0.2s;
}
.chat-redo-btn:hover {
  color: var(--rust); border-color: rgba(196, 75, 40, 0.4);
}

/* ---- CHAT LOCKED ---- */
.chat-locked {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--rust); text-align: center;
  padding: 1rem; opacity: 0; animation: fadeUp 0.6s 0.5s forwards;
}

/* ---- GATES ---- */
.gated {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 1.2s ease, opacity 0.8s ease 0.3s;
}
.gated.unlocked { max-height: 8000px; opacity: 1; overflow: visible; }

/* ---- HIDDEN STATE ---- */
.hidden { display: none !important; }
.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; }

/* ---- ANIMATIONS ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes msgFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---- MARGIN CALLOUTS (emergent textbook) ---- */
.callout-anchor { position: relative; }

.margin-callout {
  position: absolute; width: 220px; padding: 1.2rem 1.4rem;
  background: rgba(26, 23, 20, 0.95);
  border: 1px solid rgba(107, 99, 89, 0.2);
  border-radius: 3px; opacity: 0;
  transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
  z-index: 5; pointer-events: none;
}
.margin-callout.visible { opacity: 1; pointer-events: auto; }
.margin-callout.left { right: calc(100% + 2.5rem); transform: translateX(-20px); }
.margin-callout.left.visible { transform: translateX(0); }
.margin-callout.right { left: calc(100% + 2.5rem); transform: translateX(20px); }
.margin-callout.right.visible { transform: translateX(0); }

.margin-callout .callout-icon { font-size: 1.1rem; margin-bottom: 0.5rem; line-height: 1; }
.margin-callout .callout-label {
  display: block; font-family: var(--mono); font-size: 0.55rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--rust); margin-bottom: 0.5rem;
}
.margin-callout .callout-content p {
  font-family: var(--sans); font-size: 0.8rem; line-height: 1.55;
  color: var(--warm-gray); margin: 0;
}
.margin-callout .callout-content p strong { color: var(--cream); font-weight: 500; }
.margin-callout .callout-content a {
  color: var(--rust); text-decoration: none;
  border-bottom: 1px solid rgba(196, 75, 40, 0.3); transition: border-color 0.2s;
}
.margin-callout .callout-content a:hover { border-bottom-color: var(--rust); }
.margin-callout .callout-stat {
  font-family: var(--mono); font-size: 1.6rem; font-weight: 500;
  color: var(--rust); line-height: 1; margin-bottom: 0.4rem;
}

/* Callout type accents */
.margin-callout[data-type="link"] { border-left: 2px solid rgba(196, 75, 40, 0.4); }
.margin-callout[data-type="prompt"] { border-left: 2px solid rgba(184, 176, 162, 0.3); }
.margin-callout[data-type="stat"] { border-left: 2px solid var(--rust); }
.margin-callout[data-type="graphic"] { border-left: 2px solid rgba(107, 99, 89, 0.3); text-align: center; }

/* ---- REPORT SECTION ---- */
.report-section {
  max-width: 680px; margin: 0 auto; padding: 0 2rem;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 1.5s ease, opacity 1s ease 0.3s;
}
.report-section.visible { max-height: 20000px; opacity: 1; overflow: visible; }

.report-loading { text-align: center; padding: 4rem 2rem; }
.report-loading .loading-spinner {
  width: 32px; height: 32px; border: 2px solid rgba(107, 99, 89, 0.2);
  border-top-color: var(--rust); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 1.5rem;
}
.report-loading p {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--mid-gray);
}

.report-header { text-align: center; margin-bottom: 3rem; padding-top: 2rem; border-top: 1px solid rgba(196, 75, 40, 0.3); }
.report-header h2 { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: var(--white); margin-bottom: 0.5rem; }
.report-header p { font-family: var(--sans); font-size: 0.95rem; color: var(--warm-gray); }

/* Report: Summary */
.report-summary {
  background: rgba(196, 75, 40, 0.04); border-left: 3px solid var(--rust);
  padding: 2rem 2.5rem; margin-bottom: 3rem;
}
.report-summary-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 1rem;
}
.report-summary p { font-size: 1.05rem; line-height: 1.8; color: var(--cream); }

/* Report: Stats cards */
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 3rem; }
.stat-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(107, 99, 89, 0.2);
  border-radius: 3px; padding: 1.2rem; text-align: center;
}
.stat-card .stat-value {
  font-family: var(--mono); font-size: 1.8rem; font-weight: 500;
  color: var(--rust); line-height: 1; margin-bottom: 0.4rem;
}
.stat-card .stat-label {
  font-family: var(--sans); font-size: 0.75rem; color: var(--mid-gray);
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* Report: Mind map */
.report-mindmap { margin-bottom: 3rem; }
.report-mindmap-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 1rem;
}
.mindmap-container {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(107, 99, 89, 0.15);
  border-radius: 3px; padding: 1rem; min-height: 380px;
  position: relative; overflow: hidden;
}
.mindmap-container svg { width: 100%; height: 100%; display: block; }
.mindmap-tooltip {
  position: absolute; background: #1a1714; border: 1px solid rgba(196, 75, 40, 0.3);
  padding: 0.8rem 1.1rem; border-radius: 3px; max-width: 280px;
  font-family: var(--sans); font-size: 0.8rem; line-height: 1.5;
  color: var(--warm-gray); pointer-events: none; opacity: 0;
  transition: opacity 0.2s; z-index: 10;
}
.mindmap-tooltip.active { opacity: 1; }
.mindmap-tooltip strong { color: var(--cream); font-weight: 500; }
.mindmap-tooltip .tooltip-excerpt {
  font-style: italic; color: var(--mid-gray); margin-top: 0.4rem; font-size: 0.75rem;
}

/* Report: Journey arc */
.report-journey { margin-bottom: 3rem; }
.report-journey-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 1rem;
}
.journey-container {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(107, 99, 89, 0.15);
  border-radius: 3px; padding: 1.5rem; min-height: 160px;
}
.journey-container svg { width: 100%; height: 100%; display: block; }

/* Report: Theme distribution */
.report-themes { margin-bottom: 3rem; }
.report-themes-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 1rem;
}
.theme-bar {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 0.8rem;
}
.theme-bar-label {
  font-family: var(--sans); font-size: 0.8rem; color: var(--cream);
  min-width: 120px; text-align: right;
}
.theme-bar-track {
  flex: 1; height: 6px; background: rgba(255,255,255,0.04);
  border-radius: 3px; overflow: hidden;
}
.theme-bar-fill {
  height: 100%; background: var(--rust); border-radius: 3px;
  transition: width 1s ease;
}
.theme-bar-value {
  font-family: var(--mono); font-size: 0.7rem; color: var(--mid-gray);
  min-width: 30px;
}

/* Report: Transcript */
.report-transcript { margin-bottom: 3rem; }
.report-transcript-label {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 1rem;
}
.transcript-level { margin-bottom: 0.5rem; }
.transcript-trigger {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1.2rem; background: rgba(255,255,255,0.02);
  border: 1px solid rgba(107, 99, 89, 0.15); border-radius: 2px;
  cursor: pointer; transition: all 0.2s;
}
.transcript-trigger:hover { background: rgba(255,255,255,0.04); }
.transcript-trigger-text {
  font-family: var(--sans); font-size: 0.85rem; color: var(--cream);
}
.transcript-trigger-arrow {
  color: var(--mid-gray); font-size: 1rem; transition: transform 0.3s;
}
.transcript-trigger.open .transcript-trigger-arrow { transform: rotate(180deg); }
.transcript-panel {
  max-height: 0; overflow: hidden; transition: max-height 0.5s ease;
}
.transcript-panel.open { max-height: 5000px; }
.transcript-messages { padding: 1rem 1.2rem; }
.transcript-msg { margin-bottom: 1rem; }
.transcript-msg-role {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.15em;
  text-transform: uppercase; margin-bottom: 0.3rem;
}
.transcript-msg-role.user { color: var(--rust); }
.transcript-msg-role.assistant { color: var(--mid-gray); }
.transcript-msg-content {
  font-family: var(--sans); font-size: 0.9rem; line-height: 1.6; color: var(--cream);
}

/* ---- DOOR HUB (returning learners — Door 1 only) ---- */
.door-hub {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  align-items: center; padding: 3rem 2rem; position: relative;
}
.door-hub-inner { max-width: 520px; width: 100%; }
.door-hub-label {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 2rem; text-align: center;
}
.door-hub-greeting {
  font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700;
  line-height: 1.2; color: var(--white); text-align: center; margin-bottom: 0.8rem;
}
.door-hub-sub {
  font-family: var(--sans); font-size: 0.95rem; line-height: 1.7;
  color: var(--warm-gray); text-align: center; margin-bottom: 3rem;
}
.door-hub-domain {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--mid-gray); text-align: center; margin-bottom: 2.5rem;
}
.door-hub-domain strong { color: var(--cream); font-weight: 500; }

.door-list { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 3rem; }
.door-card {
  display: flex; align-items: center; gap: 1.2rem;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(107, 99, 89, 0.2);
  border-radius: 3px; padding: 1.2rem 1.5rem; transition: all 0.3s;
}
.door-card.completed { border-color: rgba(196, 75, 40, 0.3); }
.door-card.next { border-color: var(--rust); cursor: pointer; background: rgba(196, 75, 40, 0.06); }
.door-card.next:hover { background: rgba(196, 75, 40, 0.1); }
.door-card.locked { opacity: 0.35; }
.door-card-num {
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.15em;
  color: var(--mid-gray); white-space: nowrap;
}
.door-card.completed .door-card-num { color: var(--rust); }
.door-card.next .door-card-num { color: var(--rust); }
.door-card-title {
  font-family: var(--serif); font-size: 1.05rem; font-weight: 600;
  color: var(--cream); flex: 1;
}
.door-card.locked .door-card-title { color: var(--mid-gray); }
.door-card-status {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; white-space: nowrap;
}
.door-card.completed .door-card-status { color: var(--rust); }
.door-card.next .door-card-status { color: var(--rust); }
.door-card.locked .door-card-status { color: var(--mid-gray); }

.door-hub-reset { text-align: center; }
.door-hub-reset button {
  background: none; border: none; font-family: var(--sans); font-size: 0.8rem;
  color: var(--mid-gray); cursor: pointer; padding: 0.5rem 1rem;
  transition: color 0.2s; text-decoration: underline;
  text-decoration-color: rgba(107, 99, 89, 0.3);
}
.door-hub-reset button:hover { color: var(--rust); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1100px) {
  .margin-callout {
    position: relative; left: auto !important; right: auto !important;
    width: 100%; max-width: 680px; margin: 1.5rem auto;
    transform: translateY(15px) !important; border-left-width: 2px;
  }
  .margin-callout.visible { transform: translateY(0) !important; }
  .margin-callout.left, .margin-callout.right { position: relative; }
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  .hero { padding: 2rem 1.5rem; }
  .intake { padding: 2rem 1.5rem; }
  .intake-inner { max-width: 100%; }
  .section, .depth, .pull-quote, .closer, .artifact-section, .next-door, .footer, .divider, .chat-zone, .insight-block, .reading-block { padding-left: 1.5rem; padding-right: 1.5rem; }
  .artifact-box, .insight-box, .reading-box { padding: 1.5rem; }
  .section-break { padding: 4rem 0; }
  .section-break-large { padding: 5rem 0 4rem; }
  .chat-messages { max-height: 350px; }
  .report-stats { grid-template-columns: 1fr; }
  .noted .note {
    position: fixed; bottom: 5rem; left: 1rem; right: 1rem;
    top: auto; transform: none; max-width: none; width: auto;
  }
  .noted:hover .note, .noted.touched .note { transform: none; }
  .noted .note::after { display: none; }
}

@media (max-width: 400px) {
  .section, .depth, .pull-quote, .closer, .artifact-section, .next-door, .footer, .divider, .chat-zone, .insight-block, .reading-block { padding-left: 1rem; padding-right: 1rem; }
  .hero { padding: 2rem 1rem; }
  .intake { padding: 2rem 1rem; }
  .artifact-box, .insight-box, .reading-box { padding: 1rem; }
  .report-summary { padding: 1rem; }
  .theme-bar { flex-wrap: wrap; }
  .theme-bar-label { min-width: auto; text-align: left; width: 100%; }
  .chat-input-area { padding: 0.8rem 1rem; }
}
