/* ============================================================
   SkepticAayush — Design System
   Black & White · Premium · Editorial
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; }

/* ── Tokens ── */
:root {
  --ff-display: 'Cormorant Garamond', Georgia, serif;
  --ff-body:    'DM Sans', system-ui, sans-serif;
  --ff-mono:    'DM Mono', monospace;

  --nav-h: 64px;
  --max-w: 1180px;
  --read-w: 720px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── LIGHT THEME (default) ── */
:root {
  --black:   #f5f5f5;
  --ink:     #e8e8e8;
  --charcoal:#c8c8c8;
  --mid:     #888888;
  --silver:  #666666;
  --mist:    #2e2e2e;
  --smoke:   #1e1e1e;
  --white:   #141414;
  --pure:    #0f0f0f;

  --bg:      #010101;
  --surface: #0c0c0c;
  --border:  #2a2a2a;
  --text-primary: #e8e8e8;
  --text-secondary: #cccccc;
  --text-muted: #aaaaaa;

  --nav-bg: rgba(1,1,1,0.95);
  --nav-border: #0a0a0a;

  --footer-bg: #010101;
  --footer-text: #999999;
}

/* ── Base ── */
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease-in-out), color 0.3s var(--ease-in-out);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--mist); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--silver); }

/* ── Selection ── */
::selection { background: var(--text-primary); color: var(--bg); }

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(1,1,1,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: border-color 0.3s var(--ease-in-out);
}
.nav.scrolled { border-color: #1a1a1a; }

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-family: var(--ff-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.2s;
}
.nav__brand span { font-style: italic; font-weight: 400; }

.nav__links { display: flex; align-items: center; gap: 0.5rem; }

.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  transition: all 0.2s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--ff-body);
}
.nav__link:hover { color: var(--text-primary); background: var(--smoke); }

/* ── THEME TOGGLE ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.4rem 0.65rem;
  border-radius: 20px;
  transition: background 0.2s;
  font-family: var(--ff-body);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}
.theme-toggle:hover { background: var(--smoke); color: var(--text-primary); }

.theme-toggle__track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--toggle-bg);
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}
.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--toggle-thumb);
  transition: transform 0.3s var(--ease-out), background 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(16px);
}
.theme-toggle__icon { font-size: 0.9rem; }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 4rem) 2rem 6rem;
  position: relative;
  overflow: hidden;
  background: #010101;
}

/* ── Hero background video ── */
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
  opacity: 1;
  mix-blend-mode: normal;
  will-change: opacity;
  transition: opacity 0.6s ease;
}

[data-theme="dark"] .hero__video {
  opacity: 1;
  mix-blend-mode: normal;
}

.hero__content {
  position: relative;
  text-align: center;
  max-width: 800px;
}

.hero__eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  animation: fadeUp 0.9s var(--ease-out) 0.1s both;
}

.hero__title {
  font-family: var(--ff-display);
  font-size: clamp(3.2rem, 7vw, 6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  animation: fadeUp 0.9s var(--ease-out) 0.2s both;
}
.hero__title em { font-style: italic; color: var(--charcoal); }

.hero__sub {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 2.5rem;
  animation: fadeUp 0.9s var(--ease-out) 0.3s both;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--text-primary);
  padding-bottom: 0.3rem;
  cursor: pointer;
  font-family: var(--ff-body);
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
  animation: fadeUp 0.9s var(--ease-out) 0.4s both;
  opacity: 0.75;
}
.hero__cta:hover { opacity: 1; gap: 1rem; }
.hero__cta .arrow { transition: transform 0.25s var(--ease-out); }
.hero__cta:hover .arrow { transform: translateX(5px); }

.hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 1s var(--ease-out) 1.2s both;
}
.hero__scroll span { font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); }
.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollLine 1.8s ease-in-out infinite;
}
@keyframes scrollLine {
  0%  { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100%{ transform: scaleY(0); transform-origin: bottom; }
}

/* ── SECTION DIVIDER ── */
.divider {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.divider__line { flex: 1; height: 1px; background: var(--border); }
.divider__label { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }

/* ── ABOUT SECTION ── */
.about-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 5rem;
  align-items: start;
}

.about-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.about-heading {
  font-family: var(--ff-display);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.about-heading em {
  font-style: italic;
  font-weight: 400;
}

.about-body {
  padding-top: 0.5rem;
}

.about-text {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.about-text:last-child { margin-bottom: 0; }

.about-sig {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.about-sig__name {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text-primary);
}
.about-sig__line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── FEATURED POST ── */
.featured {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.featured__card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.4s var(--ease-out);
}
.featured__card:hover { box-shadow: 0 20px 60px rgba(0,0,0,0.12); }

.featured__img-wrap {
  aspect-ratio: 4/3;
  background: var(--smoke);
  overflow: hidden;
  position: relative;
}
.featured__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}
.featured__card:hover .featured__img { transform: scale(1.04); }
.featured__img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 5rem;
  font-style: italic;
  color: var(--border);
  background: var(--smoke);
}

.featured__body {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
}
.featured__tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.featured__title {
  font-family: var(--ff-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  flex: 1;
}
.featured__excerpt {
  font-size: 0.97rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--smoke);
  padding-top: 1.25rem;
}
.featured__date { font-size: 0.8rem; color: var(--text-muted); }
.featured__read { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; color: var(--text-primary); }

/* ── POST GRID ── */
.posts-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
}

