/* ============================================================
   Logos Alignment Framework — Academic Professional Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink:         #1a1a2e;
  --ink-light:   #3d3d5c;
  --ink-muted:   #6b6b8a;
  --rule:        #d4d4e8;
  --rule-light:  #eaeaf5;
  --paper:       #fafaf8;
  --paper-warm:  #f5f4ef;
  --paper-card:  #ffffff;
  --accent:      #1a3a6b;
  --accent-mid:  #2a5298;
  --accent-light:#e8eef8;
  --gold:        #8b6914;
  --gold-light:  #f5edd6;
  --green:       #1a5c3a;
  --green-light: #e6f2ec;
  --red:         #8b1a1a;
  --red-light:   #f5e6e6;
  --serif:       'EB Garamond', Georgia, serif;
  --sans:        'Inter', system-ui, sans-serif;
  --mono:        'JetBrains Mono', monospace;
  --shadow-sm:   0 1px 3px rgba(26,26,46,.08);
  --shadow-md:   0 4px 16px rgba(26,26,46,.10);
  --shadow-lg:   0 8px 32px rgba(26,26,46,.12);
  --r:           4px;
  --r-md:        8px;
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper-warm);
  min-height: 100vh;
}

/* ── Site wrapper ──────────────────────────────────────────── */
.site {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  background: var(--accent);
  color: #fff;
  padding: 2.5rem 3rem 2rem;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 39px,
    rgba(255,255,255,.03) 39px, rgba(255,255,255,.03) 40px);
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: start;
}

.header-text { }

.journal-label {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  display: block;
  margin-bottom: .6rem;
}

.site-title {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  margin-bottom: .5rem;
}

.site-title a { color: inherit; text-decoration: none; }

.site-subtitle {
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 300;
  color: rgba(255,255,255,.75);
  line-height: 1.5;
  max-width: 600px;
  margin-bottom: 1.5rem;
}

/* Header stats */
.header-stats {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1rem;
  flex-wrap: wrap;
}

.hstat {
  flex: 1;
  min-width: 140px;
  padding: 0 1.5rem 0 0;
  border-right: 1px solid rgba(255,255,255,.15);
  margin-right: 1.5rem;
}

.hstat:last-child { border-right: none; margin-right: 0; }

.hstat-value {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

.hstat-label {
  font-family: var(--sans);
  font-size: .72rem;
  color: rgba(255,255,255,.55);
  letter-spacing: .04em;
}

/* ── Book widget ───────────────────────────────────────────── */
.book-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  min-width: 150px;
  max-width: 170px;
}

.book-widget-label {
  font-family: var(--sans);
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}

/* 3-D book effect */
.book-3d {
  perspective: 800px;
  width: 130px;
}

.book-3d-inner {
  position: relative;
  width: 130px;
  transform: rotateY(-15deg) rotateX(3deg);
  transform-style: preserve-3d;
  transition: transform .4s ease;
  cursor: pointer;
  filter: drop-shadow(-8px 12px 20px rgba(0,0,0,.5));
}

.book-3d-inner:hover {
  transform: rotateY(-5deg) rotateX(1deg) translateY(-4px);
  filter: drop-shadow(-12px 18px 28px rgba(0,0,0,.6));
}

.book-3d-inner img {
  width: 130px;
  border-radius: 2px 4px 4px 2px;
  display: block;
}

/* Spine illusion */
.book-3d-inner::before {
  content: '';
  position: absolute;
  top: 0; left: -12px;
  width: 12px;
  height: 100%;
  background: linear-gradient(to right, #0d2040, #1a3a6b);
  transform-origin: right center;
  transform: rotateY(-90deg) translateX(-6px);
  border-radius: 2px 0 0 2px;
}

.btn-amazon {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .45rem 1rem;
  border-radius: var(--r);
  transition: background .2s, transform .15s;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-amazon:hover { background: #a07820; transform: translateY(-1px); }

/* ── Navigation ────────────────────────────────────────────── */
.site-nav {
  background: var(--paper-card);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--ink-muted);
  text-decoration: none;
  padding: .85rem 1.4rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s, background .2s;
}

.nav-list a:hover { color: var(--accent); background: var(--accent-light); }
.nav-list a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Main content ──────────────────────────────────────────── */
.site-main { padding: 2.5rem 3rem; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 2rem 2.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}

.card:hover { box-shadow: var(--shadow-md); }

.card h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--rule);
}

.card h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .9rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule-light);
}

.card h4 {
  font-family: var(--sans);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.5rem 0 .6rem;
}

