/* ── Game Dev Theme ──────────────────────────────────────────── */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
  isolation: isolate;
}

::view-transition-new(root) {
  animation: theme-circle-in 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes theme-circle-in {
  from { clip-path: circle(0px at var(--vt-x, 50%) var(--vt-y, 50%)); }
  to   { clip-path: circle(150% at var(--vt-x, 50%) var(--vt-y, 50%)); }
}

:root {
  color-scheme: dark;
  --c-0: #0a0e17;
  --c-1: #0f1623;
  --c-2: #162033;
  --c-3: #1e2d4a;
  --c-border: #223358;
  --c-muted: #6b7da8;
  --c-text: #c8d6f0;
  --c-glow: #5eead4;
  --c-glow2: #a78bfa;
  --c-glow-strong: rgba(94,234,212,.35);
  --c-glow-ring: rgba(94,234,212,.08);
  --c-accent: #38bdf8;
  --c-danger: #f87171;
  --c-success: #4ade80;
  --surface: #0a0e17;
  --surface-soft: #0f1623;
  --surface-muted: #162033;
  --c-white: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 32px rgba(94, 234, 212, 0.08);
  --shadow-lg: 0 8px 64px rgba(94, 234, 212, 0.12);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

:root.light {
  color-scheme: light;
  --c-0: #f8fafc;
  --c-1: #ffffff;
  --c-2: #f1f5f9;
  --c-3: #e2e8f0;
  --c-border: #cbd5e1;
  --c-muted: #64748b;
  --c-text: #0f172a;
  --c-glow: #0ea5e9;
  --c-glow2: #7c3aed;
  --c-glow-strong: rgba(14,165,233,.35);
  --c-glow-ring: rgba(14,165,233,.08);
  --c-accent: #2563eb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #f1f5f9;
  --c-white: #0f172a;
  --shadow: 0 4px 32px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 64px rgba(0,0,0,0.1);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--c-0);
  color: var(--c-text);
  line-height: 1.7;
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

a { color: var(--c-glow); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-glow2); }

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
code {
  font-family: inherit;
  background: var(--c-2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--c-glow);
}

.hidden { display: none !important; }

/* ── Particle Canvas ─────────────────────────────────────── */
.particle-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: 0.6;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--c-1) 85%, transparent);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--c-border);
  transition: background-color var(--transition), backdrop-filter var(--transition);
}

.header-inner {
  max-width: 1400px; margin: 0 auto;
  min-height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}

.brand-face {
  display: inline-flex; align-items: center; gap: 12px;
  border: 0; background: transparent; color: var(--c-white);
  font-weight: 900; font-size: 18px; letter-spacing: 0.5px;
  cursor: pointer;
}
.brand-face:hover { color: var(--c-glow); }

.face-logo {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
}

.face-circle {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: #fde047;
  box-shadow: 0 0 18px rgba(253, 224, 71, 0.35), 0 4px 6px -1px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease;
}
.face-circle:hover {
  box-shadow: 0 0 28px rgba(253, 224, 71, 0.5), 0 4px 6px -1px rgba(0,0,0,0.1);
}

.face-eye {
  position: absolute; top: 8px; width: 16px; height: 16px;
  overflow: hidden; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.face-eye.left { left: 3px; }
.face-eye.right { right: 3px; }
.eye-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #000;
  transition: transform 0.1s ease-out;
}
.eyelid {
  position: absolute; left: 0; top: 50%; z-index: 1;
  width: 100%; height: 0;
  background: #fde047;
  transition: height 0.2s ease; transform: translateY(-50%);
}
.mouth {
  position: absolute; left: 50%; bottom: 7px;
  width: 12px; height: 1px; transform: translateX(-50%);
  background: #000; transition: all 0.3s ease;
}
.mouth.mouth-smile {
  height: 6px;
  border: 0; border-bottom: 2px solid #000;
  border-radius: 0 0 9999px 9999px;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: transparent; color: var(--c-text);
  font-size: 20px;
}
.icon-btn:hover { background: var(--c-2); color: var(--c-glow); }

.theme-dark { display: none; }
:root.light .theme-light { display: none; }
:root.light .theme-dark { display: inline; }

