/* =========================================================================
   PRAMAAN (प्रमाण) — Evidence before conclusions
   Independent research and evidence publication from Nepal
   Newspaper-inspired, scientific journal transparency
   ========================================================================= */

/* ----------------------------------------------------------------- tokens */
:root {
  --cream: #F6F1E7;
  --black: #1B1A17;
  --crimson: #A3162A;
  --blue: #1F3A5F;
  --gold: #C9A227;
  
  --bg: #F6F1E7;
  --surface: #FFFFFF;
  --ink: #1B1A17;
  --muted: #4A453D;
  --light-muted: #6B665B;
  --border: #D4CCC0;
  --border-light: #E6DFD2;
  
  --f-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-body: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  --f-deva: "Noto Sans Devanagari", "Inter", sans-serif;
  
  --container: 1100px;
  --reading: 720px;
  --gutter: 1.5rem;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141310;
    --surface: #1C1B17;
    --ink: #ECE6D8;
    --muted: #B8B0A0;
    --light-muted: #A39D8D;
    --border: #34312A;
    --border-light: #2A2721;
  }
}

:root[data-theme="dark"] {
  --bg: #141310;
  --surface: #1C1B17;
  --ink: #ECE6D8;
  --muted: #B8B0A0;
  --light-muted: #A39D8D;
  --border: #34312A;
  --border-light: #2A2721;
}

/* ------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light dark;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

html.theme-ready body {
  transition: background-color 0.4s ease, color 0.4s ease;
}

html.theme-ready .masthead,
html.theme-ready .site-footer,
html.theme-ready main,
html.theme-ready .featured-story,
html.theme-ready .investigations-section,
html.theme-ready .principles-section,
html.theme-ready .newsletter-section,
html.theme-ready .card,
html.theme-ready .archive-item,
html.theme-ready .search-card,
html.theme-ready .article-toc,
html.theme-ready .prose pre,
html.theme-ready .prose code,
html.theme-ready .prose blockquote,
html.theme-ready .prose table,
html.theme-ready .prose th,
html.theme-ready .prose td,
html.theme-ready .table-wrap {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
}

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

p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

a { 
  color: var(--ink); 
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { 
  color: var(--crimson);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1em;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { margin: 0 0 1.5em; }

hr { 
  border: 0; 
  border-top: 1px solid var(--border); 
  margin: 3rem 0; 
}

:focus-visible { 
  outline: 2px solid var(--crimson); 
  outline-offset: 2px; 
}

.container { 
  width: min(var(--container), 100% - 2 * var(--gutter)); 
  margin-inline: auto; 
}

.reading-container {
  width: min(var(--reading), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.skip-link {
  position: absolute; 
  left: -999px; 
  top: 0; 
  z-index: 100;
  background: var(--crimson); 
  color: white; 
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-family: var(--f-body);
  font-weight: 500;
}
.skip-link:focus { 
  left: 0; 
}

/* ------------------------------------------------------------------- header */
.masthead {
  border-bottom: 2px solid var(--ink);
  padding: 2rem 0 1rem;
}

.masthead-top {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo {
  text-decoration: none;
  color: var(--ink);
  display: inline-block;
}

.logo:hover {
  color: var(--ink);
  text-decoration: none;
}

.logo-text {
  font-family: var(--f-display);
  font-size: 2.5rem;
  font-weight: 700;
  display: block;
  line-height: 1;
}

.logo-deva {
  font-family: var(--f-deva);
  font-size: 1.25rem;
  display: block;
  margin-top: 0.25rem;
  line-height: 1;
}

.masthead-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-primary a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--f-body);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-primary a:hover {
  color: var(--crimson);
  text-decoration: none;
}

.nav-secondary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-secondary a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--f-body);
  font-size: var(--text-sm);
}

.nav-secondary a:hover {
  color: var(--crimson);
  text-decoration: none;
}

.nav-search-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-search-link svg {
  display: block;
}

