:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-2: #fbfbfd;
  --panel: rgba(255, 255, 255, 0.7);
  --panel-strong: rgba(255, 255, 255, 0.88);
  --text: #17191d;
  --muted: #676d78;
  --line: rgba(23, 25, 29, 0.08);
  --accent: #3867ff;
  --accent-soft: rgba(56, 103, 255, 0.1);
  --code-bg: #101521;
  --code-text: #edf2ff;
  --shadow: 0 24px 80px rgba(20, 28, 46, 0.08);
  --shadow-soft: 0 12px 32px rgba(20, 28, 46, 0.06);
  --max: 1180px;
  --page-pad: max(1.375rem, calc((100vw - var(--max)) / 2 + 1.375rem));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(173, 196, 255, 0.26), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 218, 185, 0.22), transparent 28%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 54%, #f2f3f7 100%);
  color: var(--text);
  font: 16px/1.65 "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 22%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.6), transparent 42%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 180ms ease;
}

a:hover {
  color: #204dd6;
}

img {
  max-width: 100%;
  height: auto;
}

code,
pre {
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

.site-shell {
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: absolute;
  top: 1rem;
  left: var(--page-pad);
  right: var(--page-pad);
  padding: 0;
  z-index: 8;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.72rem 0.92rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.36);
  backdrop-filter: blur(16px);
  color: #121418;
  text-decoration: none;
  font: 600 0.96rem/1.2 "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.menu-button,
.menu-close {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(18px);
  color: var(--text);
  font: 500 0.92rem/1.2 "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.menu-button {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.26rem;
  width: 3rem;
  height: 3rem;
  padding: 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.menu-button span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.menu-close {
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.menu-button:hover,
.menu-close:hover,
.button-secondary:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(20, 28, 46, 0.08);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 25, 33, 0.16);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.site-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(30rem, calc(100vw - 1.25rem));
  padding: 1.35rem;
  background: rgba(252, 252, 254, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-right: 0;
  box-shadow: -24px 0 64px rgba(18, 25, 41, 0.12);
  backdrop-filter: blur(26px);
  overflow-y: auto;
  z-index: 21;
}

.menu-open {
  overflow: hidden;
}

.menu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.menu-header h2 {
  margin: 0;
  font: 400 2rem/1 "Instrument Serif", "Times New Roman", serif;
}

.menu-about-link {
  display: inline-flex;
  margin-bottom: 1rem;
  color: var(--text);
  text-decoration: none;
  font: 500 0.97rem/1.2 "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.menu-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

.menu-item {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.7rem 0.75rem;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 180ms ease, transform 180ms ease;
}

.menu-item:hover,
.menu-item.is-active {
  background: rgba(255, 255, 255, 0.72);
  transform: translateX(-1px);
}

.hero {
  padding: 3rem 0 2rem;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: clamp(8.6rem, 13vw, 10.5rem) var(--page-pad) clamp(0.8rem, 2vw, 1.2rem);
  min-height: 50rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-shadow: 1px 1px 2px #ccc;
}

.hero-card::after {
  content: none;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.article-header .eyebrow,
.article-header h1,
.article-header .article-meta,
.article-header .lede {
  width: min(100%, 42rem);
}

.eyebrow {
  display: inline-flex;
  align-self: flex-start;
  margin: 0 0 0.5rem;
  color: var(--text);
  padding: 0;
  font: 600 0.78rem/1.2 "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.article-header h1 {
  margin: 0;
  max-width: 11ch;
  font: 400 clamp(3.25rem, 7vw, 6rem)/0.95 "Instrument Serif", "Times New Roman", serif;
  letter-spacing: -0.04em;
  color: #121418;
}

.hero p,
.lede {
  max-width: 42rem;
  margin: 0.45rem 0 0;
  color: var(--text);
  font-size: 1.04rem;
}

.hero-actions,
.article-nav,
.reader-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.reader-nav-bottom {
  margin-top: 2.4rem;
  padding-top: 1.1rem;
}

#reader-nav-top {
  justify-content: space-between;
  align-items: center;
  margin-top: 0.45rem;
  margin-bottom: 2rem;
}

.nav-link-prev {
  margin-right: auto;
}

.nav-link-next {
  margin-left: auto;
}

.hero-actions {
  margin-top: 1.5rem;
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.76rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(23, 25, 29, 0.08);
  text-decoration: none;
  font: 500 0.92rem/1.2 "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.button {
  background: rgba(23, 25, 29, 0.92);
  border-color: rgba(23, 25, 29, 0.16);
  color: #fafbff;
}

.button:hover {
  color: white;
  background: #0f1217;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(14px);
  color: var(--text);
}

.layout {
  display: grid;
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.panel {
  padding: 1.5rem;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.panel p:last-child,
.panel ul:last-child,
.panel ol:last-child {
  margin-bottom: 0;
}

.summary-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.search-box {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(23, 25, 29, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px);
  color: var(--text);
  font: 500 0.98rem/1.3 "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.section-list {
  display: grid;
  gap: 1rem;
}

.arc {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.9));
}

.arc h3 {
  margin-bottom: 0.25rem;
}

.arc p {
  margin-top: 0;
  color: var(--muted);
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.article-list li {
  margin: 0;
}

.article-link {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  text-decoration: none;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
}

.article-link:hover {
  background: rgba(255, 255, 255, 0.72);
}

.article-num {
  min-width: 2.5rem;
  color: var(--muted);
  font: 600 0.9rem/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.article-title {
  color: var(--text);
}

.site-footer {
  padding: 0 0 3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.article-page {
  padding: 0 0 3.5rem;
}

.article-header {
  margin-bottom: 1.8rem;
}

.about-layout {
  gap: 2rem;
  padding-bottom: 3rem;
}

.article-frame {
  padding: 0 0 1rem;
}

.article-meta {
  color: var(--text);
  font: 500 0.93rem/1.45 "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hero-media {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
}

.hero-media + .reader-nav {
  margin-top: 1.6rem;
}

.hero-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  filter: saturate(0.9) contrast(0.98) brightness(1.02);
  opacity: 0.94;
  transform: none;
  object-position: center top;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.98) 46%, rgba(0, 0, 0, 0.8) 66%, rgba(0, 0, 0, 0.34) 86%, rgba(0, 0, 0, 0) 100%);
}

.markdown-body {
  font: 1.1rem/1.82 Georgia, "Times New Roman", serif;
  color: color-mix(in srgb, var(--text) 92%, white);
}

.article-column {
  width: min(100%, 46rem);
  margin: 0 auto;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  line-height: 1.2;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

.markdown-body h1 {
  font: 400 2.2rem/1.02 "Instrument Serif", "Times New Roman", serif;
}

.markdown-body h2 {
  padding-bottom: 0.15rem;
  border-bottom: 0;
  font: 400 1.7rem/1.08 "Instrument Serif", "Times New Roman", serif;
}

.markdown-body h3,
.markdown-body h4 {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
}

.markdown-body pre {
  overflow-x: auto;
  padding: 1.05rem 1.1rem;
  border-radius: 24px;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 34px rgba(12, 18, 30, 0.12);
  font-size: 1rem;
  line-height: 1.55;
}

.markdown-body code {
  background: rgba(56, 103, 255, 0.08);
  padding: 0.1rem 0.32rem;
  border-radius: 0.5rem;
  font-size: 0.92em;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.markdown-body pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 0;
  background: transparent;
  color: var(--code-text);
  font-size: 0.8rem;
  line-height: 1.3;
}

.markdown-body blockquote {
  margin: 1rem 0;
  padding: 0.1rem 0 0.1rem 1.2rem;
  border-left: 3px solid rgba(56, 103, 255, 0.28);
  color: #565d68;
}

.markdown-body hr {
  border: 0;
  border-top: 1px solid rgba(23, 25, 29, 0.08);
  margin: 2rem 0;
}

.status {
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 700px) {
  .panel {
    border-radius: 26px;
  }

  .site-menu {
    width: calc(100vw - 0.5rem);
    padding: 1rem 0.9rem;
  }

  .article-link {
    flex-direction: column;
    gap: 0.2rem;
  }

  .reader-nav {
    flex-direction: column;
  }

  .hero-card {
    padding: 7.2rem 1.375rem 0.9rem;
    min-height: 50rem;
    justify-content: flex-end;
  }

  #reader-nav-top {
    margin-top: 0.2rem;
    margin-bottom: 1.2rem;
  }

  .site-topbar {
    left: 1.375rem;
    right: 1.375rem;
  }

  .article-header .eyebrow,
  .article-header h1,
  .article-header .article-meta,
  .article-header .lede,
  .article-column {
    width: 100%;
  }

  .hero h1,
  .article-header h1 {
    max-width: 100%;
    font-size: clamp(2.8rem, 13vw, 4rem);
  }

  .markdown-body {
    font-size: 1.02rem;
  }

  .reader-nav {
    gap: 0.65rem;
  }

  .nav-link-prev,
  .nav-link-next {
    margin: 0;
  }
}
