/* ── Raman-specific styles ── shared demo styles live in style.css ── */

.raman-hero {
  padding: 120px 28px 48px;
  text-align: center;
  background: var(--bg);
}
.raman-hero .eyebrow {
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); margin-bottom: 14px;
}
.raman-hero h1 {
  font-size: clamp(26px, 4.5vw, 38px);
  font-weight: 600; color: var(--ink);
  letter-spacing: -.03em; line-height: 1.1; margin-bottom: 16px;
}
.raman-hero p {
  max-width: 620px; margin: 0 auto;
  color: var(--soft); font-size: 17px; line-height: 1.55;
}

/* ── Module 00 — Atom canvas ── */
.atom-canvas {
  width: 100%; height: 300px; display: block;
  background: #1b1711;
  border: 1px solid var(--rule); border-radius: 8px;
}

/* ── Module 01 — Molecule + α(Q) panels ── */
.mol-panel canvas, .aq-panel canvas {
  width: 100%; height: 220px; display: block;
  background: #1b1711;
  border: 1px solid var(--rule); border-radius: 8px;
}

.mode-explain {
  font-size: 0.82rem; color: var(--faint); line-height: 1.65;
  margin-bottom: 14px; min-height: 2.4em;
}
.mode-explain .mol-activity {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 100px;
  margin-right: 6px; vertical-align: middle;
}
.mode-explain .mol-activity.raman { background: #064e3b; color: #6ee7b7; }
.mode-explain .mol-activity.ir    { background: #422006; color: #fbbf24; }

.physics-note {
  margin-top: 12px;
  font-size: 0.84rem; color: var(--soft); line-height: 1.7;
}
.physics-note b { color: var(--ink); }

/* ── Trace rows ── */
.trace-row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; margin-bottom: 10px; }
.trace-label { font-size: 0.78rem; line-height: 1.4; color: var(--soft); }
.trace-label b { color: var(--ink); }
.trace-label .eq { display: block; font-size: 0.72rem; color: var(--faint); margin-top: 2px; }
.trace-row canvas {
  width: 100%; height: 74px; display: block;
  background: #1b1711;
  border: 1px solid var(--rule); border-radius: 8px;
}

/* Only interactive animations/figures are framed — the section stage,
   not being an animation, carries no card background of its own. */
.demo-stage { background: transparent; padding: 0; border-radius: 0; }

/* Section headings use the same mincho treatment as the measurement-error page */
.demo-head h2 { font-family: var(--mincho); }

/* ── Decomposition ── */
.decomp-section {
  margin-top: 18px;
}
.decomp-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 10px;
}
.decomp-traces { display: flex; flex-direction: column; gap: 6px; }
.decomp-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px; align-items: center; }
.decomp-tag { font-size: 0.74rem; font-weight: 600; }
.decomp-row canvas {
  width: 100%; height: 42px; display: block;
  background: #1b1711;
  border: 1px solid var(--rule); border-radius: 6px;
}

/* ── Spectrum ── */
.spectrum-wrap { margin-top: 16px; }
.spectrum-wrap canvas {
  width: 100%; height: 150px; display: block;
  background: #1b1711;
  border: 1px solid var(--rule); border-radius: 8px;
}
.spectrum-wrap .cap, .jab-cap {
  font-size: 0.8rem; color: var(--faint); margin-top: 10px; line-height: 1.6;
}

/* ── Jablonski ── */
.svg-wrap { width: 100%; }
.svg-wrap svg {
  width: 100%; height: auto; display: block;
  background: #1b1711;
  border: 1px solid var(--rule); border-radius: 8px;
}

.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: 0.76rem; color: var(--faint); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }

/* ── Module 03 — Crystals ── */
.crystal-explain {
  display: flex; flex-direction: column; gap: 24px;
}
.crystal-concept h3 {
  font-size: 0.92rem; font-weight: 700; color: var(--ink);
  margin-bottom: 8px;
}
.crystal-concept p {
  font-size: 0.84rem; color: var(--soft); line-height: 1.65;
  margin-bottom: 8px;
}
.eq-block {
  text-align: center; font-size: 1rem; font-weight: 600;
  color: var(--ink); padding: 10px 0; letter-spacing: 0.02em;
}

