@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@500;600;700;900&family=Manrope:wght@400;500;600&display=swap");

:root {
  --ink: #090a08;
  --ink-soft: #11120f;
  --paper: #e8ddc2;
  --muted: #978c74;
  --red: #c9261d;
  --red-dark: #5b110d;
  --copper: #b78d57;
  --line: rgba(221, 199, 158, 0.22);
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Manrope", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}
.site-header {
  height: 78px; padding: 0 3.4vw; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
  background: rgba(9, 10, 8, .88); backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 13px; font: 700 19px var(--serif); letter-spacing: .08em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; color: var(--red);
  border: 1px solid var(--red); border-radius: 50%; font-size: 18px;
}
nav { display: flex; gap: 3.3vw; color: #c8bda5; font: 500 14px var(--serif); }
nav a { position: relative; transition: color .2s; }
nav a:hover { color: var(--paper); }
nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -12px; height: 2px; background: var(--red); transition: right .25s; }
nav a:hover::after { right: 0; }
.header-action, .primary-button, .run-button {
  border: 1px solid #a83931; background: linear-gradient(135deg, #65150f, #941d16); color: #f2e5c9;
  padding: 13px 20px; font: 600 13px var(--serif); letter-spacing: .06em; cursor: pointer;
}
.header-action span { margin-left: 20px; }
.hero {
  min-height: calc(100vh - 78px); display: grid; grid-template-columns: .92fr 1.08fr;
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.hero-copy { padding: clamp(70px, 10vh, 116px) 4vw 48px 6vw; position: relative; z-index: 2; }
.hero h1 {
  margin: 0; max-width: 760px; font: 900 clamp(56px, 6vw, 98px)/1.13 var(--serif);
  letter-spacing: -.055em; text-wrap: balance;
}
.hero-copy > p { margin: 30px 0 36px; max-width: 540px; color: #b3a991; font: 500 17px/1.9 var(--serif); }
.hero-actions { display: flex; align-items: center; gap: 30px; }
.primary-button { padding: 16px 24px; }
.text-link { color: #bfb39a; font-size: 13px; border-bottom: 1px solid #5e5749; padding-bottom: 7px; }
.text-link span { margin-left: 22px; color: var(--red); }
.hero-metrics {
  display: flex; gap: 44px; margin-top: 10vh; padding-top: 24px; width: min(520px, 100%);
  border-top: 1px solid var(--line);
}
.hero-metrics div { display: grid; gap: 6px; }
.hero-metrics strong { font: 500 28px var(--serif); color: var(--copper); }
.hero-metrics span { font-size: 10px; color: #776f5e; letter-spacing: .12em; }
.hero-visual {
  min-height: 690px; position: relative;
  background: radial-gradient(circle at 53% 50%, rgba(122, 27, 18, .42), transparent 40%),
    linear-gradient(90deg, var(--ink), transparent 25%);
}
.hero-visual::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--ink) 0, transparent 15%, transparent 82%, var(--ink) 100%);
  pointer-events: none;
}
.orbit { position: absolute; border: 1px solid rgba(183, 141, 87, .18); border-radius: 50%; }
.orbit-one { width: 620px; height: 620px; left: 8%; top: 8%; }
.orbit-two { width: 430px; height: 430px; left: 22%; top: 22%; border-style: dashed; }
.specimen {
  position: absolute; background: url("./assets/ingredient-atlas-alpha.png") no-repeat;
  background-size: 400% 200%; filter: saturate(1.15) contrast(1.1);
  animation: float 7s ease-in-out infinite;
}
.specimen-douchi { width: 280px; height: 260px; background-position: 66.66% 0; left: 5%; top: 37%; transform: rotate(-12deg); }
.specimen-pepper { width: 300px; height: 260px; background-position: 33.33% 0; left: 30%; top: 12%; animation-delay: -2s; }
.specimen-douban { width: 320px; height: 310px; background-position: 0 0; left: 35%; top: 42%; animation-delay: -4s; }
.specimen-ginger { width: 310px; height: 280px; background-position: 33.33% 100%; right: -2%; top: 23%; animation-delay: -1s; }
@keyframes float { 0%,100% { translate: 0 0; } 50% { translate: 0 -13px; } }
.hero-caption {
  position: absolute; z-index: 2; right: 4vw; bottom: 40px; display: grid; gap: 6px;
  padding-left: 18px; border-left: 2px solid var(--red); text-align: right;
}
.hero-caption span { color: #8f8068; font-size: 10px; letter-spacing: .18em; }
.hero-caption strong { font: 600 13px var(--serif); }
section { scroll-margin-top: 78px; }
.formation, .ingredients, .methodology { padding: 100px 5vw; }
.section-heading { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 18px; margin-bottom: 65px; }
.section-index { color: var(--red); font: 500 12px var(--sans); letter-spacing: .15em; padding-top: 12px; }
.section-heading h2, .protocol h2, .sources h2 {
  margin: 0; font: 700 clamp(38px, 5vw, 68px)/1.23 var(--serif); letter-spacing: -.03em;
}
.section-heading p { max-width: 650px; color: var(--muted); font: 500 15px/1.8 var(--serif); }
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); }
.timeline-item { padding: 26px 28px 34px 0; border-right: 1px solid var(--line); cursor: pointer; transition: .3s; outline: 0; }
.timeline-item + .timeline-item { padding-left: 28px; }
.timeline-item span { color: var(--red); font-size: 10px; letter-spacing: .12em; }
.timeline-item strong { display: block; margin: 18px 0 13px; font: 600 22px var(--serif); }
.timeline-item p { color: #7e7665; font: 500 12px/1.8 var(--serif); margin: 0; }
.timeline-item.active, .timeline-item:hover { background: linear-gradient(180deg, rgba(141, 25, 18, .24), transparent); padding-top: 34px; }
.timeline-item.active strong { color: #f0d9ab; }
.evidence-note { text-align: right; color: #5f594d; font-size: 10px; margin-top: 18px; }
.lab-section { padding: 85px 2.8vw; background: #0c0d0b; border-block: 1px solid var(--line); }
.lab-heading { display: flex; align-items: end; gap: 50px; margin: 0 1.8vw 42px; }
.lab-heading > div:nth-child(2) { flex: 1; }
.lab-heading h2 { margin: 0; font: 700 44px var(--serif); }
.lab-heading p { color: var(--muted); font: 500 13px var(--serif); }
.confidence-key { display: flex; gap: 18px; color: #887e6b; font-size: 10px; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; }
.dot.observed { background: var(--copper); }
.dot.hypothesis { border: 1px solid var(--red); }
.lab-grid { display: grid; grid-template-columns: .8fr 1.2fr 1fr; border: 1px solid var(--line); }
.controls, .radar-panel, .ingredient-readout { min-width: 0; padding: 30px; }
.controls, .radar-panel { border-right: 1px solid var(--line); }
.select-label { display: block; color: #756d5d; font-size: 10px; letter-spacing: .14em; margin-bottom: 8px; }
select {
  width: 100%; color: var(--paper); background: #151611; border: 1px solid var(--line);
  padding: 14px; outline: none; font: 600 18px var(--serif);
}
.control-group { margin-top: 30px; }
.control-label { display: flex; justify-content: space-between; margin-bottom: 15px; font: 500 13px var(--serif); }
.control-label output { color: #d7ba86; font-family: var(--sans); }
input[type="range"] { width: 100%; accent-color: var(--red); }
.range-labels { display: flex; justify-content: space-between; color: #5f594d; font-size: 9px; }
.phase-control { border: 0; margin: 28px 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.phase-control legend { width: 100%; margin-bottom: 12px; font: 500 13px var(--serif); }
.phase-control button { color: #807765; background: #12130f; border: 1px solid var(--line); padding: 10px 4px; font-size: 11px; cursor: pointer; }
.phase-control button.active { color: #f0d9ab; border-color: #8d251d; background: #3a100d; }
.run-button { width: 100%; display: flex; justify-content: space-between; }
.panel-title { display: flex; justify-content: space-between; font: 600 13px var(--serif); }
.panel-title small { color: #696252; font: 500 9px var(--sans); }
#radar { width: 100%; max-height: 480px; margin: 10px auto; display: block; overflow: visible; }
#radarGrid polygon { fill: none; stroke: rgba(221, 199, 158, .16); stroke-width: 1; }
#radarGrid line { stroke: rgba(221, 199, 158, .2); }
#radarPolygon { fill: rgba(182, 37, 28, .28); stroke: var(--red); stroke-width: 2.5; transition: points .5s ease; }
#radarPoints circle { fill: #e75443; stroke: #ffbc8f; }
#radarLabels text { fill: #c3b69b; font: 500 13px var(--serif); }
.radar-legend { display: flex; justify-content: center; gap: 30px; color: #696252; font-size: 9px; }
.radar-legend i { display: inline-block; width: 32px; border-top: 2px solid var(--red); margin-right: 8px; vertical-align: middle; }
.radar-legend .dashed i { border-color: #736650; border-top-style: dashed; }
.readout-top { display: flex; min-height: 150px; border-bottom: 1px solid var(--line); }
.readout-top > div:first-child { flex: 1; }
.readout-top span { color: var(--red); font-size: 10px; letter-spacing: .13em; }
.readout-top h3 { margin: 8px 0; font: 700 39px var(--serif); }
.readout-top p { color: #7f7665; margin: 0; font-size: 10px; font-style: italic; }
.readout-image { width: 150px; background: url("./assets/ingredient-atlas-alpha.png") no-repeat; background-size: 400% 200%; }
.ingredient-summary { color: #a39a85; font: 500 12px/1.8 var(--serif); min-height: 64px; }
.signal-row { display: grid; grid-template-columns: 65px 1fr 30px; align-items: center; gap: 10px; margin: 15px 0; font-size: 10px; color: #8f8673; }
.signal-bar { height: 5px; background: #27271f; overflow: hidden; }
.signal-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7f1711, var(--red)); transition: width .5s ease; }
.signal-row strong { color: #d2b988; text-align: right; font-weight: 500; }
.mechanism { margin-top: 24px; padding: 17px; border: 1px solid var(--line); background: #10110d; }
.mechanism span, .model-status span { color: #756d5d; font-size: 9px; letter-spacing: .12em; }
.mechanism p { margin: 8px 0 0; color: #b0a58f; font: 500 11px/1.65 var(--serif); }
.model-status { margin-top: 18px; display: grid; grid-template-columns: 1fr auto; gap: 4px; }
.model-status strong { color: var(--copper); font: 500 12px var(--serif); }
.model-status span:last-child { grid-column: 1 / -1; text-align: right; color: #5f594d; letter-spacing: 0; }
.section-heading.compact { margin-bottom: 38px; }
.ingredient-rail { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.ingredient-card { min-height: 360px; padding: 25px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; position: relative; overflow: hidden; transition: background .25s; }
.ingredient-card:hover { background: #11120f; }
.ingredient-card-image {
  height: 190px; margin: -5px -5px 20px; background: radial-gradient(circle, #2a130f, #0b0c09 70%) url("./assets/ingredient-atlas-alpha.png") no-repeat;
  background-size: cover, 400% 200%; filter: contrast(1.08);
}
.ingredient-card span { color: var(--red); font-size: 9px; letter-spacing: .15em; }
.ingredient-card h3 { margin: 8px 0; font: 600 25px var(--serif); }
.ingredient-card p { margin: 0; color: #766f60; font: 500 11px/1.7 var(--serif); }
.ingredient-card button { position: absolute; right: 24px; bottom: 23px; border: 0; color: var(--copper); background: none; cursor: pointer; }
.methodology { background: #10110e; }
.causal-chain { display: grid; grid-template-columns: repeat(7, auto); align-items: center; gap: 24px; margin: 30px 0 70px; }
.causal-chain div { min-width: 0; }
.causal-chain span { color: var(--red); font-size: 9px; }
.causal-chain strong { display: block; margin: 12px 0; font: 600 16px var(--serif); }
.causal-chain small { color: #676052; font-size: 9px; }
.causal-chain b { color: #6c2a24; font-weight: 400; }
.equation { border-block: 1px solid var(--line); padding: 42px 0; display: grid; grid-template-columns: 100px 1.2fr 1fr; align-items: center; gap: 30px; }
.equation > span { color: var(--red); font-size: 10px; letter-spacing: .15em; }
.equation strong { color: #e3c992; font: 500 clamp(21px, 2.4vw, 36px) Georgia, serif; }
.equation p { color: #777060; font: 500 11px/1.8 var(--serif); }
.protocol { display: grid; grid-template-columns: .85fr 1.15fr; min-height: 650px; padding: 100px 5vw; position: relative; }
.protocol-copy { padding-right: 8vw; }
.protocol-copy > p { margin: 25px 0; color: var(--muted); font: 500 13px/1.9 var(--serif); }
#protocolButton { color: #d9c5a1; padding: 12px 0; border: 0; border-bottom: 1px solid #594f40; background: none; cursor: pointer; }
#protocolButton span { margin-left: 35px; color: var(--red); }
.protocol-table { border-top: 1px solid var(--line); align-self: start; }
.protocol-row { display: grid; grid-template-columns: .5fr .9fr 1.5fr 1fr; align-items: center; min-height: 67px; padding: 0 18px; border-bottom: 1px solid var(--line); color: #817967; font-size: 11px; }
.protocol-row.header { min-height: 40px; color: #595448; font-size: 8px; letter-spacing: .12em; }
.protocol-row strong { color: #c6ad7d; font-weight: 500; }
.protocol-row.active { background: linear-gradient(90deg, rgba(139, 25, 18, .3), transparent); border-left: 2px solid var(--red); }
.protocol-detail { grid-column: 1 / -1; max-height: 0; overflow: hidden; display: grid; grid-template-columns: repeat(4, 1fr); transition: max-height .45s ease; }
.protocol-detail.open { max-height: 220px; border-top: 1px solid var(--line); margin-top: 40px; }
.protocol-detail div { padding: 25px; border-right: 1px solid var(--line); display: grid; gap: 12px; }
.protocol-detail strong { color: var(--red); font: 500 10px var(--sans); }
.protocol-detail span { color: #8b826f; font: 500 11px/1.7 var(--serif); }
.sources { display: grid; grid-template-columns: .55fr 1.45fr; gap: 50px; padding: 80px 5vw; background: #e2d6bb; color: #171713; }
.sources > div:first-child { display: grid; grid-template-columns: 50px 1fr; }
.sources h2 { font-size: 43px; }
.source-content > p { max-width: 750px; font: 500 15px/1.9 var(--serif); color: #5b5548; }
.source-links { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 30px; border-top: 1px solid rgba(20,20,16,.2); }
.source-links a { padding: 18px 10px 18px 0; border-bottom: 1px solid rgba(20,20,16,.2); font: 600 12px var(--serif); }
footer { padding: 32px 5vw; display: flex; align-items: center; justify-content: space-between; color: #5f594d; font-size: 10px; }
footer .brand { color: #877c68; font-size: 14px; }
footer .brand-mark { width: 27px; height: 27px; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 30px; translate: -50% 20px; opacity: 0; z-index: 30; padding: 13px 20px; background: #d8c49d; color: #171713; font-size: 11px; transition: .3s; pointer-events: none; }
.toast.show { opacity: 1; translate: -50% 0; }
@media (max-width: 1050px) {
  nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 630px; }
  .hero-visual { min-height: 520px; margin-top: -180px; opacity: .62; }
  .lab-grid { grid-template-columns: 1fr 1fr; }
  .ingredient-readout { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .ingredient-rail { grid-template-columns: repeat(2, 1fr); }
  .causal-chain { grid-template-columns: 1fr; }
  .causal-chain b { rotate: 90deg; width: 10px; }
}
@media (max-width: 700px) {
  .site-header { padding: 0 20px; }
  .header-action { display: none; }
  .hero-copy { padding: 70px 24px; min-height: 610px; }
  .hero h1 { font-size: 50px; }
  .hero-metrics { gap: 20px; }
  .hero-visual { min-height: 430px; margin-top: -160px; transform: scale(.8); transform-origin: center; }
  .formation, .ingredients, .methodology, .protocol { padding: 75px 24px; }
  .section-heading { grid-template-columns: 38px 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .timeline-item { border-right: 0; border-bottom: 1px solid var(--line); padding-left: 0 !important; }
  .lab-heading { align-items: start; flex-wrap: wrap; }
  .confidence-key { width: 100%; }
  .lab-grid { grid-template-columns: 1fr; }
  .controls, .radar-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .ingredient-readout { grid-column: auto; }
  .ingredient-rail { grid-template-columns: 1fr; }
  .equation { grid-template-columns: 1fr; }
  .protocol { grid-template-columns: 1fr; gap: 45px; }
  .protocol-detail { grid-template-columns: 1fr; }
  .protocol-detail.open { max-height: 620px; }
  .protocol-row { grid-template-columns: .4fr .9fr 1.3fr; }
  .protocol-row span:last-child { display: none; }
  .sources { grid-template-columns: 1fr; padding: 65px 24px; }
  .source-links { grid-template-columns: 1fr; }
  footer { align-items: flex-start; gap: 20px; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
