:root {
  --blue-950: #07182d;
  --blue-900: #102949;
  --blue-800: #173a68;
  --blue-700: #2457a7;
  --blue-600: #2f6fd0;
  --blue-100: #dff0ff;
  --blue-050: #f3f9ff;
  --cyan-100: #d6f5ff;
  --ink: #172133;
  --muted: #5f6f84;
  --line: #d7e3ef;
  --paper: #ffffff;
  --page: #f6fbff;
  --shadow: 0 22px 70px rgba(20, 57, 105, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans", Arial, sans-serif;
  line-height: 1.6;
  background:
    linear-gradient(180deg, rgba(243, 249, 255, 0.92), #fff 580px),
    radial-gradient(circle at 76px 76px, rgba(47, 111, 208, 0.09) 0 1px, transparent 1px),
    var(--page);
  background-size: auto, 28px 28px, auto;
}

a {
  color: var(--blue-700);
  text-decoration: none;
}

a:hover {
  color: var(--blue-600);
}

img {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 12px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(215, 227, 239, 0.86);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.site-header > nav {
  margin-left: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--blue-950);
}

.brand-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-title {
  color: var(--blue-950);
  font-size: 0.98rem;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 2.8vw, 28px);
  font-size: 0.93rem;
  font-weight: 650;
}

.nav-links a {
  color: var(--blue-900);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.language-option {
  min-width: 42px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  background: transparent;
  cursor: pointer;
}

.language-option:hover {
  color: var(--blue-800);
  background: var(--blue-050);
}

.language-option.active {
  color: #fff;
  background: var(--blue-700);
}

.section-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.88fr);
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: clamp(58px, 8vw, 112px) 0 clamp(42px, 7vw, 88px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue-700);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--blue-950);
  line-height: 1.08;
}

h1 {
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 8vw, 7.1rem);
  font-weight: 700;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 700;
}

h3 {
  font-size: 1.08rem;
}

.hero-lead {
  max-width: 660px;
  margin: 24px 0 0;
  color: #3b4d66;
  font-size: clamp(1.02rem, 1.55vw, 1.22rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--blue-700);
  border-radius: 6px;
  font-weight: 750;
}

.button-primary {
  color: #fff;
  background: var(--blue-700);
}

.button-primary:hover {
  color: #fff;
  background: var(--blue-600);
}

.button-secondary {
  color: var(--blue-800);
  background: rgba(255, 255, 255, 0.78);
}

.button-secondary:hover {
  background: var(--blue-050);
}

.hero-board {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(119, 158, 205, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(232, 244, 255, 0.76)),
    var(--paper);
  box-shadow: var(--shadow);
}

.board-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(36, 87, 167, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 87, 167, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 92%);
}

.projection-diagram {
  position: absolute;
  inset: 24px;
  width: calc(100% - 48px);
  height: calc(100% - 48px);
}

.axis path,
.sample-grid path,
.mesh-lines path,
.projection-rays path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.axis path {
  stroke: #1b4f9c;
  stroke-width: 2.6;
}

.axis text,
.formula text {
  fill: var(--blue-800);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-style: italic;
}

.sample-grid path {
  stroke: rgba(36, 87, 167, 0.32);
  stroke-width: 1.6;
}

.mesh-lines path {
  stroke: #0d2850;
  stroke-width: 2;
}

.triangle-surface {
  fill: url("#triangle-fill");
  opacity: 0.52;
  stroke: #18447d;
  stroke-width: 2.4;
}

.projection-rays path {
  stroke: rgba(39, 110, 208, 0.44);
  stroke-dasharray: 7 8;
  stroke-width: 2;
}

.learning-section,
.contribute-section {
  padding: clamp(70px, 9vw, 112px) 0;
}

.bookshelf-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: clamp(28px, 5vw, 60px);
  align-items: end;
  padding: clamp(64px, 9vw, 116px) 0 34px;
}

.bookshelf-hero h1 {
  max-width: 900px;
  font-size: clamp(3rem, 7vw, 6rem);
}

.bookshelf-hero p:not(.eyebrow) {
  max-width: 780px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
}

.shelf-summary {
  display: grid;
  gap: 6px;
  justify-items: end;
  padding: 18px 0;
  border-block: 1px solid var(--line);
}