.post-card {
  background: var(--surface);
  padding: 2rem;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.post-card:hover { background: var(--smoke); }

.post-card__img-wrap {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--smoke);
  margin-bottom: 0.25rem;
}
.post-card__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.post-card:hover .post-card__img { transform: scale(1.05); }
.post-card__img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 2.5rem;
  color: var(--border);
}

.post-card__tag { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.post-card__title {
  font-family: var(--ff-display);
  font-size: 1.4rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.post-card__excerpt {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.post-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--smoke);
}
.post-card__date { font-size: 0.75rem; color: var(--text-muted); }
.post-card__arrow { font-size: 0.8rem; color: var(--text-muted); transition: transform 0.2s, color 0.2s; }
.post-card:hover .post-card__arrow { transform: translateX(3px); color: var(--text-primary); }

.empty-state {
  grid-column: 1 / -1;
  background: var(--surface);
  padding: 6rem 2rem;
  text-align: center;
}
.empty-state__icon {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 4rem;
  color: var(--border);
  margin-bottom: 1.5rem;
}
.empty-state__title { font-family: var(--ff-display); font-size: 1.9rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.empty-state__sub { font-size: 0.92rem; color: var(--text-muted); }

/* ── POST READER ── */
.reader {
  max-width: var(--read-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 3rem) 2rem 6rem;
  animation: fadeUp 0.6s var(--ease-out) both;
}

.reader__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--ff-body);
  margin-bottom: 3rem;
  transition: color 0.2s;
}
.reader__back:hover { color: var(--text-primary); }

.reader__tag { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; }

.reader__title {
  font-family: var(--ff-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.reader__meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.reader__author { font-size: 0.88rem; font-weight: 500; color: var(--text-primary); }
.reader__date { font-size: 0.85rem; color: var(--text-muted); }
.reader__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }

.reader__cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-bottom: 3rem;
  background: var(--smoke);
}

.reader__body {
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}
.reader__body p { margin-bottom: 1.5rem; }
.reader__inline-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 2px;
  display: block;
}

/* ── FOOTER ── */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 4rem 2rem 3rem;
  transition: background 0.3s;
}
.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 2.5rem;
}
.footer__brand {
  font-family: var(--ff-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: #e8e8e8;
  font-style: italic;
  letter-spacing: -0.02em;
}
.footer__brand-sub { font-size: 0.85rem; color: var(--footer-text); margin-top: 0.4rem; font-family: var(--ff-body); font-style: normal; }

.footer__tagline {
  font-size: 0.9rem;
  color: var(--footer-text);
  line-height: 1.6;
  max-width: 320px;
  text-align: right;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--footer-text);
}
.footer__copy { font-family: var(--ff-mono); letter-spacing: 0.02em; }
.footer__admin-link {
  background: none;
  border: none;
  color: transparent;
  cursor: default;
  font-size: 0.1px;
  padding: 1rem;
  user-select: none;
}

