:root {
  --thai: "Noto Serif Thai", "Noto Serif", Georgia, serif;
  --han: "Noto Serif TC", "Noto Serif CJK TC", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg: #08090c;
  --panel: #11151c;
  --panel2: #171d27;
  --fg: #f4ecdc;
  --soft: #c9bda5;
  --muted: #8f8879;
  --line: rgba(207, 171, 90, .2);
  --gold: #caa34e;
  --gold2: #ecd27e;
  --jade: #3f6d5b;
  --blue: #4f87b9;
  --crimson: #b9584a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fg);
  background:
    radial-gradient(circle at 82% -4%, rgba(79, 135, 185, .18), transparent 34%),
    radial-gradient(circle at 8% 18%, rgba(63, 109, 91, .14), transparent 30%),
    linear-gradient(180deg, #07080b 0%, var(--bg) 46%, #0d1016 100%);
  font-family: var(--thai);
  line-height: 1.76;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
img, video { max-width: 100%; }

.han { font-family: var(--han); }
.mono { font-family: var(--mono); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 12, .82);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--fg);
  font-size: 14px;
}

.brand span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seal {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--han);
  background: rgba(202, 163, 78, .08);
}

.stage {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}

.article-lang {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.article-lang select {
  min-height: 34px;
  max-width: 132px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 30px 0 12px;
  color: var(--fg);
  background: rgba(17, 21, 28, .9);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color-scheme: dark;
}

.article-lang option {
  color: var(--fg);
  background: var(--panel);
}

.hero {
  position: relative;
  min-height: 700px;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media video,
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-media video { opacity: .72; }
.hero-media .poster { display: none; opacity: .7; }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 9, 12, .96), rgba(8, 9, 12, .76) 38%, rgba(8, 9, 12, .22) 74%),
    linear-gradient(180deg, rgba(8, 9, 12, .1), rgba(8, 9, 12, .92));
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 88px 22px 64px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .17em;
  text-transform: uppercase;
}

h1, h2, h3 { letter-spacing: 0; }
h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(34px, 7vw, 74px);
  line-height: 1.12;
  font-weight: 700;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(25px, 4vw, 38px);
  line-height: 1.36;
  font-weight: 700;
}

h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.42;
  color: var(--gold2);
}

p {
  margin: 0 0 1.05em;
  color: var(--fg);
  font-size: 17px;
}

.lead {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--soft);
  font-size: clamp(17px, 2vw, 21px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  background: rgba(17, 21, 28, .78);
  font-size: 14px;
}

.btn.primary {
  border-color: var(--gold);
  color: #08090c;
  background: var(--gold);
  font-weight: 700;
}

.motion {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--soft);
  background: rgba(8, 9, 12, .76);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}

.wrap {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 48px 22px 90px;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) 286px;
  gap: 52px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 78px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.toc b {
  display: block;
  margin-bottom: 10px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.toc a {
  display: block;
  padding: 5px 0;
  color: var(--soft);
}

section { margin: 0 0 58px; }
.section-sub { color: var(--soft); font-size: 16px; }
.muted { color: var(--muted); }

.note {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: rgba(202, 163, 78, .11);
}

.note p { margin: 0; color: var(--soft); font-size: 15px; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.card,
.science-card,
.step,
.fact,
.link-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(23, 29, 39, .92), rgba(17, 21, 28, .84));
}

.card { padding: 17px; }
.btn,
.pill,
.card,
.science-card .body,
.step > div,
.reading-order a > div,
.link-card,
.fact {
  min-width: 0;
}

h1,
h2,
h3,
p,
.btn,
.pill,
.science-card p,
.link-card span,
.reading-order span {
  overflow-wrap: break-word;
}

.card b {
  display: block;
  margin-bottom: 7px;
  color: var(--gold2);
  font-size: 16px;
}
.card span { color: var(--soft); font-size: 14px; line-height: 1.7; }

.science-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.science-card {
  min-height: 238px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.science-card img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line);
}