.search-btn {
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  color: var(--crimson);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover { color: var(--crimson); }

.theme-toggle__icon {
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: block;
}

.theme-toggle:hover .theme-toggle__icon {
  transform: rotate(15deg);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--f-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1rem;
  min-height: 44px;
  font-weight: 500;
}

/* Mobile navigation panel: hidden until toggled. */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: 1rem;
}

.mobile-nav.is-open { display: block; }

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav li {
  border-bottom: 1px solid var(--border-light);
}

.mobile-nav li:last-child { border-bottom: none; }

.mobile-nav a {
  display: block;
  padding: 0.85rem 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--f-display);
  font-size: var(--text-xl);
  font-weight: 700;
}

.mobile-nav a:hover { color: var(--crimson); }

/* Reading progress bar */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--crimson);
  z-index: 50;
  transition: width 0.1s linear;
}

@media (max-width: 900px) {
  .nav-primary {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .masthead-nav {
    justify-content: space-between;
    gap: 0.75rem;
  }
  .nav-secondary {
    gap: 0.5rem;
  }
  .nav-secondary > a {
    display: none;
  }
  .logo-text {
    font-size: 2rem;
  }
  .logo-deva {
    font-size: 1.05rem;
  }
  .masthead {
    padding: 1.25rem 0 0.75rem;
  }
  .masthead-top {
    margin-bottom: 1rem;
  }
}

/* ------------------------------------------------------------------- main */
main {
  padding: 2rem 0 4rem;
}

/* ------------------------------------------------------------------- homepage */
.page-intro {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.page-intro h1 {
  font-size: var(--text-4xl);
  margin-bottom: 0.5rem;
}

.page-intro .tagline {
  font-family: var(--f-body);
  font-size: var(--text-lg);
  color: var(--muted);
  margin: 0;
  font-style: italic;
}

.featured-story {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 2px solid var(--ink);
}

@media (max-width: 968px) {
  .featured-story {
    grid-template-columns: 1fr;
  }
}

.featured-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.featured-category {
  font-family: var(--f-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--crimson);
  font-weight: 600;
}

.featured-title {
  font-size: var(--text-4xl);
  line-height: 1.15;
  margin: 0;
}

.featured-summary {
  font-size: var(--text-lg);
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-family: var(--f-body);
  font-size: var(--text-sm);
  color: var(--light-muted);
}

.featured-meta a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.featured-meta a:hover {
  color: var(--crimson);
  text-decoration: none;
}

.read-link {
  color: var(--crimson);
  text-decoration: none;
  font-weight: 600;
  font-family: var(--f-body);
}

.read-link:hover {
  text-decoration: underline;
}

.featured-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: var(--text-3xl);
  margin: 0;
}

.section-link {
  color: var(--crimson);
  text-decoration: none;
  font-family: var(--f-body);
  font-size: var(--text-sm);
  font-weight: 500;
}

.section-link:hover {
  text-decoration: underline;
}

.latest-research {
  margin-bottom: 3rem;
}

.latest-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 968px) {
  .latest-grid {
    grid-template-columns: 1fr;
  }
}

.latest-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.latest-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.latest-article {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.latest-article:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.article-card-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  align-items: start;
}

.article-card-thumb {
  width: 90px;
  height: 90px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}

.article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.25rem;
}

.article-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

@media (max-width: 640px) {
  .article-card-row {
    grid-template-columns: 70px 1fr;
    gap: 0.75rem;
  }
  .article-card-thumb {
    width: 70px;
    height: 70px;
  }
}

.article-category {
  font-family: var(--f-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--crimson);
  font-weight: 600;
}

.article-title {
  font-size: var(--text-2xl);
  line-height: 1.25;
  margin: 0;
}

.article-title a {
  color: var(--ink);
  text-decoration: none;
}

.article-title a:hover {
  color: var(--crimson);
  text-decoration: none;
}

.article-summary {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--f-body);
  font-size: var(--text-xs);
  color: var(--light-muted);
}

