
:root {
  --ink: #111;
  --muted: #666;
  --line: #d8d8d8;
  --paper: #fff;
  --accent: #7e22ce;
}
html, body {
  background: var(--paper) !important;
  color: var(--ink) !important;
  font-family: Georgia, "Times New Roman", serif;
}
body {
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
a {
  color: var(--ink);
  text-decoration-color: var(--ink);
  text-underline-offset: 0.16em;
}
a:hover { color: #000; }
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff !important;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.site-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}
.site-tagline {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 42rem;
  margin: 1rem 0 0;
}
.nav-link {
  color: var(--ink);
  padding-left: 0;
  padding-right: 1.5rem;
}
.nav-link:hover, .nav-link:focus, .nav-link.active {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.section-label, .essay-meta, .writing-meta, .year-marker {
  font-family: Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.essay-meta, .writing-meta { color: var(--accent); }
.hero-card, .writing-card, .essay-shell, .about-shell {
  border: 1px solid var(--line);
  background: #fff !important;
}
.hero-card { padding: 2rem; }
.writing-card { padding: 1.5rem; height: 100%; }
.writing-meta, .essay-meta, .about-copy, .footer-copy {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
}
.about-copy, .footer-copy { color: var(--muted); }
.feature-title, .card-title, .essay-title, .about-title {
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.feature-title {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 14ch;
}
.feature-deck, .card-deck, .essay-deck {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 44rem;
}
.essay-shell, .about-shell { padding: 2rem; }
.essay-shell { max-width: 52rem; margin: 0 auto; }
.essay-body p { margin-bottom: 1.35rem; font-size: 1.1rem; }
.essay-break {
  text-align: center;
  margin: 2rem 0;
  color: var(--muted);
  font-size: 1.25rem;
}
.chapter-title {
  font-size: 1.6rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 2.2rem 0 1rem;
}
.chapter-title:first-child { margin-top: 0; }
.year-block { margin: 1.5rem 0 1.35rem; }
.year-marker { display: block; margin-bottom: 0.35rem; }
.coordinate-link {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  color: var(--muted);
}
.coordinate-link:hover { color: var(--ink); }
.writing-list-item {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
}
.writing-list-item:first-child {
  border-top: 0;
  padding-top: 0;
}
.about-shell { max-width: 44rem; }
.site-footer { border-top: 1px solid var(--line); }
.page-section { scroll-margin-top: 6rem; }
@media (max-width: 767.98px) {
  body {
    background-size: min(24vw, 110px);
    background-position: right 0.9rem bottom 0.9rem;
  }
  .hero-card, .essay-shell, .about-shell, .writing-card { padding: 1.25rem; }
  .essay-body p { font-size: 1.02rem; }
  .site-header .col-lg-8 { text-align: center; }
  .site-tagline { max-width: none; }
}


.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.small-muted { color: var(--muted); }
.legal-shell { max-width: 48rem; }
.legal-shell p, .legal-shell li { font-size: 1.05rem; }
.notfound-shell { max-width: 42rem; }



.site-header, main, .site-footer {
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .py-md-6 {
    padding-top: 4.5rem !important;
    padding-bottom: 4.5rem !important;
  }
}

.nav-button {
  border: 0;
  background: transparent;
  font: inherit;
  text-decoration-color: currentColor;
}

.admin-shell, .app-shell {
  max-width: 72rem;
}

.admin-table-wrap {
  border: 1px solid var(--line);
  background: #fff;
  overflow-x: auto;
}

.admin-filter {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1rem;
  font-family: Arial, Helvetica, sans-serif;
}

.admin-table {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
}

.admin-form {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1.5rem;
  font-family: Arial, Helvetica, sans-serif;
}

.admin-action, .admin-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
}

.admin-action:hover, .admin-button:hover {
  background: #000;
  color: #fff;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.status-pill {
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-published {
  border-color: #7e22ce;
  color: #5b1599;
}

.status-draft {
  color: var(--muted);
}

.status-archived {
  border-color: #aaa;
  color: #444;
  background: #f7f7f7;
}

.cms-body-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.app-placeholder {
  min-height: 9rem;
}

.app-nav {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1rem;
  font-family: Arial, Helvetica, sans-serif;
}

.app-nav-label, .app-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-top: 0.65rem;
}

.app-nav-links a {
  color: var(--ink);
  text-decoration: none;
}

.app-nav-links a:hover, .app-nav-links a.active {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.app-dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.app-card {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 11rem;
  padding: 1.25rem;
  text-decoration: none;
}

.app-card:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.app-count {
  display: block;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  margin: 1.4rem 0 0.7rem;
}

.app-empty {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1.5rem;
  max-width: 46rem;
}

.app-empty h2 {
  font-size: 1.45rem;
  margin-bottom: 0.45rem;
}

.app-empty p {
  color: var(--muted);
  margin-bottom: 0;
}

.app-list {
  border: 1px solid var(--line);
  background: #fff;
}

.app-list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.25rem;
  border-top: 1px solid var(--line);
}

.app-list-item:first-child {
  border-top: 0;
}

.app-list-item p {
  color: var(--muted);
  margin-bottom: 0;
  white-space: pre-line;
}

.app-list-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  min-width: 14rem;
  font-family: Arial, Helvetica, sans-serif;
}

.app-list-actions form {
  display: inline-flex;
}

.app-form {
  max-width: 56rem;
}

.status-planned {
  color: var(--muted);
}

.status-active {
  border-color: var(--accent);
  color: #5b1599;
}

.status-completed {
  border-color: #555;
  color: #222;
}

@media (max-width: 767.98px) {
  body::after {
    right: 0.75rem;
    bottom: 0.75rem;
    width: min(22vw, 120px);
    opacity: 0.72;
  }

  .app-list-item {
    display: block;
  }

  .app-list-actions {
    justify-content: flex-start;
    margin-top: 1rem;
    min-width: 0;
  }

  .app-list-item > a, .app-list-item > .status-pill {
    margin-top: 1rem;
  }
}

/* Article illustration system (kept for any standalone use) */
.tol-article-illustration,
.article-hero-illustration {
  display: block;
  width: min(100%, 760px);
  margin: 2rem auto 2.5rem auto;
  height: auto;
  object-fit: contain;
  filter: none;
}
.tol-article-illustration-wrap,
.article-hero-illustration-wrap {
  width: 100%;
  margin: 0;
  padding: 0;
}
.tol-article-illustration-wrap figcaption,
.article-hero-illustration-wrap figcaption { display: none; }
@media (min-width: 768px) {
  .tol-article-illustration,
  .article-hero-illustration {
    margin-top: 2.25rem;
    margin-bottom: 3rem;
  }
}

/* ─── Scroll-driven article layout ─────────────────────────────────────── */

/* Outer scroll proxy — height set by JS to 100vh + scrollable text height  */
.art-scroll-wrapper {
  /* height injected by JS */
}

/* The panel that goes sticky and fills the viewport */
.art-sticky-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

/* Header: type label + title + deck, full width */
.art-header {
  flex-shrink: 0;
  padding: 1.75rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.art-header-meta {
  font-family: Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 0.55rem;
}
.art-header-title {
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 0.55rem;
}
.art-header-deck {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  max-width: 72ch;
  font-style: italic;
}

/* Two-column body */
.art-cols {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Left column — illustration, warm paper background matching the art */
.art-col-illus {
  width: 44%;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1.25rem 1.25rem;
  overflow: hidden;
  background: #f3ece3;
}
.art-col-illus img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Right column — fixed-height text viewport */
.art-col-text-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-width: 0;
  border-left: 1px solid var(--line);
}

/* The scrollable text slab — translated by JS */
.art-col-text-inner {
  padding: 2.25rem 3rem 4rem 2.5rem;
  will-change: transform;
}

/* Long-form body typography */
.art-col-text-inner .essay-body p {
  font-size: 1.175rem;
  line-height: 1.82;
  margin-bottom: 1.6rem;
  color: var(--ink);
}

/* Drop cap on the very first paragraph */
.art-col-text-inner .essay-body > p:first-of-type::first-letter {
  font-size: 5.2em;
  float: left;
  line-height: 0.78;
  margin: 0.05em 0.1em 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  color: var(--ink);
}

/* When no illustration exists, text takes the full width */
.art-no-illus .art-col-illus { display: none; }
.art-no-illus .art-col-text-viewport { border-left: none; }

/* ── Mobile: revert to normal stacked layout ──── */
@media (max-width: 767px) {
  .art-scroll-wrapper { height: auto !important; }
  .art-sticky-panel {
    position: static;
    height: auto;
    overflow: visible;
  }
  .art-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--line);
  }
  .art-cols { flex-direction: column; }
  .art-col-illus {
    width: 100%;
    align-items: center;
    padding: 1rem;
  }
  .art-col-text-viewport {
    overflow: visible;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .art-col-text-inner {
    transform: none !important;
    padding: 1.5rem 1.25rem 2rem;
  }
  .art-col-text-inner .essay-body p {
    font-size: 1.08rem;
    line-height: 1.75;
  }
  .art-col-text-inner .essay-body > p:first-of-type::first-letter {
    font-size: 4em;
  }
}

/* ── Back-link row (below the scroll wrapper) ─── */
.art-back-link {
  padding: 1rem 0 2rem;
}
