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

:root {
  --bg: #17212b;
  --bg-card: #1e2c3a;
  --bg-code: #242f3d;
  --text: #dce1e8;
  --text-dim: #8696a7;
  --pink: #fecdc8;
  --pink-mid: #d4a8a3;
  --pink-dim: #a88480;
  --pink-glow: rgba(254, 205, 200, 0.08);
  --link: #6ab7e2;
  --link-hover: #8dcbf0;
  --border: #2b3d4f;
  --tag-bg: #263545;
  --tag-text: #e8a838;
  --warm: #e8a838;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', monospace;
  --max-width: 740px;
  --radius: 12px;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

/* === BACKGROUND === */
body {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    /* Llama silhouette pattern */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='350' height='350' viewBox='0 0 350 350'%3E%3Cdefs%3E%3Cpath id='l' d='M0,48 Q0,42 2,36 L2,16 Q2,10 5,6 Q8,2 12,2 Q16,2 18,6 Q20,10 18,16 L18,36 Q20,42 20,48 L20,56 Q20,60 16,62 L4,62 Q0,60 0,56 Z M6,8 Q4,6 4,4 Q4,2 6,1 Q8,0 9,2 Z M14,8 Q16,6 16,4 Q16,2 14,1 Q12,0 11,2 Z M7,20 A2,2 0 1,0 9,20 A2,2 0 1,0 7,20 M12,20 A2,2 0 1,0 14,20 A2,2 0 1,0 12,20 M8,26 Q10,28 12,26 M3,62 L3,72 L7,72 L7,62 M13,62 L13,72 L17,72 L17,62'/%3E%3C/defs%3E%3Cg fill='none' stroke='%23fecdc8' stroke-width='0.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cuse href='%23l' transform='translate(30,25) scale(0.9)' opacity='0.04'/%3E%3Cuse href='%23l' transform='translate(240,15) scale(0.7) rotate(8,10,35)' opacity='0.03'/%3E%3Cuse href='%23l' transform='translate(155,110) scale(0.6)' opacity='0.035'/%3E%3Cuse href='%23l' transform='translate(60,195) scale(0.75) rotate(-5,10,35)' opacity='0.03'/%3E%3Cuse href='%23l' transform='translate(280,175) scale(0.85)' opacity='0.04'/%3E%3Cuse href='%23l' transform='translate(170,275) scale(0.65) rotate(6,10,35)' opacity='0.03'/%3E%3Cuse href='%23l' transform='translate(310,290) scale(0.5)' opacity='0.025'/%3E%3C/g%3E%3C/svg%3E"),
    /* Mesh gradient - boosted pink/warm */
    radial-gradient(ellipse 700px 600px at 80% 5%, rgba(254,205,200,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 600px 600px at 5% 85%, rgba(254,205,200,0.08) 0%, transparent 65%),
    radial-gradient(ellipse 800px 500px at 50% 50%, rgba(254,205,200,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 500px 500px at 20% 20%, rgba(212,168,163,0.06) 0%, transparent 65%),
    radial-gradient(ellipse 500px 400px at 75% 80%, rgba(254,205,200,0.06) 0%, transparent 60%);
  background-size: 350px 350px, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-attachment: scroll, fixed, fixed, fixed, fixed, fixed;
}

/* Subtle grain overlay - lightweight static pattern instead of feTurbulence */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' x='0' y='0' fill='%23fff' opacity='0.015'/%3E%3Crect width='1' height='1' x='2' y='2' fill='%23fff' opacity='0.01'/%3E%3C/svg%3E");
  background-size: 4px 4px;
  pointer-events: none;
  z-index: 0;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, rgba(23,33,43,0.3) 0%, transparent 60%),
    radial-gradient(ellipse 100% 50% at 50% 100%, rgba(23,33,43,0.25) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* === BACKGROUND DECORATION === */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Gradient blobs - no blur filter, soft gradients instead */
.bg-blob {
  position: absolute;
  border-radius: 50%;
}

.bg-blob-1 {
  width: 800px;
  height: 800px;
  top: -20%;
  right: -12%;
  background: radial-gradient(circle, rgba(254,205,200,0.1) 0%, rgba(254,205,200,0.03) 30%, transparent 60%);
  animation: blob-drift-1 25s ease-in-out infinite;
}

.bg-blob-2 {
  width: 700px;
  height: 700px;
  bottom: -5%;
  left: -12%;
  background: radial-gradient(circle, rgba(212,168,163,0.08) 0%, rgba(212,168,163,0.02) 30%, transparent 60%);
  animation: blob-drift-2 30s ease-in-out infinite;
}

.bg-blob-3 {
  width: 500px;
  height: 500px;
  top: 35%;
  left: 20%;
  background: radial-gradient(circle, rgba(254,205,200,0.06) 0%, transparent 55%);
  animation: blob-drift-1 22s ease-in-out infinite reverse;
}

@keyframes blob-drift-1 {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-30px, 40px, 0); }
}

@keyframes blob-drift-2 {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(40px, -30px, 0); }
}

