/* ===== Dongbei Renaissance — winter-industrial ===== */
:root{
  --bg: #0a1320;
  --bg-2: #11202d;
  --bg-3: #19293a;
  --line: #2a3a4d;
  --line-2: #3a4d66;
  --ink: #e8eef0;
  --ink-soft: #a4c2d4;
  --snow: #f3f6f8;
  --steel: #5a6976;
  --furnace: #e87a3a;
  --soviet: #c8313b;
  --pine: #4a8a4a;
  --frost: #6aaecf;
  --rust: #b85d2a;
}
[data-theme="light"]{
  --bg: #ecedea;
  --bg-2: #f6f7f3;
  --bg-3: #dde0d8;
  --line: #c2c5b8;
  --line-2: #a8ad9c;
  --ink: #1a1f28;
  --ink-soft: #4a5663;
  --snow: #1a1f28;
  --steel: #6a7480;
  --furnace: #a85a23;
  --soviet: #9b1f29;
  --pine: #2a6a3a;
  --frost: #2a6aae;
  --rust: #8a4513;
}

*{box-sizing: border-box}
html, body{margin:0; padding:0}
html{scroll-behavior: smooth; scroll-padding-top: 72px}
body{
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 17px; line-height: 1.65;
  color: var(--ink); background: var(--bg);
  background-image:
    radial-gradient(1100px 700px at 12% -10%, rgba(106,174,207,0.10), transparent 60%),
    radial-gradient(800px 600px at 110% 25%, rgba(232,122,58,0.08), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(200,49,59,0.06), transparent 60%);
}
[data-theme="light"] body{
  background-image:
    radial-gradient(1100px 700px at 12% -10%, rgba(42,106,174,0.08), transparent 60%),
    radial-gradient(800px 600px at 110% 25%, rgba(168,90,35,0.07), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(155,31,41,0.05), transparent 60%);
}

a{color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px}
a:hover{text-decoration-color: var(--furnace)}
em{font-style: italic; color: var(--furnace)}
code, .mono{font-family: "JetBrains Mono", ui-monospace, monospace}

/* Bilingual */
[lang="zh"]{display:none}
html[data-lang="zh"] [lang="en"]{display:none}
html[data-lang="zh"] [lang="zh"]{display:initial}
html svg [lang="zh"]{display:none}
html[data-lang="zh"] svg [lang="zh"]{display:inline}
html[data-lang="zh"] svg [lang="en"]{display:none}
html[data-lang="zh"]{font-family: "Noto Serif SC", "Source Han Serif SC", "Source Serif 4", Georgia, serif;}

/* Topbar */
.topbar{
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner{
  max-width: 1320px; margin: 0 auto;
  padding: 12px 24px;
  display: flex; align-items: center; gap: 18px;
}
.brand{
  display: flex; align-items: center; gap: 12px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 18px; font-weight: 700; letter-spacing: -.005em;
  text-decoration: none; color: var(--ink);
}
.brand .seal{
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 4px;
  background: var(--soviet);
  color: var(--snow);
  border: 1px solid var(--ink);
  font-family: "Noto Serif SC", "Cormorant Garamond", serif;
  font-weight: 700; font-size: 22px;
  position: relative; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-2);
}
.brand em{color: var(--furnace); font-style: italic; font-weight: 600}
.nav{display: flex; gap: 14px; flex-wrap: wrap; margin-left: 8px}
.nav a{
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 0; border-bottom: 1px solid transparent;
}
.nav a:hover{color: var(--ink); border-bottom-color: var(--furnace)}
.toolbar{margin-left: auto; display: flex; gap: 10px}
.lang-toggle, .theme-toggle{
  display: inline-flex; gap: 0;
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
}
.lang-toggle button, .theme-toggle button{
  font-family: "JetBrains Mono", monospace; font-size: 11px;
  background: transparent; color: var(--ink-soft);
  border: none; border-right: 1px solid var(--line);
  padding: 5px 10px; cursor: pointer; letter-spacing: .04em;
}
.lang-toggle button:last-child, .theme-toggle button:last-child{border-right: none}
.lang-toggle button.active, .theme-toggle button.active{background: var(--furnace); color: var(--snow)}