.science-card .body {
  padding: 15px 16px 17px;
}

.science-card small,
.fact small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.science-card h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--fg);
}

.science-card h3 em {
  color: var(--gold);
  font-family: var(--han);
  font-style: normal;
  font-size: 23px;
}

.science-card p { color: var(--soft); font-size: 14.5px; line-height: 1.7; }
.science-card .go { color: var(--gold2); font-family: var(--mono); font-size: 11px; }

.steps {
  display: grid;
  gap: 12px;
  counter-reset: step;
  margin-top: 22px;
}

.step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.glyph {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  background: rgba(202, 163, 78, .08);
  font-family: var(--han);
  font-size: 22px;
}

.step h3 { margin: 0; color: var(--fg); font-size: 18px; }
.step p { margin: 4px 0 0; color: var(--soft); font-size: 14.5px; }
.go { color: var(--gold); font-family: var(--mono); font-size: 11px; white-space: nowrap; overflow-wrap: anywhere; }

figure {
  margin: 30px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

figure img { display: block; width: 100%; height: auto; }
figcaption {
  border-top: 1px solid var(--line);
  padding: 11px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.media-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #050609;
}

.learn-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.learn-list li {
  border-left: 2px solid rgba(202, 163, 78, .55);
  padding: 8px 0 8px 14px;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.72;
}

.learn-list b { color: var(--gold2); }

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.fact { padding: 16px; }
.fact b { display: block; color: var(--gold2); font-size: 16px; margin-bottom: 6px; }
.fact p { margin: 0; color: var(--soft); font-size: 14.5px; line-height: 1.72; }

.reading-order {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.reading-order a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 21, 28, .82);
}

.reading-order em {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(202, 163, 78, .5);
  color: var(--gold);
  font-family: var(--han);
  font-style: normal;
}

.reading-order b { display: block; color: var(--fg); }
.reading-order span { display: block; color: var(--soft); font-size: 13.5px; }

.detail-hero {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 42px 22px 0;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 30px;
  align-items: end;
}

.detail-copy { padding: 38px 0 26px; }
.detail-copy h1 { font-size: clamp(34px, 6vw, 64px); }

figure.poster {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

figure.poster img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(17, 21, 28, .62);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 740px) 310px;
  gap: 56px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 12px;
}

.link-card {
  padding: 15px;
}

.link-card b { display: block; color: var(--gold2); margin-bottom: 4px; }
.link-card span { color: var(--soft); font-size: 13.5px; line-height: 1.65; }

.next-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.next-grid a {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 21, 28, .72);
}

.next-grid b { display: block; color: var(--gold2); }
.next-grid span { display: block; color: var(--soft); font-size: 13px; }

.final-box {
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(202, 163, 78, .16), rgba(17, 21, 28, .82));
}

footer {
  margin-top: 58px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 980px) {
  .hero { min-height: 620px; }
  .article-grid,
  .detail-layout,
  .detail-head { display: block; }
  .toc,
  .sidebar {
    position: static;
    margin: 0 0 34px;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 16px 0 0;
  }
  .cards,
  .science-grid,
  .facts { grid-template-columns: 1fr; }
  figure.poster { margin-top: 22px; }
}

@media (max-width: 620px) {
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .stage { display: none; }
  .article-lang { margin-left: 0; width: 100%; justify-content: flex-end; }
  .article-lang select { max-width: 104px; padding-inline: 9px 24px; }
  .hero-inner { padding: 72px 18px 48px; }
  .wrap,
  .detail-hero { padding-left: 18px; padding-right: 18px; }
  p { font-size: 16px; }
  .step,
  .reading-order a { grid-template-columns: 48px minmax(0, 1fr); }
  .step .go,
  .reading-order .go { grid-column: 2; }
  .go { white-space: normal; }
  .next-grid { grid-template-columns: 1fr; }
  .hero-media video,
  .hero-media img { object-position: 60% center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media video { display: none; }
  .hero-media .poster { display: block; }
}