/* ── Theme Toggle Animation ───────────────────────────────── */
.icon-btn.theme-btn {
  position: relative; overflow: hidden;
}
.icon-btn.theme-btn::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at center, var(--c-glow) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.5s ease;
}
.icon-btn.theme-btn:active::after { opacity: 0.3; }

/* ── Side Menu ────────────────────────────────────────────── */
.side-menu {
  position: fixed; top: 0; right: 0; z-index: 200;
  width: 300px; height: 100%;
  transform: translateX(100%);
  background: var(--c-1); border-left: 1px solid var(--c-border);
  box-shadow: -20px 0 60px rgba(0,0,0,0.3);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
.side-menu.open { transform: translateX(0); }

.side-inner { display: grid; gap: 20px; padding: 80px 24px 24px; }

.search-box { position: relative; }
.search-box input {
  width: 100%; height: 44px; padding: 0 80px 0 14px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-2); color: var(--c-text);
  transition: all var(--transition);
}
.search-box input:focus {
  border-color: var(--c-glow); outline: none;
  box-shadow: 0 0 0 3px rgba(94,234,212,0.15);
}

.search-go, .search-clear {
  position: absolute; top: 50%; transform: translateY(-50%); border: 0;
}
.search-go {
  right: 6px; height: 32px; border-radius: 6px; padding: 0 12px;
  background: var(--c-glow); color: #0a0e17; font-weight: 900; font-size: 12px;
  transition: all var(--transition);
}
.search-go:hover { background: var(--c-glow2); }
.search-clear {
  right: 58px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--c-3); color: var(--c-text); font-size: 14px;
}

.side-nav { display: grid; gap: 4px; }
.nav-item {
  border: 0; border-radius: var(--radius-sm); padding: 12px 16px;
  background: transparent; color: var(--c-muted); font-weight: 700;
  text-align: left; transition: all var(--transition);
}
.nav-item:hover, .nav-item.nav-active {
  background: var(--c-2); color: var(--c-glow);
}

.auth-btn {
  width: 100%; border: 1px solid var(--c-glow); border-radius: var(--radius-sm);
  padding: 12px; background: transparent; color: var(--c-glow);
  font-weight: 900; transition: all var(--transition);
}
.auth-btn:hover { background: var(--c-glow); color: var(--c-0); }