/* Scattered llama avatars - static, no animations */
.llama-bg {
  position: absolute;
  background: url('/images/avatar.jpg') center/cover no-repeat;
  border-radius: 50%;
  pointer-events: none;
  filter: saturate(0.3) brightness(0.8);
}

.llama-bg-1 {
  width: 220px;
  height: 220px;
  top: 2%;
  left: 4%;
  opacity: 0.045;
  transform: rotate(-10deg);
}

.llama-bg-2 {
  width: 300px;
  height: 300px;
  bottom: -50px;
  right: -40px;
  opacity: 0.05;
  transform: rotate(8deg);
}

.llama-bg-3 {
  width: 140px;
  height: 140px;
  top: 40%;
  right: 6%;
  opacity: 0.035;
  transform: rotate(-6deg);
}

.llama-bg-4 {
  width: 180px;
  height: 180px;
  bottom: 20%;
  left: 2%;
  opacity: 0.04;
  transform: rotate(12deg);
}


a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--link-hover);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* === LANGUAGE SWITCH === */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-top: 0.8rem;
}

.lang-active {
  color: var(--pink);
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  background: rgba(254, 205, 200, 0.08);
  border-radius: 4px;
}

.lang-link {
  color: var(--text-dim);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.lang-link:hover {
  color: var(--pink);
  background: rgba(254, 205, 200, 0.05);
}

.float-nav .lang-switch {
  margin-top: 0.5rem;
  font-size: 0.7rem;
}

/* === FLOATING NAV === */
.float-nav {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 100;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.float-nav.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.float-nav-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(23, 33, 43, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.float-nav-home:hover {
  border-color: var(--pink-dim);
  box-shadow: 0 0 20px rgba(254, 205, 200, 0.15);
}

.float-nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--pink);
}

/* === HERO === */
.hero {
  padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(254, 205, 200, 0.08) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: hero-glow-pulse 6s ease-in-out infinite;
}

@keyframes hero-glow-pulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-avatar-wrap {
  position: relative;
  margin-bottom: 1.5rem;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--pink);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 30px rgba(254, 205, 200, 0.12), 0 0 60px rgba(254, 205, 200, 0.05);
  animation: avatar-glow 4s ease-in-out infinite;
}

.hero-avatar-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px dashed rgba(254, 205, 200, 0.2);
  animation: ring-spin 10s linear infinite;
  pointer-events: none;
}

.hero-avatar-ring::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(254, 205, 200, 0.7), 0 0 24px rgba(254, 205, 200, 0.3);
}

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes avatar-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(254, 205, 200, 0.12), 0 0 60px rgba(254, 205, 200, 0.05); }
  50% { box-shadow: 0 0 40px rgba(254, 205, 200, 0.2), 0 0 80px rgba(254, 205, 200, 0.1); }
}

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

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.4rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 60%, var(--pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-dot {
  -webkit-text-fill-color: var(--pink);
  font-weight: 900;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  max-width: 420px;
}

.hero-terminal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.4rem 1rem;
  background: rgba(36, 47, 61, 0.7);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.term-prompt {
  color: var(--pink);
  font-weight: 700;
}

.term-text {
  color: var(--text-dim);
}

.term-cursor {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  background: var(--pink);
  animation: cursor-blink 1s step-end infinite;
  vertical-align: text-bottom;
  border-radius: 1px;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* === POST CARDS === */
.posts-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  padding: 1.5rem 1.3rem 1.5rem 1.6rem;
  margin-bottom: 0.6rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid transparent;
  border-left: 3px solid var(--pink-dim);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s, background 0.3s;
}

/* Gradient top line */
.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--warm) 50%, transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

/* Post number */
.post-card::after {
  content: attr(data-num);
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--pink-dim);
  opacity: 0.25;
  transition: opacity 0.3s, color 0.3s;
}

.post-card:hover {
  border-color: rgba(254, 205, 200, 0.1);
  border-left-color: var(--pink);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.25),
    inset 3px 0 12px -6px rgba(254, 205, 200, 0.06);
  transform: translateX(3px);
  background: linear-gradient(90deg, rgba(254, 205, 200, 0.025) 0%, var(--bg-card) 25%);
}

.post-card:hover::before {
  opacity: 0.7;
}

.post-card:hover::after {
  opacity: 0.6;
  color: var(--pink);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.post-meta time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.01em;
}

.post-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  position: relative;
  z-index: 1;
}

.post-card h2 a {
  color: #fff;
  transition: color 0.2s;
}

.post-card h2 a:hover {
  color: var(--pink);
}

.post-summary {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}

/* === BACK LINK === */
.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--pink);
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--pink-mid);
}

/* === SINGLE POST === */
.post-full {
  padding: 2rem 0 4rem;
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

/* === POST CONTENT === */
.post-content {
  font-size: 1rem;
  line-height: 1.8;
}

.post-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 2.2rem 0 0.8rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.post-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 1.8rem 0 0.6rem;
}

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

.post-content ul, .post-content ol {
  margin-bottom: 1.1rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.35rem;
}

.post-content strong {
  color: #fff;
  font-weight: 600;
}

.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

.post-content blockquote {
  border-left: 3px solid var(--pink);
  padding: 0.7rem 1.1rem;
  margin: 1.3rem 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
}

.post-content blockquote p {
  margin-bottom: 0;
}

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

.post-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  margin: 1.3rem 0;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.84rem;
  color: var(--text);
}

.post-content a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(106, 183, 226, 0.3);
  text-underline-offset: 3px;
}

.post-content a:hover {
  text-decoration-color: var(--pink);
  color: var(--pink);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.3rem 0;
  font-size: 0.9rem;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.post-content th {
  background: var(--bg-card);
  color: #fff;
  font-weight: 600;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* === POST FOOTER === */
.post-footer {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

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

.footer-llama {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--pink-dim);
  margin-bottom: 0.4rem;
  opacity: 0.5;
  transition: opacity 0.3s;
  letter-spacing: 0.05em;
}

.footer-llama:hover {
  opacity: 1;
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
}

.site-footer a {
  color: var(--pink-dim);
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--pink);
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .hero {
    padding: 3rem 0 2rem;
  }

  .hero-avatar {
    width: 96px;
    height: 96px;
  }

  .hero-avatar-ring {
    inset: -6px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-glow {
    width: 300px;
    height: 300px;
  }

  .post-header h1 {
    font-size: 1.4rem;
  }

  .post-card {
    padding: 1.2rem 1rem 1.2rem 1.15rem;
  }

  .post-card:hover {
    transform: none;
  }

  .post-card::after {
    font-size: 0.65rem;
    top: 0.8rem;
    right: 0.8rem;
  }

  .llama-bg { display: none; }
  .bg-blob-1 { width: 350px; height: 350px; }
  .bg-blob-2 { width: 300px; height: 300px; }
  .bg-blob-3 { display: none; }

  .float-nav {
    top: 0.75rem;
    right: 0.75rem;
  }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  .hero-glow { animation: none; }
  .bg-blob { animation: none; }
}

/* === SELECTION === */
::selection {
  background: rgba(254, 205, 200, 0.25);
  color: #fff;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--pink-dim);
}
