:root {
  color-scheme: dark;
  --bg: #12100d;
  --paper: #f7efd8;
  --ink: #1e1914;
  --muted: #8f826f;
  --line: rgba(247, 239, 216, 0.16);
  --panel: rgba(247, 239, 216, 0.08);
  --panel-strong: rgba(247, 239, 216, 0.14);
  --glow: rgba(255, 184, 77, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 184, 77, 0.22), transparent 34rem),
    radial-gradient(circle at 82% 10%, rgba(125, 211, 252, 0.16), transparent 32rem),
    linear-gradient(135deg, #17120e 0%, #0f1117 52%, #17100d 100%);
  color: var(--paper);
  font-family: "Iowan Old Style", "Songti SC", "Noto Serif SC", Georgia, serif;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  z-index: 20;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 17px 17px;
  mix-blend-mode: overlay;
}

.hero, main, .footer, .detail-nav, .detail-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
}

.brand, .nav-links { display: flex; align-items: center; gap: 14px; }
.brand { font-weight: 800; letter-spacing: .04em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 40px var(--glow);
}
.nav-links { color: rgba(247, 239, 216, .72); font-size: 14px; }
.nav-links a { transition: color .2s ease, transform .2s ease; }
.nav-links a:hover { color: var(--paper); transform: translateY(-1px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 48px;
  align-items: center;
  min-height: 610px;
  padding: 42px 0 84px;
}

.eyebrow {
  margin: 0 0 16px;
  color: #ffcf79;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
.hero h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: clamp(48px, 8vw, 104px);
  line-height: .92;
  letter-spacing: -0.07em;
}
.hero-copy {
  max-width: 700px;
  color: rgba(247, 239, 216, .76);
  font-size: 19px;
  line-height: 1.9;
}
.hero-actions, .detail-footer { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }
.primary-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 14px 20px;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
  font-weight: 800;
}
.primary-btn { background: var(--paper); color: var(--ink); box-shadow: 0 18px 70px rgba(247,239,216,.18); }
.ghost-btn { border: 1px solid var(--line); color: var(--paper); background: rgba(247,239,216,.05); }

.terminal-card {
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 26px;
  background: linear-gradient(145deg, rgba(247,239,216,.13), rgba(247,239,216,.05));
  box-shadow: 0 35px 110px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.12);
  transform: rotate(2deg);
}
.terminal-top { display: flex; gap: 8px; margin-bottom: 20px; }
.terminal-top span { width: 11px; height: 11px; border-radius: 50%; background: #ffcf79; }
.terminal-top span:nth-child(2) { background: #7dd3fc; }
.terminal-top span:nth-child(3) { background: #86efac; }
pre {
  overflow: auto;
  margin: 0 0 20px;
  color: #d9f99d;
  font: 15px/1.8 "SFMono-Regular", Consolas, monospace;
}
.terminal-card p { color: rgba(247,239,216,.68); line-height: 1.8; }

.lab-section, .article-section { padding: 74px 0; }
.section-heading { margin-bottom: 28px; }
.section-heading h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  letter-spacing: -0.055em;
}
.split { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.section-note { color: rgba(247,239,216,.62); }

.lab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.lab-grid article {
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  background: rgba(247,239,216,.06);
}
.lab-grid span { color: #ffcf79; font-weight: 900; }
.lab-grid h3 { margin: 32px 0 12px; font-size: 24px; }
.lab-grid p { color: rgba(247,239,216,.68); line-height: 1.8; }

.article-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.article-card {
  position: relative;
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 20px;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(247,239,216,.11), rgba(247,239,216,.045));
  animation: rise .55s ease both;
  animation-delay: var(--delay);
  transition: transform .24s ease, border-color .24s ease, background .24s ease;
}
.article-card::before {
  content: "";
  position: absolute;
  inset: auto 20px 0 20px;
  height: 3px;
  background: var(--accent);
  border-radius: 99px 99px 0 0;
}
.article-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent), white 20%); background: rgba(247,239,216,.12); }
.thumb {
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: color-mix(in srgb, var(--accent), transparent 82%);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  color: rgba(247,239,216,.58);
  font: 12px/1.2 "Avenir Next", "PingFang SC", sans-serif;
}
.meta span:first-child { color: var(--accent); font-weight: 900; }
.article-card h3 { margin-bottom: 10px; font-size: 25px; line-height: 1.25; letter-spacing: -.03em; }
.article-card p { color: rgba(247,239,216,.68); line-height: 1.75; }
.card-arrow { position: absolute; right: 18px; top: 16px; color: var(--accent); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 32px 0 46px;
  color: rgba(247,239,216,.58);
}
.footer a { color: var(--paper); }

.detail-body { background: linear-gradient(140deg, #11100f, #17110e 58%, #0e1216); }
.detail-shell { padding: 34px 0 80px; }
.detail-article {
  border: 1px solid var(--line);
  border-radius: 42px;
  padding: clamp(24px, 5vw, 58px);
  background: linear-gradient(145deg, rgba(247,239,216,.11), rgba(247,239,216,.045));
  box-shadow: 0 45px 120px rgba(0,0,0,.28);
}
.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 38px;
  align-items: center;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
}
.detail-hero h1 { font-size: clamp(42px, 6vw, 80px); line-height: 1; letter-spacing: -.06em; }
.detail-hero p:not(.eyebrow) { color: rgba(247,239,216,.74); font-size: 19px; line-height: 1.8; }
.detail-hero img {
  border-radius: 30px;
  background: color-mix(in srgb, var(--accent), transparent 82%);
  box-shadow: 0 28px 80px color-mix(in srgb, var(--accent), transparent 76%);
}
.detail-content {
  max-width: 800px;
  margin: 44px auto 0;
}
.detail-content p {
  color: rgba(247,239,216,.78);
  font-size: 20px;
  line-height: 2.05;
}
.not-found { min-height: 60vh; display: grid; place-content: center; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 920px) {
  .hero-grid, .detail-hero { grid-template-columns: 1fr; min-height: auto; }
  .terminal-card { transform: none; }
  .lab-grid, .article-list { grid-template-columns: 1fr; }
  .detail-hero img { max-width: 360px; }
}

@media (max-width: 620px) {
  .hero, main, .footer, .detail-nav, .detail-shell { width: min(100% - 24px, 1180px); }
  .nav, .footer, .split { align-items: flex-start; flex-direction: column; }
  .nav-links { flex-wrap: wrap; }
  .hero h1 { font-size: 48px; }
  .article-card { grid-template-columns: 1fr; }
  .thumb { min-height: 180px; }
}