/* ── Page Container ───────────────────────────────────────── */
.page-container {
  position: relative; z-index: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.page-container.shifted { transform: translateX(-300px); }

.main-shell { flex: 1; }

/* ── Hero Section ─────────────────────────────────────────── */
.hero-section {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 60px 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1200px;
  width: 100%;
  align-items: center;
}

.hero-left { display: grid; gap: 28px; }

.hero-greeting {
  font-size: 14px; font-weight: 700; letter-spacing: 2px;
  color: var(--c-glow);
  animation: fadeInUp 0.8s ease;
}
.typed-caret {
  display: inline-block;
  width: 1ch;
  margin-left: 1px;
  color: var(--c-glow);
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.hero-name {
  font-size: clamp(40px, 7vw, 72px); font-weight: 900;
  line-height: 1.1; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--c-white) 0%, var(--c-glow) 50%, var(--c-glow2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-title {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--c-muted);
  border-left: 3px solid var(--c-glow);
  padding-left: 16px;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-tags {
  display: flex; flex-wrap: wrap; gap: 10px;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.tag {
  padding: 6px 16px; border: 1px solid var(--c-border);
  border-radius: 999px; font-size: 13px; font-weight: 700;
  color: var(--c-muted); transition: all var(--transition);
}
.tag:hover { border-color: var(--c-glow); color: var(--c-glow); background: rgba(94,234,212,0.05); }

.hero-actions {
  display: flex; flex-wrap: wrap; gap: 14px;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.btn-glow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border: 0; border-radius: var(--radius-sm);
  background: var(--c-glow); color: #0a0e17;
  font-weight: 900; font-size: 15px;
  box-shadow: 0 0 32px rgba(94,234,212,0.25);
  transition: all var(--transition);
}
.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 48px rgba(94,234,212,0.4);
}

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); background: transparent;
  color: var(--c-text); font-weight: 900; font-size: 15px;
  transition: all var(--transition);
}
.btn-outline:hover {
  border-color: var(--c-glow2); color: var(--c-glow2);
}

.hero-right {
  position: relative;
  display: flex; justify-content: center;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-avatar-wrap {
  position: relative;
  width: clamp(240px, 30vw, 360px);
  height: clamp(240px, 30vw, 360px);
}

.hero-avatar-ring {
  position: absolute; inset: -8px;
  border-radius: 24px;
  border: 2px solid var(--c-glow);
  animation: rotateBorder 8s linear infinite;
}
@keyframes rotateBorder {
  0% { clip-path: inset(0 0 95% 0); }
  25% { clip-path: inset(0 0 0 95%); }
  50% { clip-path: inset(95% 0 0 0); }
  75% { clip-path: inset(0 95% 0 0); }
  100% { clip-path: inset(0 0 95% 0); }
}

.hero-avatar {
  display: grid; place-items: center;
  width: 100%; height: 100%; border-radius: 20px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid var(--c-border);
  font-size: clamp(80px, 12vw, 140px);
  filter: grayscale(0.2);
  transition: all var(--transition);
  overflow: hidden;
}
.hero-avatar:hover { filter: grayscale(0); transform: scale(1.02); }

.hero-avatar-emoji {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hero-avatar:hover .hero-avatar-emoji { transform: scale(1.15) rotate(5deg); }

.hero-float-badge {
  position: absolute; bottom: 12px; right: -12px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--c-1); border: 1px solid var(--c-border);
  font-size: 13px; font-weight: 900; color: var(--c-glow);
  box-shadow: var(--shadow);
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── Hero Stage (visual orbit, no redundant text) ─────────── */
.hero-stage {
  position: relative;
  width: clamp(280px, 32vw, 420px);
  aspect-ratio: 1 / 1;
  color: var(--c-glow);
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-stage-grid {
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center,
      transparent 0,
      transparent 30%,
      var(--c-glow-ring, rgba(94,234,212,.08)) 60%,
      transparent 100%),
    repeating-radial-gradient(circle at center,
      transparent 0,
      transparent 14px,
      var(--c-glow-ring, rgba(94,234,212,.10)) 14px,
      var(--c-glow-ring, rgba(94,234,212,.10)) 15px);
  mask: radial-gradient(circle, #000 60%, transparent 75%);
}

.hero-stage-glow {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    var(--c-glow-strong, rgba(94,234,212,.35)) 0%,
    var(--c-glow-ring, rgba(94,234,212,.08)) 35%,
    transparent 65%);
  filter: blur(20px);
  animation: glowPulse 6s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: .8; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.08); }
}

/* ── radar SVG ────────────────────────────────────────────── */
.hero-stage-radar {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  color: var(--c-glow);
  opacity: .9;
}

.radar-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: .8;
  stroke-dasharray: 2 4;
}
.radar-ring:nth-child(1) { opacity: .15; }
.radar-ring:nth-child(2) { opacity: .25; }
.radar-ring:nth-child(3) { opacity: .35; stroke-dasharray: 0; stroke-width: 1; }

.radar-axis {
  stroke: currentColor;
  stroke-width: .6;
  opacity: .35;
  stroke-dasharray: 3 5;
}

.radar-data {
  fill: var(--c-glow);
  fill-opacity: .22;
  stroke: var(--c-glow);
  stroke-width: 2;
  stroke-linejoin: round;
}

.radar-dot {
  fill: var(--c-glow);
  opacity: .8;
}
.radar-dot-strong {
  fill: var(--c-glow2);
  opacity: 1;
}

.radar-center-ring {
  animation: radarCenterPulse 3s ease-in-out infinite;
}
.radar-center-dot {
  animation: radarCenterPulse 3s ease-in-out infinite reverse;
}
@keyframes radarCenterPulse {
  0%, 100% { opacity: .6; }
  50%      { opacity: 1;  }
}