.card p { margin-bottom: .75rem; color: var(--ink-light); }
.card ul, .card ol { margin: .5rem 0 .75rem 1.5rem; color: var(--ink-light); }
.card li { margin-bottom: .35rem; }
.card a { color: var(--accent-mid); }
.card a:hover { color: var(--accent); }

/* ── Book callout ──────────────────────────────────────────── */
.book-callout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--gold-light);
  border: 1px solid #d4b86a;
  border-left: 4px solid var(--gold);
  border-radius: var(--r-md);
  padding: 1.5rem 2rem;
  margin-bottom: 1.75rem;
}

.book-callout-cover {
  flex-shrink: 0;
  width: 80px;
  perspective: 600px;
}

.book-callout-cover-inner {
  transform: rotateY(-12deg) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform .35s ease;
  filter: drop-shadow(-4px 6px 12px rgba(0,0,0,.35));
  cursor: pointer;
}

.book-callout-cover-inner:hover {
  transform: rotateY(-4deg) rotateX(1deg) translateY(-3px);
}

.book-callout-cover-inner img { width: 80px; border-radius: 2px 3px 3px 2px; display: block; }

.book-callout-body h4 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 .3rem;
}

.book-callout-body p {
  font-family: var(--sans);
  font-size: .88rem;
  color: var(--ink-muted);
  margin: 0 0 .75rem;
}

/* ── Equations ─────────────────────────────────────────────── */
.eq {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  padding: 1.25rem 1.75rem;
  margin: 1.25rem 0;
  text-align: center;
  overflow-x: auto;
}

.eq-caption {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: .5rem;
  display: block;
}

/* ── Callout boxes ─────────────────────────────────────────── */
.callout {
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-family: var(--sans);
  font-size: .9rem;
}

.callout-gold  { background: var(--gold-light);  border-left: 4px solid var(--gold);  color: var(--ink-light); }
.callout-blue  { background: var(--accent-light); border-left: 4px solid var(--accent); color: var(--ink-light); }
.callout-green { background: var(--green-light);  border-left: 4px solid var(--green);  color: var(--ink-light); }
.callout-red   { background: var(--red-light);    border-left: 4px solid var(--red);    color: var(--red); }

.callout strong { color: var(--gold); }
.callout-blue strong { color: var(--accent); }
.callout-green strong { color: var(--green); }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 1rem 0; }

table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .88rem; }
thead { background: var(--accent); color: #fff; }
th { padding: .7rem 1rem; text-align: left; font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
td { padding: .65rem 1rem; border-bottom: 1px solid var(--rule-light); color: var(--ink-light); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--paper-warm); }
tbody tr:hover { background: var(--accent-light); }

.success { color: var(--green); font-weight: 600; }
.highlight { background: var(--gold-light) !important; font-weight: 600; }

/* ── Papers grid ───────────────────────────────────────────── */
.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.paper-card {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 1.5rem;
  transition: box-shadow .2s, transform .15s;
}

.paper-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.paper-card h4 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 .6rem;
}

.paper-card p { font-family: var(--sans); font-size: .85rem; color: var(--ink-muted); margin-bottom: .5rem; }
.paper-card a { color: var(--accent-mid); text-decoration: none; }
.paper-card a:hover { text-decoration: underline; }

.paper-link {
  display: inline-block;
  margin-top: .75rem;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

.paper-link:hover { color: var(--accent-mid); }

/* ── Scripts grid ──────────────────────────────────────────── */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.script-card {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--green);
  border-radius: var(--r-md);
  padding: 1.5rem;
  transition: box-shadow .2s, transform .15s;
}

.script-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.script-card h4 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 .6rem;
}

.script-card p { font-family: var(--sans); font-size: .85rem; color: var(--ink-muted); margin-bottom: .75rem; }

.download-link {
  display: inline-block;
  margin-top: .5rem;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid var(--green);
  padding-bottom: 1px;
  transition: color .2s;
}