.article-meta a {
  color: var(--ink);
  text-decoration: none;
}

.article-meta a:hover {
  color: var(--crimson);
}

.investigations-section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
}

.investigations-section .section-header {
  border-bottom-color: var(--border);
}

.categories-section {
  margin-bottom: 3rem;
}

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

.category-link {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
}

.category-link:hover {
  border-color: var(--crimson);
  color: var(--crimson);
  text-decoration: none;
}

.principles-section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--crimson);
}

.principles-section h2 {
  font-size: var(--text-2xl);
  margin-bottom: 1rem;
}

.principles-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem 2rem;
  margin: 0;
  padding-left: 1.25rem;
}

.principles-list li {
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.newsletter-section {
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.newsletter-section h2 {
  font-size: var(--text-2xl);
  margin-bottom: 0.5rem;
}

.newsletter-section p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  max-width: 400px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .newsletter-form {
    flex-direction: column;
  }
}

.newsletter-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  font-family: var(--f-body);
  font-size: var(--text-sm);
  background: var(--bg);
  color: var(--ink);
  min-height: 44px;
}

.newsletter-input:focus {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
  border-color: var(--crimson);
}

.newsletter-btn {
  background: var(--crimson);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-family: var(--f-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
}

.newsletter-btn:hover {
  opacity: 0.9;
}

/* ------------------------------------------------------------------- footer */
.site-footer {
  border-top: 2px solid var(--ink);
  padding: 2rem 0 3rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 968px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-logo {
  font-family: var(--f-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.footer-logo:hover {
  color: var(--ink);
  text-decoration: none;
}

.footer-deva {
  font-family: var(--f-deva);
  font-size: 1rem;
}

.footer-section h3 {
  font-family: var(--f-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.footer-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 0;
}

.footer-section a:hover {
  color: var(--crimson);
  text-decoration: none;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-bottom p {
  color: var(--light-muted);
  font-size: var(--text-xs);
  margin: 0;
}

/* ------------------------------------------------------------------- article */
.article-header {
  max-width: var(--reading);
  margin: 0 auto 2rem;
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-family: var(--f-body);
  font-size: var(--text-sm);
  color: var(--light-muted);
  flex-wrap: wrap;
}

.article-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.article-breadcrumb a:hover {
  color: var(--crimson);
}

.article-category-detail {
  font-family: var(--f-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--crimson);
  font-weight: 600;
  display: block;
  margin-bottom: 0.75rem;
}

.article-title-detail {
  font-size: var(--text-5xl);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.article-summary-detail {
  font-size: var(--text-xl);
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-weight: 400;
}

.article-meta-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-family: var(--f-body);
  font-size: var(--text-sm);
  color: var(--muted);
}

.article-meta-detail a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.article-meta-detail a:hover {
  color: var(--crimson);
}

.article-featured-image {
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  border: 1px solid var(--border);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 3rem;
  max-width: 1000px;
  min-width: 0;
  margin: 0 auto;
}

@media (max-width: 968px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
}

.article-main {
  max-width: var(--reading);
  min-width: 0;
}

.article-toc {
  position: sticky;
  top: 2rem;
  height: fit-content;
  font-family: var(--f-body);
  font-size: var(--text-sm);
}

@media (max-width: 968px) {
  .article-toc {
    position: static;
    order: -1;
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    background: var(--surface);
  }
  .article-toc > ul,
  .article-toc .toc {
    max-height: 220px;
    overflow-y: auto;
  }
}

.article-toc h3 {
  font-family: var(--f-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.article-toc .toc ul,
.article-toc > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-toc .toc li,
.article-toc > ul li {
  margin-bottom: 0.25rem;
}

/* Nested TOC levels from the Markdown extension. */
.article-toc .toc ul ul {
  padding-left: 0.85rem;
  margin-top: 0.25rem;
}

.article-toc .toc a {
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 2px 0;
}

.article-toc .toc a:hover,
.article-toc .toc a.is-active {
  color: var(--crimson);
}

.prose {
  font-size: 17px;
  line-height: 1.8;
  min-width: 0;
}

.prose > * {
  max-width: 100%;
}

.prose h2 {
  font-size: var(--text-3xl);
  margin-top: 2.5em;
  margin-bottom: 1em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
}

.prose h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.prose h3 {
  font-size: var(--text-2xl);
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.prose h4 {
  font-size: var(--text-xl);
  margin-top: 1.75em;
  margin-bottom: 0.75em;
}

.prose p {
  margin-bottom: 1.5em;
}

.prose a {
  color: var(--crimson);
  text-decoration: underline;
}

.prose blockquote {
  margin: 2em 0;
  padding: 1.5em 0 1.5em 2em;
  border-left: 3px solid var(--crimson);
  font-family: var(--f-display);
  font-size: var(--text-xl);
  font-style: italic;
  background: var(--surface);
}

.prose ul, .prose ol {
  margin-bottom: 1.5em;
  padding-left: 1.75em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.2em 0.4em;
  border: 1px solid var(--border);
}

.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5em;
  overflow-x: auto;
  margin: 2em 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875em;
  line-height: 1.5;
}

.prose pre code {
  background: none;
  padding: 0;
  border: none;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: var(--text-sm);
}

/* Wide tables scroll inside their own box, never widening the page. */
.table-wrap,
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin: 2em 0;
}

.table-wrap table,
.table-scroll table {
  margin: 0;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.75em;
  text-align: left;
}

.prose th {
  background: var(--surface);
  font-weight: 600;
  font-family: var(--f-body);
}

.methodology-box,
.limitations-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5em;
  margin: 2em 0;
}

.methodology-box {
  border-left: 3px solid var(--blue);
}

.limitations-box {
  border-left: 3px solid var(--gold);
}

.methodology-box h3,
.limitations-box h3,
.methodology-box h2,
.limitations-box h2 {
  font-family: var(--f-body);
  font-size: var(--text-lg);
  margin-bottom: 0.75em;
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.references-section {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 2px solid var(--border);
}

/* Standalone information pages (About, Methodology, policies) */
.prose.page {
  max-width: var(--reading);
  margin: 0 auto;
}

.prose.page .page-head {
  text-align: left;
  max-width: none;
  margin: 0 auto 2.5rem;
}

.prose.page .lede {
  font-size: var(--text-lg);
  color: var(--muted);
  line-height: 1.65;
}

.prose.page h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 2.5em;
}

.prose.page h3 {
  margin-top: 2em;
}

.prose.page ol,
.prose.page ul {
  padding-left: 1.5em;
}

.prose.page li { margin-bottom: 0.6em; }

.references-section h2 {
  font-size: var(--text-2xl);
  margin-bottom: 1em;
  border-top: none;
  padding-top: 0;
}

.references-list {
  list-style: none;
  padding: 0;
}

.references-list li {
  margin-bottom: 0.75em;
  padding-left: 1.5em;
  text-indent: -1.5em;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.related-section {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 2px solid var(--border);
}

.related-section h2 {
  font-size: var(--text-2xl);
  margin-bottom: 1.5em;
  border-top: none;
  padding-top: 0;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5em;
}

/* ------------------------------------------------------------------- lists */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card__link {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.card__link:hover { text-decoration: none; }

.card__link:hover .article-title { color: var(--crimson); }

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--f-body);
  font-size: var(--text-xs);
  color: var(--light-muted);
}

.draft-badge {
  font-family: var(--f-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 0 0.35em;
  font-weight: 600;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.tags a {
  font-family: var(--f-body);
  font-size: var(--text-xs);
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.tags a:hover {
  color: var(--crimson);
  border-color: var(--crimson);
}

.page-head {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--ink);
}

.page-head h1 {
  font-size: var(--text-4xl);
  margin-bottom: 0.25rem;
}

.page-head__lede {
  color: var(--muted);
  margin: 0;
}

.kicker {
  font-family: var(--f-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--crimson);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.empty {
  color: var(--muted);
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ------------------------------------------------------------------- archive */
.archive-controls {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--ink);
}

.archive-form {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "search sort"
    "filters filters";
  gap: 1rem 1.5rem;
  align-items: center;
}

.archive-search { grid-area: search; display: block; }

.archive-search input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--text-base);
  min-height: 48px;
}

.archive-search input:focus {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
  border-color: var(--crimson);
}

.archive-filters {
  grid-area: filters;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--f-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  min-height: 36px;
}

.filter-chip:hover {
  border-color: var(--crimson);
  color: var(--crimson);
  text-decoration: none;
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.filter-chip.is-active:hover {
  background: var(--crimson);
  border-color: var(--crimson);
  color: #fff;
}

.archive-sort {
  grid-area: sort;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--light-muted);
  white-space: nowrap;
}

.archive-sort select {
  font-family: var(--f-body);
  font-size: var(--text-sm);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
  cursor: pointer;
}

.archive-sort select:focus {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}

.archive-submit {
  font-family: var(--f-body);
  font-size: var(--text-sm);
  padding: 0.6rem 1.2rem;
  background: var(--ink);
  color: var(--bg);
  border: none;
  cursor: pointer;
  min-height: 44px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.active-filters__label {
  font-family: var(--f-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--light-muted);
}

.clear-filters {
  font-family: var(--f-body);
  font-size: var(--text-xs);
  color: var(--crimson);
  text-decoration: underline;
}

.archive-count {
  margin: 1rem 0 0;
  font-family: var(--f-body);
  font-size: var(--text-sm);
  color: var(--muted);
}

.archive-list {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
}

.archive-item {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.archive-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-family: var(--f-body);
  font-size: var(--text-xs);
  color: var(--light-muted);
  margin-bottom: 0.5rem;
}

.archive-item__title {
  font-size: var(--text-2xl);
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.archive-item__title a {
  color: var(--ink);
  text-decoration: none;
}

.archive-item__title a:hover {
  color: var(--crimson);
  text-decoration: none;
}

.archive-item__summary {
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  font-family: var(--f-body);
  font-size: var(--text-sm);
}

.pagination__link {
  color: var(--crimson);
  text-decoration: none;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.pagination__link:hover { text-decoration: underline; }

.pagination__status { color: var(--muted); }

.empty-state {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: 60ch;
}

.empty-state h2 {
  font-size: var(--text-2xl);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--muted);
}

.empty-state--quiet { border-top: none; }

.search__results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search__result {
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------- responsive */
/* Desktop  >= 1024px  : full masthead, side TOC, asymmetric hero
   Tablet   768-1023px : single column hero, stacked TOC
   Mobile   <= 767px   : compact masthead, drawer nav, 16px body
   Small    <= 420px   : tighter gutters and type scale                     */

@media (max-width: 1024px) {
  .featured-story {
    grid-template-columns: 1fr;
  }
  .featured-image {
    height: 260px;
  }
  .article-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .article-toc {
    position: static;
    order: -1;
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    background: var(--surface);
  }
  .article-main {
    max-width: 100%;
  }
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767px) {
  :root {
    --gutter: 1rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.375rem;
    --text-2xl: 1.2rem;
    --text-xl: 1.0625rem;
  }

  body {
    font-size: 16px;
  }

  main {
    padding: 1.5rem 0 3rem;
  }

  .page-intro {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
  }

  .featured-story {
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
  }

  .featured-image {
    height: 200px;
  }

  .latest-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .latest-main {
    padding-bottom: 1.25rem;
  }

  .latest-side {
    gap: 1.25rem;
  }

  .investigations-section,
  .principles-section,
  .newsletter-section {
    padding: 1.25rem;
  }

  .categories-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .category-link {
    padding: 0.75rem 0.5rem;
    font-size: var(--text-sm);
  }

  .newsletter-form {
    flex-direction: column;
    max-width: none;
  }

  .prose {
    font-size: 16px;
    line-height: 1.75;
  }

  .prose h2 {
    font-size: var(--text-2xl);
    margin-top: 2em;
  }

  .prose h3 {
    font-size: var(--text-xl);
  }

  .prose blockquote {
    padding: 1rem 0 1rem 1rem;
    font-size: var(--text-lg);
  }

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

  .article-featured-image {
    margin: 1.5rem 0;
  }

  .methodology-box,
  .limitations-box {
    padding: 1rem 1.15rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .archive-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "search"
      "filters"
      "sort";
    gap: 0.75rem;
  }

  .archive-sort {
    justify-content: space-between;
  }

  .archive-item {
    padding: 1.25rem 0;
  }

  .site-footer {
    padding: 1.5rem 0 2rem;
    margin-top: 2.5rem;
  }
}

@media (max-width: 420px) {
  :root {
    --gutter: 0.875rem;
  }
  .categories-grid {
    grid-template-columns: 1fr;
  }
  .logo-text {
    font-size: 1.75rem;
  }
  .article-title-detail {
    font-size: 1.75rem;
  }
  .prose table {
    font-size: var(--text-xs);
  }
}

/* ------------------------------------------------------------------- accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ------------------------------------------------------------------- print */
@media print {
  :root {
    --bg: #ffffff;
    --ink: #000000;
    --muted: #333333;
    --border: #cccccc;
  }
  
  .masthead,
  .site-footer,
  .article-toc,
  .newsletter-section {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.6;
  }
  
  a {
    color: #000000;
    text-decoration: underline;
  }
  
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #333333;
  }
}


/* ------------------------------------------------------------------- enhanced styling */
.featured-image {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.featured-story:hover .featured-image {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(27, 26, 23, 0.08);
}

.featured-image--placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  object-fit: contain;
  padding: 1rem;
}

@keyframes pramaan-shimmer {
  0% { transform: translateX(-10%); }
  100% { transform: translateX(10%); }
}

.article-title a {
  position: relative;
  background-image: linear-gradient(var(--crimson), var(--crimson));
  background-size: 0% 1px;
  background-position: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.2s ease;
}

.article-title a:hover {
  background-size: 100% 1px;
}

.card,
.latest-article,
.archive-item {
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover,
.latest-article:hover,
.archive-item:hover {
  transform: translateX(4px);
  border-color: var(--crimson);
}

.category-link {
  position: relative;
  overflow: hidden;
}

.category-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(161, 22, 42, 0.04), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-link:hover::before {
  opacity: 1;
}

.category-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(27, 26, 23, 0.06);
}

.nav-primary a,
.nav-secondary a,
.footer-section a {
  position: relative;
}

.nav-primary a::after,
.nav-secondary a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--crimson);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.nav-primary a:hover::after,
.nav-secondary a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.prose table {
  display: table;
  min-width: 100%;
}

.prose .table-wrap {
  border: 1px solid var(--border);
}

.prose .table-wrap table {
  border: none;
}

.prose .table-wrap th,
.prose .table-wrap td {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .prose .table-wrap th,
  .prose .table-wrap td {
    white-space: normal;
  }
}


/* ------------------------------------------------------------------- search */
.search-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.search-form {
  grid-template-columns: 1fr;
  grid-template-areas:
    "search"
    "filters";
}

.search-input-wrap {
  grid-area: search;
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar {
  width: 100%;
}

.search-bar input {
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: var(--text-lg);
  padding: 1rem 3.25rem 1rem 1.25rem;
  width: 100%;
}

.search-icon-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

.search-icon-btn:hover {
  color: var(--crimson);
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  width: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B1A17' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center/contain no-repeat;
  cursor: pointer;
}

:root[data-theme="dark"] input[type="search"]::-webkit-search-cancel-button {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ECE6D8' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center/contain no-repeat;
}

.search-filters {
  justify-content: flex-start;
}

.search-results-header {
  margin: 2rem 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.search-results-header h2 {
  font-size: var(--text-2xl);
  margin: 0;
}

.search__results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search__result {
  margin: 0;
  padding: 0;
  border: none;
}

.search-card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.search-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--crimson), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.search-card:hover {
  transform: translateY(-4px);
  border-color: var(--crimson);
  box-shadow: 0 18px 40px rgba(27, 26, 23, 0.08);
}

.search-card:hover::before {
  transform: scaleX(1);
}

.search-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-body);
  font-size: var(--text-xs);
  color: var(--light-muted);
}

.meta-sep {
  opacity: 0.6;
}

.search-card__title {
  font-size: var(--text-3xl);
  margin: 0;
}

.search-card__title a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--crimson), var(--crimson));
  background-size: 0% 1px;
  background-position: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.2s ease;
}

.search-card__title a:hover {
  color: var(--crimson);
  background-size: 100% 1px;
}

.search-card__summary {
  color: var(--muted);
  margin: 0;
  max-width: 70ch;
}

.search-card__tags {
  margin-top: 0.25rem;
}

@media (max-width: 767px) {
  .search-controls {
    padding: 1rem;
  }
  .search-card {
    padding: 1.25rem;
  }
  .search-card__title {
    font-size: var(--text-2xl);
  }
}


/* ------------------------------------------------------------------- wow polish */
.masthead {
  position: relative;
  background: radial-gradient(circle at top, rgba(161, 22, 42, 0.03), transparent 70%);
}

.logo-text {
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(27, 26, 23, 0.02);
}

.featured-story {
  position: relative;
  overflow: hidden;
}

.featured-story::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(161, 22, 42, 0.04), transparent 55%);
  pointer-events: none;
}

.featured-content,
.featured-media {
  position: relative;
  z-index: 1;
}

.featured-title {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-title {
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.4rem;
  width: 3rem;
  height: 2px;
  background: var(--crimson);
}

.investigations-section {
  position: relative;
  overflow: hidden;
}

.investigations-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at bottom right, rgba(31, 58, 95, 0.04), transparent 60%);
  pointer-events: none;
}

.investigations-section .section-header,
.investigations-section .latest-grid {
  position: relative;
  z-index: 1;
}

.principles-section {
  position: relative;
  overflow: hidden;
}

.principles-section::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.08), transparent 70%);
  pointer-events: none;
}