.hero-stage-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: .7;
}
.hero-stage-orb-1 {
  top: 10%; left: 15%;
  width: 8px; height: 8px;
  background: var(--c-glow);
  box-shadow: 0 0 12px var(--c-glow);
  animation: floatA 5s ease-in-out infinite;
}
.hero-stage-orb-2 {
  bottom: 20%; right: 18%;
  width: 6px; height: 6px;
  background: var(--c-glow2);
  box-shadow: 0 0 10px var(--c-glow2);
  animation: floatB 7s ease-in-out infinite;
}
.hero-stage-orb-3 {
  top: 55%; left: 8%;
  width: 5px; height: 5px;
  background: var(--c-white);
  box-shadow: 0 0 8px var(--c-glow);
  animation: floatA 9s ease-in-out infinite reverse;
}
@keyframes floatA {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(10px, -14px); }
}
@keyframes floatB {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-12px, 10px); }
}



.hero-stage-chip {
  position: absolute;
  left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  padding: 3px 9px;
  font-size: 10px; font-weight: 800;
  letter-spacing: .5px;
  color: var(--c-glow);
  background: var(--c-1);
  border: 1px solid var(--c-glow);
  border-radius: 999px;
  box-shadow: 0 0 6px var(--c-glow-strong, var(--c-glow));
  backdrop-filter: blur(6px);
  white-space: nowrap;
  animation: floatA 6s ease-in-out infinite;
}
.hero-stage-chip:nth-child(odd)  { animation-duration: 7s; }
.hero-stage-chip:nth-child(even) { animation-duration: 5s; animation-direction: reverse; }
.hero-stage-chip:nth-child(3n)   { animation-delay: -1.2s; }
.hero-stage-chip:nth-child(4n)   { animation-delay: -2.4s; }

/* ── Section Common ───────────────────────────────────────── */
.section-full {
  padding: 60px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.section-header {
  text-align: center; margin-bottom: 60px;
}

.section-label {
  font-size: 13px; font-weight: 700; letter-spacing: 4px;
  color: var(--c-glow); text-transform: uppercase; margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 5vw, 48px); font-weight: 900;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--c-white), var(--c-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-line {
  width: 60px; height: 3px; margin: 16px auto 0;
  background: var(--c-glow); border-radius: 999px;
}

/* ── Skills ───────────────────────────────────────────────── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.skills-grid > .skill-card {
  flex: 0 1 calc((100% - 60px) / 4);
  min-width: 240px;
}

.skill-card {
  padding: 28px; border: 1px solid var(--c-border);
  border-radius: var(--radius); background: var(--c-1);
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.skill-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--c-glow), var(--c-glow2));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s ease;
}
.skill-card:hover::before { transform: scaleX(1); }
.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c-glow);
}

.skill-icon { font-size: 36px; margin-bottom: 16px; }

.skill-card h3 {
  font-size: 18px; margin-bottom: 8px;
  color: var(--c-white);
}

.skill-card p { color: var(--c-muted); font-size: 14px; line-height: 1.7; }

.skill-bar-wrap { margin-top: 14px; }
.skill-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--c-muted); margin-bottom: 6px; }
.skill-bar {
  height: 4px; border-radius: 999px; background: var(--c-2); overflow: hidden;
}
.skill-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--c-glow), var(--c-glow2));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Projects ─────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  position: relative;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-1); overflow: hidden;
  transition: all var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c-glow);
}

.project-cover {
  height: 180px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c-2), var(--c-3));
  font-size: 60px; transition: all var(--transition);
}
.project-card:hover .project-cover {
  background: linear-gradient(135deg, rgba(94,234,212,0.15), rgba(167,139,250,0.15), var(--c-2));
}

.project-body { padding: 24px; }
.project-body h3 { font-size: 20px; margin-bottom: 8px; color: var(--c-white); }
.project-body p { color: var(--c-muted); font-size: 14px; margin-bottom: 16px; }

.project-tech { display: flex; flex-wrap: wrap; gap: 6px; }
.project-tech span {
  padding: 3px 10px; border-radius: 999px;
  background: var(--c-2); color: var(--c-muted);
  font-size: 11px; font-weight: 700;
}

/* ── Contact ──────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 800px; margin: 0 auto;
}

.contact-card {
  display: flex; align-items: center; gap: 16px;
  padding: 24px; border: 1px solid var(--c-border);
  border-radius: var(--radius); background: var(--c-1);
  transition: all var(--transition);
}
.contact-card:hover {
  border-color: var(--c-glow);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.contact-icon {
  width: 50px; height: 50px; display: grid; place-items: center;
  border-radius: var(--radius-sm); background: var(--c-2);
  font-size: 24px; flex-shrink: 0;
}

.contact-info strong { display: block; font-size: 14px; color: var(--c-white); margin-bottom: 2px; }
.contact-info span { font-size: 13px; color: var(--c-muted); word-break: break-all; }

/* ── Posts List ───────────────────────────────────────────── */
.posts-section { padding: 60px 24px 100px; max-width: 1400px; margin: 0 auto; }

.post-list { display: grid; gap: 24px; }
.post-card {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-1); overflow: hidden;
  transition: all var(--transition);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c-glow);
}