.tensor-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin: 14px 0;
}
.tensor-card {
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 14px; text-align: center;
  background: var(--bg-soft);
}
.tensor-label {
  display: block; font-size: 0.88rem; font-weight: 700;
  color: var(--accent); margin-bottom: 8px;
}
.tensor-matrix table {
  margin: 0 auto; border-collapse: collapse;
}
.tensor-matrix td {
  width: 28px; height: 28px; text-align: center;
  font-size: 0.82rem; color: var(--ink); font-style: italic;
}
.tensor-matrix td:empty::after {
  content: "0"; color: #57534e;
}
.tensor-polar {
  display: block; margin-top: 8px;
  font-size: 0.7rem; color: var(--faint); font-style: italic;
}

.raman-info-list {
  list-style: none; padding: 0; margin: 8px 0 0;
}
.raman-info-list li {
  font-size: 0.82rem; color: var(--soft); line-height: 1.65;
  padding: 4px 0 4px 18px; position: relative;
}
.raman-info-list li::before {
  content: ""; position: absolute; left: 0; top: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.raman-info-list li b { color: var(--ink); }

.crystal-concept .ext-link {
  color: var(--accent); text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px; font-weight: 500;
}
.crystal-concept .ext-link:hover {
  color: var(--soft); text-decoration-color: var(--soft);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .trace-row { grid-template-columns: 1fr; gap: 6px; }
  .trace-label { display: flex; gap: 8px; align-items: baseline; }
  .decomp-row { grid-template-columns: 1fr; gap: 4px; }
  .tensor-grid { grid-template-columns: 1fr; }
}

/* ── Module 01 — Classical theory: Figure 1 + derivation ── */
.ray-fig { margin: 4px 0 22px; }
.ray-svg {
  width: 100%; height: auto; display: block;
  background: #f8fafc;
  border: 1px solid var(--rule); border-radius: 10px;
}
.ray-lab { font-size: 13px; font-weight: 600; font-family: 'Zen Kaku Gothic New', sans-serif; }
.ray-ax  { font-size: 13px; font-style: italic; font-weight: 700; }
.ray-fig figcaption {
  font-size: 0.8rem; color: var(--faint); line-height: 1.6;
  margin-top: 10px; padding-left: 2px;
}
.ray-fig figcaption b { color: var(--soft); }

.derivation { display: flex; flex-direction: column; gap: 4px; }
.derivation h3 {
  font-family: var(--mincho);
  font-size: 0.95rem; font-weight: 700; color: var(--ink);
  margin: 22px 0 4px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}
.derivation h3:first-child { margin-top: 4px; }
.derivation p {
  font-size: 0.9rem; color: var(--soft); line-height: 1.75; margin: 10px 0;
}
.derivation p b { color: var(--ink); }
.derivation .eq-block {
  margin: 8px 0; padding: 4px 0; overflow-x: auto;
}

/* ── Coming-soon badge — uses the shared .callout (cv-daikake) styling;
   only the label is shown (no body), so trim the label's bottom margin. ── */
.coming-soon { margin-top: 18px; }
.coming-soon .co-label { margin-bottom: 0; }

.recall {
  margin: 16px 0; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--bg-soft);
}
.recall > summary {
  cursor: pointer; list-style: none; padding: 10px 16px;
  font-size: 0.8rem; font-weight: 600; color: var(--faint);
  display: flex; align-items: center; gap: 8px; user-select: none;
}
.recall > summary::-webkit-details-marker { display: none; }
.recall > summary::before {
  content: "\25B8"; color: var(--faint); transition: transform .15s ease;
}
.recall[open] > summary::before { transform: rotate(90deg); }
.recall[open] > summary { border-bottom: 1px solid var(--rule); }
.recall > summary:hover { color: var(--ink); }
.recall > div {
  padding: 6px 16px 12px;
}
.recall p { font-size: 0.82rem; color: var(--soft); line-height: 1.65; margin: 8px 0; }