.download-link:hover { color: #1e6b44; }

/* ── Books grid ────────────────────────────────────────────── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.book-card {
  background: var(--gold-light);
  border: 1px solid #d4b86a;
  border-top: 3px solid var(--gold);
  border-radius: var(--r-md);
  padding: 1.5rem;
  transition: box-shadow .2s, transform .15s;
}

.book-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.book-card h4 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 .6rem;
}

.book-card p { font-family: var(--sans); font-size: .88rem; color: var(--ink-light); margin-bottom: .75rem; }

.book-link {
  display: inline-block;
  margin-top: .5rem;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 1px;
  transition: color .2s;
}

.book-link:hover { color: #a07820; }

/* ── Nav grid ──────────────────────────────────────────────── */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.nav-item {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 1.25rem;
  transition: box-shadow .2s, transform .15s;
}

.nav-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.nav-item h4 {
  font-family: var(--sans);
  font-size: .88rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 .4rem;
}

.nav-item h4 a { color: inherit; text-decoration: none; }
.nav-item h4 a:hover { text-decoration: underline; }
.nav-item p { font-family: var(--sans); font-size: .82rem; color: var(--ink-muted); margin: 0; }

/* ── Author info ───────────────────────────────────────────── */
.author-box {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: var(--r);
  padding: 1.5rem;
}

.author-box p { font-family: var(--sans); font-size: .9rem; color: var(--ink-light); margin: .35rem 0; }
.author-box ul { margin: .5rem 0 0 1.25rem; }
.author-box li { font-family: var(--sans); font-size: .88rem; color: var(--ink-muted); margin: .3rem 0; }
.author-box a { color: var(--accent-mid); }

/* ── Blog ──────────────────────────────────────────────────── */
.blog-grid { display: grid; gap: 1.5rem; }

.blog-card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 1.75rem 2rem;
  transition: box-shadow .2s, transform .15s;
}

.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.blog-meta {
  font-family: var(--sans);
  font-size: .75rem;
  color: var(--ink-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  background: var(--accent-light);
  color: var(--accent);
  padding: .15rem .5rem;
  border-radius: 2px;
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.blog-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .5rem;
  line-height: 1.35;
}

.blog-title a { color: inherit; text-decoration: none; }
.blog-title a:hover { color: var(--accent); }

.blog-excerpt {
  font-family: var(--sans);
  font-size: .88rem;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-bottom: .75rem;
}

.read-more {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

.read-more:hover { color: var(--accent-mid); }

/* Blog post page */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2rem;
  align-items: start;
}

.post-sidebar { position: sticky; top: 1rem; }

.post-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }

.post-header h1 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: .75rem;
}

.post-lede {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink-muted);
  line-height: 1.6;
  font-style: italic;
}

/* Blog content typography */
.post-body { font-family: var(--serif); font-size: 1.05rem; line-height: 1.85; color: var(--ink-light); }
.post-body h1 { font-size: 1.75rem; margin: 2.5rem 0 .75rem; border-bottom: 1px solid var(--rule); padding-bottom: .4rem; }
.post-body h2 { font-size: 1.4rem; margin: 2rem 0 .6rem; border-bottom: 1px solid var(--rule-light); padding-bottom: .35rem; }
.post-body h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.post-body p { margin-bottom: 1rem; }
.post-body ul, .post-body ol { margin: .5rem 0 1rem 1.75rem; }
.post-body li { margin-bottom: .35rem; }
.post-body strong { font-weight: 700; color: var(--ink); }
.post-body a { color: var(--accent-mid); border-bottom: 1px solid rgba(42,82,152,.3); text-decoration: none; }
.post-body a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: .75rem 1.5rem;
  background: var(--accent-light);
  border-radius: 0 var(--r) var(--r) 0;
  font-style: italic;
  color: var(--ink-muted);
}

.post-body code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .1em .35em;
  color: var(--red);
}

