:root {
  color-scheme: dark;
  --bg: #080b10;
  --surface: #0f141d;
  --surface-2: #151b26;
  --surface-3: #1b2230;
  --text: #f4f6fa;
  --muted: #99a5b8;
  --soft: #c6ceda;
  --line: rgba(255,255,255,.09);
  --accent: #5b8cff;
  --accent-2: #8a63ff;
  --success: #49c58a;
  --warning: #e5b85c;
  --danger: #ef7b76;
  --shadow: 0 28px 90px rgba(0,0,0,.34);
  --content: 1240px;
  --reader: 760px;
  --header: 76px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-2: #eff2f7;
  --surface-3: #e7ebf2;
  --text: #151a24;
  --muted: #667188;
  --soft: #39455a;
  --line: rgba(21,31,50,.12);
  --shadow: 0 24px 80px rgba(35,48,72,.12);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; }
img, svg { max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(var(--content), calc(100% - 40px));
  min-height: var(--header);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-symbol {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 15px);
  grid-template-rows: repeat(2, 15px);
  gap: 3px;
  width: 36px;
  height: 36px;
}
.brand-symbol i { border: 2px solid currentColor; border-radius: 2px; }
.brand-symbol::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.brand strong { display: block; font-size: 19px; line-height: 1; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.desktop-nav { justify-self: center; display: flex; align-items: center; gap: 22px; }
.desktop-nav a { text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 650; }
.desktop-nav a:hover { color: var(--text); }
.header-actions { display: flex; gap: 8px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-button:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.menu-button { display: none; }
.mobile-nav { display: none; }
.mobile-nav.open { display: grid; }

.search-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  padding: max(90px, 10vh) 20px 20px;
  background: rgba(3,6,11,.82);
  backdrop-filter: blur(18px);
}
.search-panel.open { display: block; }
.search-inner {
  position: relative;
  width: min(760px,100%);
  max-height: calc(100vh - 130px);
  margin: 0 auto;
  padding: 24px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-inner > .icon-button { position: absolute; top: 18px; right: 18px; }
.search-inner label { display: grid; gap: 9px; padding-right: 54px; color: var(--muted); font-size: 12px; font-weight: 750; }
.search-inner input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  outline: 0;
}
.search-inner input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 13%,transparent); }
.search-results { display: grid; gap: 9px; margin-top: 18px; }
.search-result { display: block; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); text-decoration: none; }
.search-result strong { display: block; }
.search-result small { color: var(--muted); }