/* Hero */
.hero{ max-width: 1320px; margin: 0 auto; padding: 90px 24px 60px; position: relative; overflow: hidden;}
.hero::before{
  content:""; position: absolute; top: -10%; left: -5%; width: 800px; height: 600px;
  background-image: radial-gradient(circle at 20% 30%, var(--frost), transparent 40%);
  opacity: 0.12; pointer-events: none; transform: rotate(-8deg);
}
.hero-eyebrow{
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; letter-spacing: .18em;
  color: var(--furnace); text-transform: uppercase;
  margin-bottom: 24px; position: relative;
}
.hero-eyebrow::before{content:"❄ "; color: var(--frost)}
.hero h1{
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 6.2vw, 80px);
  line-height: 1.02; letter-spacing: -.025em;
  margin: 0 0 12px; max-width: 18ch; position: relative;
}
.hero h1 em{
  font-style: italic;
  color: var(--furnace);
  background: linear-gradient(120deg, var(--furnace), var(--soviet));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 .zh-title{font-family: "Noto Serif SC", serif; font-weight: 700; letter-spacing: -.005em}
.hero-sub{
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 22px; line-height: 1.35;
  color: var(--ink-soft);
  font-weight: 400; max-width: 60ch;
  margin: 0 0 24px; position: relative;
}
.hero-lede{
  font-size: 19px; line-height: 1.6;
  max-width: 64ch; color: var(--ink-soft);
  margin: 0 0 28px; position: relative;
}
.hero-thesis{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-top: 40px; position: relative;
}
.hero-thesis div{
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 18px; border-radius: 4px;
  position: relative;
}
.hero-thesis div:nth-child(1){border-top: 3px solid var(--frost)}
.hero-thesis div:nth-child(2){border-top: 3px solid var(--furnace)}
.hero-thesis div:nth-child(3){border-top: 3px solid var(--soviet)}
.hero-thesis div:nth-child(4){border-top: 3px solid var(--pine)}
.hero-thesis strong{
  font-family: "JetBrains Mono", monospace; font-weight: 500;
  font-size: 11px; letter-spacing: .12em;
  color: var(--furnace); text-transform: uppercase;
  display: block; margin-bottom: 8px;
}

/* Sections */
section{ max-width: 1320px; margin: 0 auto; padding: 72px 24px; border-top: 1px solid var(--line); }
section.no-rule{border-top: none}
.section-eyebrow{
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: .18em;
  color: var(--furnace); text-transform: uppercase;
  margin: 0 0 14px;
}
.section-eyebrow::before{content: "// "; color: var(--ink-soft)}
.section-title{
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.1; margin: 0 0 16px;
  letter-spacing: -.018em;
}
.section-title .zh{font-family: "Noto Serif SC", serif; font-weight: 700}
.section-lede{
  font-size: 18px; line-height: 1.6; color: var(--ink-soft);
  max-width: 72ch; margin: 0 0 32px;
}

/* Map */
.map-wrap{
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2);
  background-image:
    repeating-linear-gradient(0deg, rgba(164,194,212,0.04) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(164,194,212,0.04) 0 1px, transparent 1px 32px);
  overflow: hidden;
}
.map-wrap svg{display: block; width: 100%; height: auto}
.map-legend{
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; color: var(--ink-soft);
}
.map-legend span{display: inline-flex; align-items: center; gap: 6px}
.map-legend i{display:inline-block; width:10px; height:10px; border-radius: 50%; border: 1px solid var(--ink)}

