/* Fonts are loaded via <link> tags in each page's <head> (not @import) so they fetch in parallel instead of blocking this stylesheet. */

:root {
  --primary-color: #4a1c83;
  --secondary-color: #7a3ec4;
  --text-color: #c3a8dd;
  --text-muted: #9c8bbf;
  --dark-bg: #1a1a24;
  --darker-bg: #13131b;
  --card-bg: #242436;
  --accent-color: #d4453f;
  --accent-glow: #e8934a;
  --accent-mint: #d4af37;
  --pixel-border: 4px;
  --gradient: linear-gradient(120deg, #4a1c83, #7a3ec4);
  --body-font: "Space Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --hover-glow: 0 0 18px rgba(232, 147, 74, 0.35);
  --hover-lift: -2px;
  --hover-border: rgba(232, 147, 74, 0.55);
  --ease-snap: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Keyframes */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shine {
  0% { background-position: -100px; }
  40%, 100% { background-position: 200px; }
}

@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-3%, 2%, 0) scale(1.05); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes auroraHue {
  0%, 100% { filter: brightness(1) saturate(1); }
  50% { filter: brightness(1.15) saturate(1.1); }
}

@keyframes headerPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

@keyframes runeDrift {
  0% { background-position: 0 0, 50% 0; }
  100% { background-position: 200px 0, -200px 0; }
}

@keyframes particlesFloat {
  0% { background-position: 0 0, 0 0, 0 0; }
  50% { background-position: 80px -40px, -60px 30px, 40px 60px; }
  100% { background-position: 0 0, 0 0, 0 0; }
}

@keyframes placeholderShimmer {
  0% { background-position: -100%; }
  100% { background-position: 100%; }
}

@keyframes emberDrift {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 20px -380px, -15px -340px, 10px -300px, -20px -360px, 15px -400px, -10px -320px, 20px -420px, -15px -300px, 10px -370px; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes nameShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

@keyframes borderGlowPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(232, 147, 74, 0.4); }
  20% { box-shadow: 0 0 22px rgba(232, 147, 74, 0.55); }
  45% { box-shadow: 0 0 14px rgba(212, 69, 63, 0.35); }
  70% { box-shadow: 0 0 26px rgba(212, 175, 55, 0.5); }
}

@keyframes currentPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(212, 175, 55, 0.8), 0 0 0 3px rgba(212, 175, 55, 0.18); }
  50% { box-shadow: 0 0 18px rgba(212, 175, 55, 1), 0 0 0 6px rgba(212, 175, 55, 0.28); }
}

/* Base */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(212, 175, 55, 0.05) 0px, rgba(212, 175, 55, 0.05) 1px, transparent 2px, transparent 48px),
    repeating-linear-gradient(0deg, rgba(232, 147, 74, 0.045) 0px, rgba(232, 147, 74, 0.045) 1px, transparent 2px, transparent 48px);
  animation: runeDrift 55s linear infinite;
}

body {
  font-family: var(--body-font);
  background: var(--darker-bg) url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAGElEQVQYV2NkYGD4z8DAwMgAI0AMdEAAOQgAGWYA1T8A7YAAAAAASUVORK5CYII=') repeat;
  line-height: 1.6;
  image-rendering: pixelated;
  color: var(--text-color);
  min-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.25s ease, transform 0.25s ease;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

body.page-transition-out {
  opacity: 0;
  transform: scale(0.98);
}

body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  background:
    radial-gradient(40vmax 30vmax at 10% 20%, rgba(122, 62, 196, 0.34), transparent 60%),
    radial-gradient(45vmax 35vmax at 80% 10%, rgba(232, 147, 74, 0.28), transparent 60%),
    radial-gradient(50vmax 40vmax at 70% 80%, rgba(212, 69, 63, 0.3), transparent 65%),
    radial-gradient(38vmax 32vmax at 25% 78%, rgba(212, 175, 55, 0.24), transparent 60%);
  opacity: 0.95;
  z-index: -2;
  animation: aurora 18s ease-in-out infinite, auroraHue 26s ease-in-out infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 35%, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
  z-index: -1;
  pointer-events: none;
}

