:root {
  --paper: #f5f1ea;
  --paper-deep: #ece4d8;
  --surface: rgba(255, 252, 247, 0.9);
  --surface-strong: #fffdfa;
  --ink: #18221d;
  --muted: #58635d;
  --soft: #76807a;
  --line: rgba(24, 34, 29, 0.1);
  --accent: #975d40;
  --accent-deep: #74452f;
  --olive: #657465;
  --gold: #b08a58;
  --shadow: 0 24px 70px rgba(22, 30, 26, 0.08);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --site-width: min(1360px, calc(100vw - 40px));
  --content-width: min(1040px, 100%);
  --body-font: "Instrument Sans", sans-serif;
  --display-font: "Instrument Sans", sans-serif;
  --sanskrit-font: "Noto Serif Devanagari", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(176, 138, 88, 0.12), transparent 24%),
    radial-gradient(circle at 92% 8%, rgba(101, 116, 101, 0.12), transparent 22%),
    linear-gradient(180deg, #fbf8f3 0%, var(--paper) 46%, #f0e8dc 100%);
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-telugu {
  --body-font: "Noto Sans Telugu", "Instrument Sans", sans-serif;
  --display-font: "Noto Sans Telugu", "Instrument Sans", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16)),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 92px,
      rgba(24, 34, 29, 0.018) 92px,
      rgba(24, 34, 29, 0.018) 93px
    );
  opacity: 0.65;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  position: relative;
  padding-bottom: 72px;
}

.masthead,
.main-layout {
  width: var(--site-width);
  margin: 0 auto;
}

.masthead {
  padding: 24px 0 64px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.76);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(30, 30, 25, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(151, 93, 64, 0.12);
  color: var(--accent-deep);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-text,
.topbar-links a,
.eyebrow,
.pull-label,
.block-label,
.row-index {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-text {
  font-size: 0.9rem;
  font-weight: 800;
}

.topbar-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
}

.topbar-links a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 4px;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
}

.language-button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.language-button.is-active {
  background: rgba(151, 93, 64, 0.12);
  color: var(--accent-deep);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 46px;
  align-items: start;
  margin-top: 60px;
}

.hero-copy {
  padding-top: 12px;
}

.surface-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.surface-inset {
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.42);
}

.hero-preview {
  padding: 28px;
}

.eyebrow,
.pull-label,
.block-label,
.row-index {
  margin: 0 0 12px;
  color: var(--accent-deep);
  font-size: 0.76rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display-font);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 6.2vw, 5.4rem);
}

h2 {
  max-width: 15ch;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
}

h3 {
  font-size: clamp(1.14rem, 2vw, 1.5rem);
}