.shelf-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shelf-summary strong {
  color: var(--blue-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  line-height: 1;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading p:not(.eyebrow) {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.section-heading.compact {
  max-width: 680px;
}

.section-heading.wide {
  max-width: 850px;
}

.section-link {
  display: inline-flex;
  margin-top: 18px;
  font-weight: 800;
}

.notes-list {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 10px;
}

.note-link {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--blue-950);
  font: inherit;
  text-align: left;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.note-link:hover,
.note-link.active {
  border-color: rgba(47, 111, 208, 0.68);
  background: #fff;
  box-shadow: 0 10px 30px rgba(26, 76, 140, 0.1);
}

.note-link span {
  font-weight: 800;
}

.note-link small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.chapter-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chapter-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-950);
  background: rgba(255, 255, 255, 0.86);
}

.chapter-card:hover,
.chapter-card.active {
  border-color: rgba(47, 111, 208, 0.72);
  color: var(--blue-950);
  background: #fff;
  box-shadow: 0 12px 34px rgba(26, 76, 140, 0.11);
}

.chapter-card span {
  font-weight: 850;
}

.chapter-card small {
  color: var(--muted);
  font-size: 0.84rem;
}

.markdown-panel {
  min-height: 520px;
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(20, 57, 105, 0.08);
}

.markdown-status {
  color: var(--muted);
  font-size: 0.94rem;
}

.markdown-status:empty {
  display: none;
}

.markdown-content {
  color: #26374d;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  color: var(--blue-950);
}

.markdown-content h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 18px;
}

.markdown-content h2 {
  margin-top: 36px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 1.65rem;
}

.markdown-content h3 {
  margin-top: 28px;
  font-size: 1.2rem;
}

.markdown-content p,
.markdown-content ul,
.markdown-content ol,
.markdown-content blockquote,
.markdown-content table,
.markdown-content pre {
  margin: 16px 0;
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 1.35rem;
}

.markdown-content code {
  padding: 0.12rem 0.32rem;
  border-radius: 4px;
  color: #163b71;
  background: #eaf4ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.markdown-content pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid #d6e6f6;
  border-radius: 7px;
  background: #07182d;
}

.markdown-content pre code {
  padding: 0;
  color: #e6f3ff;
  background: transparent;
}

.markdown-content blockquote {
  padding: 10px 18px;
  border-left: 4px solid var(--blue-600);
  color: #3f526c;
  background: #f4f9ff;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.markdown-content th,
.markdown-content td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.markdown-content th {
  color: var(--blue-950);
  background: var(--blue-050);
}

.learning-map {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 34px;
  border: 1px solid var(--line);
  background: var(--line);
  box-shadow: 0 20px 70px rgba(20, 57, 105, 0.08);
}

.map-item {
  min-height: 260px;
  padding: clamp(22px, 3vw, 32px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.9)),
    #fff;
}

.map-item span {
  color: var(--blue-600);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.map-item h3 {
  margin-top: 44px;
  font-size: 1.12rem;
}

.map-item p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.formats-section {
  padding: clamp(70px, 9vw, 112px) 0;
  background:
    linear-gradient(180deg, rgba(7, 24, 45, 0.96), rgba(16, 41, 73, 0.98)),
    var(--blue-950);
}

.formats-section .eyebrow,
.formats-section h2 {
  color: #fff;
}

.content-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.content-type-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.content-type-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  content: "";
}

.content-type-card.blue::before {
  background: #70b5ff;
}

.content-type-card.teal::before {
  background: #59d2c8;
}

.content-type-card.rose::before {
  background: #ec7f9c;
}

.content-type-card.violet::before {
  background: #aa96ff;
}

.content-type-card strong {
  color: #9fd7ff;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content-type-card h3 {
  margin-top: 54px;
  color: #fff;
}

.content-type-card p {
  color: #c7dcf2;
}

.bookshelf-section {
  padding: 0 0 clamp(54px, 7vw, 86px);
}

.shelf-frame {
  position: relative;
  padding: clamp(24px, 4vw, 42px) clamp(18px, 4vw, 42px) 0;
  border: 1px solid #cad9e9;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(230, 242, 255, 0.7)),
    linear-gradient(90deg, rgba(36, 87, 167, 0.06) 1px, transparent 1px);
  background-size: auto, 36px 36px;
  box-shadow: 0 24px 80px rgba(20, 57, 105, 0.12);
}

.shelf-books {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: clamp(12px, 2vw, 22px);
  min-height: 330px;
  overflow-x: auto;
  padding: 10px 8px 0;
}

.shelf-board {
  height: 34px;
  margin: 0 -8px;
  border: 1px solid rgba(11, 43, 83, 0.22);
  border-radius: 5px;
  background:
    linear-gradient(180deg, #eaf3fc, #bfd6ef 54%, #91b2d6),
    #bfd6ef;
  box-shadow: 0 16px 34px rgba(20, 57, 105, 0.22);
}

.book-volume {
  position: relative;
  display: grid;
  align-content: space-between;
  flex: 0 0 clamp(108px, 13vw, 148px);
  height: var(--book-height);
  min-height: 238px;
  max-height: 320px;
  padding: 18px 13px 16px;
  border: 0;
  border-radius: 6px 4px 3px 6px;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transform-origin: bottom center;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    box-shadow 180ms ease;
  box-shadow:
    inset 9px 0 14px rgba(255, 255, 255, 0.18),
    inset -10px 0 18px rgba(0, 0, 0, 0.18),
    10px 12px 22px rgba(12, 37, 72, 0.2);
}

.book-volume::before,
.book-volume::after {
  position: absolute;
  content: "";
}

.book-volume::before {
  inset: 0 8px auto 8px;
  height: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.34);
}