/* ── Polarizability demo: α slider, mode toggle, legend ── */
.atom-controls {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px 22px; margin: 14px 2px 8px;
}
.atom-slider { display: flex; align-items: center; gap: 10px; flex: 1 1 240px; }
.atom-slider label { font-size: 0.82rem; color: var(--soft); white-space: nowrap; }
.atom-slider input[type="range"] {
  flex: 1 1 auto; min-width: 110px; accent-color: #38bdf8; cursor: pointer;
}
.atom-slider output {
  font-size: 0.8rem; color: var(--accent); font-variant-numeric: tabular-nums;
  min-width: 80px; text-align: right;
}
.atom-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin: 0 2px 6px; font-size: 0.76rem; color: var(--faint);
}
.atom-legend span { display: inline-flex; align-items: center; gap: 6px; }
.atom-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* ── Equation references: hover to preview the equation ── */
.eqref {
  border-bottom: 1px dotted currentColor; cursor: help;
  white-space: nowrap; text-underline-offset: 2px;
}
.eqref:hover { color: var(--accent); }
.eq-tip {
  position: fixed; z-index: 1000; max-width: min(92vw, 560px);
  background: var(--paper); border: 1px solid var(--rule-2);
  border-radius: 8px; padding: 4px 16px;
  box-shadow: var(--shadow-card-h);
  pointer-events: none; opacity: 0; transition: opacity .12s ease;
  overflow-x: auto;
}
.eq-tip.show { opacity: 1; }
.eq-tip .katex-display { margin: 6px 0; }

/* ── In-section sub-demo heading (e.g. CO2 demo inside the classical theory) ── */
.demo-sub {
  font-size: 1rem; font-weight: 700; color: var(--ink);
  margin: 28px 0 6px; padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.demo-sub-p { font-size: 0.86rem; color: var(--soft); line-height: 1.7; margin: 6px 0 14px; }

/* ── Taylor reminder: sin x animation ── */
.taylor-canvas {
  width: 100%; height: 240px; display: block; margin: 6px 0 4px;
  background: #1b1711;
  border: 1px solid var(--rule); border-radius: 8px;
}

/* Paper page + framed dark "screens" for the interactive animations */
.demo-stage { color: var(--ink); }
.atom-canvas, .taylor-canvas,
.mol-panel canvas, .aq-panel canvas,
.trace-row canvas, .decomp-row canvas, .spectrum-wrap canvas,
.ray-svg { box-shadow: var(--shadow-card); }

/* ── Interactive animation card: the canvas AND its controls share one frame ── */
.anim-card {
  background: #1b1711; border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: var(--shadow-card); padding: 18px; margin: 16px 0;
  color: #e7e5e4;
}
/* canvases become inset screens inside the card (the card is the frame) */
.anim-card canvas {
  background: #14110b; border: 1px solid rgba(255,255,255,0.08); box-shadow: none;
}
/* text reverts to light on the dark card */
.anim-card .atom-slider label,
.anim-card .trace-label { color: #d6d3d1; }
.anim-card .atom-slider output { color: #7dd3fc; }
.anim-card .trace-label b { color: #fafaf9; }
.anim-card .trace-label .eq,
.anim-card .atom-legend,
.anim-card .legend,
.anim-card .decomp-label,
.anim-card .mode-explain,
.anim-card .spectrum-wrap .cap { color: #a8a29e; }

/* Align the page header with the demo content (same left edge) */

/* Header row: title left, language toggle right (no number/meta on sub-pages) */
.ptop { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ── CO2 traces shown as a product: E(t) × α(t) = p(t) ── */
.trace-mult { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.trace-cell { flex: 1 1 0; min-width: 0; }
.trace-cell .trace-label { margin-bottom: 6px; }
.trace-cell canvas { width: 100%; height: 96px; display: block; }
.trace-op { flex: 0 0 auto; font-size: 1.4rem; font-weight: 600; color: #d6d3d1; margin-top: 16px; }
@media (max-width: 640px) {
  .trace-mult { flex-direction: column; align-items: stretch; }
  .trace-op { margin: 0; text-align: center; }
}

/* ── Angle-resolved polar plots (I_parallel / I_perp vs angle) ── */
.polar-fig { margin: 12px 0 6px; text-align: center; }
.polar-svg { width: min(210px, 62%); height: auto; display: inline-block; }
.polar-cap { font-size: 0.78rem; color: var(--soft); margin-top: 2px; }
.polar-cap b { color: var(--ink); }
.polar-cap .sw {
  display: inline-block; width: 11px; height: 11px; border-radius: 2px;
  vertical-align: middle; margin-right: 4px;
}