.post-cover {
  height: 200px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c-2), var(--c-3));
  position: relative; overflow: hidden;
}
.post-cover.has-image {
  background: var(--c-2);
  display: flex; align-items: center; justify-content: center;
}
.post-cover.has-image img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.5s ease;
}
.post-card:hover .post-cover.has-image img {
  transform: scale(1.05);
}
.post-cover::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(94,234,212,0.1), transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(167,139,250,0.1), transparent 50%);
}
.post-cover.has-image::after {
  display: none;
}
.post-cover span {
  position: absolute; top: 16px; left: 16px; z-index: 1;
  padding: 5px 14px; border-radius: 999px;
  background: var(--c-glow); color: #0a0e17;
  font-size: 12px; font-weight: 900;
}
.post-cover.has-image span {
  display: none;
}

.post-card-body { padding: 24px; }
.post-card-body h2 {
  font-size: clamp(20px, 3vw, 26px); margin-bottom: 10px;
  color: var(--c-white); line-height: 1.3;
}
.post-card-body p { color: var(--c-muted); font-size: 14px; }
.post-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--c-border);
  color: var(--c-muted); font-size: 13px;
}

.view-post {
  border: 0; background: transparent;
  color: var(--c-glow); font-weight: 900;
  transition: all var(--transition);
}
.view-post:hover { color: var(--c-glow2); }

.load-more-wrap { margin-top: 40px; text-align: center; }

.load-more-sentinel { height: 1px; }

.load-more-spinner {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 20px 0; color: var(--c-muted); font-size: 13px;
  font-weight: 700;
}
.load-more-spinner.hidden { display: none; }
.spinner-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--c-glow);
  animation: spinner-bounce 0.6s infinite alternate;
}
@keyframes spinner-bounce {
  from { transform: scale(0.6); opacity: 0.4; }
  to   { transform: scale(1);   opacity: 1;   }
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  min-height: 44px; border: 0; border-radius: var(--radius-sm);
  padding: 12px 24px; font-weight: 900; font-size: 14px;
  transition: all var(--transition);
}
.btn.primary {
  background: var(--c-glow); color: #0a0e17;
  box-shadow: 0 0 24px rgba(94,234,212,0.2);
}
.btn.primary:hover { box-shadow: 0 0 40px rgba(94,234,212,0.35); transform: translateY(-1px); }
.btn.ghost { background: var(--c-2); color: var(--c-text); }
.btn.ghost:hover { background: var(--c-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Empty ────────────────────────────────────────────────── */
.empty-state {
  padding: 40px; border: 1px dashed var(--c-border);
  border-radius: var(--radius); background: var(--c-1);
  color: var(--c-muted); text-align: center;
}

/* ── Publish ──────────────────────────────────────────────── */
.publish-card {
  display: grid; gap: 16px; padding: 32px;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-1);
}

input, select, textarea {
  width: 100%; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 13px 16px; background: var(--c-2); color: var(--c-text);
  transition: all var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--c-glow); outline: none;
  box-shadow: 0 0 0 3px rgba(94,234,212,0.12);
}