.book-volume::after {
  top: 16px;
  right: -8px;
  width: 8px;
  height: calc(100% - 16px);
  border-radius: 0 5px 4px 0;
  background: rgba(6, 22, 43, 0.22);
}

.book-volume:hover,
.book-volume.active {
  filter: saturate(1.08);
  transform: translateY(-14px);
  box-shadow:
    inset 9px 0 14px rgba(255, 255, 255, 0.2),
    inset -10px 0 18px rgba(0, 0, 0, 0.18),
    14px 22px 34px rgba(12, 37, 72, 0.24);
}

.book-volume.active {
  outline: 3px solid rgba(47, 111, 208, 0.22);
  outline-offset: 5px;
}

.book-volume.blue {
  background: linear-gradient(135deg, #133e75, #2f6fd0 58%, #7fb6ed);
}

.book-volume.teal {
  background: linear-gradient(135deg, #0e5064, #2c9a9d 58%, #9be0d2);
}

.book-volume.rose {
  background: linear-gradient(135deg, #6f2448, #c45672 58%, #f0a7b3);
}

.book-volume.violet {
  background: linear-gradient(135deg, #402c78, #7059c8 58%, #b9a8f0);
}

.book-band {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16);
}

.book-volume strong {
  display: block;
  margin-top: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.12;
}

.book-volume small {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 750;
}

.reading-section {
  padding: 0 0 clamp(76px, 9vw, 120px);
}

.reading-shell {
  --article-width: min(1180px, calc(100% - 40px));
  --sidebar-width: 220px;
  --sidebar-gap: 28px;
  display: grid;
  grid-template-columns:
    max(20px, calc((100% - var(--article-width)) / 2 - var(--sidebar-width) - var(--sidebar-gap)))
    var(--sidebar-width)
    var(--sidebar-gap)
    minmax(0, var(--article-width))
    minmax(20px, 1fr);
  align-items: start;
  width: 100%;
  margin: 0 auto;
}

.volume-detail {
  display: grid;
  gap: 22px;
  align-items: start;
  min-width: 0;
}

.volume-detail-header {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(20, 57, 105, 0.08);
}

.volume-detail-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.volume-detail-header p:not(.eyebrow) {
  max-width: 780px;
  color: var(--muted);
}

.catalog-meta,
.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.catalog-meta span,
.topic-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cfe0f2;
  border-radius: 999px;
  color: var(--blue-800);
  font-size: 0.82rem;
  font-weight: 750;
  background: var(--blue-050);
}

.chapter-list {
  position: sticky;
  top: 100px;
  grid-column: 2;
  justify-self: stretch;
}

.article-panel {
  width: 100%;
}

.volume-detail {
  grid-column: 4;
}

.catalog-only {
  grid-column: auto;
}

.reader-main {
  padding: clamp(34px, 5vw, 70px) 0 clamp(76px, 9vw, 120px);
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 880px);
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.reader-sidebar {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 18px;
}

.back-link {
  font-weight: 850;
}

.reader-meta {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.reader-meta h2 {
  font-size: 1.45rem;
}

.reader-meta p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.92rem;
}

.reader-panel {
  min-width: 0;
}

.contribute-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1fr);
  gap: clamp(34px, 6vw, 82px);
  align-items: start;
}

.contribute-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.02rem;
}

.contribute-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.contribute-steps li {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 20px 20px 20px 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.contribute-steps li::before {
  position: absolute;
  top: 20px;
  left: 20px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  background: var(--blue-700);
  counter-increment: steps;
  content: counter(steps);
}

.contribute-steps strong {
  color: var(--blue-950);
}

.contribute-steps span {
  color: var(--muted);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
}

.site-footer img {
  width: min(340px, 52vw);
  height: auto;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .hero,
  .bookshelf-hero,
  .reading-shell,
  .reader-layout,
  .contribute-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-board {
    min-height: 360px;
  }

  .learning-map,
  .content-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .notes-list {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }

  .chapter-list {
    position: static;
    grid-column: auto;
  }

  .reader-sidebar {
    position: static;
  }

  .volume-detail {
    grid-column: auto;
  }

  .shelf-summary {
    justify-items: start;
  }
}

@media (max-width: 700px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
  }

  .brand-title,
  .brand-subtitle {
    white-space: normal;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .language-switcher {
    width: 100%;
  }

  .language-option {
    flex: 1;
  }

  .section-shell {
    width: min(100% - 28px, 1180px);
  }

  .hero {
    padding-top: 44px;
  }

  h1 {
    font-size: clamp(2.65rem, 15vw, 4.2rem);
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-board {
    min-height: 310px;
  }

  .projection-diagram {
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
  }

  .learning-map,
  .content-type-grid,
  .chapter-catalog {
    grid-template-columns: 1fr;
  }

  .markdown-panel {
    padding: 20px;
  }

  .contribute-steps li {
    padding-left: 68px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