.embers {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.75;
  background:
    radial-gradient(1.5px 1.5px at 10% 85%, rgba(232, 147, 74, 0.65), transparent 60%),
    radial-gradient(1px 1px at 35% 60%, rgba(212, 69, 63, 0.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 60% 90%, rgba(212, 175, 55, 0.6), transparent 60%),
    radial-gradient(1px 1px at 80% 40%, rgba(232, 147, 74, 0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 90% 75%, rgba(212, 69, 63, 0.5), transparent 60%),
    radial-gradient(1px 1px at 20% 30%, rgba(212, 175, 55, 0.45), transparent 60%),
    radial-gradient(1px 1px at 50% 15%, rgba(232, 147, 74, 0.4), transparent 60%),
    radial-gradient(2px 2px at 5% 50%, rgba(212, 175, 55, 0.5), transparent 60%),
    radial-gradient(1px 1px at 70% 65%, rgba(212, 69, 63, 0.45), transparent 60%);
  background-repeat: repeat;
  background-size: 380px 380px, 340px 340px, 300px 300px, 360px 360px, 400px 400px, 320px 320px, 420px 420px, 300px 300px, 370px 370px;
  animation: emberDrift 26s linear infinite, twinkle 4s ease-in-out infinite;
}

/* Cursor-follow ambient glow (desktop pointer only) */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 320px;
  margin-left: -160px;
  margin-top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 147, 74, 0.16), rgba(122, 62, 196, 0.12) 45%, transparent 70%);
  filter: blur(4px);
  z-index: 1;
  pointer-events: none;
  will-change: transform;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  z-index: 2;
  padding: 1rem 0 2.5rem;
}

/* Hero section */
.hero-section {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.hero-card {
  background: rgba(19, 19, 27, 0.85);
  border: 2px solid rgba(232, 147, 74, 0.35);
  box-shadow: 0 0 22px rgba(232, 147, 74, 0.16);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  backdrop-filter: blur(6px);
  transition: transform 0.15s var(--ease-snap), box-shadow 0.3s ease, border-color 0.3s ease;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.hero-card .hero,
.hero-card .hero-text,
.hero-card .hero-name,
.hero-card .hero-meta,
.hero-card .hero-badge,
.hero-card .hero-tagline {
  position: relative;
  z-index: 1;
}

.hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  overflow: visible;
  border: 3px solid var(--accent-glow);
  box-shadow: 0 0 18px rgba(232, 147, 74, 0.4);
  background: rgba(19, 19, 27, 0.6);
  flex: 0 0 auto;
  position: relative;
  animation: borderGlowPulse 4s ease-in-out infinite;
}

.hero-avatar::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 20px;
  z-index: -1;
  background: conic-gradient(from 0deg, var(--accent-glow), var(--accent-mint), var(--accent-color), var(--secondary-color), var(--accent-glow));
  filter: blur(3px);
  opacity: 0.85;
  animation: ringSpin 6s linear infinite;
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  display: block;
  border-radius: 13px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
}

.hero-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-glow), var(--accent-mint), var(--accent-color));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(212, 69, 63, 0.45));
  animation: float 2s ease-in-out infinite, nameShimmer 6s linear infinite;
  font-size: 1.1rem;
}

.hero-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.hero-role {
  color: var(--accent-glow);
  text-shadow: 0 0 10px rgba(232, 147, 74, 0.35);
}

.hero-location {
  color: var(--text-color);
}

.hero-badge {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent-mint);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.35);
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.3));
  font-size: 0.7rem;
}

.hero-tagline {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-color);
  text-shadow: 0 0 8px rgba(176, 136, 249, 0.5);
  font-size: 0.65rem;
}

.header-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Header runes + particles */
.hero-card {
  position: relative;
  overflow: hidden;
}

.hero-card .rune-field,
.hero-card .particle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-card .rune-field {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(212, 175, 55, 0.12) 0px,
      rgba(212, 175, 55, 0.12) 2px,
      transparent 3px,
      transparent 16px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(232, 147, 74, 0.08) 0px,
      rgba(232, 147, 74, 0.08) 1px,
      transparent 2px,
      transparent 10px
    );
  opacity: 0.55;
  animation: runeDrift 18s linear infinite;
}

.hero-card .particle-field {
  background:
    radial-gradient(2px 2px at 15% 30%, rgba(255, 255, 255, 0.35), transparent 50%),
    radial-gradient(2px 2px at 80% 20%, rgba(212, 175, 55, 0.3), transparent 50%),
    radial-gradient(3px 3px at 60% 70%, rgba(232, 147, 74, 0.25), transparent 50%);
  opacity: 0.7;
  animation: particlesFloat 12s ease-in-out infinite;
}

