/* ============================================================
   BOTTO v2 — blog.botto.is
   DarkSea palette · Dark/Light · JetBrains Mono + Inter
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================================
   1. CSS VARIABLES
   ============================================================ */
:root {
  /* DarkSea Dark (default) */
  --bg:         #0d1117;
  --bg-raised:  #161b22;
  --bg-surface: #1c2129;
  --bg-hover:   #21262d;

  --text:       #88b4e7;
  --text-bright:#d6e9ff;
  --text-dim:   #586f89;
  --text-muted: #444c55;

  --accent:     #34febb;
  --accent-mid: #32ae85;
  --accent-dim: #42675a;

  --border:     #21262d;
  --border-light:#2d333b;

  --font-heading: 'JetBrains Mono', var(--gh-font-heading, monospace);
  --font-body:    'Inter', var(--gh-font-body, sans-serif);
  --font-mono:    'JetBrains Mono', monospace;

  --max-width:  720px;
  --max-wide:   1080px;
  --gap:        2rem;
  --radius:     8px;
  --radius-lg:  12px;

  --transition: 0.2s ease;
}

/* Light mode */
[data-theme="light"] {
  --bg:         #fffdf7;
  --bg-raised:  #f5f3ed;
  --bg-surface: #edeae3;
  --bg-hover:   #e5e2db;

  --text:       #2d2d2d;
  --text-bright:#0d1117;
  --text-dim:   #6b6b6b;
  --text-muted: #9b9b9b;

  --accent:     #0d9668;
  --accent-mid: #0b7d56;
  --accent-dim: #d4f0e5;

  --border:     #e0ddd6;
  --border-light:#eae7e0;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-bright); }

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

::selection { background: var(--accent); color: var(--bg); }

/* ============================================================
   3. LAYOUT
   ============================================================ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.container--wide { max-width: var(--max-wide); margin: 0 auto; padding: 0 1.5rem; }

/* ============================================================
   4. HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  transition: color var(--transition);
}
.site-nav a:hover, .site-nav a.active { color: var(--text-bright); }

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 0.4rem;
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
}
.theme-toggle:hover { color: var(--accent); background: var(--bg-hover); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 0.4rem; }
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    top: 0; right: -100%;
    width: 75%; max-width: 300px;
    height: 100vh;
    background: var(--bg-raised);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.3s ease;
    z-index: 200;
    border-left: 1px solid var(--border);
  }
  .site-nav.open { right: 0; }
  .site-nav a { font-size: 1rem; }
  .nav-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .nav-overlay.visible { opacity: 1; pointer-events: auto; }
}

/* ============================================================
   5. HERO (Home)
   ============================================================ */
.hero {
  padding: 6rem 0 4rem;
}

.hero__greeting {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

.hero__bio {
  font-size: 1.1rem;
  color: var(--text);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 1.8rem;
}

.hero__links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: 100px;
  color: var(--text);
  transition: all var(--transition);
}
.hero__link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.hero__link svg { width: 14px; height: 14px; }

/* ============================================================
   6. SECTION HEADERS
   ============================================================ */
.section {
  padding: 4rem 0;
}

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

.section__title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section__link {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: color var(--transition);
}
.section__link:hover { color: var(--accent); }

/* ============================================================
   7. POST CARDS (Blog)
   ============================================================ */
.post-feed { display: flex; flex-direction: column; gap: 0; }

.post-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  gap: 1rem;
}
.post-card:first-child { border-top: none; }
.post-card:hover { background: var(--bg-raised); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; border-radius: var(--radius); }

.post-card__content { min-width: 0; }

.post-card__tag {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.post-card__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--accent); }

