/* /microbes ? language-tuned typography + 3D motion surfaces.
 * Scoped under body.microbes. Prefix new classes with mc-. */

/* ---------- language-optimized type ---------- */
body.microbes {
  --mc-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --mc-depth: 28px;
  --mc-ease: cubic-bezier(.22, 1, .36, 1);
  --mc-font-display: "Segoe UI", system-ui, sans-serif;
  --mc-font-body: "Segoe UI", system-ui, sans-serif;
  --mc-tracking: -0.01em;
  --mc-leading: 1.55;
  --mc-title-leading: 1.2;
  --mc-hero-from: #022c22;
  --mc-hero-mid: #059669;
  --mc-hero-to: #34d399;
}

html[lang^="ko"] body.microbes {
  --mc-font-display: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --mc-font-body: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --mc-tracking: -0.02em;
  --mc-leading: 1.7;
  --mc-title-leading: 1.35;
}
html[lang^="ja"] body.microbes {
  --mc-font-display: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --mc-font-body: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --mc-tracking: 0.02em;
  --mc-leading: 1.75;
  --mc-title-leading: 1.4;
}
html[lang^="zh"] body.microbes {
  --mc-font-display: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mc-font-body: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mc-tracking: 0.01em;
  --mc-leading: 1.7;
  --mc-title-leading: 1.35;
}
html[lang="ru"] body.microbes {
  --mc-font-display: "Segoe UI", "PT Sans", "Helvetica Neue", Arial, sans-serif;
  --mc-font-body: "Segoe UI", "PT Sans", Arial, sans-serif;
  --mc-tracking: 0;
  --mc-leading: 1.6;
}
html[lang="de"] body.microbes,
html[lang="es"] body.microbes,
html[lang="fr"] body.microbes,
html[lang="pt-BR"] body.microbes,
html[lang="pt"] body.microbes {
  --mc-font-display: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mc-tracking: -0.015em;
  --mc-leading: 1.58;
}

html[lang^="ko"] body.microbes,
html[lang^="ja"] body.microbes {
  --mc-hero-from: #022c22;
  --mc-hero-mid: #047857;
  --mc-hero-to: #6ee7b7;
}
html[lang^="zh"] body.microbes {
  --mc-hero-from: #022c22;
  --mc-hero-mid: #059669;
  --mc-hero-to: #a78bfa;
}
html[lang="de"] body.microbes,
html[lang="ru"] body.microbes {
  --mc-hero-from: #022c22;
  --mc-hero-mid: #065f46;
  --mc-hero-to: #34d399;
}

body.microbes,
body.microbes .lede,
body.microbes .sub,
body.microbes p,
body.microbes .section-intro {
  font-family: var(--mc-font-body);
  letter-spacing: var(--mc-tracking);
  line-height: var(--mc-leading);
}
body.microbes h1,
body.microbes h2,
body.microbes h3,
body.microbes .kicker {
  font-family: var(--mc-font-display);
  line-height: var(--mc-title-leading);
  letter-spacing: var(--mc-tracking);
}

html[lang^="ko"] body.microbes,
html[lang^="ja"] body.microbes,
html[lang^="zh"] body.microbes {
  font-size: 1.02rem;
}
html[lang^="ko"] body.microbes h1,
html[lang^="ja"] body.microbes h1,
html[lang^="zh"] body.microbes h1 {
  word-break: keep-all;
  text-wrap: balance;
}