/* Buttons */
.btn {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--dark-bg);
  border: var(--pixel-border) solid var(--primary-color);
  box-shadow: 0 0 10px rgba(122, 62, 196, 0.3), inset 0 0 15px rgba(122, 62, 196, 0.2);
  color: var(--text-color);
  text-shadow: 0 0 5px rgba(176, 136, 249, 0.5);
  text-decoration: none;
  display: inline-block;
  padding: 0.9rem 1.2rem;
  font-size: 0.8em;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  transition: transform 0.2s var(--ease-snap), box-shadow 0.25s ease, color 0.2s ease, border-color 0.25s ease;
}

.btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(transparent, rgba(122, 62, 196, 0.1), transparent);
  transform: rotate(45deg);
  animation: shine 3s infinite;
  pointer-events: none;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(var(--hover-lift)) scale(1.03);
  box-shadow: var(--hover-glow), inset 0 0 18px rgba(122, 62, 196, 0.3);
  color: #fff;
  border-color: var(--hover-border);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

/* Sections */
.main-content section {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(26, 26, 36, 0.9), rgba(19, 19, 27, 0.9));
  border: 2px solid rgba(122, 62, 196, 0.35);
  box-shadow: 0 0 22px rgba(122, 62, 196, 0.12);
  border-radius: var(--radius-md, 12px);
  backdrop-filter: blur(6px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.main-content section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}

.main-content section::before {
  content: "";
  position: absolute;
  inset: -30% -10%;
  background:
    radial-gradient(120px 80px at 20% 30%, rgba(232, 147, 74, 0.18), transparent 70%),
    radial-gradient(140px 90px at 80% 20%, rgba(212, 69, 63, 0.16), transparent 70%);
  opacity: 0.7;
  transform: translate3d(0, var(--panel-shift, 0px), 0);
  transition: transform 0.2s ease-out;
  pointer-events: none;
}

.posts-section > .resume-back {
  margin-bottom: 0.75rem;
}

.main-content h2 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent-mint);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.35);
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.3));
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
  margin-top: 0;
}

.main-content h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: -30%;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-mint), var(--accent-glow), transparent);
  background-size: 200% 100%;
  animation: gradient 4s ease infinite;
}

.main-content h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.main-content h2 a:hover,
.main-content h2 a:focus-visible {
  color: #fff;
}

.resume-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
  text-align: left;
}

.resume-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent-mint);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.35);
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.3));
  margin: 0;
  font-size: 1.1rem;
}

.resume-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.resume-back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 0.7rem;
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.resume-back:hover,
.resume-back:focus-visible {
  opacity: 1;
  transform: translateX(-2px);
}

.main-content h3 {
  color: var(--accent-glow);
  text-shadow: 0 0 8px rgba(232, 147, 74, 0.35);
}

/* Resume */
.resume-card {
  background: rgba(19, 19, 27, 0.7);
  border: 2px solid rgba(232, 147, 74, 0.4);
  box-shadow: 0 0 18px rgba(232, 147, 74, 0.18);
  padding: 1.25rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: transform 0.15s var(--ease-snap), box-shadow 0.3s ease, border-color 0.3s ease;
}

.resume-card.full {
  gap: 2rem;
  background: rgba(19, 19, 27, 0.8);
}

.resume-card p {
  margin: 0;
  color: var(--text-color);
}


.resume-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

.resume-card-link:hover .resume-card {
  transform: translateY(var(--hover-lift));
  box-shadow: var(--hover-glow);
  border-color: var(--hover-border);
}

.resume-card-link:focus-visible .resume-card {
  box-shadow: var(--hover-glow);
  border-color: var(--hover-border);
}

.resume-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resume-block h3 {
  margin: 0;
}

body[data-page="resume"] .main-content section {
  width: min(860px, 100%);
}

/* Skills */
.skills-container {
  margin: 2rem 0;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 0.7em;
  background: var(--dark-bg);
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 10px rgba(122, 62, 196, 0.3);
  color: var(--text-color);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  animation: float 3s ease-in-out infinite;
  animation-delay: calc(var(--tag-index, 0) * 0.15s);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-snap), box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.skill-tag:nth-child(1) { --tag-index: 1; }
