/* ═══════════════════════════════════════
   TOKENS
═══════════════════════════════════════ */
:root {
  --bg:      #f7f5f0;
  --fg:      #1a1a1a;
  --accent:  #c0392b;
  --muted:   #7a7a72;
  --border:  #d8d4cc;
  --card-bg: #fff;
  --mono:    'JetBrains Mono', monospace;
  --serif:   'Libre Baskerville', Georgia, serif;
  --sans:    'DM Sans', sans-serif;
  --nav-h:   56px;
  --glow:    rgba(192,57,43,.18);
}
[data-dark] {
  --bg:      #0e0e0c;
  --fg:      #e8e4dc;
  --accent:  #e74c3c;
  --muted:   #8a8a82;
  --border:  #252520;
  --card-bg: #161614;
  --glow:    rgba(231,76,60,.22);
}

/* ═══════════════════════════════════════
   RESET
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  transition: background .4s, color .4s;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Page load fade-in */
.page-wrap {
  animation: fadeUp .4s cubic-bezier(.2,.8,.3,1);
  position: relative;
  z-index: 1;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════
   MATRIX CANVAS
═══════════════════════════════════════ */
#matrix-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: .12;
  transition: opacity .4s;
}
[data-dark] #matrix-canvas { opacity: .18; }

/* ═══════════════════════════════════════
   NAV
═══════════════════════════════════════ */
nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 2rem; gap: 2rem;
  transition: background .4s, border-color .4s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-dark] nav { background: rgba(14,14,12,.85); }

.nav-brand {
  font-family: var(--mono);
  font-size: .85rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--fg); white-space: nowrap;
}
.nav-brand span { color: var(--accent); }
.nav-brand:hover { color: var(--fg); }

.nav-links { display: flex; gap: .25rem; list-style: none; flex: 1; }
.nav-links > li { position: relative; }
.nav-links > li > a,
.nav-links > li > span {
  display: block;
  padding: .4rem .75rem;
  font-size: .8rem; font-weight: 500;
  letter-spacing: .03em;
  border-radius: 3px;
  transition: background .15s, color .15s;
  white-space: nowrap; color: var(--muted);
  cursor: pointer;
}
.nav-links > li > a:hover,
.nav-links > li > span:hover { color: var(--fg); background: var(--border); }
.nav-links > li > a.active { color: var(--accent); background: transparent; }

.nav-brand  { order: 1; }
.nav-links  { order: 2; }
.nav-right  { order: 3; margin-left: auto; } /* pushes to far right */

.dropdown {
  position: absolute; top: calc(100% + 2px); left: 0;
  min-width: 190px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px; padding: .4rem 0;
  display: none;
  box-shadow: 0 12px 32px rgba(0,0,0,.14);
  animation: dropIn .18s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown a {
  display: block; padding: .45rem 1rem;
  font-size: .78rem; color: var(--muted);
  transition: color .12s, background .12s;
}
.dropdown .dropdown-sep {
  height: 1px; background: var(--border);
  margin: .3rem 0;
}
.dropdown a:hover { color: var(--fg); background: var(--border); }
.nav-links > li:hover .dropdown { display: block; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.theme-btn {
  background: none; border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg); transition: background .15s, transform .2s;
}
.theme-btn:hover { background: var(--border); transform: rotate(180deg); }

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
.hero {
  border-bottom: 1px solid var(--border);
  padding: 5rem 2rem 4.5rem;
  max-width: 900px; margin: 0 auto;
  position: relative; overflow: hidden;
}
.flowline {
  position: absolute; right: -40px; top: -20px;
  width: 340px; opacity: .06; pointer-events: none;
  animation: flowPulse 8s ease-in-out infinite;
}
@keyframes flowPulse {
  0%,100% { transform: scale(1) rotate(0deg); opacity: .06; }
  50%      { transform: scale(1.04) rotate(1deg); opacity: .09; }
}

.terminal-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--fg); color: var(--bg);
  font-family: var(--mono); font-size: .7rem;
  padding: .3rem .7rem; border-radius: 100px;
  margin-bottom: 1.25rem;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: .3; }
}

.hero-eyebrow {
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: .5rem;
}
.hero-eyebrow::after {
  content: ''; flex: 1; max-width: 60px;
  height: 1px; background: var(--accent);
}