/* ── PASSWORD GATE ── */
.gate {
  min-height: 100vh;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.4s var(--ease-out) both;
}
.gate__box {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.gate__brand {
  font-family: var(--ff-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: #e8e8e8;
  font-style: italic;
  margin-bottom: 0.5rem;
}
.gate__sub { font-size: 0.8rem; color: #aaaaaa; margin-bottom: 3rem; letter-spacing: 0.04em; }
.gate__label { display: block; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: #aaaaaa; margin-bottom: 0.6rem; text-align: left; }
.gate__input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid #2e2e2e;
  border-radius: 2px;
  color: #e8e8e8;
  font-family: var(--ff-mono);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  letter-spacing: 0.15em;
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
  text-align: center;
}
.gate__input:focus { border-color: #aaaaaa; }
.gate__input::placeholder { color: #2e2e2e; letter-spacing: 0.05em; }
.gate__btn {
  width: 100%;
  background: #e8e8e8;
  color: #0a0a0a;
  border: none;
  border-radius: 2px;
  font-family: var(--ff-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.gate__btn:hover { background: #f0f0f0; }
.gate__error { font-size: 0.8rem; color: #b05050; margin-top: 0.75rem; min-height: 1.2em; }

/* ── ADMIN SHELL ── */
.admin {
  display: flex;
  min-height: 100vh;
  background: #111;
  animation: fadeIn 0.4s var(--ease-out) both;
}

.admin__sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #111;
  border-right: 1px solid #222;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin__logo {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px solid #222;
}
.admin__logo-name {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: #e8e8e8;
  font-style: italic;
}
.admin__logo-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.08);
  color: #aaaaaa;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  margin-top: 0.3rem;
}

.admin__nav { flex: 1; padding: 1rem 0; }

.admin__nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 1.5rem;
  font-size: 0.85rem;
  color: #aaaaaa;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--ff-body);
  text-align: left;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.admin__nav-item:hover { color: #e8e8e8; background: rgba(255,255,255,0.04); }
.admin__nav-item.active { color: #e8e8e8; border-left-color: #e8e8e8; background: rgba(255,255,255,0.06); }
.admin__nav-item .icon { font-size: 1rem; width: 18px; text-align: center; }

.admin__nav-section {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888888;
  padding: 1.5rem 1.5rem 0.5rem;
}

.admin__logout {
  padding: 1rem 1.5rem;
  border-top: 1px solid #222;
}
.admin__logout-btn {
  font-size: 0.8rem;
  color: #aaaaaa;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--ff-body);
  padding: 0;
  transition: color 0.15s;
}
.admin__logout-btn:hover { color: #b05050; }

/* ── ADMIN MAIN ── */
.admin__main {
  flex: 1;
  padding: 2.5rem 3rem;
  overflow-y: auto;
  background: #0d0d0d;
}

.admin__page { display: none; }
.admin__page.active { display: block; }

.admin__page-header { margin-bottom: 2.5rem; }
.admin__page-title {
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 400;
  color: #e8e8e8;
  font-style: italic;
  margin-bottom: 0.35rem;
}
.admin__page-sub { font-size: 0.85rem; color: #aaaaaa; }

/* Stats row */
.admin__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #222;
  margin-bottom: 2.5rem;
}
.admin__stat {
  background: #111;
  padding: 1.5rem;
}
.admin__stat-val { font-family: var(--ff-display); font-size: 2.5rem; color: #e8e8e8; font-style: italic; line-height: 1; }
.admin__stat-label { font-size: 0.75rem; color: #aaaaaa; margin-top: 0.35rem; letter-spacing: 0.06em; }

/* Post list in admin */
.admin__post-list { display: flex; flex-direction: column; gap: 1px; background: #222; }
.admin__post-row {
  background: #111;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: background 0.15s;
}
.admin__post-row:hover { background: #161616; }
.admin__post-row-title { font-size: 0.97rem; color: #e8e8e8; flex: 1; font-family: var(--ff-display); font-style: italic; }
.admin__post-row-meta { font-size: 0.75rem; color: #aaaaaa; white-space: nowrap; }
.admin__post-row-tag { font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: #999999; background: #1a1a1a; padding: 0.2rem 0.55rem; border-radius: 2px; white-space: nowrap; }
.admin__post-row-del {
  background: none;
  border: 1px solid #2a2a2a;
  border-radius: 2px;
  color: #999999;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  font-family: var(--ff-body);
  transition: all 0.15s;
  white-space: nowrap;
}
.admin__post-row-del:hover { border-color: #b05050; color: #b05050; }

.admin__empty {
  background: #111;
  padding: 4rem 2rem;
  text-align: center;
  color: #aaaaaa;
  font-size: 0.92rem;
  font-family: var(--ff-display);
  font-style: italic;
}

/* ── COMPOSE FORM ── */
.compose { max-width: 700px; }

.compose__field { margin-bottom: 1.5rem; }
.compose__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #999999;
  margin-bottom: 0.6rem;
}
.compose__input,
.compose__textarea,
.compose__select {
  width: 100%;
  background: #111;
  border: 1px solid #222;
  border-radius: 2px;
  color: #e8e8e8;
  font-family: var(--ff-body);
  font-size: 0.97rem;
  padding: 0.8rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.compose__input:focus,
.compose__textarea:focus,
.compose__select:focus { border-color: #999999; }
.compose__input::placeholder,
.compose__textarea::placeholder { color: #2a2a2a; }
.compose__input--title {
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-style: italic;
  letter-spacing: -0.01em;
  padding: 0.9rem 1rem;
}

.compose__textarea { resize: vertical; min-height: 320px; line-height: 1.7; }
.compose__select option { background: #111; color: #e8e8e8; }

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

/* Image upload */
.compose__upload-wrap {
  border: 1px dashed #2a2a2a;
  border-radius: 2px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.compose__upload-wrap:hover { border-color: #999999; background: rgba(255,255,255,0.02); }
.compose__upload-wrap.has-image { padding: 0; border-style: solid; border-color: #888888; }
.compose__upload-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.compose__upload-text { font-size: 0.85rem; color: #aaaaaa; }
.compose__upload-hint { font-size: 0.75rem; color: #888888; margin-top: 0.3rem; }
.compose__preview { width: 100%; height: 200px; object-fit: cover; display: none; }
.compose__preview.visible { display: block; }
#cover-input { display: none; }

.compose__actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.compose__publish {
  background: #e8e8e8;
  color: #0a0a0a;
  border: none;
  border-radius: 2px;
  font-family: var(--ff-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: all 0.2s;
}
.compose__publish:hover { background: #f0f0f0; }
.compose__cancel {
  background: none;
  border: none;
  font-family: var(--ff-body);
  font-size: 0.8rem;
  color: #999999;
  cursor: pointer;
  transition: color 0.15s;
}
.compose__cancel:hover { color: #aaaaaa; }

/* ── GRAIN OVERLAY ── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
  mix-blend-mode: multiply;
}
[data-theme="dark"] .grain {
  opacity: 0.055;
  mix-blend-mode: screen;
}

/* ── POST CARD READING TIME ── */
.post-card__readtime {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--ff-mono);
}


.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.85rem 1.75rem;
  border-radius: 2px;
  border: 1px solid var(--border);
  opacity: 0;
  transition: all 0.35s var(--ease-out);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  will-change: opacity, transform;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible { will-change: auto; }
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .featured__card { grid-template-columns: 1fr; }
  .featured__body { padding: 2rem; }
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .admin__stats { grid-template-columns: 1fr 1fr; }
  .about-inner { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 600px) {
  .posts-grid { grid-template-columns: 1fr; }
  .admin { flex-direction: column; }
  .admin__sidebar { width: 100%; height: auto; position: static; }
  .admin__main { padding: 1.5rem; }
  .compose__row { grid-template-columns: 1fr; }
  .footer__top { flex-direction: column; gap: 1.5rem; }
  .footer__tagline { text-align: left; }
  .footer__bottom { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
}

/* ── UPDATED CARD SIZING & CONTRAST ── */
.posts-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1px !important;
}

.post-card {
  padding: 1.25rem !important;
  gap: 0.5rem !important;
}

.post-card__img-wrap {
  aspect-ratio: 3/2 !important;
}

.post-card__title {
  font-size: 1.15rem !important;
  color: var(--ink) !important;
}

.post-card__tag {
  color: var(--charcoal) !important;
  font-size: 0.65rem !important;
}

.post-card__excerpt {
  font-size: 0.82rem !important;
  color: var(--charcoal) !important;
  -webkit-line-clamp: 2 !important;
}

.post-card__date {
  color: var(--mid) !important;
  font-size: 0.72rem !important;
}

.post-card__readtime {
  color: var(--mid) !important;
}

/* Stronger contrast overrides */
[data-theme="light"] .post-card {
  background: #ffffff !important;
}
[data-theme="light"] .post-card:hover {
  background: #f5f5f5 !important;
}
[data-theme="light"] .post-card__title {
  color: #111111 !important;
}
[data-theme="light"] .post-card__excerpt {
  color: #999999 !important;
}
[data-theme="dark"] .post-card {
  background: #161616 !important;
}
[data-theme="dark"] .post-card:hover {
  background: #1e1e1e !important;
}
[data-theme="dark"] .post-card__title {
  color: #e8e8e8 !important;
}
[data-theme="dark"] .post-card__excerpt {
  color: #cccccc !important;
}

/* ── HERO TITLE WORD ANIMATION ── */
.hero__title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  animation: wordFadeUp 0.7s cubic-bezier(0.16,1,0.3,1) forwards;
}

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

/* ── INLINE IMAGE FIGURE ── */
.reader__inline-figure {
  margin: 2rem auto;
  display: block;
}
.reader__inline-figure .reader__inline-img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  display: block;
  margin: 0;
}



/* ══════════════════════════════════════════════
   NEW FEATURES — Reading progress, tag filter,
   theme transition, hero video, read time
   ══════════════════════════════════════════════ */



/* ── Reading progress bar ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--text-primary);
  z-index: 9999;
  transition: width 0.1s linear, opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}
.reading-progress.visible { opacity: 1; }

/* ── Hero video — bump opacity in light mode ── */


/* ── Tag filter bar ── */
.tag-filter {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tag-filter__btn {
  font-family: var(--ff-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: all 0.18s;
}
.tag-filter__btn:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.tag-filter__btn.active {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

/* ── Reader read time (already in meta, just ensure spacing) ── */
.reader__readtime {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── OG / share meta is handled in <head>, no CSS needed ── */

/* ══════════════════════════════════════════════════
   ALL ADDITIONS — single clean block
   ══════════════════════════════════════════════════ */

/* Global transition removed — handled via .no-transition class in JS */
.hero__video { transition: opacity 0.6s ease !important; }
.post-card, .nav__link, .hero__cta, .theme-toggle__thumb {
  transition: background-color 0.45s ease, color 0.35s ease,
              opacity 0.2s ease, transform 0.2s cubic-bezier(0.16,1,0.3,1) !important;
}

/* Grain */
.grain {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: 0.038; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 180px 180px;
}
[data-theme="dark"] .grain { opacity: 0.055; mix-blend-mode: screen; }

/* Reading progress */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--text-primary); z-index: 9999;
  opacity: 0; transition: opacity 0.3s, width 0.1s linear;
}
.reading-progress.visible { opacity: 1; }

/* Inline image */
.reader__inline-figure { margin: 2rem auto; display: block; }
.reader__inline-figure .reader__inline-img { width: 100%; height: auto; border-radius: 2px; display: block; }

/* Card contrast */
[data-theme="light"] .post-card          { background: #ffffff; }
[data-theme="light"] .post-card:hover    { background: #f5f5f5; }
[data-theme="light"] .post-card__title   { color: #111111; }
[data-theme="light"] .post-card__excerpt { color: #999999; }
[data-theme="dark"]  .post-card          { background: #161616; }
[data-theme="dark"]  .post-card:hover    { background: #1e1e1e; }
[data-theme="dark"]  .post-card__title   { color: #e8e8e8; }
[data-theme="dark"]  .post-card__excerpt { color: #cccccc; }
.posts-grid { grid-template-columns: repeat(3,1fr); gap: 1px; }
.post-card  { padding: 1.25rem; }

/* Hero word animation */
.hero__title .word {
  display: inline-block; opacity: 0; transform: translateY(18px);
  animation: wordFadeUp 0.7s cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes wordFadeUp { to { opacity: 1; transform: translateY(0); } }

/* Hamburger */
.nav__hamburger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 40px; height: 40px;
  background: none; border: none; cursor: pointer; padding: 8px;
  -webkit-tap-highlight-color: transparent;
}
.nav__hamburger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text-primary); border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1); transform-origin: center;
}
.nav__hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.nav__drawer {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem; flex-direction: column; gap: 0.25rem;
  z-index: 999; opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.nav__drawer.open { opacity: 1; transform: translateY(0); pointer-events: all; }
.nav__drawer-link {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--border);
  font-family: var(--ff-body); font-size: 1rem; font-weight: 500;
  color: var(--text-secondary); padding: 0.85rem 0.5rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav__drawer-theme {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 0.5rem 0.25rem;
}
.nav__drawer-theme-label {
  font-size: 1rem; font-weight: 500;
  color: var(--text-secondary); font-family: var(--ff-body);
}
.nav__drawer-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  background: none; border: none; cursor: pointer; padding: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}
.nav__drawer-toggle-track {
  width: 44px; height: 24px; border-radius: 12px; background: var(--toggle-bg); position: relative;
}
.nav__drawer-toggle-thumb {
  position: absolute; top: 4px; left: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--toggle-thumb);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-theme="dark"] .nav__drawer-toggle-thumb { transform: translateX(20px); }

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .featured__card { grid-template-columns: 1fr; }
  .featured__body { padding: 1.75rem; }
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .about-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero__title { font-size: clamp(2rem, 6vw, 3.5rem); }
  .admin__stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  /* Nav */
  .nav__links     { display: none; }
  .nav__hamburger { display: flex; }
  .nav__drawer    { display: flex; }
  .nav__inner     { padding: 0 1rem; }

  /* Hero — THE fix */
  .hero {
    overflow: hidden;
    position: relative;
    padding: calc(var(--nav-h) + 2rem) 1.25rem 4rem;
    min-height: 95svh;
  }
  /* Video is 16:9 landscape. On portrait phones, we centre it
     and scale it to fill the width — height will be less than
     the hero height so it stays fully inside the screen. */
  .hero__video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    object-fit: unset !important;
    max-width: 100% !important;
  }

  .hero__title    { font-size: clamp(1.9rem, 8vw, 2.8rem); line-height: 1.1; }
  .hero__sub      { font-size: 0.95rem; }
  .hero__eyebrow  { font-size: 0.7rem; }
  .posts-grid     { grid-template-columns: 1fr; }
  .post-card      { padding: 1rem; }
  .featured__body { padding: 1.25rem; }
  .featured__title { font-size: 1.5rem; }
  .reader         { padding: calc(var(--nav-h) + 1.5rem) 1.25rem 4rem; }
  .reader__body   { font-size: 1rem; line-height: 1.8; }
  .about-section  { padding: 3rem 1.25rem; }
  .about-heading  { font-size: 2rem; }
  .footer__top    { flex-direction: column; gap: 1.25rem; }
  .footer__tagline { text-align: left; font-size: 0.82rem; }
  .footer__bottom { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .footer__brand  { font-size: 1.4rem; }
  footer          { padding: 2.5rem 1.25rem 2rem; }
  .divider        { padding: 0 1.25rem; }
  .posts-section  { padding: 0 0 4rem; }
  .compose__row   { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .hero__title { font-size: 1.7rem; }
  .nav__brand  { font-size: 1.2rem; }
}

/* ══ PWA INSTALL BANNER ══ */
.pwa-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 480px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  z-index: 9000;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1);
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.pwa-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.pwa-banner__left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.pwa-banner__icon img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
}

.pwa-banner__title {
  font-family: var(--ff-display);
  font-size: 1rem;
  font-style: italic;
  font-weight: 600;
  color: #e8e8e8;
  letter-spacing: -0.01em;
}

.pwa-banner__sub {
  font-size: 0.75rem;
  color: #aaaaaa;
  font-family: var(--ff-body);
  margin-top: 0.1rem;
}

.pwa-banner__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pwa-banner__install {
  background: #e8e8e8;
  color: #111;
  border: none;
  border-radius: 6px;
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.pwa-banner__install:hover { background: #ffffff; }

.pwa-banner__dismiss {
  background: none;
  border: none;
  color: #aaaaaa;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.pwa-banner__dismiss:hover { color: #e8e8e8; }

@media (max-width: 400px) {
  .pwa-banner { bottom: 1rem; }
  .pwa-banner__sub { display: none; }
}

/* ══ READER EXPERIENCE FIX ══ */

/* Slightly lifted background so it's not pure black — easier on eyes */
#view-reader {
  background: #161616;
  min-height: 100vh;
}

.reader {
  max-width: 680px !important;
  margin: 0 auto !important;
  padding: calc(var(--nav-h) + 4rem) 2.5rem 8rem !important;
}

/* Back button — more visible */
.reader__back {
  font-size: 0.75rem !important;
  letter-spacing: 0.12em !important;
  color: #aaaaaa !important;
  margin-bottom: 3.5rem !important;
  padding: 0.5rem 0 !important;
}
.reader__back:hover { color: #e8e8e8 !important; }

/* Tag */
.reader__tag {
  font-size: 0.68rem !important;
  letter-spacing: 0.22em !important;
  color: #aaaaaa !important;
  margin-bottom: 1.25rem !important;
}

/* Title — bigger and more airy */
.reader__title {
  font-size: clamp(2.4rem, 5vw, 3.8rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.03em !important;
  color: #f0f0f0 !important;
  margin-bottom: 2rem !important;
}

/* Meta row */
.reader__meta {
  gap: 1rem !important;
  padding: 1.25rem 0 !important;
  border-color: #222222 !important;
  margin-bottom: 3rem !important;
}
.reader__author  { font-size: 0.9rem !important; color: #cccccc !important; }
.reader__date    { font-size: 0.82rem !important; color: #aaaaaa !important; }
.reader__readtime { font-size: 0.82rem !important; color: #aaaaaa !important; }
.reader__dot     { background: #333333 !important; }

/* Timestamp */
.reader__timestamp {
  font-size: 0.72rem !important;
  color: #999999 !important;
  margin-top: -2rem !important;
  margin-bottom: 2.5rem !important;
  font-family: var(--ff-mono) !important;
}

/* Body text — the main fix */
.reader__body {
  font-size: 1.18rem !important;
  line-height: 2 !important;
  color: #c8c8c8 !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  letter-spacing: 0.01em !important;
}

/* Paragraph spacing */
.reader__body p {
  margin-bottom: 2rem !important;
}

/* Indent first paragraph slightly */
.reader__body > p:first-child {
  font-size: 1.22rem !important;
  color: #d8d8d8 !important;
}

/* Divider between meta and body */
.reader__cover {
  border-radius: 4px !important;
  margin-bottom: 3.5rem !important;
}

/* Love row */
.reader__love-row {
  margin-top: 4rem !important;
  padding-top: 2.5rem !important;
  border-top: 1px solid #3a3a3a !important;
}
.reader__love-label { color: #999999 !important; }

/* Mobile reader */
@media (max-width: 640px) {
  .reader {
    padding: calc(var(--nav-h) + 2rem) 1.5rem 5rem !important;
  }
  .reader__title { font-size: 2rem !important; }
  .reader__body  { font-size: 1.05rem !important; line-height: 1.9 !important; }
}

/* ══ BLOG BODY & FOOTER FONT INCREASE ══ */

/* Reader body text — bigger */
.reader__body {
  font-size: 1.28rem !important;
  line-height: 2.05 !important;
}
.reader__body > p:first-child {
  font-size: 1.32rem !important;
}
@media (max-width: 640px) {
  .reader__body { font-size: 1.12rem !important; }
  .reader__body > p:first-child { font-size: 1.15rem !important; }
}

/* Footer text — bigger */
.footer__brand     { font-size: 2rem !important; }
.footer__brand-sub { font-size: 1.05rem !important; }
.footer__tagline   { font-size: 1.05rem !important; line-height: 1.8 !important; }
.footer__copy      { font-size: 0.92rem !important; }

/* ══ LOVE REACTION ══ */
.reader__love-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #3a3a3a;
}
.reader__love-label {
  font-size: 0.85rem;
  color: #aaaaaa;
  font-family: var(--ff-body);
}
.post-love {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  font-family: var(--ff-body);
  font-size: 0.85rem;
  color: #aaaaaa;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
}
.post-love:hover {
  border-color: #c0404080;
  color: #e05555;
  background: rgba(224,85,85,0.06);
}
.post-love.loved {
  border-color: #e05555;
  color: #e05555;
  background: rgba(224,85,85,0.08);
}
.post-love__icon {
  font-size: 1rem;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
  line-height: 1;
}
.post-love.loved .post-love__icon {
  transform: scale(1.35);
}
.post-love__count {
  font-weight: 600;
  font-size: 0.82rem;
  min-width: 14px;
}

/* ══ VERTICAL POST LIST (replaces grid) ══ */
#posts-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  background: none !important;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.post-list__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid #3a3a3a;
  cursor: pointer;
  transition: opacity 0.2s;
}
.post-list__item:first-child { border-top: 1px solid #3a3a3a; }
.post-list__item:hover { opacity: 0.75; }

.post-list__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.post-list__tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #aaaaaa;
  font-family: var(--ff-mono);
}

.post-list__title {
  font-family: var(--ff-display);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #e8e8e8;
  transition: color 0.2s;
}
.post-list__item:hover .post-list__title { color: #ffffff; }

.post-list__excerpt {
  font-size: 0.95rem;
  color: #aaaaaa;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-list__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.post-list__date { font-size: 0.78rem; color: #999999; }
.post-list__dot  { color: #888888; font-size: 0.7rem; }
.post-list__read { font-size: 0.78rem; color: #999999; }

.post-list__img {
  width: 120px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 3px;
}
.post-list__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  #posts-grid { padding: 0 1.25rem !important; }
  .post-list__item { gap: 1.25rem; padding: 2rem 0; }
  .post-list__title { font-size: 1.25rem; }
  .post-list__img { width: 80px; height: 60px; }
  .post-list__excerpt { display: none; }
}

/* ══ POSTS GRID — all posts, same style ══ */
.posts-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

#posts-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1px !important;
  background: #1a1a1a !important;
}

.pgrid__card {
  background: #111111;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.pgrid__card:hover { background: #161616; }

.pgrid__img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #1a1a1a;
}
.pgrid__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.pgrid__card:hover .pgrid__img { transform: scale(1.04); }
.pgrid__img--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 2rem;
  color: #2a2a2a;
}

.pgrid__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.pgrid__tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #aaaaaa;
  font-family: var(--ff-mono);
}
.pgrid__title {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #e8e8e8;
}
.pgrid__excerpt {
  font-size: 0.85rem;
  color: #aaaaaa;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.pgrid__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid #3a3a3a;
  margin-top: auto;
}
.pgrid__date { font-size: 0.75rem; color: #999999; }
.pgrid__dot  { color: #888888; font-size: 0.65rem; }
.pgrid__read { font-size: 0.75rem; color: #999999; }

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  background: #111111;
  padding: 6rem 2rem;
  text-align: center;
}
.empty-state__icon  { font-family: var(--ff-display); font-style: italic; font-size: 3rem; color: #2a2a2a; margin-bottom: 1rem; }
.empty-state__title { font-family: var(--ff-display); font-size: 1.6rem; color: #999999; margin-bottom: 0.5rem; }
.empty-state__sub   { font-size: 0.88rem; color: #888888; }

/* Responsive */
@media (max-width: 900px) {
  #posts-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 540px) {
  #posts-grid { grid-template-columns: 1fr !important; }
  .posts-section { padding: 2rem 0 4rem; }
  .pgrid__body { padding: 1.25rem; }
  .pgrid__title { font-size: 1.15rem; }
}

/* ══ FULL WIDTH FEED ══ */
#posts-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  background: none !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  padding: 0 2rem !important;
}

.feed__card {
  width: 100%;
  border-bottom: 1px solid #3a3a3a;
  padding: 2.5rem 0;
  cursor: pointer;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.feed__card:first-child { border-top: 1px solid #3a3a3a; }
.feed__card:hover { opacity: 0.8; }

.feed__img-wrap {
  width: 100%;
  aspect-ratio: 16/6;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}
.feed__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.feed__card:hover .feed__img { transform: scale(1.02); }

.feed__body { display: flex; flex-direction: column; gap: 0.6rem; }

.feed__tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #aaaaaa;
  font-family: var(--ff-mono);
}
.feed__title {
  font-family: var(--ff-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #e8e8e8;
}

.feed__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.feed__date { font-size: 0.8rem; color: #999999; }
.feed__dot  { color: #888888; font-size: 0.7rem; }
.feed__read { font-size: 0.8rem; color: #999999; }

.posts-section { padding-top: 3rem !important; }

@media (max-width: 640px) {
  #posts-grid { padding: 0 1.25rem !important; }
  .feed__card { padding: 2rem 0; }
  .feed__title { font-size: 1.4rem; }
  
  .feed__img-wrap { aspect-ratio: 16/7; }
}

/* ══ FONT SIZE & COLOR IMPROVEMENTS ══ */

/* Base body */
body { font-size: 18px; }

/* Navbar */
.nav__brand      { font-size: 1.8rem !important; }
.nav__link       { font-size: 1rem !important; }
.nav__drawer-link { font-size: 1.1rem !important; }

/* Feed cards */
.feed__tag     { font-size: 0.82rem !important; letter-spacing: 0.18em !important; color: #777777 !important; }
.feed__title   { font-size: clamp(1.8rem, 3.5vw, 2.4rem) !important; color: #f0f0f0 !important; }

.feed__date    { font-size: 0.95rem !important; color: #aaaaaa !important; }
.feed__read    { font-size: 0.95rem !important; color: #aaaaaa !important; }

/* Reader */
.reader__body {
  font-size: 1.25rem !important;
  line-height: 2.0 !important;
  color: #cccccc !important;
}
.reader__title  { font-size: clamp(2.2rem, 5vw, 3.5rem) !important; color: #f2f2f2 !important; }
.reader__author { font-size: 1.05rem !important; color: #cccccc !important; }
.reader__date   { font-size: 0.97rem !important; color: #aaaaaa !important; }
.reader__readtime { font-size: 0.97rem !important; color: #aaaaaa !important; }
.reader__tag    { font-size: 0.85rem !important; color: #aaaaaa !important; }

/* About section */
.about-text     { font-size: 1.15rem !important; line-height: 1.9 !important; color: #aaaaaa !important; }
.about-heading  { font-size: clamp(2.2rem, 4vw, 3rem) !important; color: #f0f0f0 !important; }
.about-label    { font-size: 0.88rem !important; color: #aaaaaa !important; }
.about-sig__name { font-size: 1.4rem !important; color: #cccccc !important; }

/* Footer */
.footer__brand     { font-size: 2rem !important; }
.footer__brand-sub { font-size: 1.05rem !important; color: #aaaaaa !important; }
.footer__tagline   { font-size: 1.05rem !important; color: #aaaaaa !important; line-height: 1.8 !important; }
.footer__copy      { font-size: 0.95rem !important; color: #999999 !important; }

/* Mobile adjustments */
@media (max-width: 640px) {
  body             { font-size: 17px; }
  .reader__body    { font-size: 1.1rem !important; }
  .feed__title     { font-size: 1.5rem !important; }
}

/* ══════════════════════════════════════════════════
   CORE WEB VITALS & ACCESSIBILITY IMPROVEMENTS
   ══════════════════════════════════════════════════ */

/* ── Focus styles — visible for all keyboard users ── */
:focus-visible {
  outline: 2px solid #e8e8e8;
  outline-offset: 3px;
  border-radius: 2px;
}
[data-theme="light"] :focus-visible { outline-color: #111111; }

/* Remove default outline only when not keyboard navigating */
:focus:not(:focus-visible) { outline: none; }

/* ── content-visibility: boost rendering performance on off-screen sections ── */
.posts-section,
.about-section,
footer {
  content-visibility: auto;
  contain-intrinsic-size: 0 600px;
}

/* ── Reduced motion — respect user preference ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero__video { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ── High contrast mode ── */
@media (forced-colors: active) {
  .nav { border-bottom: 1px solid ButtonText; }
  .feed__card { border-bottom: 1px solid ButtonText; }
  .reader__meta { border-color: ButtonText; }
  .post-love { border-color: ButtonText; }
}

/* ── Touch targets — minimum 44×44px for all interactive elements ── */
button, [role="button"], .nav__link, .nav__drawer-link,
.tag-filter__btn, .reader__back, .post-love,
.pwa-banner__install, .pwa-banner__dismiss {
  min-height: 44px;
  min-width: 44px;
}

/* ── Better colour contrast for WCAG AA ── */
.feed__tag    { color: #bbbbbb; }
.feed__date   { color: #bbbbbb; }
.feed__read   { color: #bbbbbb; }
.pgrid__tag   { color: #bbbbbb; }
.pgrid__date  { color: #bbbbbb; }
.pgrid__read  { color: #bbbbbb; }
.reader__tag  { color: #bbbbbb; }
.reader__date { color: #bbbbbb; }
.reader__readtime { color: #bbbbbb; }
.reader__back { color: #bbbbbb; }
.post-list__date { color: #bbbbbb; }
.post-list__read { color: #bbbbbb; }

/* ── Image performance ── */
img {
  max-width: 100%;
  height: auto;
  /* Prevent layout shift */
}
.feed__img, .pgrid__img, .post-list__img img,
.featured__img, .post-card__img, .reader__cover {
  object-fit: cover;
  will-change: transform;
}

/* ── Prevent layout shift on font load ── */
body {
  font-display: swap;
  size-adjust: 100%;
}

/* ── Print styles ── */
@media print {
  .nav, .hero__video, .grain, .reading-progress,
  .pwa-banner, .hero__scroll, .post-love,
  .nav__hamburger, .nav__drawer { display: none !important; }

  body { background: #fff; color: #000; font-size: 12pt; }
  .reader { max-width: 100%; padding: 0; }
  .reader__title { font-size: 24pt; }
  .reader__body { font-size: 11pt; line-height: 1.6; color: #000; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }

  footer { border-top: 1px solid #ccc; padding: 1rem 0; }
  .footer__brand, .footer__tagline { color: #333; }
}

/* ── Excerpt fade — theme-aware gradient ── */
[data-theme="dark"]  
[data-theme="light"] 

/* On hover: fade lifts slightly so a tiny bit more text peeks through */
.feed__card:hover 




/* ══════════════════════════════════════════════════
   FEATURE: Text Size Control
   ══════════════════════════════════════════════════ */
.text-size-ctrl {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.text-size-ctrl__btn {
  background: none;
  border: 1px solid var(--border-strong, #3a3a3a);
  border-radius: 3px;
  color: var(--text-muted);
  font-family: var(--ff-body);
  font-weight: 600;
  cursor: pointer;
  padding: 0.18rem 0.55rem;
  line-height: 1;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  min-height: 32px;
  min-width: 32px;
}
.text-size-ctrl__btn:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.text-size-ctrl__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.text-size-ctrl__label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.25rem;
  min-width: 28px;
  text-align: center;
  font-family: var(--ff-mono);
}
.text-size-ctrl__btn--sm { font-size: 0.75rem; }
.text-size-ctrl__btn--lg { font-size: 1rem; }

/* Reader body font size — controlled via data-size attribute on .reader */
.reader[data-size="xs"] .reader__body { font-size: 0.95rem  !important; line-height: 1.8  !important; }
.reader[data-size="sm"] .reader__body { font-size: 1.02rem  !important; line-height: 1.82 !important; }
.reader[data-size="md"] .reader__body { font-size: 1.1rem   !important; line-height: 1.85 !important; }
.reader[data-size="lg"] .reader__body { font-size: 1.2rem   !important; line-height: 1.88 !important; }
.reader[data-size="xl"] .reader__body { font-size: 1.32rem  !important; line-height: 1.9  !important; }

/* Reader meta row — flex so text-size-ctrl sits on the right */
.reader__meta {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
}

/* ══════════════════════════════════════════════════
   FEATURE: Ambient Reading Mode
   ══════════════════════════════════════════════════ */

/* Ambient toggle button — sits in reader meta row */
.ambient-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border-strong, #3a3a3a);
  border-radius: 3px;
  color: var(--text-muted);
  font-family: var(--ff-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  min-height: 32px;
  white-space: nowrap;
}
.ambient-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.ambient-btn.active {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}
.ambient-btn__icon { font-size: 0.85rem; line-height: 1; }

/* Ambient mode — full immersion */
body.ambient-mode .nav          { opacity: 0; pointer-events: none; transition: opacity 0.6s ease; }
body.ambient-mode #main-footer  { display: none !important; }
body.ambient-mode .reading-progress { opacity: 1; }

/* Darken everything outside the reader */
body.ambient-mode::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0.88;
  z-index: 10;
  pointer-events: none;
  animation: ambientFadeIn 0.5s ease forwards;
}

/* Reader sits above the dim overlay */
body.ambient-mode #view-reader {
  position: relative;
  z-index: 11;
}

/* Reader gets slightly wider and more spacious in ambient mode */
body.ambient-mode .reader {
  max-width: 680px;
  padding-top: 3rem;
}

/* Body text gets a tiny glow — very subtle, very premium */
body.ambient-mode .reader__body {
  color: #e8e8e8 !important;
  text-shadow: 0 0 40px rgba(255,255,255,0.04);
}

body.ambient-mode .reader__title { color: #f2f2f2 !important; }
body.ambient-mode .reader__back  { color: #555 !important; }

/* Exit hint — appears subtly at top when in ambient mode */
.ambient-exit-hint {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #333;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  font-family: var(--ff-body);
  white-space: nowrap;
}
body.ambient-mode .ambient-exit-hint { opacity: 1; }

@keyframes ambientFadeIn {
  from { opacity: 0; }
  to   { opacity: 0.88; }
}

/* Escape key hint fades out after 3s */
.ambient-exit-hint.fade { animation: hintFade 3s ease 1.5s forwards; }
@keyframes hintFade {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ══════════════════════════════════════════════════
   FEATURE: Post Views Counter
   ══════════════════════════════════════════════════ */

/* On feed cards */
.feed__views {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--ff-mono);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.feed__views-icon { font-size: 0.7rem; opacity: 0.6; }

/* In reader meta */
.reader__views {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--ff-mono);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Skeleton loader while views load */
.views-loading {
  display: inline-block;
  width: 32px;
  height: 0.8em;
  background: var(--border);
  border-radius: 2px;
  animation: shimmer 1.4s ease infinite;
  vertical-align: middle;
}
@keyframes shimmer {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.9; }
}