.post-body pre {
  background: var(--ink);
  color: #e8e8f0;
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.post-body pre code { background: none; border: none; padding: 0; color: inherit; font-size: .88rem; }

.post-body table { margin: 1.25rem 0; }

/* Sidebar widgets */
.sidebar-widget {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.sidebar-widget h5 {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule-light);
}

.sidebar-widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-widget li { margin-bottom: .5rem; }
.sidebar-widget a { font-family: var(--sans); font-size: .85rem; color: var(--accent-mid); text-decoration: none; line-height: 1.4; }
.sidebar-widget a:hover { text-decoration: underline; }
.sidebar-widget p { font-family: var(--sans); font-size: .85rem; color: var(--ink-muted); line-height: 1.5; margin-bottom: .5rem; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.post-nav a {
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

/* ── Articles form ─────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: .4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: .9rem;
  color: var(--ink);
  background: var(--paper-card);
  transition: border-color .2s, box-shadow .2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px rgba(42,82,152,.1);
}

.form-group textarea { resize: vertical; min-height: 110px; }

.help-text { font-family: var(--sans); font-size: .78rem; color: var(--ink-muted); margin-top: .25rem; display: block; }

.btn-submit {
  background: var(--green);
  color: #fff;
  border: none;
  padding: .75rem 2rem;
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 600;
  transition: background .2s, transform .15s;
}

.btn-submit:hover { background: #1e6b44; transform: translateY(-1px); }

/* ── Consciousness ─────────────────────────────────────────── */
.consciousness-box {
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-left: 4px solid #6b4fa0;
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin: .75rem 0;
  font-family: var(--sans);
  font-size: .9rem;
  color: var(--ink-light);
}

.consciousness-box ul { margin: .4rem 0 .4rem 1.25rem; }
.consciousness-box li { margin: .25rem 0; }

/* ── Physics derivation ────────────────────────────────────── */
.derivation {
  background: var(--green-light);
  border-left: 4px solid var(--green);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-family: var(--sans);
  font-size: .9rem;
}

.derivation p { margin: .4rem 0; color: var(--ink-light); }
.derivation ul, .derivation ol { margin: .4rem 0 .4rem 1.25rem; }
.derivation li { margin: .2rem 0; color: var(--ink-light); }

/* ── View counter ──────────────────────────────────────────── */
.view-counter {
  margin-top: 1rem;
  padding: .6rem;
  background: rgba(255,255,255,.1);
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.2);
  text-align: center;
}

.stats-display { display: flex; justify-content: center; gap: 1.5rem; font-family: var(--sans); font-size: .82rem; }
.stat-item { color: rgba(255,255,255,.8); font-weight: 500; background: rgba(255,255,255,.1); padding: .35rem .85rem; border-radius: 20px; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.7);
  padding: 2.5rem 3rem;
  font-family: var(--sans);
  font-size: .85rem;
}

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

.footer-col h5 {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: .75rem;
}

.footer-col p, .footer-col li { color: rgba(255,255,255,.6); margin-bottom: .35rem; line-height: 1.5; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col a { color: rgba(255,255,255,.6); text-decoration: none; transition: color .2s; }
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p { color: rgba(255,255,255,.4); margin: 0; }

.footer-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

.btn-twitter {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(29,161,242,.15);
  color: #5bb8f5;
  text-decoration: none;
  padding: .45rem 1rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid rgba(29,161,242,.3);
  transition: background .2s, color .2s;
}

.btn-twitter:hover { background: rgba(29,161,242,.25); color: #7ecbf8; }

.btn-book-footer {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,153,0,.15);
  color: #ffb347;
  text-decoration: none;
  padding: .45rem 1rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid rgba(255,153,0,.3);
  transition: background .2s, color .2s;
}

.btn-book-footer:hover { background: rgba(255,153,0,.25); color: #ffc570; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--paper-warm); }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }

/* ── MathJax ───────────────────────────────────────────────── */
.mjx-chtml { font-size: 1.05em !important; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .site-main { padding: 1.75rem 2rem; }
  .site-header { padding: 2rem 2rem 1.5rem; }
  .site-footer { padding: 2rem; }
  .header-inner { grid-template-columns: 1fr; }
  .book-widget { flex-direction: row; max-width: 100%; align-items: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; }
}

@media (max-width: 768px) {
  html { font-size: 16px; }
  .site-main { padding: 1.25rem; }
  .site-header { padding: 1.5rem 1.25rem; }
  .site-title { font-size: 1.8rem; }
  .site-footer { padding: 1.5rem 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .nav-list { flex-direction: column; }
  .nav-list a { border-bottom: 1px solid var(--rule-light); border-left: 3px solid transparent; }
  .nav-list a.active { border-left-color: var(--accent); }
  .papers-grid { grid-template-columns: 1fr; }
  .scripts-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: 1fr; }
  .nav-grid { grid-template-columns: 1fr 1fr; }
  .header-stats { flex-direction: column; gap: .75rem; }
  .hstat { border-right: none; margin-right: 0; padding-right: 0; }
  table { font-size: .8rem; }
  th, td { padding: .5rem .65rem; }
}

@media (max-width: 480px) {
  .site-title { font-size: 1.5rem; }
  .nav-grid { grid-template-columns: 1fr; }
  .card { padding: 1.25rem; }
  .post-header h1 { font-size: 1.5rem; }
}

@media print {
  body { background: white; }
  .site { box-shadow: none; background: white; border: none; }
  .site-nav, button { display: none; }
  .site-header { background: white; color: var(--ink); padding: 1rem 0; }
  .site-title { color: var(--ink); }
  .site-footer { background: white; color: var(--ink-muted); }
}