/* ── TYPEWRITER HERO — gap fix via clip-path ── */
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15; font-weight: 700;
  margin-bottom: 1.5rem;
}
.hero h1 .line {
  display: block;
  overflow: visible;
  white-space: nowrap;
  /* clip-path masks text without collapsing the line's height  */
  /* so no blank gap appears before animation triggers          */
  clip-path: inset(0 100% 0 0);
}
.hero h1 .line.revealed {
  animation: typeIn 4.0s cubic-bezier(.2,.8,.3,1) forwards;
}
@keyframes typeIn {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}
.cursor {
  display: inline-block;
  width: 3px; height: 1em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: bottom;
  animation: cursorBlink .7s step-end infinite;
}
@keyframes cursorBlink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0; }
}

.hero-sub {
  font-size: 1.05rem; color: var(--muted);
  max-width: 540px; line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.5rem; }
.tag {
  font-family: var(--mono); font-size: .68rem;
  padding: .3rem .6rem;
  border: 1px solid var(--border); border-radius: 2px;
  color: var(--muted); letter-spacing: .04em;
  transition: color .15s, border-color .15s, transform .15s;
  cursor: pointer;
}
.tag:hover {
  color: var(--accent); border-color: var(--accent);
  transform: translateY(-1px);
}

.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn-primary {
  background: var(--fg); color: var(--bg);
  padding: .65rem 1.4rem; font-size: .82rem;
  font-weight: 500; letter-spacing: .04em;
  border: none; cursor: pointer; border-radius: 2px;
  transition: opacity .15s, transform .15s;
  font-family: var(--sans);
  display: inline-block;
}
.btn-primary:hover { opacity: .85; transform: translateY(-1px); }

.btn-ghost {
  background: none; border: 1px solid var(--border);
  color: var(--fg); padding: .65rem 1.4rem;
  font-size: .82rem; font-weight: 500;
  letter-spacing: .04em; cursor: pointer; border-radius: 2px;
  transition: background .15s, border-color .15s, transform .15s;
  font-family: var(--sans);
  display: inline-block;
}
.btn-ghost:hover { background: var(--border); transform: translateY(-1px); }

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.content-wrap { max-width: 900px; margin: 0 auto; padding: 3rem 2rem; }
.two-col {
  display: grid; grid-template-columns: 1fr 280px;
  gap: 3rem; align-items: start;
}
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  nav { padding: 0 1rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .content-wrap { padding: 2rem 1rem; }
}

/* ═══════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════ */
.section-header {
  display: flex; align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.section-header h2 { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; }
.section-header a {
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .08em; color: var(--muted);
  text-transform: uppercase;
  transition: color .15s;
}
.section-header a:hover { color: var(--accent); }

/* ═══════════════════════════════════════
   POST CARDS
═══════════════════════════════════════ */
.post-list { display: flex; flex-direction: column; }
.post-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr 100px;
  gap: 1rem; align-items: start;
  transition: opacity .15s, transform .2s;
}
.post-item:hover { opacity: .78; transform: translateX(3px); }
.post-item:first-child { padding-top: 0; }