.post-card__excerpt {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Featured post (home) */
.post-featured {
  padding: 2.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  transition: border-color var(--transition);
}
.post-featured:hover { border-color: var(--accent-dim); }

.post-featured__label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.post-featured__label::before {
  content: '★';
  font-size: 0.8rem;
}

.post-featured__title {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}
.post-featured__title a { color: inherit; }
.post-featured__title a:hover { color: var(--accent); }

.post-featured__excerpt {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 580px;
}

.post-featured__meta {
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   8. PROJECT CARDS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.project-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }

.project-card__image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--bg-surface);
}

.project-card__body { padding: 1.5rem; }

.project-card__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.project-card__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-card__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
}
.project-card__title a { color: inherit; }
.project-card__title a:hover { color: var(--accent); }

.project-card__desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--accent);
}
.project-card__link:hover { color: var(--text-bright); }

/* ============================================================
   9. BOOKMARK CARDS
   ============================================================ */
.bookmarks-list { display: flex; flex-direction: column; gap: 0; }

.bookmark-card {
  border-bottom: 1px solid var(--border);
}

.bookmark-card__link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 1rem 0;
  gap: 1rem;
  transition: background var(--transition);
  color: inherit;
  text-decoration: none;
}
.bookmark-card__link:hover {
  background: var(--bg-raised);
  margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem;
  border-radius: var(--radius);
}

.bookmark-card__content { min-width: 0; }

.bookmark-card__category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}

.bookmark-card__title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
}

.bookmark-card__desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-card__arrow {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color var(--transition), transform var(--transition);
}
.bookmark-card__link:hover .bookmark-card__arrow { color: var(--accent); transform: translateX(3px); }

/* ============================================================
   10. SINGLE POST
   ============================================================ */
.post-header {
  padding: 5rem 0 2rem;
  text-align: center;
}

.post-header__tag {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  display: inline-block;
}

.post-header__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 800px;
  margin: 0 auto 1rem;
}

.post-header__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.post-header__meta span + span::before { content: ' · '; }

.post-header__image {
  margin-top: 2.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.post-header__image img { width: 100%; }

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

/* Post content */
.post-content {
  padding: 2rem 0 4rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 3rem 0 1rem;
  letter-spacing: -0.02em;
}

.post-content h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 2.5rem 0 0.8rem;
}

.post-content p { margin-bottom: 1.5rem; }

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.2rem;
  margin: 2rem 0;
  color: var(--text);
  font-style: italic;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent);
}

.post-content pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.6;
}

.post-content ul, .post-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}
.post-content li { margin-bottom: 0.4rem; }

.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--text-bright); }

.post-content img {
  border-radius: var(--radius);
  margin: 2rem auto;
}

.post-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

/* Ghost specific content cards */
.post-content .kg-image-card, .post-content .kg-gallery-card { margin: 2rem 0; }
.post-content .kg-image-card img { border-radius: var(--radius); }
.post-content .kg-width-wide { margin-left: -4rem; margin-right: -4rem; max-width: calc(100% + 8rem); }
.post-content .kg-width-full { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); max-width: 100vw; }

.post-content .kg-bookmark-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-content .kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: inherit;
}
.post-content .kg-bookmark-content { padding: 1rem; flex: 1; }
.post-content .kg-bookmark-title { font-weight: 600; color: var(--text-bright); }
.post-content .kg-bookmark-description { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.3rem; }
.post-content .kg-bookmark-metadata { margin-top: 0.5rem; font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.post-content .kg-bookmark-icon { width: 16px; height: 16px; }
.post-content .kg-bookmark-author, .post-content .kg-bookmark-publisher { color: var(--text-muted); }
.post-content .kg-bookmark-thumbnail { width: 200px; min-height: 100%; }
.post-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   11. NEWSLETTER CTA
   ============================================================ */
.newsletter {
  padding: 3rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 3rem 0;
}

.newsletter__icon { color: var(--accent); margin-bottom: 1rem; }
.newsletter__icon svg { width: 32px; height: 32px; }

.newsletter__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.newsletter__desc {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter__form {
  display: flex;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto;
}

.newsletter__input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}
.newsletter__input::placeholder { color: var(--text-muted); }
.newsletter__input:focus { border-color: var(--accent); }

.newsletter__btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  white-space: nowrap;
}
.newsletter__btn:hover { opacity: 0.85; }