p,
li {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.hero-lead {
  max-width: 62ch;
  margin-top: 24px;
  font-size: 1.14rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 800;
}

.button-primary {
  color: #fffaf6;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
}

.button-secondary {
  border: 1px solid rgba(24, 34, 29, 0.12);
  background: rgba(255, 255, 255, 0.54);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 920px;
  margin-top: 44px;
}

.metric {
  padding: 0 18px 0 0;
  border-right: 1px solid rgba(24, 34, 29, 0.08);
}

.metric:last-child {
  border-right: 0;
}

.metric-number {
  display: block;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.metric-label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.main-layout {
  width: var(--content-width);
  margin: 0 auto;
}

.main-content {
  width: 100%;
}

.editorial-section {
  padding: 56px 0;
}

#begin,
#pathways,
#library,
#works,
#sources {
  scroll-margin-top: 124px;
}

.section-header {
  display: grid;
  gap: 10px;
  margin-bottom: 30px;
}

.premise-grid,
.footer-grid {
  display: grid;
  gap: 18px;
}

.premise-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.essay-card,
.footer-panel {
  padding: 28px;
}

.essay-card h3 + p,
.footer-panel h3 + p {
  margin-top: 12px;
}

.pull-panel {
  margin-top: 22px;
  padding: 30px;
}

.pull-line {
  max-width: 28ch;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(1.4rem, 2.2vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.demo-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.library-layout {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.gateway-panel,
.detail-stage {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 252, 247, 0.92)),
    var(--surface);
}

.gateway-panel {
  position: sticky;
  top: 110px;
  padding: 22px;
}

.library-rail {
  align-self: start;
  display: grid;
  gap: 18px;
}

.library-rail .guide-shell {
  margin: 0;
}

.library-rail .search-shell {
  margin: 0;
}

.library-skip-link {
  position: absolute;
  left: 24px;
  top: 0;
  transform: translateY(-130%);
}

.library-skip-link:focus {
  transform: translateY(-12px);
}

.panel-intro p {
  margin-top: 10px;
}

.context-button,
.related-button {
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  cursor: pointer;
}

.context-list {
  display: grid;
  gap: 10px;
}

.search-shell {
  display: grid;
  gap: 8px;
  margin: 8px 0 18px;
}

.library-work-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 18px;
}

.library-work-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.library-work-button.is-active {
  border-color: rgba(151, 93, 64, 0.34);
  background: rgba(151, 93, 64, 0.08);
}

.guide-shell {
  display: grid;
  gap: 10px;
  margin: 10px 0 18px;
}

.guide-grid {
  display: grid;
  gap: 10px;
}

.search-label {
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-input {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(24, 34, 29, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.search-input:focus-visible {
  outline: 2px solid rgba(151, 93, 64, 0.3);
  outline-offset: 2px;
}

.library-summary {
  padding: 18px;
}

.library-summary p + p {
  margin-top: 10px;
}

.library-browse-label {
  margin-top: 18px;
}

.library-list {
  display: grid;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.library-section {
  display: grid;
  gap: 10px;
}

.library-section-toggle {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.library-section-toggle.is-active {
  border-color: rgba(151, 93, 64, 0.34);
  background: rgba(151, 93, 64, 0.08);
  box-shadow: inset 3px 0 0 rgba(151, 93, 64, 0.54);
}

.library-section-panel {
  display: grid;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid rgba(151, 93, 64, 0.14);
}

.library-section-count {
  display: block;
  margin-top: 10px;
  color: var(--soft);
  font-size: 0.82rem;
  line-height: 1.4;
}

.guide-button {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.context-button {
  width: 100%;
  padding: 16px;
  text-align: left;
  border-color: rgba(24, 34, 29, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.context-button:hover,
.context-button:focus-visible,
.guide-button:hover,
.guide-button:focus-visible,
.library-work-button:hover,
.library-work-button:focus-visible,
.library-section-toggle:hover,
.library-section-toggle:focus-visible,
.library-button:hover,
.library-button:focus-visible,
.related-button:hover,
.related-button:focus-visible {
  outline: none;
  border-color: rgba(151, 93, 64, 0.42);
  transform: translateY(-1px);
}

.context-button.is-active {
  border-color: rgba(151, 93, 64, 0.34);
  background: rgba(151, 93, 64, 0.08);
}

.guide-button.is-active {
  border-color: rgba(151, 93, 64, 0.34);
  background: rgba(151, 93, 64, 0.08);
}

.library-button {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.library-button.is-active {
  border-color: rgba(151, 93, 64, 0.34);
  background: rgba(151, 93, 64, 0.08);
  box-shadow:
    inset 3px 0 0 rgba(151, 93, 64, 0.54),
    inset 0 0 0 1px rgba(151, 93, 64, 0.12);
}

.context-name {
  display: block;
  color: var(--ink);
  font-size: 0.97rem;
  font-weight: 800;
}

.context-strap {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 0.87rem;
  line-height: 1.55;
}

.library-number {
  display: block;
  color: var(--accent-deep);
  font-family: "SFMono-Regular", "Menlo", "Monaco", "Consolas", monospace;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.guide-name {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.guide-prompt {
  display: block;
  margin-top: 6px;
  color: var(--soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.library-opening {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
}

.library-empty-list {
  padding: 18px;
  border: 1px dashed rgba(24, 34, 29, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.32);
}

.detail-stage {
  padding: 32px;
}

.detail-shell,
.preview-shell {
  display: grid;
  gap: 28px;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 28px;
  align-items: start;
}

.detail-head-compact {
  grid-template-columns: 1fr;
}

.detail-kicker,
.preview-kicker {
  color: var(--accent-deep);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-question {
  margin-top: 12px;
  max-width: 15ch;
}

.detail-strap {
  margin-top: 16px;
  max-width: 58ch;
}

.detail-visual,
.preview-canvas-wrap {
  position: relative;
}

.context-canvas,
.preview-canvas {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: 24px;
}

.context-canvas,
.preview-canvas {
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, var(--canvas-c), transparent 26%),
    radial-gradient(circle at 75% 25%, rgba(255, 255, 255, 0.52), transparent 22%),
    linear-gradient(135deg, var(--canvas-a) 0%, var(--canvas-b) 100%);
}

.context-canvas {
  display: grid;
  align-content: end;
  min-height: 340px;
}

.preview-canvas {
  min-height: 220px;
}

.context-canvas::before,
.preview-canvas::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
}

.context-canvas::after,
.preview-canvas::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -34px;
  right: -24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(0.5px);
}

.canvas-card {
  position: relative;
  z-index: 1;
  max-width: 20ch;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.78);
  backdrop-filter: blur(10px);
}

.canvas-card h3 {
  font-size: 1.1rem;
}

.canvas-card p {
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.6;
}

.canvas-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(24, 34, 29, 0.08);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(101, 116, 101, 0.12);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.detail-essay-grid,
.mini-grid,
.thread-grid {
  display: grid;
  gap: 16px;
}

.detail-essay-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-block,
.mini-card,
.thread-card,
.bridge-panel {
  padding: 22px;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.46);
}

.detail-block p:last-child,
.mini-card p:last-child,
.thread-card p:last-child {
  margin-top: 10px;
}

.verse-card {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 252, 247, 0.7);
}

.verse-meta,
.verse-support-grid {
  display: grid;
  gap: 16px;
}

.verse-meta {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.verse-citation {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.55;
}

.verse-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.verse-links a {
  color: var(--accent-deep);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.verse-original,
.verse-transliteration {
  margin: 0;
}

.verse-original {
  color: var(--ink);
  font-family: var(--sanskrit-font);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 500;
  line-height: 1.8;
}

.verse-support-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.verse-support {
  padding: 20px;
  border: 1px solid rgba(24, 34, 29, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.42);
}

.verse-transliteration {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.75;
}

.verse-rendering {
  color: var(--muted);
}

.verse-note {
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.7;
}

.library-verse-text {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.18rem, 1.8vw, 1.45rem);
  line-height: 1.85;
}

.library-feature-card h3 {
  margin-bottom: 12px;
}

.library-feature-card p + p {
  margin-top: 12px;
}

.library-across-grid {
  margin-top: 16px;
}

.library-across-item {
  display: grid;
  gap: 10px;
}

.library-across-item .related-button {
  justify-self: start;
}

.library-empty {
  max-width: 40rem;
}

.mini-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.thread-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.thread-card h3 {
  font-size: 1.08rem;
}

.bridge-panel {
  border-left: 4px solid rgba(151, 93, 64, 0.34);
  background: rgba(151, 93, 64, 0.08);
}

.related-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.related-button {
  min-height: 42px;
  padding: 0 14px;
  border-color: rgba(24, 34, 29, 0.08);
}

.atlas-rows {
  border-top: 1px solid rgba(24, 34, 29, 0.08);
}

.atlas-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid rgba(24, 34, 29, 0.08);
}

.row-index {
  padding-top: 6px;
}

.atlas-row h3 + p {
  margin-top: 10px;
}

.flow-panel {
  margin-top: 26px;
  padding: 26px;
}

.flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.flow-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(101, 116, 101, 0.12);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}
.source-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.footer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-panel {
  min-height: 250px;
}

.footer-panel p + p {
  margin-top: 14px;
}

.source-list a {
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.footer-credit {
  margin-top: 22px;
  color: var(--soft);
  font-size: 0.94rem;
  line-height: 1.7;
}

.footer-credit a {
  color: var(--ink);
}

.preview-title {
  max-width: 10ch;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.preview-copy {
  margin-top: 10px;
}

.preview-shell .tag-row {
  margin-top: 0;
}

body.is-telugu .brand-text,
body.is-telugu .topbar-links a,
body.is-telugu .language-button,
body.is-telugu .eyebrow,
body.is-telugu .pull-label,
body.is-telugu .block-label,
body.is-telugu .row-index,
body.is-telugu .search-label,
body.is-telugu .library-number,
body.is-telugu .preview-kicker,
body.is-telugu .detail-kicker,
body.is-telugu .canvas-badge {
  letter-spacing: 0;
  text-transform: none;
}

body.is-telugu h1,
body.is-telugu h2,
body.is-telugu h3,
body.is-telugu .metric-number,
body.is-telugu .pull-line {
  letter-spacing: -0.01em;
  line-height: 1.22;
}

body.is-telugu p,
body.is-telugu li,
body.is-telugu .metric-label,
body.is-telugu .context-strap,
body.is-telugu .guide-prompt,
body.is-telugu .library-opening,
body.is-telugu .canvas-card p,
body.is-telugu .verse-note {
  line-height: 1.9;
}

.reveal-up {
  animation: reveal-up 520ms ease both;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .hero-grid,
  .demo-layout,
  .detail-head,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .library-layout {
    grid-template-columns: 1fr 1fr;
  }

  .library-layout .detail-stage {
    grid-column: 1 / -1;
  }

  .gateway-panel {
    position: static;
  }

  .library-rail,
  .library-layout .detail-stage {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .library-layout {
    grid-template-columns: 1fr;
  }

  .library-layout .detail-stage {
    grid-column: auto;
  }

  .topbar {
    position: static;
    border-radius: 28px;
  }

  .verse-meta {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-metrics,
  .premise-grid,
  .detail-essay-grid,
  .mini-grid,
  .thread-grid,
  .verse-support-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    padding-right: 0;
    padding-bottom: 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(24, 34, 29, 0.08);
  }

  .metric:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }
}

@media (max-width: 680px) {
  .masthead,
  .main-layout {
    width: min(100vw - 24px, 1360px);
  }

  .masthead {
    padding-top: 12px;
  }

  .hero-grid {
    gap: 28px;
    margin-top: 36px;
  }

  .button {
    width: 100%;
  }

  .hero-preview,
  .essay-card,
  .pull-panel,
  .gateway-panel,
  .detail-stage,
  .footer-panel {
    padding: 22px;
  }

  h1 {
    max-width: none;
  }

  h2,
  .detail-question,
  .preview-title,
  .pull-line {
    max-width: none;
  }

  .context-canvas {
    min-height: 280px;
  }
}