.markdown-preview {
  min-height: 300px; overflow: auto; padding: 16px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-2);
}
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { margin: 12px 0 8px; }
.markdown-preview p { margin: 0 0 8px; }

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  min-height: 550px;
}
.editor-grid label { display: grid; grid-template-rows: auto 1fr; gap: 8px; min-width: 0; }
.editor-grid label > span { font-weight: 900; }
.editor-grid textarea { resize: none; height: 100%; min-height: 500px; }
.editor-grid .markdown-preview { min-height: 500px; }

/* ── Markdown Toolbar ─────────────────────────────────────── */
.md-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-2);
}
.md-toolbar button {
  display: grid; place-items: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--c-muted);
  font-size: 13px; font-family: inherit; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
}
.md-toolbar button:hover {
  border-color: var(--c-glow); color: var(--c-glow);
  background: rgba(94,234,212,0.06);
}

.upload-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border: 1px dashed var(--c-border);
  border-radius: var(--radius-sm); background: transparent;
  color: var(--c-muted); font-size: 13px; cursor: pointer;
  transition: all var(--transition);
}
.tool-pill:hover { border-color: var(--c-glow); color: var(--c-glow); }
.tool-pill input { display: none; }

.attachment-list { display: grid; gap: 8px; }
.attachment-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px; align-items: center; padding: 12px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-2);
}
.attachment-item a { color: var(--c-glow); font-weight: 900; }
.attachment-item-actions { display: flex; gap: 8px; }
.attachment-deleted { opacity: 0.35; text-decoration: line-through; }

.cover-label { position: relative; }
.cover-label::before { content: '🖼'; margin-right: 4px; }
.cover-preview {
  margin-top: 12px; position: relative;
  max-width: 400px; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--c-border);
}
.cover-preview img {
  width: 100%; height: auto; max-height: 200px;
  object-fit: cover; display: block;
}
.remove-cover-btn {
  position: absolute; top: 4px; right: 4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 18px; line-height: 28px; text-align: center;
  border: none; cursor: pointer;
  transition: background 0.2s;
}
.remove-cover-btn:hover { background: rgba(239,68,68,0.8); }
.attachment-deleted a { pointer-events: none; }

.form-actions {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px;
}
.publish-submit { width: 100%; }

/* ── Post Detail ──────────────────────────────────────────── */
.page-section { padding: 40px 0; }

.back-btn {
  margin-bottom: 24px; border: 0; background: transparent;
  color: var(--c-glow); font-weight: 900; font-size: 15px;
  transition: all var(--transition);
}
.back-btn:hover { color: var(--c-glow2); }

.post-detail {
  padding: 40px; border: 1px solid var(--c-border);
  border-radius: var(--radius); background: var(--c-1);
}

.detail-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.detail-meta span {
  padding: 4px 12px; border-radius: 999px;
  background: var(--c-2); color: var(--c-muted); font-size: 12px;
}

.post-detail h1 {
  font-size: clamp(28px, 5vw, 44px); margin-bottom: 12px;
  color: var(--c-white); line-height: 1.2;
}

.detail-summary { color: var(--c-muted); margin-bottom: 24px; }

.detail-cover {
  margin-bottom: 24px; border-radius: var(--radius-sm);
  overflow: hidden; max-height: 400px;
}
.detail-cover img {
  width: 100%; max-height: 400px;
  object-fit: cover; display: block;
}

.detail-content {
  white-space: pre-wrap; padding-top: 24px;
  border-top: 1px solid var(--c-border); line-height: 1.8;
}

.signature-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; margin: 24px 0;
}
.signature-grid div { min-width: 0; }
.signature-grid span { display: block; margin-bottom: 4px; color: var(--c-muted); font-size: 12px; }
.signature-grid code { font-size: 11px; word-break: break-all; }
@media (max-width: 768px) {
  .signature-grid { grid-template-columns: 1fr; }
}