.newsletter__note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

@media (max-width: 500px) {
  .newsletter__form { flex-direction: column; }
}

/* ============================================================
   12. FOOTER
   ============================================================ */
.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer__nav {
  width: 100%;
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.site-footer__nav a {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color var(--transition);
}

.site-footer__nav a:hover {
  color: var(--accent);
}

.site-footer__copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.site-footer__socials {
  display: flex;
  gap: 0.5rem;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all var(--transition);
}
.social-pill:hover { border-color: var(--accent); color: var(--accent); }
.social-pill svg { width: 13px; height: 13px; }

/* ============================================================
   13. TAG & AUTHOR PAGES
   ============================================================ */
.archive-header {
  padding: 4rem 0 2rem;
}
.archive-header__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}
.archive-header__desc {
  font-size: 1rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  max-width: 540px;
}
.archive-header__count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
}

/* ============================================================
   14. PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem 0;
  font-family: var(--font-heading);
  font-size: 0.82rem;
}

.pagination a {
  color: var(--text-dim);
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

.pagination .page-number { color: var(--text-muted); }

/* ============================================================
   15. ERROR PAGES
   ============================================================ */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}
.error-page__code {
  font-family: var(--font-heading);
  font-size: 6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.error-page__message {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-top: 1rem;
}
.error-page__link {
  margin-top: 2rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

/* ============================================================
   16. SHARE & NAV BUTTONS
   ============================================================ */
.share-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: none;
  cursor: pointer;
  transition: all var(--transition);
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn svg { width: 14px; height: 14px; }

/* Prev/Next */
.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.prev-next__item {
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.prev-next__item:hover { border-color: var(--accent-dim); }
.prev-next__item--next { text-align: right; }

.prev-next__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.prev-next__title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
}

@media (max-width: 600px) {
  .prev-next { grid-template-columns: 1fr; }
}

/* ============================================================
   17. ANIMATIONS
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   18. BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 40px; height: 40px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 50;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { border-color: var(--accent); color: var(--accent); }
.back-to-top svg { width: 18px; height: 18px; }

/* ============================================================
   19. CUSTOM PAGE TEMPLATES
   ============================================================ */

/* Projects page */
.page-projects .page-content { display: none; }
.page-bookmarks .page-content { display: none; }

/* ============================================================
   20. PRISM.JS OVERRIDES
   ============================================================ */
.post-content pre[class*="language-"] {
  background: var(--bg-raised);
  border: 1px solid var(--border);
}

code[class*="language-"],
pre[class*="language-"] {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--text-muted); }
.token.punctuation { color: var(--text-dim); }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #79c0ff; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: var(--accent); }
.token.operator, .token.entity, .token.url { color: #d2a8ff; }
.token.atrule, .token.attr-value, .token.keyword { color: #ff7b72; }
.token.function, .token.class-name { color: #d2a8ff; }
.token.regex, .token.important, .token.variable { color: #ffa657; }

/* ============================================================
   21. NATIVE COMMENTS
   ============================================================ */
.post-comments {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

/* Ghost native comments iframe overrides */
.post-comments iframe {
  color-scheme: dark light;
}

[data-theme="dark"] .gh-comments-frame {
  color-scheme: dark;
}

[data-theme="light"] .gh-comments-frame {
  color-scheme: light;
}

/* ============================================================
   22. RESPONSIVE FINE-TUNING
   ============================================================ */
@media (max-width: 768px) {
  .hero { padding: 4rem 0 3rem; }
  .section { padding: 3rem 0; }
  .post-featured { padding: 1.5rem; }
  .newsletter { padding: 2rem 1.5rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .post-content .kg-width-wide { margin-left: 0; margin-right: 0; max-width: 100%; }
}