.post-meta {
  font-family: var(--mono); font-size: .65rem;
  letter-spacing: .06em; color: var(--muted);
  text-transform: uppercase; margin-bottom: .5rem;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.post-meta .cat { color: var(--accent); }
.post-item h3 {
  font-family: var(--serif); font-size: 1rem;
  line-height: 1.4; margin-bottom: .4rem; font-weight: 700;
}
.post-item p { font-size: .82rem; color: var(--muted); line-height: 1.6; }
.post-cover {
  aspect-ratio: 4/3; background: var(--border);
  border-radius: 2px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.post-item:hover .post-cover { background: color-mix(in srgb, var(--accent) 10%, var(--border)); }
.post-cover svg { width: 60%; opacity: .3; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════ */
.sidebar { position: sticky; top: calc(var(--nav-h) + 2rem); }
.sidebar-block { margin-bottom: 2rem; }
.sidebar-title {
  font-family: var(--mono); font-size: .65rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.about-card { display: flex; flex-direction: column; gap: .6rem; }

/* ── SIDEBAR AVATAR — accepts img or GIF ── */
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #2c3e50);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.1rem; color: #fff; font-weight: 700;
  position: relative; flex-shrink: 0;
  overflow: hidden;
}
.avatar::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: .5;
  animation: ringPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ringPulse {
  0%,100% { transform: scale(1); opacity: .5; }
  50%      { transform: scale(1.08); opacity: .15; }
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.about-card h4 { font-family: var(--serif); font-size: .9rem; }
.about-card p { font-size: .78rem; color: var(--muted); line-height: 1.5; }
.about-card a { font-size: .75rem; color: var(--accent); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }
.sidebar-links { display: flex; flex-direction: column; gap: .1rem; }
.sidebar-links a {
  display: flex; align-items: center; gap: .5rem;
  font-size: .78rem; color: var(--muted);
  padding: .35rem 0; border-bottom: 1px solid var(--border);
  transition: color .15s;
}
.sidebar-links a:hover { color: var(--accent); }
.sidebar-links .icon { font-family: var(--mono); font-size: .65rem; width: 20px; text-align: center; }

/* ═══════════════════════════════════════
   ABOUT PAGE
═══════════════════════════════════════ */
.about-hero {
  padding: 4rem 2rem 3rem;
  border-bottom: 1px solid var(--border);
  max-width: 900px; margin: 0 auto;
  display: flex; gap: 2.5rem; align-items: flex-start;
}
@media (max-width: 600px) {
  .about-hero { flex-direction: column; gap: 1.5rem; }
  .about-grid { grid-template-columns: 1fr !important; }
}

/* ── LARGE GIF AVATAR ── */
.avatar-lg {
  width: 120px; height: 120px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; position: relative;
  background: linear-gradient(135deg, var(--accent), #2c3e50);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--border);
  transition: box-shadow .3s;
}
.avatar-lg:hover { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg .avatar-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 2.4rem; color: #fff; font-weight: 700;
}
.avatar-lg::before {
  content: '';
  position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(var(--accent) 0%, transparent 35%, transparent 65%, var(--accent) 100%);
  animation: spin 5s linear infinite;
  z-index: -1;
}
@keyframes spin { to { transform: rotate(360deg); } }

.about-hero-text h1 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: .75rem;
}
.about-hero-text .tagline {
  font-size: 1rem; color: var(--muted);
  line-height: 1.7; max-width: 800px;
  margin-bottom: 1.25rem;
}
.about-hero-text .hero-ctas { margin-top: .5rem; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 2rem; }

.prose { font-size: .9rem; line-height: 1.8; color: var(--fg); }
.prose h3:first-child { margin-top: 0; }
.prose p { margin-bottom: 1rem; }
.prose h2, .prose h3 {
  font-family: var(--mono);
  color: var(--fg);
  font-size: .72rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 400;
  margin: 2rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.prose h3 { font-family: var(--serif); font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose a { color: var(--accent); }
.prose code {
  font-family: var(--mono); font-size: .85em;
  background: var(--border); padding: .1em .3em;
  border-radius: 2px;
}
.prose pre {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1.25rem;
  overflow-x: auto; margin: 1.25rem 0;
}
.prose pre code { background: none; padding: 0; font-size: .82rem; }

/* ── SKILLS BARS ── */
.skills-grid { display: flex; flex-direction: column; gap: .85rem; }
.skill-item { display: flex; flex-direction: column; gap: .3rem; }
.skill-label {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .06em; color: var(--muted);
  text-transform: uppercase;
  display: flex; justify-content: space-between;
}
.skill-bar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.skill-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), #e05a4a);
  border-radius: 2px; width: 0;
  transition: width 1.1s cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════
   BLOG PAGE
═══════════════════════════════════════ */
.blog-header {
  padding: 3rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
  max-width: 900px; margin: 0 auto;
}
.blog-header h1 { font-family: var(--serif); font-size: 2rem; }
.cat-tabs { display: flex; gap: .5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.cat-tab {
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .4rem .8rem;
  border: 1px solid var(--border); border-radius: 2px;
  cursor: pointer; color: var(--muted); transition: all .15s;
}
.cat-tab:hover { color: var(--fg); border-color: var(--fg); }
.cat-tab.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ═══════════════════════════════════════
   PROJECTS PAGE
═══════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem; margin-top: 2rem;
}
.project-card {
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg);
  transition: border-color .2s, transform .25s, box-shadow .25s;
  overflow: hidden;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--glow);
}
.project-media {
  width: 100%; aspect-ratio: 16/7;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  transition: background .2s;
}
.project-card:hover .project-media { background: color-mix(in srgb, var(--accent) 8%, var(--border)); }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.project-media .project-icon-emoji {
  font-size: 2rem;
  filter: grayscale(1);
  transition: filter .2s;
}
.project-card:hover .project-icon-emoji { filter: grayscale(0); }
.project-media .project-icon-svg {
  width: 40px; height: 40px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #2c3e50);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .9rem; color: #fff; font-weight: 700;
  transition: transform .2s;
}
.project-card:hover .project-icon-svg { transform: scale(1.1) rotate(-3deg); }
.project-body { padding: 1.25rem; }
.project-body h3 { font-family: var(--serif); font-size: 1rem; margin-bottom: .5rem; }
.project-body p { font-size: .8rem; color: var(--muted); line-height: 1.5; margin-bottom: 1rem; }
.project-footer { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.badge {
  font-family: var(--mono); font-size: .62rem;
  letter-spacing: .04em; padding: .2rem .5rem;
  border-radius: 2px; background: var(--border); color: var(--muted);
}
.badge.lang { background: rgba(192,57,43,.12); color: var(--accent); }
.badge.status { background: rgba(46,204,113,.1); color: #2ecc71; }

/* ═══════════════════════════════════════
   EXT LINK CARDS (legacy, used in sidebar)
═══════════════════════════════════════ */
.ext-arrow { margin-left: auto; color: var(--accent); font-size: .8rem; font-family: var(--mono); }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem; margin-top: 4rem;
  position: relative; z-index: 1;
}
.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem;
}
@media (max-width: 600px) { .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; } }
.footer-brand { font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .05em; margin-bottom: .5rem; }
.footer-brand span { color: var(--accent); }
footer p { font-size: .75rem; color: var(--muted); line-height: 1.6; }
.footer-title { font-family: var(--mono); font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.footer-links { display: flex; flex-direction: column; gap: .35rem; }
.footer-links a { font-size: .78rem; color: var(--muted); transition: color .15s; }
.footer-links a:hover { color: var(--accent); }
.social-row { display: flex; gap: .75rem; margin-top: 1rem; }
.social-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border); border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .62rem; color: var(--muted);
  cursor: pointer; transition: color .15s, border-color .15s, transform .15s;
}
.social-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.footer-bottom {
  max-width: 900px; margin: 1.5rem auto 0;
  padding-top: 1rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.footer-bottom p { font-family: var(--mono); font-size: .65rem; color: var(--muted); letter-spacing: .04em; }

/* ═══════════════════════════════════════
   ARTICLE / SINGLE POST
═══════════════════════════════════════ */
.article-header { padding: 3rem 2rem 2.5rem; border-bottom: 1px solid var(--border); max-width: 720px; margin: 0 auto; }
.article-body { max-width: 720px; margin: 0 auto; padding: 2.5rem 2rem; }
.back-link {
  font-family: var(--mono); font-size: .7rem; color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .3rem; margin-bottom: 1.5rem;
  transition: color .15s;
}
.back-link:hover { color: var(--accent); }
.article-header h1 { font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.25; margin-bottom: .75rem; }
.article-meta { font-family: var(--mono); font-size: .68rem; color: var(--muted); letter-spacing: .06em; display: flex; gap: 1rem; flex-wrap: wrap; }
.article-meta .cat { color: var(--accent); }

/* ═══════════════════════════════════════
   SCROLL FADE-IN
═══════════════════════════════════════ */
.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* deco */
.deco-line { width: 100%; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); margin: 2rem 0; opacity: .4; }

/* ═══════════════════════════════════════
   WRITING PAGE
═══════════════════════════════════════ */
.writing-hero {
  border-bottom: 1px solid var(--border);
  padding: 5rem 2rem 4rem;
  position: relative; overflow: hidden;
}
.writing-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, var(--glow), transparent);
  pointer-events: none;
}
.writing-hero-inner { max-width: 860px; margin: 0 auto; position: relative; }
.writing-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15; margin: 1rem 0 1.25rem;
}
.writing-hero p { font-size: 1rem; color: var(--muted); max-width: 540px; line-height: 1.75; margin-bottom: 2rem; }
.writing-stats { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.wstat { display: flex; flex-direction: column; gap: .15rem; }
.wstat-num { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--fg); }
.wstat-label { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.wstat-sep { color: var(--border); font-size: 1.5rem; line-height: 1; }
.pub-featured {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-top: 2.5rem;
  transition: border-color .2s, box-shadow .2s;
}
.pub-featured:hover { border-color: var(--accent); box-shadow: 0 0 40px var(--glow); }
.pub-featured-label {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: .6rem 1.5rem;
  font-family: var(--mono); font-size: .65rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
  display: flex; align-items: center; gap: .5rem;
}
.pub-featured-body {
  padding: 2rem 1.5rem;
  display: flex; gap: 1.5rem; align-items: flex-start;
}
.pub-featured-icon {
  font-size: 2.5rem; flex-shrink: 0;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
}
.pub-featured-text h2 { font-family: var(--serif); font-size: 1.6rem; margin-bottom: .75rem; }
.pub-featured-text p { font-size: .88rem; color: var(--muted); line-height: 1.7; margin-bottom: 1rem; }
.pub-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.writing-cards {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.25rem; margin-top: 1.5rem;
}
@media (max-width: 600px) { .writing-cards { grid-template-columns: 1fr; } }
.writing-card {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 1.5rem; background: var(--card-bg);
  display: flex; flex-direction: column; gap: .75rem;
  transition: border-color .2s, transform .2s;
}
.writing-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.writing-card-head { display: flex; align-items: center; gap: .85rem; }
.writing-card-icon {
  width: 44px; height: 44px; border-radius: 6px;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  font-family: var(--mono); font-weight: 700; color: var(--muted);
}
.writing-card-head h3 { font-family: var(--serif); font-size: 1rem; }
.writing-card-sub { font-family: var(--mono); font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.writing-card > p { font-size: .82rem; color: var(--muted); line-height: 1.65; flex: 1; }
.writing-card-footer { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.writing-cta-strip {
  margin-top: 3rem; padding: 1.5rem;
  border: 1px dashed var(--border); border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.writing-cta-strip p { font-size: .85rem; color: var(--muted); line-height: 1.6; }

.writing-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* ═══════════════════════════════════════
   SHOP PAGE
═══════════════════════════════════════ */
.shop-hero {
  border-bottom: 1px solid var(--border);
  padding: 5rem 2rem 4rem;
  position: relative; overflow: hidden;
}
.shop-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 70% at 20% 60%, var(--glow), transparent);
  pointer-events: none;
}
.shop-hero-inner { max-width: 860px; margin: 0 auto; position: relative; }
.shop-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15; margin: 1rem 0 1.25rem;
}
.shop-hero p { font-size: 1rem; color: var(--muted); max-width: 520px; line-height: 1.75; }
.shop-tiers {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.25rem; margin-top: 2.5rem;
}
@media (max-width: 700px) { .shop-tiers { grid-template-columns: 1fr; } }
.shop-tier {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 1.75rem; background: var(--card-bg);
  display: flex; flex-direction: column; gap: .75rem;
  position: relative; overflow: hidden;
  transition: border-color .2s, transform .25s, box-shadow .25s;
}
.shop-tier:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px var(--glow);
}
.shop-tier-highlight {
  border-color: var(--accent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 6%, var(--card-bg)), var(--card-bg));
}
.shop-tier-badge {
  position: absolute; top: 0; right: 0;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: .6rem;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .3rem .75rem;
  border-radius: 0 8px 0 4px;
}
.shop-tier-icon { font-size: 2rem; }
.shop-tier h3 { font-family: var(--serif); font-size: 1.15rem; }
.shop-tier-price { font-family: var(--mono); font-size: .75rem; color: var(--accent); letter-spacing: .06em; }
.shop-tier > p { font-size: .82rem; color: var(--muted); line-height: 1.65; flex: 1; }
.shop-tier-perks {
  list-style: none;
  display: flex; flex-direction: column; gap: .4rem;
  padding-top: .25rem;
  border-top: 1px solid var(--border);
}
.shop-tier-perks li { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
.shop-transparency {
  margin-top: 3rem; padding: 1.5rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg);
  display: flex; gap: 1.25rem; align-items: flex-start;
}
.shop-transparency-icon { font-size: 1.5rem; flex-shrink: 0; }
.shop-transparency h4 { font-family: var(--serif); font-size: .95rem; margin-bottom: .4rem; }
.shop-transparency p { font-size: .8rem; color: var(--muted); line-height: 1.65; }

/* ═══════════════════════════════════════
   MOBILE RESPONSIVENESS
═══════════════════════════════════════ */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  transition: transform .25s, opacity .25s;
}

@media (max-width: 800px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }

  .nav-brand     { order: 1; }
  .nav-right     { order: 2; margin-left: auto; } /* pushes toggle right of brand */
  .nav-hamburger { order: 3; margin-left: 0; }    /* hamburger sits right of toggle */
  .nav-links     { order: 4; }

  /* Flatten dropdown on mobile */
  .dropdown {
    position: static;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .5rem 0 0 .75rem;
    box-shadow: none;
    border: none;
    background: none;
  }
  nav { position: relative; }
}

/* Hamburger → X when open */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }