:root {
  color-scheme: dark;
  --canvas: #070c18;
  --ink: #eef4ff;
  --soft: #a2afc5;
  --cyan: #94edee;
  --lavender: #c5b0ff;
  --line: rgba(178, 205, 242, .16);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 145px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(rgba(150, 190, 235, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(150, 190, 235, .035) 1px, transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(#000, transparent 95%); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 5px; }
::selection { background: #536687; color: #fff; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.ambient i { position: absolute; width: min(80vw, 1000px); aspect-ratio: 1; top: -45%; left: -20%; background: radial-gradient(ellipse, rgba(62, 197, 222, .15), transparent 67%); animation: drift 24s ease-in-out infinite alternate; }
.ambient i + i { top: 10%; left: 55%; background: radial-gradient(ellipse, rgba(144, 100, 236, .14), transparent 67%); animation-duration: 31s; animation-delay: -12s; }
@keyframes drift { to { transform: translate3d(10%, 18%, 0) scale(1.12); } }
.reading-progress { position: fixed; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--cyan), var(--lavender)); transform: scaleX(0); transform-origin: left; z-index: 20; pointer-events: none; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 30; padding: 12px; border-radius: 6px; background: var(--ink); color: var(--canvas); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(7, 12, 24, .84); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1520px; margin: auto; padding: 16px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.brand { display: inline-flex; align-items: center; gap: 14px; min-height: 40px; flex-shrink: 0; font-size: 19px; font-weight: 650; }
.brand > span:first-child { color: #65778f; font-weight: 400; }
.brand-en { font-size: 10px; font-weight: 500; letter-spacing: .18em; }
.project-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.project-nav a, .project-nav button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 10px; border: 1px solid transparent; border-radius: 7px; background: none; font-size: 11px; white-space: nowrap; }
.project-nav .active { border-color: rgba(148, 237, 238, .25); background: rgba(148, 237, 238, .07); color: var(--cyan); font-weight: 650; }
.nav-dot { width: 5px; height: 5px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 10px #94edee70; }
.project-nav button:disabled { color: #9aa7bd; opacity: 1; cursor: not-allowed; }
.project-nav button span { font-size: 9px; color: #919db2; padding: 2px 4px; border: 1px solid var(--line); border-radius: 3px; }
.works-stream { width: min(1320px, calc(100% - 96px)); margin: auto; }
.project-heading { padding: 42px 0 0; }
.eyebrow { margin: 0; color: var(--cyan); font-size: 10px; font-weight: 600; line-height: 1.6; letter-spacing: .2em; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; margin-top: 16px; }
h1 { margin: 0; font-size: clamp(48px, 5.7vw, 82px); font-weight: 650; line-height: 1.12; letter-spacing: -.05em; }
h1 span { display: inline-block; margin-left: 14px; font-weight: 500; letter-spacing: -.065em; color: var(--cyan); background: linear-gradient(110deg, #c4ffff 5%, #93d8f4 38%, #c8adff 67%, #c4ffff 95%); background-size: 200% auto; background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: spectrum 16s ease-in-out infinite alternate; }
@keyframes spectrum { to { background-position: 100% center; } }
.value-proposition { font-size: clamp(18px, 2vw, 27px); font-weight: 500; margin: 16px 0 0; letter-spacing: .02em; }
.hero-intro > p { max-width: 490px; margin: 0; color: var(--soft); font-size: 14px; line-height: 1.9; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 18px 0 0; padding: 0; }
.chips li { border: 1px solid var(--line); border-radius: 30px; padding: 6px 13px; font-size: 11px; color: #d0dcec; background: linear-gradient(130deg, #94edee09, #c5b0ff09); }
.chips li::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--cyan); }
.hero-meta { margin-top: 28px; padding: 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); color: var(--soft); font-size: 10px; letter-spacing: .12em; }
.hero-meta a { min-height: 28px; display: inline-flex; align-items: center; gap: 18px; }
.hero-meta a:hover, .footer-links a:hover { color: var(--cyan); }
.chapter { position: relative; padding-top: 100px; }
.chapter-first { padding-top: 25px; }
.chapter-copy { display: grid; grid-template-columns: 1.1fr 1fr; align-items: end; gap: 56px; margin-bottom: 25px; }
.chapter-heading { min-width: 0; }
.figure-number { display: inline-block; margin-right: 16px; padding-right: 16px; border-right: 1px solid #7c98b44d; font-variant-numeric: tabular-nums; color: var(--lavender); letter-spacing: .08em; }
h2 { margin: 12px 0 0; font-size: clamp(23px, 2.7vw, 36px); line-height: 1.4; font-weight: 550; letter-spacing: -.03em; text-wrap: balance; }
.chapter-first h2 { font-size: clamp(22px, 2.3vw, 30px); }
.chapter-description { margin: 0; color: var(--soft); font-size: 14px; line-height: 1.9; max-width: 560px; }
.section-label { display: inline-block; margin-bottom: 10px; font-size: 10px; letter-spacing: .12em; color: var(--lavender); }
figure { margin: 0; perspective: 1400px; }
.image-link { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; position: relative; display: block; cursor: zoom-in; border: 1px solid rgba(171, 207, 251, .24); border-radius: 12px; background: #10192a; padding: 8px; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .35s ease-out, border-color .35s, box-shadow .35s; box-shadow: 0 25px 65px -30px #000c, 0 0 45px -25px #6fa7d74d; }
.image-link::after { content: ""; position: absolute; inset: -1px; border: 1px solid transparent; border-radius: inherit; pointer-events: none; opacity: 0; box-shadow: 0 0 24px #94edee25, inset 0 0 12px #c5b0ff20; background: radial-gradient(400px circle at var(--mx) var(--my), #b1eaff18, transparent 70%); transition: opacity .35s; }
.image-link.is-tilting { transition: border-color .35s, box-shadow .35s; }
.image-link img { display: block; width: 100%; height: auto; border-radius: 6px; }
.image-link:focus-visible::after { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .image-link:hover { border-color: #94edee80; box-shadow: 0 30px 70px -30px #000, 0 0 40px -15px #95b9ff40; } .image-link:hover::after { opacity: 1; } }
figcaption { display: flex; justify-content: space-between; gap: 16px; padding: 13px 2px; color: #95a5bc; font-size: 10px; letter-spacing: .05em; line-height: 1.6; }
.chapter-visual .chapter-copy { padding: 0 4%; }
.chapter-local::before { content: ""; position: absolute; inset: 50px -25px -20px; border-radius: 22px; border: 1px solid #94edee0e; background: linear-gradient(140deg, #94edee06, transparent 60%); z-index: -1; }
.chapter-concept, .chapter-expansion { padding-top: 110px; }
.chapter-concept .chapter-copy, .chapter-expansion .chapter-copy { border-top: 1px solid var(--line); padding-top: 30px; }
.reveal { opacity: 1; transform: none; }
.reveal.reveal-pending { opacity: 0; transform: translateY(28px); }
.reveal.reveal-ready { transition: opacity .85s ease, transform .85s cubic-bezier(.2, .65, .3, 1); }
.stream-footer { display: flex; justify-content: space-between; gap: 30px; margin-top: 80px; padding: 38px 0 45px; border-top: 1px solid var(--line); }
.stream-footer p:not(.eyebrow) { font-size: 25px; margin: 14px 0; }
.stream-footer small { color: var(--soft); font-size: 11px; line-height: 1.8; }
.footer-links { display: flex; align-items: end; flex-direction: column; justify-content: center; gap: 12px; font-size: 12px; flex-shrink: 0; }
.footer-links a { padding: 8px 0; }
body.viewer-open { overflow: hidden; }
.image-viewer { width: min(1600px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid #4c607d; border-radius: 14px; background: #0c1423; color: var(--ink); box-shadow: 0 24px 100px #0009; }
.image-viewer::backdrop { background: rgba(2, 5, 14, .9); backdrop-filter: blur(10px); }
.viewer-shell { padding: 16px 20px 12px; }
.viewer-toolbar, .viewer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.viewer-toolbar { margin-bottom: 12px; }
.viewer-toolbar h2 { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .02em; }
.image-viewer button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #ffffff05; color: var(--ink); cursor: pointer; font-size: 12px; flex-shrink: 0; }
.image-viewer button:hover { background: #94edee12; border-color: var(--cyan); }
.viewer-close span { margin-left: 8px; font-size: 18px; }
.viewer-stage { display: flex; justify-content: center; align-items: center; min-height: 80px; }
.viewer-image { display: block; max-width: 100%; width: auto; height: auto; max-height: calc(100dvh - 300px); object-fit: contain; }
.viewer-bottom { margin-top: 14px; }
.viewer-caption { margin: 0; font-size: 12px; text-align: center; line-height: 1.6; color: var(--cyan); }
#viewer-description { max-width: 850px; margin: 12px auto 0; color: var(--soft); font-size: 12px; line-height: 1.7; text-align: center; }
#viewer-help { margin: 10px 0 0; color: var(--soft); font-size: 10px; text-align: center; }
@media (max-width: 1180px) {
  .header-inner { gap: 4px; }
  .project-nav { flex-basis: 100%; justify-content: space-between; }
  .hero-grid, .chapter-copy { gap: 32px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 160px; }
  .header-inner { padding: 9px 20px; }
  .brand { font-size: 16px; gap: 12px; min-height: 33px; }
  .brand-en { font-size: 9px; }
  .project-nav { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 10px; padding: 5px 3px 7px; scrollbar-width: thin; scrollbar-color: #475875 transparent; }
  .project-nav a, .project-nav button { flex-shrink: 0; min-height: 40px; }
  .works-stream { width: calc(100% - 36px); }
  .project-heading { padding-top: 26px; }
  .eyebrow { font-size: 9px; letter-spacing: .13em; }
  .hero-grid { grid-template-columns: 1fr; gap: 17px; margin-top: 12px; }
  h1 { font-size: 52px; }
  .value-proposition { margin-top: 10px; font-size: 20px; }
  .hero-intro > p, .chapter-description { font-size: 13px; line-height: 1.8; }
  .chips { margin-top: 13px; gap: 8px; }
  .chips li { font-size: 10px; padding: 5px 11px; }
  .hero-meta { margin-top: 17px; padding: 10px 0; font-size: 9px; letter-spacing: .02em; }
  .hero-meta > span { max-width: 135px; line-height: 1.6; }
  .hero-meta a { gap: 9px; }
  .chapter, .chapter-concept, .chapter-expansion { padding-top: 60px; }
  .chapter-first { padding-top: 20px; }
  .chapter-copy { grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
  .chapter-visual .chapter-copy { padding: 0; }
  h2, .chapter-first h2 { font-size: 24px; margin-top: 8px; }
  .chapter-visual h2 br { display: none; }
  .section-label { margin-bottom: 6px; }
  .image-link { padding: 4px; border-radius: 8px; }
  .image-link img { border-radius: 4px; }
  figcaption { gap: 10px; font-size: 9px; padding: 10px 0; }
  figcaption span:last-child { text-align: right; }
  .chapter-local::before { inset: 35px -9px -10px; }
  .stream-footer { margin-top: 45px; padding: 28px 0; flex-direction: column; gap: 18px; }
  .footer-links { flex-direction: row; justify-content: space-between; }
  .image-viewer { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .viewer-shell { padding: 10px; }
  .viewer-bottom { gap: 6px; flex-wrap: wrap; }
  .viewer-caption { order: -1; width: 100%; font-size: 11px; }
  .viewer-image { max-height: calc(100dvh - 350px); }
  #viewer-description { font-size: 11px; text-align: left; }
  .image-viewer button { padding: 8px 12px; font-size: 11px; }
}
/* Product screenshots stay compact in the stream; full-size inspection uses the viewer. */
body.ailyn-theme .chapter, body.social-theme .chapter { max-width: 1080px; margin-inline: auto; }
body.ailyn-theme .chapter > figure, body.social-theme .chapter > figure { width: min(100%, 960px); margin-inline: auto; }
body.ailyn-theme .chapter-first > figure { width: min(100%, 1040px); }
body.ailyn-theme .chapter-visual > figure { width: min(100%, 860px); }
body.ailyn-theme .chapter-local > figure { width: min(100%, 920px); }
body.ailyn-theme .chapter-concept > figure, body.ailyn-theme .chapter-expansion > figure { width: min(100%, 780px); }
body.social-theme .chapter > figure { width: min(100%, 900px); }
body.social-theme .chapter-first > figure { width: min(100%, 960px); }
body.ailyn-theme .chapter-visual .chapter-copy, body.social-theme .chapter-visual .chapter-copy { padding-inline: 0; }
body.ailyn-theme .chapter:not(.chapter-first), body.social-theme .chapter:not(.chapter-first) { padding-top: 76px; }
@media (max-width: 760px) {
  body.ailyn-theme .chapter:not(.chapter-first), body.social-theme .chapter:not(.chapter-first) { padding-top: 48px; }
  body.ailyn-theme figcaption, body.social-theme figcaption { flex-wrap: wrap; gap: 6px 12px; }
}
/* The social project shares layout and motion, with its own warm accent palette. */
body.social-theme {
  --canvas: #120d17;
  --ink: #fff2ee;
  --soft: #beafc4;
  --cyan: #ffad96;
  --lavender: #d4baff;
  --line: rgba(235, 187, 210, .18);
  --social-glow: #ff997d;
  --social-surface: #201622;
}
.social-theme .site-header { background: rgba(18, 13, 23, .86); }
.social-theme .ambient i { background: radial-gradient(ellipse, #ff997d24, transparent 67%); }
.social-theme .ambient i + i { background: radial-gradient(ellipse, #c39cff26, transparent 67%); }
.social-theme .project-nav .active { border-color: #ffad9640; background: #ffad9612; }
.project-nav a:not(.active):hover { color: var(--cyan); border-color: var(--line); }
.social-theme .nav-dot { box-shadow: 0 0 10px var(--social-glow); }
.social-project-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.social-project-links a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; border: 1px solid #ffad9640; border-radius: 7px; background: #ffad9612; color: var(--cyan); font-size: 12px; }
.social-project-links a:hover { border-color: var(--cyan); background: #ffad9620; }
.social-theme .hero-grid > *, .social-theme .chapter-copy > * { min-width: 0; }
.social-theme h1 { font-size: clamp(44px, 4.7vw, 66px); line-height: 1.25; letter-spacing: -.02em; }
/* Gradient text needs paint space for glyph overhangs and descenders. */
.social-theme h1 span { margin-left: -.08em; padding: .06em .12em .12em .08em; line-height: 1.25; letter-spacing: -.02em; max-width: 100%; background-image: linear-gradient(110deg, #ffd5bf 5%, #ffad96 38%, #d4baff 67%, #ffd5bf 95%); }
.social-theme h1 b { font-weight: inherit; }
.social-theme .value-proposition { font-size: clamp(18px, 1.85vw, 25px); text-wrap: balance; }
.social-theme .chips li { color: #ead7e4; background: linear-gradient(130deg, #ffad9609, #d4baff09); }
.social-theme .image-link { background: var(--social-surface); border-color: #e8b9ce40; box-shadow: 0 25px 65px -30px #000c, 0 0 45px -25px #ff997d40; }
.social-theme .image-link::after { box-shadow: 0 0 24px #ffad9625, inset 0 0 12px #d4baff20; background: radial-gradient(400px circle at var(--mx) var(--my), #ffc5b518, transparent 70%); }
.social-theme .chapter-local::before { border-color: #ffad9615; background: linear-gradient(140deg, #ffad9609, transparent 60%); }
.social-theme figcaption { color: var(--soft); }
.social-theme .image-viewer { background: var(--social-surface); border-color: #806478; }
.social-theme .image-viewer button:hover { background: #ffad9612; }
@media (hover: hover) and (pointer: fine) {
  .social-theme .image-link:hover { border-color: var(--cyan); box-shadow: 0 30px 70px -30px #000, 0 0 40px -15px #ff997d40; }
}
@media (max-width: 760px) {
  .social-theme .project-heading { padding-top: 20px; }
  .social-theme h1 { font-size: clamp(36px, 9vw, 52px); }
  .social-theme .hero-grid { gap: 12px; }
  .social-theme .chapter-first .chapter-copy { gap: 8px; margin-bottom: 14px; }
  .social-theme .chapter-first h2 { font-size: 22px; }
  .social-theme .viewer-toolbar { align-items: flex-start; }
  .social-theme .viewer-toolbar h2 { line-height: 1.6; overflow-wrap: anywhere; }
}
/* SPARK: research figures keep their complete aspect ratios, with no cropping. */
body.spark-theme {
  --canvas: #100d20;
  --ink: #f3efff;
  --soft: #b8b5cf;
  --cyan: #b4eaff;
  --lavender: #c7abff;
  --line: rgba(198, 177, 246, .2);
}
.spark-theme .site-header { background: rgba(16, 13, 32, .86); }
.spark-theme .ambient i { background: radial-gradient(ellipse, #a47aff2b, transparent 67%); }
.spark-theme .ambient i + i { background: radial-gradient(ellipse, #8cdaff20, transparent 67%); }
.spark-theme .project-nav .active { border-color: #c7abff55; background: #c7abff14; }
.spark-theme .nav-dot { box-shadow: 0 0 10px #b4eaff70; }
.spark-theme .hero-grid > *, .spark-theme .chapter-copy > * { min-width: 0; }
.spark-theme h1 { font-size: clamp(64px, 8vw, 112px); line-height: 1; }
.spark-theme h1 span { margin-left: 0; letter-spacing: -.055em; background-image: linear-gradient(110deg, #e4d4ff 5%, #c7abff 38%, #b4eaff 67%, #e4d4ff 95%); }
.spark-theme .value-proposition { text-wrap: balance; }
.spark-theme .chips li { color: #e2dcf6; background: linear-gradient(130deg, #c7abff0d, #b4eaff09); }
.spark-theme .spark-research-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.spark-theme .spark-research-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; color: var(--cyan); }
.spark-theme .spark-research-links a:first-child { background: #c7abff16; border-color: #c7abff55; }
.spark-theme .spark-research-links a:hover { background: #b4eaff18; border-color: var(--cyan); }
.spark-theme .image-link { background: #211a34; border-color: #c7abff50; box-shadow: 0 25px 65px -30px #000c, 0 0 45px -25px #ad8bff55; }
.spark-theme .image-link img { height: auto; object-fit: contain; }
.spark-theme .image-link::after { box-shadow: 0 0 24px #c7abff25; background: radial-gradient(400px circle at var(--mx) var(--my), #b4eaff12, transparent 70%); }
/* Native PNG widths cap each figure, including its closely fitted image frame. */
body.spark-theme .chapter > figure { width: min(100%, var(--figure-native-width)); min-width: 0; }
body.spark-theme .chapter .image-link { width: 100%; }
body.spark-theme .chapter .image-link img { max-width: var(--figure-native-width); }
body.spark-theme .spark-workflow > figure { margin-inline: auto; }
body.spark-theme .spark-memory { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 672px); align-items: center; gap: clamp(32px, 5vw, 72px); }
body.spark-theme .spark-memory > .chapter-copy { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 0; max-width: 420px; }
body.spark-theme .spark-memory > figure { justify-self: end; }
/* Separate wide results: retain room for labels rather than squeezing into a pair. */
body.spark-theme .spark-trajectory > figure { max-width: 1200px; margin-inline: 0 auto; }
body.spark-theme .spark-ablation > figure { max-width: 1080px; margin-inline: auto 0; }
body.spark-theme .chapter figcaption { flex-wrap: wrap; overflow-wrap: anywhere; }
@media (max-width: 1050px) {
  /* Keep the text-heavy prompt legible instead of forcing a narrow image column. */
  body.spark-theme .spark-memory { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  body.spark-theme .spark-memory > .chapter-copy { max-width: none; grid-template-columns: 1.1fr 1fr; gap: 32px; }
  body.spark-theme .spark-memory > figure { justify-self: center; }
}
.spark-theme figcaption { color: var(--soft); }
.spark-theme .image-viewer { background: #171226; border-color: #77648f; }
.spark-theme .viewer-toolbar h2 { line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .spark-theme h1 { font-size: clamp(60px, 16vw, 88px); }
  .spark-theme .spark-research-links { margin-top: 14px; }
  .spark-theme .viewer-toolbar { align-items: flex-start; }
  body.spark-theme .hero-grid { gap: 12px; }
  body.spark-theme .project-heading { padding-top: 20px; }
  body.spark-theme .chapter-first .chapter-copy { gap: 8px; margin-bottom: 14px; }
  body.spark-theme .chapter-first h2 { font-size: 22px; }
  body.spark-theme .spark-memory { gap: 18px; }
  body.spark-theme .spark-memory > .chapter-copy { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  body.spark-theme .chapter > figure { margin-inline: auto; }
  body.spark-theme .chapter figcaption > span { min-width: 0; }
}
/* C-MTCSD only: mint / cyan research theme, native-size, uncropped tables. */
body.cmtcsd-theme {
  --canvas: #071713;
  --ink: #edfff7;
  --soft: #acc7bc;
  --cyan: #8af0c5;
  --lavender: #75d8ed;
  --line: rgba(138, 240, 197, .19);
}
body.cmtcsd-theme::before { background-image: linear-gradient(#8af0c508 1px, transparent 1px), linear-gradient(90deg, #75d8ed08 1px, transparent 1px); }
body.cmtcsd-theme .site-header { background: rgba(7, 23, 19, .86); }
body.cmtcsd-theme .ambient i { background: radial-gradient(ellipse, #49d79d25, transparent 67%); }
body.cmtcsd-theme .ambient i + i { background: radial-gradient(ellipse, #39c9e520, transparent 67%); }
body.cmtcsd-theme .project-nav .active { border-color: #8af0c550; background: #8af0c512; }
body.cmtcsd-theme .nav-dot { box-shadow: 0 0 10px #8af0c580; }
body.cmtcsd-theme .hero-grid > *, body.cmtcsd-theme .chapter-copy > * { min-width: 0; }
body.cmtcsd-theme h1 { font-size: clamp(48px, 6.2vw, 88px); line-height: 1.12; }
body.cmtcsd-theme h1 span { margin-left: 0; letter-spacing: -.055em; background-image: linear-gradient(110deg, #d4ffe8 5%, #8af0c5 38%, #75d8ed 67%, #d4ffe8 95%); }
body.cmtcsd-theme .value-proposition { text-wrap: balance; }
body.cmtcsd-theme .chips li { color: #d4eee2; background: linear-gradient(130deg, #8af0c509, #75d8ed09); }
body.cmtcsd-theme .cmtcsd-research-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
body.cmtcsd-theme .cmtcsd-research-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; color: var(--cyan); }
body.cmtcsd-theme .cmtcsd-research-links a:first-child { background: #8af0c514; border-color: #8af0c550; }
body.cmtcsd-theme .cmtcsd-research-links a:hover { background: #75d8ed18; border-color: var(--cyan); }
body.cmtcsd-theme .chapter > figure { width: min(100%, var(--figure-native-width), var(--figure-max-width)); min-width: 0; margin-inline: auto; }
body.cmtcsd-theme .image-link { background: #102b24; border-color: #8af0c540; box-shadow: 0 25px 65px -30px #000c, 0 0 45px -25px #49d79d45; }
body.cmtcsd-theme .image-link img { max-width: var(--figure-native-width); height: auto; object-fit: contain; }
body.cmtcsd-theme .image-link::after { box-shadow: 0 0 24px #8af0c525; background: radial-gradient(400px circle at var(--mx) var(--my), #75d8ed12, transparent 70%); }
body.cmtcsd-theme .cmtcsd-agreement { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 760px); align-items: center; gap: clamp(32px, 4vw, 56px); }
body.cmtcsd-theme .cmtcsd-agreement > .chapter-copy { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-bottom: 0; }
body.cmtcsd-theme .cmtcsd-results > .chapter-copy, body.cmtcsd-theme .cmtcsd-depth-results > .chapter-copy { border-top: 1px solid var(--line); padding-top: 30px; }
body.cmtcsd-theme figcaption { color: var(--soft); flex-wrap: wrap; overflow-wrap: anywhere; }
body.cmtcsd-theme figcaption > span { min-width: 0; }
body.cmtcsd-theme .image-viewer { background: #0d241e; border-color: #497d69; }
body.cmtcsd-theme .image-viewer button:hover { background: #8af0c512; }
body.cmtcsd-theme .viewer-toolbar h2 { line-height: 1.6; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) {
  body.cmtcsd-theme .image-link:hover { border-color: var(--cyan); box-shadow: 0 30px 70px -30px #000, 0 0 40px -15px #49d79d45; }
}
@media (max-width: 1180px) {
  body.cmtcsd-theme .cmtcsd-agreement { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  body.cmtcsd-theme .cmtcsd-agreement > .chapter-copy { grid-template-columns: 1.1fr 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  body.cmtcsd-theme h1 { font-size: clamp(36px, 11.5vw, 72px); }
  body.cmtcsd-theme .hero-grid { grid-template-columns: minmax(0, 1fr); }
  body.cmtcsd-theme .project-nav { min-width: 0; max-width: 100%; }
  body.cmtcsd-theme .chapter-copy, body.cmtcsd-theme .cmtcsd-agreement > .chapter-copy { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  body.cmtcsd-theme .cmtcsd-agreement { gap: 18px; }
  body.cmtcsd-theme .cmtcsd-research-links { margin-top: 14px; }
  body.cmtcsd-theme .viewer-toolbar { align-items: flex-start; }
  body.cmtcsd-theme .footer-links { flex-wrap: wrap; }
  body.cmtcsd-theme .stream-footer p:not(.eyebrow) { font-size: 22px; }
}
/* DataAgent: evidence-first static replay; isolated blue / amber palette. */
body.dataagent-theme { --canvas: #080f20; --ink: #eff5ff; --soft: #aabbd4; --cyan: #88bdff; --lavender: #f3c477; --line: #88bdff30; }
.dataagent-theme .site-header { background: #080f20e0; }
.dataagent-theme .ambient i { background: radial-gradient(ellipse, #377ff230, transparent 67%); }
.dataagent-theme .ambient i + i { background: radial-gradient(ellipse, #e9a64016, transparent 67%); }
.dataagent-theme h1 { font-size: clamp(48px, 7vw, 96px); line-height: 1.25; letter-spacing: -.02em; }
.dataagent-theme h1 span { margin-left: -.08em; padding: .06em .12em .12em .08em; line-height: 1.25; letter-spacing: -.02em; max-width: 100%; background-image: linear-gradient(110deg, #d8eaff 5%, #88bdff 38%, #f3c477 67%, #d8eaff 95%); }
.dataagent-theme .hero-grid > *, .dataagent-theme .chapter-copy > *, .dataagent-theme .header-inner > * { min-width: 0; }
.dataagent-theme .project-nav { max-width: 100%; }
.dataagent-theme .project-nav .active { background: #88bdff14; border-color: #88bdff55; }
.dataagent-theme .nav-dot { box-shadow: 0 0 10px #88bdff80; }
.dataagent-theme h3 { margin: 0 0 14px; font-size: 21px; line-height: 1.5; font-weight: 550; }
.dataagent-theme p, .dataagent-theme li, .dataagent-theme dd { overflow-wrap: anywhere; }
.da-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.da-links a { color: var(--cyan); border: 1px solid var(--line); border-radius: 7px; padding: 12px 16px; font-size: 12px; }
.da-links a:hover { background: #88bdff14; }
.da-chapters { justify-content: flex-start; gap: 32px; flex-wrap: wrap; }
.da-replay { border: 1px solid #88bdff50; border-radius: 16px; background: linear-gradient(140deg, #112344e8, #0b1426f2 65%); box-shadow: 0 30px 80px -40px #000, 0 0 45px -30px #88bdff; overflow: hidden; }
.da-replay-top, .da-replay-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 20px 28px; font-size: 11px; color: var(--soft); }
.da-replay-top { border-bottom: 1px solid var(--line); }
.da-badge { color: var(--lavender); padding: 7px 10px; border: 1px solid #f3c47755; border-radius: 5px; background: #f3c4770a; }
.da-question { padding: 28px 28px 0; }
.da-question h3 { margin: 12px 0; font-size: clamp(21px, 2.2vw, 30px); }
.da-question > p:last-child { color: var(--soft); font-size: 13px; line-height: 1.8; }
.da-replay-note { color: var(--soft); padding: 0 28px; font-size: 12px; line-height: 1.8; max-width: 950px; }
.da-tabs { display: none; }
.da-tabs[role="tablist"] { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 22px 28px 0; }
.da-tabs button { color: var(--soft); background: #080f2080; border: 1px solid var(--line); border-radius: 6px; min-height: 48px; cursor: pointer; font-size: 13px; }
.da-tabs button:hover { border-color: var(--cyan); }
.da-tabs button[aria-selected="true"] { background: #88bdff1c; color: var(--ink); border-color: var(--cyan); box-shadow: inset 0 -2px var(--cyan); }
.da-panel { padding: 30px 28px; border-bottom: 1px solid var(--line); }
.da-panel[hidden] { display: none; }
.da-panel > p, .da-panel-grid p, .da-design p, .da-caveats p, .da-evolution p { color: var(--soft); font-size: 14px; line-height: 1.85; }
.da-panel-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.da-panel-grid > *, .da-answer-grid > *, .da-design > * { min-width: 0; }
.da-note { border-left: 2px solid var(--cyan); background: #88bdff09; padding: 20px; line-height: 1.9; font-size: 13px; color: var(--soft); }
.da-note strong { color: var(--ink); }
.da-note small { font-size: 11px; line-height: 1.8; }
.da-warning { border-color: var(--lavender); background: #f3c47708; }
.da-warning strong { color: var(--lavender); }
.da-list { list-style: none; padding: 0; color: var(--soft); font-size: 13px; line-height: 2.4; }
.dataagent-theme code { font-family: Consolas, "SFMono-Regular", monospace; font-size: .92em; }
.dataagent-theme pre { max-width: 100%; max-height: 420px; overflow: auto; padding: 20px; background: #050b17; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.8; color: #cadcf7; tab-size: 4; }
.dataagent-theme pre:focus-visible, .da-table-scroll:focus-visible, .da-panel:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.da-fields { margin: 0; font-size: 13px; }
.da-fields dt { color: var(--cyan); margin-top: 14px; font-family: Consolas, monospace; }
.da-fields dd { margin: 4px 0 0; }
.da-source { color: var(--soft); font-size: 11px !important; line-height: 1.85; margin: 18px 0 0; }
.da-answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.da-answer-grid > div { border: 1px solid var(--line); padding: 25px; border-radius: 8px; }
.da-answer-grid span, .da-answer-grid small { display: block; color: var(--soft); font-size: 12px; }
.da-answer-grid strong { display: block; font-size: clamp(32px, 4vw, 52px); font-weight: 500; color: var(--lavender); font-variant-numeric: tabular-nums; margin: 10px 0; }
.da-replay-bottom a { color: var(--cyan); min-height: 32px; display: inline-flex; align-items: center; }
.da-evolution { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.da-evolution li { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: #101c3180; }
.da-evolution .da-own { border-top: 2px solid var(--lavender); }
.da-evolution h3 { font-size: 19px; }
.da-evolution strong { font-size: 13px; color: var(--lavender); }
.da-design { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; padding: 32px; border: 1px solid var(--line); border-radius: 10px; margin-top: 24px; }
.da-design h3 { margin-top: 12px; }
.da-routing p { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 18px; margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.da-routing strong { color: var(--cyan); font-size: 13px; }
.da-eval-label { display: flex; flex-wrap: wrap; gap: 12px 30px; padding: 18px 20px; background: #f3c4770b; border: 1px solid #f3c47744; border-radius: 8px 8px 0 0; font-size: 12px; color: var(--lavender); line-height: 1.7; }
.da-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; }
.da-table-scroll table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.da-table-scroll caption { text-align: left; color: var(--soft); font-size: 11px; padding: 16px 22px; }
.da-table-scroll th, .da-table-scroll td { text-align: left; padding: 18px 22px; border-top: 1px solid var(--line); }
.da-table-scroll thead { color: var(--soft); background: #88bdff08; font-size: 12px; }
.da-table-scroll tbody th { font-weight: 500; }
.da-table-scroll td:last-child { color: var(--lavender); }
.da-caveats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 28px; }
.da-caveats h3 { font-size: 17px; color: var(--cyan); }
@media (max-width: 1080px) { .da-evolution { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .dataagent-theme h1 { font-size: clamp(42px, 12vw, 70px); }
  .dataagent-theme .hero-grid, .dataagent-theme .chapter-copy, .da-panel-grid, .da-answer-grid, .da-evolution, .da-design, .da-caveats { grid-template-columns: minmax(0, 1fr); }
  .da-chapters { gap: 12px 22px; }
  .da-replay-top, .da-replay-bottom { padding: 16px; }
  .da-question { padding: 20px 16px 0; }
  .da-replay-note { padding: 0 16px; }
  .da-tabs[role="tablist"] { padding: 18px 16px 0; gap: 5px; }
  .da-tabs button { font-size: 11px; padding: 5px 2px; }
  .da-panel { padding: 24px 16px; }
  .da-panel-grid, .da-caveats { gap: 18px; }
  .dataagent-theme pre { padding: 14px; font-size: 12px; }
  .da-answer-grid { gap: 12px; }
  .da-answer-grid > div { padding: 18px; }
  .da-design { padding: 22px; gap: 12px; }
  .dataagent-theme .footer-links { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .image-link { transform: none !important; }
  .reveal.reveal-pending { opacity: 1; transform: none; }
}