main { min-height: 60vh; }
.kicker, .category { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.category { text-decoration: none; letter-spacing: .12em; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button:hover { transform: translateY(-1px); }

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 10% 5%, color-mix(in srgb,var(--accent) 14%,transparent), transparent 33%),
    radial-gradient(circle at 90% 10%, color-mix(in srgb,var(--accent-2) 13%,transparent), transparent 30%),
    var(--bg);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--line) 1px,transparent 1px), linear-gradient(90deg,var(--line) 1px,transparent 1px);
  background-size: 50px 50px;
  mask-image: linear-gradient(90deg,transparent,black 55%,transparent);
  opacity: .28;
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--content),calc(100% - 40px));
  min-height: min(760px, calc(100vh - var(--header)));
  margin: 0 auto;
  padding: 72px 0 58px;
  display: grid;
  grid-template-columns: minmax(0,.8fr) minmax(460px,1.2fr);
  gap: 64px;
  align-items: center;
}
.hero-copy h1 { margin: 10px 0 20px; font-size: clamp(58px,8vw,108px); line-height: .88; letter-spacing: -.065em; }
.hero-copy p { max-width: 620px; margin: 0; color: var(--soft); font-size: clamp(18px,2vw,23px); line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.featured-wrap { min-width: 0; }
.featured-copy { padding: 22px 4px 0; }
.featured-copy h2 { margin: 6px 0 8px; font-size: clamp(27px,3vw,42px); line-height: 1.08; letter-spacing: -.035em; }
.featured-copy h2 a { text-decoration: none; }
.featured-copy p { margin: 0; color: var(--muted); }
.byline { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 15px; color: var(--muted); font-size: 11px; font-weight: 650; }

.cover {
  --cover-accent: var(--accent);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(140deg, color-mix(in srgb,var(--cover-accent) 16%,transparent), transparent 52%),
    linear-gradient(35deg, var(--surface-2), #0a0f18);
  color: #f4f6fa;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,.06) 1px,transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(135deg,black,transparent 72%);
}
.cover > * { position: relative; z-index: 2; }
.cover > span { color: var(--cover-accent); font-size: 11px; font-weight: 850; letter-spacing: .18em; }
.cover > strong { max-width: 86%; margin: auto 0 24px; font-size: clamp(25px,3vw,44px); line-height: 1.04; letter-spacing: -.035em; }
.cover > small { color: #aab4c4; }
.cover.large { aspect-ratio: 16/10; min-height: 330px; }
.cover.large > strong { font-size: clamp(36px,5vw,72px); }
.cover-lines {
  position: absolute;
  z-index: 1;
  right: 4%;
  top: 24%;
  width: 34%;
  height: 58%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 100px 0 0 100px;
  background: rgba(255,255,255,.025);
}
.cover-lines i { position: absolute; left: 22%; right: 0; height: 7px; background: var(--cover-accent); opacity: .9; }
.cover-lines i::before { content: ""; position: absolute; left: -11px; top: -6px; width: 16px; height: 16px; border: 5px solid var(--cover-accent); border-radius: 50%; background: #0d121c; }
.cover-lines i:nth-child(1) { top: 18%; }
.cover-lines i:nth-child(2) { top: 40%; opacity: .65; }
.cover-lines i:nth-child(3) { top: 62%; }
.cover-lines i:nth-child(4) { top: 82%; opacity: .65; }

.topic-rail { border-bottom: 1px solid var(--line); }
.topic-rail > div { width: min(var(--content),calc(100% - 40px)); margin: 0 auto; display: flex; gap: 9px; overflow-x: auto; padding: 16px 0; scrollbar-width: none; }
.topic-rail a { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; }
.topic-rail a:hover { color: var(--text); border-color: color-mix(in srgb,var(--accent) 40%,var(--line)); }

.section { width: min(var(--content),calc(100% - 40px)); margin: 0 auto; padding: 80px 0; }
.section-head { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; margin-bottom: 27px; }
.section-head h2 { margin: 6px 0 0; font-size: clamp(32px,4vw,54px); line-height: 1; letter-spacing: -.045em; }
.section-head p { max-width: 660px; margin: 13px 0 0; color: var(--muted); }
.section-head > a { color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 750; }
.article-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.article-card { min-width: 0; }
.article-card .cover { box-shadow: none; }
.article-card-body { padding: 20px 3px 0; }
.article-card h2 { margin: 7px 0 9px; font-size: clamp(23px,2.5vw,34px); line-height: 1.12; letter-spacing: -.03em; }
.article-card h2 a { text-decoration: none; }
.article-card p { margin: 0; color: var(--muted); }

.lab-section { border-block: 1px solid var(--line); background: var(--surface); }
.lab-inner { width: min(var(--content),calc(100% - 40px)); margin: 0 auto; padding: 80px 0; }
.lab-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.popular ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.popular li { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.popular li > span { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.popular li > a { text-decoration: none; font-size: clamp(19px,2vw,27px); font-weight: 740; letter-spacing: -.025em; }
.popular li > small { color: var(--muted); }
.product-band {
  width: min(var(--content),calc(100% - 40px));
  margin: 0 auto 80px;
  padding: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  border: 1px solid color-mix(in srgb,var(--accent) 28%,var(--line));
  border-radius: 20px;
  background: linear-gradient(130deg,color-mix(in srgb,var(--accent) 10%,var(--surface)),var(--surface));
}
.product-band h2 { margin: 7px 0 10px; font-size: clamp(31px,4vw,54px); letter-spacing: -.045em; line-height: 1; }
.product-band p { max-width: 700px; margin: 0; color: var(--muted); }
.product-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 9px; }

.listing-hero, .info-head {
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 15% 0,color-mix(in srgb,var(--accent) 12%,transparent),transparent 35%);
}
.listing-hero > div, .info-head {
  width: min(var(--content),calc(100% - 40px));
  margin: 0 auto;
  padding: 80px 0 60px;
}
.listing-hero h1, .info-head h1 { margin: 7px 0 15px; font-size: clamp(50px,8vw,96px); line-height: .92; letter-spacing: -.06em; }
.listing-hero p, .info-head p { max-width: 750px; margin: 0; color: var(--soft); font-size: 20px; }

.article-header {
  width: min(1020px,calc(100% - 40px));
  margin: 0 auto;
  padding: 68px 0 42px;
}
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 25px; color: var(--muted); font-size: 11px; }
.breadcrumbs a { text-decoration: none; }
.article-header h1 { max-width: 980px; margin: 10px 0 20px; font-size: clamp(48px,7.5vw,92px); line-height: .94; letter-spacing: -.057em; }
.standfirst { max-width: 850px; margin: 0; color: var(--soft); font-size: clamp(19px,2.2vw,26px); line-height: 1.5; }
.article-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.article-meta div { min-width: 0; }
.article-meta span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.article-meta strong { display: block; margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }
.article-meta a { text-decoration: none; }
.article-cover { width: min(var(--content),calc(100% - 40px)); margin: 0 auto; }
.article-cover .cover { width: 100%; }
.article-layout { width: min(1060px,calc(100% - 40px)); margin: 0 auto; padding: 65px 0 90px; display: grid; grid-template-columns: 220px minmax(0,var(--reader)); gap: 70px; justify-content: center; align-items: start; }
.toc { position: sticky; top: calc(var(--header) + 24px); display: grid; gap: 9px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toc strong { margin-bottom: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.toc a { color: var(--muted); text-decoration: none; font-size: 12px; line-height: 1.4; }
.toc a:hover { color: var(--accent); }
.prose { min-width: 0; font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif; font-size: 18px; line-height: 1.78; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.35em; }
.prose h2 { margin: 2.1em 0 .65em; font-family: Inter,ui-sans-serif,system-ui,sans-serif; font-size: clamp(28px,3vw,42px); line-height: 1.12; letter-spacing: -.035em; scroll-margin-top: calc(var(--header) + 22px); }
.prose h3 { margin: 1.8em 0 .55em; font-family: Inter,ui-sans-serif,system-ui,sans-serif; font-size: 24px; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.35em; }
.prose li { margin-bottom: .55em; }
.prose a { color: var(--accent); }
.prose pre { margin: 1.7em 0; padding: 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #0c111a; color: #dce4f0; font: 14px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace; }
.prose code { font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: .86em; }
.prose hr { margin: 3em 0; border: 0; border-top: 1px solid var(--line); }
.ad-placeholder { min-height: 100px; margin: 0 0 2em; display: grid; place-items: center; align-content: center; gap: 3px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-family: Inter,ui-sans-serif,system-ui,sans-serif; text-align: center; }
.ad-placeholder span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.ad-placeholder small { font-size: 10px; }
.production-note { padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.production-note h2 { margin-top: 0; font-size: 24px; }
.production-note p { margin-bottom: 0; color: var(--muted); }
.author-box { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 20px; margin-top: 28px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-family: Inter,ui-sans-serif,system-ui,sans-serif; }
.avatar { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: color-mix(in srgb,var(--accent) 16%,var(--surface-2)); color: var(--accent); font-weight: 900; }
.author-box h2 { margin: 4px 0 7px; font-size: 26px; }
.author-box p { margin: 0 0 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.author-box a { font-size: 13px; font-weight: 750; }
.related { padding-top: 0; }

.info-page { padding-bottom: 90px; }
.info-page .prose { width: min(var(--reader),calc(100% - 40px)); margin: 60px auto 0; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { width: min(var(--content),calc(100% - 40px)); margin: 0 auto; padding: 58px 0 44px; display: grid; grid-template-columns: 1.6fr repeat(3,1fr); gap: 45px; }
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.footer-brand { text-decoration: none; font-size: 22px; font-weight: 850; }
.footer-grid p { max-width: 390px; margin: 2px 0 0; color: var(--muted); }
.footer-grid strong { margin-bottom: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.footer-grid a, .footer-link { border: 0; padding: 0; background: transparent; color: var(--muted); text-decoration: none; font-size: 12px; cursor: pointer; }
.footer-grid a:hover, .footer-link:hover { color: var(--text); }
.footer-bottom { width: min(var(--content),calc(100% - 40px)); margin: 0 auto; padding: 18px 0; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.consent {
  position: fixed;
  z-index: 90;
  left: 20px;
  right: 20px;
  bottom: 20px;
  width: min(780px,calc(100% - 40px));
  margin: auto;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.consent[hidden] { display: none; }
.consent strong { display: block; }
.consent p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.consent-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.consent button { min-height: 39px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 750; font-size: 12px; }
.consent button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }

.reading-progress { position: fixed; z-index: 70; top: var(--header); left: 0; height: 2px; width: 0; background: var(--accent); }

@media (max-width: 1100px) {
  .desktop-nav { display: none; }
  .menu-button { display: inline-grid; }
  .mobile-nav { width: min(var(--content),calc(100% - 40px)); margin: 0 auto; padding: 0 0 18px; grid-template-columns: repeat(3,1fr); gap: 8px; }
  .mobile-nav a { padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); text-decoration: none; text-align: center; font-size: 12px; }
  .hero-inner { grid-template-columns: 1fr; gap: 50px; min-height: auto; }
  .hero-copy h1 { max-width: 800px; }
  .featured-wrap { max-width: 900px; }
  .article-layout { grid-template-columns: 1fr; gap: 30px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 9px 14px; }
  .toc strong { width: 100%; }
  .footer-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  :root { --header: 68px; }
  .header-inner { width: min(100% - 24px,var(--content)); gap: 12px; }
  .brand strong { font-size: 17px; }
  .brand-symbol { transform: scale(.9); transform-origin: left center; }
  .icon-button { width: 40px; height: 40px; }
  .mobile-nav { grid-template-columns: repeat(2,1fr); width: calc(100% - 24px); }
  .hero-inner, .section, .lab-inner, .article-header, .article-cover, .article-layout, .footer-grid, .footer-bottom, .product-band { width: calc(100% - 28px); }
  .hero-inner { padding: 54px 0 38px; }
  .hero-copy h1 { font-size: clamp(52px,18vw,78px); }
  .hero-copy p { font-size: 18px; }
  .cover.large { min-height: 0; aspect-ratio: 16/9; padding: 18px; }
  .cover.large > strong { max-width: 80%; font-size: clamp(26px,8vw,48px); }
  .section, .lab-inner { padding: 56px 0; }
  .section-head { align-items: flex-start; }
  .article-grid, .lab-grid { grid-template-columns: 1fr; gap: 35px; }
  .article-card .cover { aspect-ratio: 16/9; min-height: 0; }
  .popular li { grid-template-columns: 42px minmax(0,1fr); }
  .popular li small { grid-column: 2; }
  .product-band { display: grid; padding: 25px; margin-bottom: 56px; }
  .article-header { padding: 50px 0 32px; }
  .article-header h1 { font-size: clamp(44px,13vw,72px); }
  .article-meta { grid-template-columns: repeat(2,1fr); }
  .article-layout { padding: 44px 0 60px; }
  .prose { font-size: 17px; line-height: 1.72; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 35px 24px; }
  .footer-grid > div:first-child { grid-column: 1/-1; }
  .consent { align-items: stretch; flex-direction: column; gap: 14px; }
  .consent-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .brand small { display: none; }
  .header-actions { gap: 5px; }
  .hero-copy h1 { font-size: 51px; }
  .hero-actions, .product-actions { display: grid; grid-template-columns: 1fr; }
  .cover { min-height: 190px; padding: 18px; }
  .cover > strong { font-size: 25px; }
  .article-meta { gap: 17px; }
  .article-header h1 { font-size: 43px; overflow-wrap: anywhere; }
  .standfirst { font-size: 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div:first-child { grid-column: auto; }
  .footer-bottom { display: grid; }
  .author-box { grid-template-columns: 1fr; }
  .avatar { width: 58px; height: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