/* ---------- home atmosphere ---------- */
body.microbes .jhome-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 480px at 12% -12%, color-mix(in srgb, var(--mc-hero-to) 35%, transparent), transparent 58%),
    radial-gradient(900px 420px at 92% 8%, color-mix(in srgb, #7c3aed 18%, transparent), transparent 55%),
    linear-gradient(165deg, var(--mc-hero-from) 0%, var(--mc-hero-mid) 48%, var(--mc-hero-to) 100%);
  color: #ecfdf5;
}
body.microbes .jhome-hero .lede,
body.microbes .jhome-hero .crumbs a,
body.microbes .jhome-hero .kicker { color: #a7f3d0; }
body.microbes .jhome-hero h1 { color: #fff; text-wrap: balance; }
body.microbes .jhome-hero .jh-stats b { color: #fff; }

body.microbes .topic-card .jc-meter i,
body.microbes .jc-meter i {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

/* ---------- 3D stage (home) ---------- */
.mc-stage-wrap {
  perspective: 1200px;
  margin: 1.25rem 0 0.25rem;
}
.mc-stage {
  --mc-tilt-x: 0deg;
  --mc-tilt-y: 0deg;
  position: relative;
  min-height: 176px;
  transform-style: preserve-3d;
  transform: rotateX(var(--mc-tilt-x)) rotateY(var(--mc-tilt-y));
  transition: transform .45s var(--mc-ease);
  border-radius: 22px;
  background:
    radial-gradient(60% 80% at 50% 120%, rgba(52, 211, 153, .32), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .14);
  overflow: hidden;
}
.mc-stage-floor {
  position: absolute;
  inset: auto 8% 10% 8%;
  height: 44%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(52, 211, 153, .38), transparent 70%);
  filter: blur(2px);
  transform: rotateX(68deg) translateZ(-40px);
  pointer-events: none;
}
.mc-orb {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--card-accent, #059669) 22%, rgba(255, 255, 255, .12));
  border: 1px solid color-mix(in srgb, var(--card-accent, #059669) 45%, rgba(255, 255, 255, .25));
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .28);
  backdrop-filter: blur(8px);
  transform-style: preserve-3d;
  will-change: transform;
}
.mc-orb-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 800;
  color: #fff;
  background: var(--card-accent, #059669);
  letter-spacing: -.02em;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .4);
}
.mc-orb b {
  position: absolute;
  bottom: -1.35rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  color: rgba(236, 253, 245, .92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.mc-orb:nth-child(2) { left: 12%; top: 26%; }
.mc-orb:nth-child(3) { left: 34%; top: 16%; }
.mc-orb:nth-child(4) { left: 56%; top: 20%; }
.mc-orb:nth-child(5) { left: 76%; top: 28%; }
.mc-stage.is-still .mc-orb { transform: none !important; }

.mc-path {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.15rem;
}
.mc-path a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #ecfdf5;
  font-size: .86rem;
  font-weight: 650;
  text-decoration: none;
  transition: transform .25s var(--mc-ease), background .25s ease, box-shadow .25s ease;
}
.mc-path a:hover,
.mc-path a.is-hot {
  background: rgba(255, 255, 255, .22);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .55);
}

html[lang^="ko"] .mc-orb b,
html[lang^="ja"] .mc-orb b,
html[lang^="zh"] .mc-orb b {
  font-size: .62rem;
  letter-spacing: 0;
}

/* ---------- deep-tilt shine ---------- */
body.microbes [data-tilt-deep] {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .35s var(--mc-ease), box-shadow .35s ease;
  position: relative;
}
body.microbes [data-tilt-deep]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 40%),
    rgba(255, 255, 255, calc(var(--shine, 0) * .35)), transparent 55%);
  opacity: 0;
  transition: opacity .3s ease;
}
body.microbes [data-tilt-deep]:hover::after { opacity: 1; }
body.microbes [data-tilt-deep]:hover {
  box-shadow: 0 22px 48px -20px rgba(15, 23, 42, .45), 0 2px 8px rgba(15, 23, 42, .08);
}

body.microbes .topic-card,
body.microbes .field-card,
body.microbes .pillar-card,
body.microbes .sec-card,
body.microbes .mc-fam-card {
  transform-style: preserve-3d;
}

/* ---------- family cards ---------- */
body.microbes .mc-fam-card {
  border-top: 3px solid var(--card-accent, var(--accent, #059669));
}

/* ---------- scale figure ---------- */
body.microbes .mc-scale {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  background: #f0fdf4;
}
body.microbes .mc-scale-frame {
  margin: 0 0 1.25rem;
  padding: 0.4rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #ecfdf5, #fff);
  border: 1px solid #d1fae5;
  box-shadow: 0 18px 40px -30px rgba(6, 78, 59, .28);
}

/* ---------- disclaimer ---------- */
.mc-disclaimer {
  margin: 0 0 1.5rem;
  padding: .9rem 1.05rem;
  border-left: 3px solid var(--accent, #059669);
  background: var(--mc-soft, rgba(5, 150, 105, .08));
  border-radius: 0 10px 10px 0;
  font-size: .9rem;
  color: var(--muted, #64748b);
}
.mc-disclaimer p { margin: 0; }
html[lang^="ko"] .mc-disclaimer,
html[lang^="ja"] .mc-disclaimer {
  font-size: .88rem;
  line-height: 1.75;
}

/* ---------- kind badge ---------- */
.mc-kind {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent, #059669);
  margin-bottom: .35rem;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: var(--mc-soft);
}
html[lang^="ko"] .mc-kind,
html[lang^="ja"] .mc-kind,
html[lang^="zh"] .mc-kind {
  text-transform: none;
  letter-spacing: 0;
  font-size: .78rem;
}

/* ---------- myth vs reality ---------- */
.mc-myth-grid {
  display: grid;
  gap: 1rem;
}
.mc-myth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}
.mc-myth,
.mc-real {
  padding: 1.05rem 1.15rem 1.15rem;
}
.mc-myth { background: #fef2f2; }
.mc-real { background: #ecfdf5; }
.mc-myth span,
.mc-real span {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .4rem;
  opacity: .8;
}
.mc-myth h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.mc-real p { margin: 0; line-height: 1.55; }

/* ---------- VS ---------- */
.mc-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0 1.5rem;
}
.mc-vs-col { text-align: center; }
.mc-vs-mid {
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--muted, #64748b);
}
.mc-vs-scores {
  display: grid;
  gap: .65rem;
}
.mc-vs-row {
  display: grid;
  grid-template-columns: 3rem 1fr auto 1fr 3rem;
  gap: .5rem;
  align-items: center;
}
.mc-vs-row .bar { background: var(--track, #e2e8f0); border-radius: 999px; height: 10px; overflow: hidden; }
.mc-vs-row .fill { height: 100%; border-radius: 999px; background: var(--accent, #059669); width: 0; }

/* ---------- mark badges ---------- */
body.microbes .mc-ico {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 11px;
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  background: var(--card-accent, var(--accent));
  letter-spacing: -.02em;
  line-height: 1;
  flex-shrink: 0;
}
body.microbes .mc-ico-sm {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  font-size: .78rem;
}

body.microbes .map {
  border-radius: 18px;
  padding: 22px 20px 16px;
  background: linear-gradient(180deg, #fbfcfd, #fff);
  box-shadow: 0 16px 36px -28px rgba(15, 23, 42, .28);
}

body.microbes .hero .pills { gap: 8px; }
body.microbes .hero a.pill {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .45);
  color: #f8fffc;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
body.microbes .hero a.pill:hover {
  background: rgba(255, 255, 255, .28);
  color: #fff;
  text-decoration: none;
}
body.microbes .hero a.pill.active {
  background: var(--accent, #059669);
  border-color: transparent;
  color: #fff;
  text-shadow: none;
}

[data-mc-depth] { will-change: transform; }

@media (max-width: 700px) {
  .mc-orb { width: 52px; height: 52px; border-radius: 14px; }
  .mc-stage { min-height: 148px; }
  .mc-myth-row,
  .mc-vs { grid-template-columns: 1fr; }
  .mc-vs-mid { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  body.microbes [data-tilt-deep],
  .mc-path a,
  .mc-stage {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
  .mc-stage { transform: none !important; }
}