.rendered-content { white-space: normal; }
.rendered-content > * { margin: 12px 0; }
.rendered-content > *:first-child { margin-top: 0; }
.rendered-content > *:last-child { margin-bottom: 0; }
.rendered-content h1 { font-size: 28px; color: var(--c-white); margin: 24px 0 12px; }
.rendered-content h2 { font-size: 22px; color: var(--c-white); margin: 24px 0 12px; border-bottom: 1px solid var(--c-border); padding-bottom: 8px; }
.rendered-content h3 { font-size: 18px; color: var(--c-white); margin: 20px 0 10px; }
.rendered-content h4 { font-size: 16px; color: var(--c-white); margin: 16px 0 8px; }
.rendered-content p { line-height: 1.9; margin: 12px 0; }
.rendered-content a { color: var(--c-glow); text-decoration: none; border-bottom: 1px dashed var(--c-glow); }
.rendered-content a:hover { color: var(--c-glow2); }
.rendered-content ul, .rendered-content ol { padding-left: 24px; margin: 12px 0; }
.rendered-content li { line-height: 1.8; margin: 4px 0; }
.rendered-content blockquote { border-left: 4px solid var(--c-glow); margin: 16px 0; padding: 8px 16px; background: var(--c-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--c-muted); }
.rendered-content blockquote p { margin: 4px 0; }
.rendered-content pre { background: var(--c-2); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 16px 20px; overflow-x: auto; margin: 16px 0; }
.rendered-content pre code { font-family: 'JetBrains Mono','Fira Code',Consolas,monospace; font-size: 13px; line-height: 1.7; background: transparent !important; padding: 0; color: var(--c-text); }
.rendered-content pre code.hljs { background: transparent !important; color: var(--c-text); }
.rendered-content code { background: var(--c-2); padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono','Fira Code',Consolas,monospace; font-size: 13px; }
.rendered-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 16px 0; display: block; }
.rendered-content video { max-width: 100%; border-radius: var(--radius-sm); margin: 16px 0; }
.rendered-content hr { border: none; border-top: 1px solid var(--c-border); margin: 24px 0; }
.rendered-content strong { color: var(--c-white); }
.rendered-content em { color: var(--c-muted); }
.rendered-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.rendered-content thead { background: var(--c-2); }
.rendered-content th, .rendered-content td { padding: 10px 14px; border: 1px solid var(--c-border); text-align: left; }
.rendered-content th { font-weight: 700; color: var(--c-white); }
.rendered-content td { color: var(--c-text); }
.rendered-content tr:hover td { background: var(--c-2); }
.rendered-content del { opacity: 0.6; }

.post-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.post-actions button, .detail-actions button {
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 10px 16px; background: var(--c-2); color: var(--c-text);
  font-weight: 900; font-size: 13px; transition: all var(--transition);
}
.post-actions button:hover, .detail-actions button:hover { border-color: var(--c-glow); color: var(--c-glow); }
.post-actions .btn.danger, .post-actions [data-delete-post], .detail-actions .danger { color: var(--c-danger); }

.cover-pattern { display: none; }

/* ── Sidebar (articles page) ──────────────────────────────── */
.content-layout { display: flex; gap: 32px; align-items: flex-start; }
.sidebar { width: 280px; flex-shrink: 0; display: grid; gap: 20px; }
.sidebar.compact { position: sticky; top: 92px; }
.post-column { flex: 1; min-width: 0; }