.skill-tag:nth-child(2) { --tag-index: 2; }
.skill-tag:nth-child(3) { --tag-index: 3; }
.skill-tag:nth-child(4) { --tag-index: 4; }
.skill-tag:nth-child(5) { --tag-index: 5; }
.skill-tag:nth-child(6) { --tag-index: 6; }
.skill-tag:nth-child(7) { --tag-index: 7; }
.skill-tag:nth-child(8) { --tag-index: 8; }

.skill-tag::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(122, 62, 196, 0.35), rgba(232, 147, 74, 0.25));
  opacity: 0;
  transition: opacity 0.3s;
}

.skill-tag:hover::before,
.skill-tag:focus-visible::before {
  opacity: 1;
}

.skill-tag:hover,
.skill-tag:focus-visible {
  transform: translateY(var(--hover-lift));
  box-shadow: var(--hover-glow);
  border-color: var(--hover-border);
}

/* Experience + Education */
.experience-section,
.education-section {
  position: relative;
}

.experience-item,
.education-item {
  padding: 1rem 1.25rem 1rem 1.75rem;
  margin: 1rem 0 1rem 0.5rem;
  border-left: none;
  background: rgba(19, 19, 27, 0.6);
  box-shadow: inset 0 0 18px rgba(122, 62, 196, 0.12);
  transition: transform 0.2s var(--ease-snap), border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  border-radius: 4px;
}

.experience-item::before,
.education-item::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 1.2rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-glow);
  box-shadow: 0 0 10px rgba(232, 147, 74, 0.7), 0 0 0 3px rgba(232, 147, 74, 0.15);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.experience-item::after,
.education-item::after {
  content: '';
  position: absolute;
  left: -0.125rem;
  top: 1.7rem;
  bottom: -1.5rem;
  width: 2px;
  background: linear-gradient(var(--accent-glow), rgba(232, 147, 74, 0.15));
}

.experience-item:last-child::after,
.education-item:last-child::after {
  display: none;
}

.experience-item:hover,
.education-item:hover {
  transform: translateX(6px);
  border-color: var(--accent-mint);
}

.experience-item:hover::before,
.education-item:hover::before {
  background: var(--accent-mint);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.8), 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.experience-item.is-current::before {
  background: var(--accent-mint);
  animation: currentPulse 2s ease-in-out infinite;
}

.current-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.6rem;
  padding: 0.15rem 0.5rem;
  font-family: var(--body-font);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--darker-bg);
  background: var(--accent-mint);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.experience-item .role,
.education-item .duration,
.experience-item .duration {
  color: var(--text-muted);
  font-size: 0.85em;
}

/* Posts */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.post-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

.post-card-link:focus-visible .post-card {
  box-shadow: var(--hover-glow);
  border-color: var(--hover-border);
}

.post-card {
  background: var(--dark-bg);
  border: var(--pixel-border) solid var(--primary-color);
  box-shadow: 0 0 10px rgba(122, 62, 196, 0.3);
  padding: 1.5rem;
  position: relative;
  transition: transform 0.15s var(--ease-snap), box-shadow 0.3s ease, border-color 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 12px;
}

.post-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(232, 147, 74, 0.12) 40%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.post-card:hover {
  transform: translateY(calc(var(--hover-lift) * 2));
  box-shadow: var(--hover-glow);
}

.post-card:hover::after {
  opacity: 1;
}

.post-card h3 {
  margin-top: 0;
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 4px rgba(212, 69, 63, 0.3));
}

.post-date {
  font-size: 0.8rem;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 1rem;
}

.post-links {
  margin-top: auto;
  padding-top: 1rem;
}

.post-link {
  color: var(--text-color);
  text-decoration: none;
  position: relative;
  padding-left: 1.2em;
}

.post-link::before {
  content: '►';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  color: var(--accent-color);
}

/* Social */
#contact {
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.social-link {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 0.8em;
  color: var(--text-color);
  text-shadow: 0 0 5px rgba(176, 136, 249, 0.5);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  position: relative;
  transition: transform 0.2s ease, color 0.2s ease;
}

.social-link::before {
  content: '►';
  position: absolute;
  left: -1rem;
  color: var(--accent-color);
  opacity: 0;
  transition: all 0.2s;
}

.social-link:hover,
.social-link:focus-visible {
  transform: translateX(4px);
  color: #fff;
}

.post-link:hover,
.post-link:focus-visible {
  color: #fff;
  text-shadow: 0 0 8px rgba(232, 147, 74, 0.4);
}