.principles-section h2,
.principles-section .principles-list {
  position: relative;
  z-index: 1;
}

.newsletter-section {
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(161, 22, 42, 0.03), transparent 65%);
  pointer-events: none;
}

.newsletter-section h2,
.newsletter-section p,
.newsletter-form {
  position: relative;
  z-index: 1;
}

.newsletter-btn {
  position: relative;
  overflow: hidden;
}

.newsletter-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.newsletter-btn:hover::after {
  transform: translateX(100%);
}

.article-title-detail {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.prose h2 {
  position: relative;
}

.prose h2::before {
  content: "�";
  position: absolute;
  left: -1.5rem;
  color: var(--crimson);
  opacity: 0.4;
  font-family: var(--f-display);
}

@media (max-width: 1024px) {
  .prose h2::before {
    display: none;
  }
}

.prose blockquote {
  position: relative;
  box-shadow: 0 12px 30px rgba(27, 26, 23, 0.04);
}

.prose blockquote::before {
  content: "�";
  position: absolute;
  top: -0.4rem;
  left: 0.6rem;
  font-size: 4rem;
  color: var(--crimson);
  opacity: 0.15;
  font-family: var(--f-display);
}


/* ------------------------------------------------------------------- back to top */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--text-sm);
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease, border-color 0.2s ease;
  z-index: 40;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--crimson);
  border-color: var(--crimson);
}

@media (max-width: 640px) {
  .back-to-top {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