.card-hover {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-1); padding: 24px;
  transition: all var(--transition);
}
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* profile card */
.profile-card { text-align: center; position: relative; overflow: hidden; }
.profile-card h2, .profile-card p { margin: 0; }
.profile-line {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--c-glow), var(--c-glow2));
}
.avatar {
   display: grid; place-items: center;
   width: 80px; height: 80px; margin: 0 auto 12px;
   border: 3px solid var(--c-glow); border-radius: 50%;
   background: linear-gradient(135deg, #1e293b, #0f172a);
   color: var(--c-glow); font-size: 28px; font-weight: 900;
   box-shadow: 0 0 20px rgba(94,234,212,0.2);
   animation: avatarFloat 5s ease-in-out infinite;
 }
 @keyframes avatarFloat {
   0%, 100% { transform: translateY(0); }
   50% { transform: translateY(-5px); }
 }
.socials { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.socials a {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c-2); color: var(--c-muted);
  font-size: 14px; font-weight: 900; transition: all var(--transition);
}
.socials a:hover { background: var(--c-glow); color: #0a0e17; }

.category-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.category-item {
  border: 0; border-radius: 999px; padding: 6px 14px;
  background: var(--c-2); color: var(--c-muted);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all var(--transition);
}
.category-item:hover, .category-item.active {
  background: rgba(94,234,212,0.12); color: var(--c-glow);
}

.node-card { display: grid; gap: 10px; }
.node-card h3 { color: var(--c-white); margin: 0; }
.node-card code { display: block; word-break: break-all; }
.node-card span { color: var(--c-muted); font-size: 13px; }

.section-title-compact {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.pulse-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c-glow);
  box-shadow: 0 0 0 0 rgba(94,234,212,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 14px rgba(94,234,212,0); }
  100% { box-shadow: 0 0 0 0 rgba(94,234,212,0); }
}
.section-title-compact h1, .gradient-title {
  margin: 0; font-size: clamp(24px, 4vw, 34px);
  background: linear-gradient(135deg, var(--c-white), var(--c-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  padding: 32px 24px; border-top: 1px solid var(--c-border);
  background: var(--c-1); color: var(--c-muted);
  text-align: center; font-size: 13px;
}
.site-footer p { margin: 4px 0; }
.site-footer .footer-icp a {
  color: var(--c-muted); text-decoration: none;
  transition: color var(--transition);
}
.site-footer .footer-icp a:hover { color: var(--c-glow); }

/* ── Modal ────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative; z-index: 1;
  width: min(460px, calc(100% - 32px));
  padding: 36px; border: 1px solid var(--c-border);
  border-radius: var(--radius); background: var(--c-1);
  box-shadow: var(--shadow-lg);
  display: grid; gap: 24px;
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head h2 { font-size: 22px; color: var(--c-white); margin-bottom: 4px; }
.modal-head p { color: var(--c-muted); font-size: 14px; }

.upload-box {
  display: grid; place-items: center; gap: 8px;
  padding: 40px; border: 2px dashed var(--c-border);
  border-radius: var(--radius); background: var(--c-2);
  cursor: pointer; transition: all var(--transition);
}
.upload-box:hover { border-color: var(--c-glow); background: rgba(94,234,212,0.03); }
.upload-box strong { font-size: 14px; color: var(--c-white); }
.upload-box small { font-size: 12px; color: var(--c-muted); }
.upload-box input { display: none; }
.upload-icon { font-size: 36px; }
.upload-name { font-size: 13px; color: var(--c-glow); text-align: center; }
.form-error { font-size: 13px; color: var(--c-danger); text-align: center; }

.modal-actions { display: flex; gap: 12px; }
.modal-actions button { flex: 1; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-left { justify-items: center; }
  .hero-title { border-left: 0; padding-left: 0; }
  .hero-tags { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-hud { width: min(100%, 360px); margin: 0 auto; }
  .hero-stage { width: min(85vw, 360px); margin: 0 auto; }
  .content-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar.compact { position: static; }
  .editor-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid > .skill-card { flex: 1 1 calc((100% - 20px) / 2); min-width: 0; }
  .signature-grid { grid-template-columns: 1fr; }
  .post-detail { padding: 24px; }
  .section-full { padding: 60px 16px; }
}

/* ── Toast ──────────────────────────────────── */
.toast {
  position: fixed; top: 24px; right: 24px; z-index: 9999;
  min-width: 240px; max-width: 420px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5;
  color: var(--c-0);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-12px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--c-danger); color: #fff; }
.toast-info  { background: var(--c-glow); color: var(--c-0); }
.toast-success { background: var(--c-success); color: var(--c-0); }

@media (max-width: 600px) {
  .hero-section { min-height: auto; padding: 40px 16px; }
  .hero-avatar-wrap { width: 200px; height: 200px; }
  .contact-grid { grid-template-columns: 1fr; }
  .form-actions { grid-template-columns: 1fr; }
  .skills-grid > .skill-card { flex: 1 1 100%; }
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-1); }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-glow); }

/* selection */
::selection { background: rgba(94,234,212,0.3); color: var(--c-white); }