/* Cards */
.grid{ display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.two{grid-template-columns: repeat(auto-fit, minmax(380px, 1fr))}
.grid.three{grid-template-columns: repeat(auto-fit, minmax(320px, 1fr))}
.card{
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 4px; padding: 22px;
  position: relative;
  transition: transform .15s, border-color .15s;
}
.card:hover{transform: translateY(-2px); border-color: var(--furnace)}
.card.frost{border-top: 3px solid var(--frost)}
.card.furnace{border-top: 3px solid var(--furnace)}
.card.soviet{border-top: 3px solid var(--soviet)}
.card.pine{border-top: 3px solid var(--pine)}
.card.rust{border-top: 3px solid var(--rust)}
.card.steel{border-top: 3px solid var(--steel)}
.card h3{
  font-family: "Space Grotesk", system-ui, sans-serif; font-weight: 600;
  font-size: 22px; margin: 0 0 8px; line-height: 1.2;
  letter-spacing: -.005em;
}
.card h3 .zh{font-family: "Noto Serif SC", serif}
.card .meta{
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: .08em;
  color: var(--furnace); text-transform: uppercase;
  margin-bottom: 10px;
}
.card p{margin: 0 0 10px; line-height: 1.55}

/* Timeline */
.timeline-wrap{
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2);
}
.timeline-row{
  display: grid; grid-template-columns: 240px 1fr;
  gap: 0; border-bottom: 1px solid var(--line);
}
.timeline-row:last-child{border-bottom: none}
.timeline-row.peak{background: linear-gradient(90deg, color-mix(in oklab, var(--furnace) 12%, var(--bg-2)), var(--bg-2))}
.timeline-row > div{padding: 22px 24px}
.timeline-row .tl-head{
  border-right: 1px dashed var(--line);
  background: color-mix(in oklab, var(--bg-3) 50%, var(--bg-2));
}
.timeline-row .tl-head h4{
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 19px; font-weight: 600; margin: 0 0 4px; line-height: 1.2;
}
.timeline-row .tl-head h4 .zh{font-family: "Noto Serif SC", serif}
.timeline-row .tl-body p{margin: 0; line-height: 1.6}

/* Contrast table */
.tbl-wrap{ border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
table.contrast{
  width: 100%; border-collapse: collapse; font-size: 14px;
}
table.contrast th, table.contrast td{
  text-align: left; vertical-align: top;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
table.contrast th{
  background: var(--bg-3);
  font-family: "JetBrains Mono", monospace; font-weight: 500;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--furnace);
}
table.contrast td:first-child{
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 16px; font-weight: 600;
  color: var(--ink);
}

/* Simulator */
.sim{
  display: grid; grid-template-columns: 320px 1fr; gap: 24px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2); padding: 24px;
}
.sim-controls .ctrl{margin-bottom: 18px}
.sim-controls label{
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); display: block; margin-bottom: 6px;
}
.sim-controls input[type="range"]{ width: 100%; accent-color: var(--furnace); }
.sim-controls .val{
  font-family: "JetBrains Mono", monospace; font-size: 12px;
  color: var(--furnace); float: right;
}
.sim-output{display: flex; flex-direction: column; gap: 16px}
.sim-meter{
  display: grid; grid-template-columns: 200px 1fr 60px;
  gap: 12px; align-items: center;
  font-family: "JetBrains Mono", monospace; font-size: 12px;
}
.sim-meter .bar{ height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.sim-meter .bar-fill{
  height: 100%;
  background: linear-gradient(90deg, var(--frost), var(--furnace), var(--soviet));
  transition: width .25s ease;
}
.sim-meter .num{text-align: right; color: var(--furnace)}
.sim-summary{
  margin-top: 8px; padding: 16px;
  background: var(--bg); border: 1px dashed var(--line); border-radius: 4px;
  font-style: italic; color: var(--ink-soft); font-size: 15px; line-height: 1.55;
}

/* AI Q&A */
.ai-panel{
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2); padding: 24px;
}
.ai-q{
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 22px; font-weight: 600; margin: 0 0 8px;
  line-height: 1.25; letter-spacing: -.005em;
}
.ai-q::before{content: "❄ "; color: var(--frost)}
.ai-q .zh{font-family: "Noto Serif SC", serif}
.ai-a{
  margin: 0 0 24px;
  padding-left: 22px; border-left: 2px solid var(--furnace);
  font-size: 16px; line-height: 1.65; color: var(--ink-soft);
}
.ai-a:last-child{margin-bottom: 0}

/* Footer */
footer{
  max-width: 1320px; margin: 0 auto; padding: 48px 24px 64px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-soft);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
footer a{color: var(--ink-soft)}

/* Responsive */
@media (max-width: 900px){
  .nav{display: none}
  .sim{grid-template-columns: 1fr}
  .timeline-row{grid-template-columns: 1fr}
  .timeline-row .tl-head{border-right: none; border-bottom: 1px dashed var(--line)}
}
@media (max-width: 600px){
  .topbar-inner{padding: 10px 16px; gap: 10px}
  .hero{padding: 56px 16px 36px}
  section{padding: 56px 16px}
}