.social-link:hover::before,
.social-link:focus-visible::before {
  opacity: 1;
  left: -0.4rem;
}

/* Footer */
.site-footer {
  border-top: var(--pixel-border) solid var(--primary-color);
  margin-top: auto;
  padding: 2rem 0;
  text-align: center;
  color: var(--text-color);
  text-shadow: 0 0 5px rgba(176, 136, 249, 0.3);
}

/* Post page */
.post-page .main-content {
  padding-top: 1rem;
}

.post-container {
  background: var(--dark-bg);
  border: var(--pixel-border) solid var(--primary-color);
  box-shadow: 0 0 30px rgba(122, 62, 196, 0.3);
  padding: 2rem;
  width: min(900px, 100%);
  margin: 2rem auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  animation: fadeInUp 0.4s var(--ease-snap);
}

.not-found {
  align-items: center;
  text-align: center;
}

.not-found h2 {
  margin-bottom: 0.5rem;
}

.not-found .btn {
  align-self: center;
  margin-top: 1rem;
}

.post-header {
  margin: 1rem 0 2rem;
  padding-bottom: 1rem;
  border-bottom: var(--pixel-border) solid var(--primary-color);
}

.post-body {
  line-height: 1.8;
}

.post-body h1 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(212, 69, 63, 0.5);
  filter: drop-shadow(0 0 4px rgba(212, 69, 63, 0.3));
  font-size: 1.3rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.post-body h2 {
  color: var(--secondary-color);
  margin: 1.5rem 0;
  font-size: 1.4em;
  text-shadow: 0 0 8px rgba(122, 62, 196, 0.35);
}

.post-body ul {
  list-style: none;
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.post-body li {
  margin-bottom: 0.5rem;
}

.post-body li::before {
  content: '►';
  color: var(--accent-color);
  margin-right: 0.5rem;
}

.close-btn,
.back-btn {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 0.5rem;
  background: var(--dark-bg);
  border: var(--pixel-border) solid var(--primary-color);
  box-shadow: 0 0 10px rgba(122, 62, 196, 0.3);
  padding: 0.8rem 1.4rem;
  border-radius: 4px;
  transition: transform 0.2s var(--ease-snap), box-shadow 0.3s ease, color 0.2s ease, border-color 0.3s ease;
  text-decoration: none;
  color: var(--text-color);
}

.close-btn:hover,
.back-btn:hover {
  transform: translateX(-4px) scale(1.03);
  box-shadow: 0 0 20px rgba(122, 62, 196, 0.5);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* Loading bar */
.loading-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), var(--secondary-color), var(--accent-glow), var(--accent-mint), var(--accent-color));
  background-size: 300% 100%;
  box-shadow: 0 0 12px rgba(232, 147, 74, 0.6);
  animation: gradient 1.4s linear infinite;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  transition: opacity 0.3s ease;
}

/* Reading progress (post pages) */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(122, 62, 196, 0.15);
  z-index: 9;
}

.reading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-mint), var(--accent-glow), var(--secondary-color));
  box-shadow: 0 0 10px rgba(232, 147, 74, 0.6);
  transition: width 0.15s ease-out;
}

/* Placeholders */
.placeholder {
  background: linear-gradient(90deg, var(--darker-bg) 25%, var(--dark-bg) 50%, var(--darker-bg) 75%);
  background-size: 200% 100%;
  animation: placeholderShimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.placeholder-title { height: 2rem; width: 60%; }
.placeholder-text { height: 1rem; width: 100%; margin-top: 0.5rem; }
.placeholder-text.short { width: 80%; }

/* Scrollbar */
html { scrollbar-color: var(--primary-color) var(--darker-bg); scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--darker-bg); border-left: 2px solid var(--primary-color); }
::-webkit-scrollbar-thumb { background: var(--primary-color); border: 2px solid var(--secondary-color); }
::-webkit-scrollbar-thumb:hover { background: var(--secondary-color); }

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(1px);
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 600ms ease, filter 600ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: none;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .main-content { padding: 0.5rem 0 2rem; }
  .main-content section { padding: 1.25rem; }
  .social-links { flex-direction: column; align-items: center; gap: 1rem; }
  .post-container { margin: 1.5rem auto; padding: 1.5rem; }
  .hero-avatar { width: 72px; height: 72px; }
  .hero-name { font-size: 1.05rem; }
}

@media (hover: none), (pointer: coarse) {
  .cursor-glow { display: none; }
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
