/* ============================================================
   DESIGN TOKENS
   Single source of truth — referenced everywhere below.
============================================================ */
:root {
  /* Backgrounds */
  --bg-primary:    #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary:  #0f0f0f;

  /* Borders */
  --border-color:  #2a2a35;
  --border-hover:  rgba(255, 62, 62, 0.25);

  /* Text */
  --text-primary:   #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted:     #71717a;

  /* Semantic aliases used in older pages */
  --bg:          var(--bg-primary);
  --panel:       var(--bg-secondary);
  --text:        var(--text-secondary);
  --text-bright: var(--text-primary);
  --text-dim:    var(--text-muted);

  /* Accent palette — red/grey cyber theme */
  --accent:       #ff3e3e;
  --accent2:      #00d9ff;
  --accent3:      #c92a2a;

  /* Component aliases */
  --accent-cyan:   #ff3e3e;
  --accent-green:  #ff6b6b;
  --accent-red:    #ff3e3e;
  --accent-purple: #c92a2a;
  --accent-blue:   #58a6ff;
  --accent-orange: #d2991d;

  /* Glow helpers */
  --accent-cyan-glow:  rgba(255, 62, 62, 0.15);
  --accent-green-glow: rgba(255, 107, 107, 0.15);

  /* Shared */
  --font-mono:  'JetBrains Mono', monospace;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --radius:     6px;
  --surface:    var(--bg-secondary);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible,
.project-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}


/* ============================================================
   SCROLLBAR
============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-cyan); }


/* ============================================================
   BACKGROUND LAYERS 
============================================================ */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 217, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 217, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, transparent 20%, var(--bg-primary) 80%);
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  animation: flicker-burst 0.7s steps(2, end) 1;
}

.boot-static {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0px, transparent 2px, transparent 4px),
    linear-gradient(180deg, rgba(255,62,62,0.12), transparent 60%);
  mix-blend-mode: screen;
  animation: boot-static 0.5s ease-out 1 forwards;
}

main, nav, footer {
  position: relative;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .scanlines { animation: none; }
  .boot-static { display: none; }
}


/* ============================================================
   KEYFRAMES
   One definition each — no duplicates.
============================================================ */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes pulse {
  0%   { transform: scale(0.9); opacity: 0.6; }
  50%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 8px #00ff41; transform: scale(1); }
  50%       { box-shadow: 0 0 20px #00ff41, 0 0 40px rgba(0,255,65,0.3); transform: scale(1.1); }
}

@keyframes ping {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

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

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
  0%, 100% { text-shadow: 0 0 5px rgba(0, 212, 255, 0.2); }
  50%       { text-shadow: 0 0 15px rgba(0, 212, 255, 0.8); }
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40%      { content: '..'; }
  60%, 100%{ content: '...'; }
}

@keyframes rotateHUD {
  100% { transform: rotate(360deg); }
}

@keyframes bounce-icon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}

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

@keyframes scan-flash {
  0%   { opacity: 0.35; }
  100% { opacity: 0.06; }
}

@keyframes boot-static {
  0%   { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Profile picture */
@keyframes matrixBorder {
  0%   { border-color: #4cc9f0; box-shadow: 0 0 20px rgba(76,201,240,0.6), 0 0 40px rgba(114,9,183,0.3), inset 0 0 20px rgba(76,201,240,0.2); }
  25%  { border-color: #7209b7; box-shadow: 0 0 25px rgba(114,9,183,0.7), 0 0 50px rgba(67,97,238,0.4), inset 0 0 25px rgba(114,9,183,0.25); }
  50%  { border-color: #4361ee; box-shadow: 0 0 20px rgba(67,97,238,0.6), 0 0 40px rgba(76,201,240,0.3), inset 0 0 20px rgba(67,97,238,0.2); }
  75%  { border-color: #4895ef; box-shadow: 0 0 25px rgba(72,149,239,0.7), 0 0 50px rgba(114,9,183,0.4), inset 0 0 25px rgba(72,149,239,0.25); }
  100% { border-color: #4cc9f0; box-shadow: 0 0 20px rgba(76,201,240,0.6), 0 0 40px rgba(114,9,183,0.3), inset 0 0 20px rgba(76,201,240,0.2); }
}

@keyframes imageBreathing {
  0%, 100% { filter: brightness(1) contrast(1.05) saturate(1.1) hue-rotate(0deg); }
  50%       { filter: brightness(1.2) contrast(1.15) saturate(1.3) hue-rotate(10deg); }
}

@keyframes cornerPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); box-shadow: 0 0 10px rgba(76,201,240,0.8); }
  50%       { opacity: 1; transform: scale(1.4); box-shadow: 0 0 20px rgba(114,9,183,1); }
}

/* Glitch system */
@keyframes glitch-rgb-split {
  0%   { text-shadow: 0 0 0 transparent, 0 0 0 transparent; transform: translate(0,0); }
  18%  { text-shadow: -2px 0 var(--accent2), 2px 0 var(--accent3); transform: translate(-1px,0); }
  22%  { text-shadow: 2px 0 var(--accent2), -2px 0 var(--accent3); transform: translate(1px,0); }
  26%  { text-shadow: 0 0 0 transparent, 0 0 0 transparent; transform: translate(0,0); }
  72%  { text-shadow: 0 0 0 transparent, 0 0 0 transparent; transform: translate(0,0); }
  76%  { text-shadow: 1px 0 var(--accent2), -1px 0 var(--accent3); transform: translate(1px,0); }
  80%  { text-shadow: 0 0 0 transparent, 0 0 0 transparent; transform: translate(0,0); }
  100% { text-shadow: 0 0 0 transparent, 0 0 0 transparent; transform: translate(0,0); }
}

@keyframes glitch-slice-in {
  0%   { clip-path: inset(0 0 0 0); opacity: 0; transform: translateX(-14px); filter: brightness(2) saturate(0); }
  8%   { clip-path: inset(10% 0 70% 0); opacity: 1; transform: translateX(10px); }
  16%  { clip-path: inset(60% 0 5% 0); transform: translateX(-8px); }
  24%  { clip-path: inset(0 0 0 0); transform: translateX(4px); filter: brightness(1.4) saturate(1.6); }
  32%  { transform: translateX(-2px); filter: brightness(1) saturate(1); }
  100% { clip-path: inset(0 0 0 0); opacity: 1; transform: translateX(0); filter: none; }
}

@keyframes glitch-out {
  0%   { clip-path: inset(0 0 0 0); opacity: 1; filter: none; }
  15%  { clip-path: inset(0 0 0 0); transform: translateX(6px); filter: brightness(1.6) saturate(1.8); }
  35%  { clip-path: inset(20% 0 30% 0); transform: translateX(-10px); }
  55%  { clip-path: inset(65% 0 2% 0); transform: translateX(12px); }
  75%  { clip-path: inset(5% 0 80% 0); transform: translateX(-6px); opacity: 0.6; }
  100% { clip-path: inset(50% 0 50% 0); opacity: 0; transform: translateX(0); }
}

@keyframes flicker-burst {
  0%, 100% { opacity: 1; }
  4%   { opacity: 0.2; }
  8%   { opacity: 1; }
  12%  { opacity: 0.4; }
  16%  { opacity: 1; }
  70%  { opacity: 1; }
  74%  { opacity: 0.3; }
  78%  { opacity: 1; }
}

@keyframes glitch-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Glitch utility classes */
.glitch-stagger {
  opacity: 0;
  animation: glitch-slice-in 0.5s steps(8, end) forwards;
}
.glitch-replay        { animation: glitch-slice-in 0.45s steps(10, end) 1 !important; }
.glitch-out-active    { animation: glitch-out 0.3s steps(8, end) 1 forwards !important; }
.is-hidden            { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .glitch-stagger { opacity: 1; animation: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* ============================================================
   NAVIGATION
============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(137, 114, 114, 0.25);
}

.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0.9rem 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: -0.5px;
}

.nav-prompt     { color: var(--accent-cyan); font-weight: 600; }
.cursor-blink   { color: var(--accent-cyan); animation: blink 1s step-end infinite; }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  transition: var(--transition);
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  position: relative;
}

.nav-link:hover,
.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background-color: var(--accent-cyan);
  transition: var(--transition);
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(169, 123, 123, 0.2);
  gap: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  position: relative;
  z-index: 99;
}

.mobile-nav.show,
.mobile-nav.open {
  max-height: 240px;
  padding: 1rem 1.8rem;
  gap: 1rem;
}

.mobile-nav-link {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text-muted);
}

.mobile-nav-link:hover,
.mobile-nav-link[aria-current="page"] { color: var(--accent-cyan); }

@media (max-width: 768px) {
  .nav-links  { display: none; }
  .nav-toggle { display: flex; }
}


/* ============================================================
   MAIN LAYOUT
============================================================ */
.main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.8rem 4rem;
}


/* ============================================================
   HERO
============================================================ */
.hero {
  padding: 4rem 0 2rem;
  animation: fadeInUp 0.8s ease-out;
  margin-bottom: 1rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-avatar-col {
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-avatar-col { order: -1; }
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  background: var(--accent-cyan-glow);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 62, 62, 0.2);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -2px;
  margin-bottom: 1rem;
}

.hero-title span {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.9s ease forwards, glow 3s ease-in-out infinite;
}

.hero-title .line1              { animation-delay: 0.2s, 1.1s; }
.hero-title .hero-accent:nth-of-type(1) { animation-delay: 0.5s, 1.4s; color: #00d4ff; }
.hero-title .line2              { animation-delay: 0.8s, 1.7s; }
.hero-title .hero-accent:nth-of-type(2) { animation-delay: 1.1s, 2s;   color: #00d4ff; }

.hero-accent { color: var(--accent-cyan); font-style: italic; font-weight: 300; }

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 650px;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--bg-tertiary);
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.tag:hover   { color: var(--accent-green); }
.tag-sep     { color: var(--border-color); }

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  background: var(--accent-cyan);
  color: var(--bg-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.8rem 1.6rem;
  border-radius: 4px;
  transition: var(--transition);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(255,62,62,0.25);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent-cyan);
  box-shadow: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.8rem 1.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.btn-ghost:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.btn-ghost .arrow { margin-left: 0.5rem; transition: transform 0.2s ease; }
.btn-ghost:hover .arrow { transform: translateX(4px); }


/* ============================================================
   SECTION DIVIDER
============================================================ */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 2.5rem 0 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.divider-label {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  white-space: nowrap;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(255, 62, 62, 0.5), transparent);
}


/* ============================================================
   DASHBOARD WIDGET
============================================================ */
.dashboard-widget {
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid rgba(0,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: all 0.3s ease;
  margin-bottom: 4rem;
  font-family: var(--font-mono);
  position: relative;
  animation: fadeInUp 1s ease-out;
}

.dashboard-widget::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green), var(--accent-purple));
}

.dashboard-widget:hover {
  border-color: rgba(0,255,255,0.2);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.4),
    0 0 40px rgba(0,255,255,0.05),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(0,255,255,0.15);
  backdrop-filter: blur(10px);
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e0e0e0;
  letter-spacing: 0.5px;
}

.dashboard-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}

.db-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #8892b0;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.db-tab::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.db-tab:hover::before { left: 100%; }
.db-tab:hover {
  color: #ccd6f6;
  background: rgba(0,255,255,0.05);
  transform: translateY(-1px);
}

.db-tab.active {
  background: linear-gradient(135deg, rgba(0,255,255,0.15), rgba(0,180,255,0.1));
  color: #00ffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,255,255,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  border: 1px solid rgba(0,255,255,0.3);
}

.db-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 2px;
  background: #00ffff;
  border-radius: 2px;
  box-shadow: 0 0 8px #00ffff;
}

.tab-icon { font-size: 0.9rem; filter: grayscale(0.3); transition: all 0.3s ease; }
.db-tab.active .tab-icon { filter: grayscale(0); animation: bounce-icon 0.5s ease; }

.dashboard-content {
  padding: 20px;
  min-height: 200px;
  background: rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.dashboard-content > * { animation: fadeSlideIn 0.4s ease; }

.console-line    { margin-bottom: 0.4rem; display: flex; gap: 0.5rem; }
.console-prompt  { color: var(--accent-green); user-select: none; }
.console-output  { color: var(--text-primary); }
.console-warn    { color: var(--accent-red); }
.console-accent  { color: var(--accent-cyan); }

@media (max-width: 768px) {
  .dashboard-header { flex-direction: column; gap: 12px; }
  .dashboard-tabs   { width: 100%; justify-content: center; flex-wrap: wrap; }
  .db-tab           { padding: 6px 12px; font-size: 0.75rem; }
  .tab-icon         { font-size: 0.8rem; }
}


/* ============================================================
   LIVE DOT
============================================================ */
.live-dot {
  width: 10px;
  height: 10px;
  background: #00ff41;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-shadow: 0 0 8px #00ff41;
  animation: pulse-dot 2s infinite;
}

.live-dot::after {
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  background: #00ff41;
  border-radius: 50%;
  top: 0; left: 0;
  animation: ping 2s infinite;
}


/* ============================================================
   POSTS / WRITEUPS LIST
============================================================ */
.posts-section { margin-bottom: 4rem; }

.posts-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.section-title { font-size: 1.8rem; font-weight: 600; letter-spacing: -1px; }

.view-all {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition);
}

.view-all:hover { text-shadow: 0 0 10px var(--accent-cyan-glow); }

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-item {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  position: relative;
  align-items: flex-start;
  overflow: hidden;
  cursor: pointer;
}

.post-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%; width: 3px;
  background: var(--accent-cyan);
  transform: scaleY(0);
  transition: var(--transition);
  transform-origin: bottom;
}

.post-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.post-item:hover::before { transform: scaleY(1); }

.post-meta {
  width: 150px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.post-num  { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.post-date { font-size: 0.85rem; color: var(--text-secondary); }

.post-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
  text-transform: uppercase;
}

.post-badge.external {
  background: rgba(255,62,62,0.1);
  color: var(--accent-red);
  border: 1px solid rgba(255,62,62,0.2);
}

.post-badge.read {
  background: rgba(255,107,107,0.1);
  color: var(--accent-green);
  border: 1px solid rgba(255,107,107,0.2);
}

.post-badge.draft-badge {
  background: rgba(210,153,29,0.1);
  color: var(--accent-orange);
  border-color: rgba(210,153,29,0.3);
}

.post-content {
  flex: 1;
  padding-right: 2rem;
}

.post-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  letter-spacing: -0.5px;
}

.post-title a { text-decoration: none; color: var(--text-primary); transition: var(--transition); }
.post-item:hover .post-title a { color: var(--accent-cyan); }

.post-excerpt { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; margin-bottom: 0.8rem; }

.post-tags { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.ptag { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

.post-arrow {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: var(--transition);
  align-self: center;
}

.post-item:hover .post-arrow { color: var(--accent-cyan); transform: translate(3px,-3px); }

.posts-footer { margin-top: 2rem; text-align: center; }

.view-all-footer {
  display: inline-block;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-color);
  padding: 0.8rem 2rem;
  border-radius: 4px;
  transition: var(--transition);
}

.view-all-footer:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }


/* ============================================================
   MANIFEST / INFO SECTION
============================================================ */
.manifest-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 3rem;
  border-radius: 8px;
  position: relative;
}

.manifest-quote {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.manifest-note { color: var(--text-muted); font-size: 0.95rem; }


/* ============================================================
   PLATFORM CARDS
============================================================ */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.platform-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  font-family: var(--font-mono);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.platform-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 30px rgba(255,62,62,0.1);
  transform: translateY(-3px);
}

.platform-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  position: relative;
}

.platform-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 1.1rem;
  font-weight: 500;
}

.platform-rank { font-size: 0.8rem; color: var(--accent-green); }

.platform-name-link {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  position: relative;
}

.platform-name-link:hover .platform-name  { color: var(--accent-cyan); text-shadow: 0 0 8px rgba(0,255,255,0.3); }
.platform-name-link:hover .platform-logo  { filter: brightness(1.3); transform: scale(1.1); }

.platform-logo {
  width: 26px; height: 26px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
  transition: all 0.3s ease;
}

.platform-stats { display: flex; flex-direction: column; gap: 0.8rem; }

.stat-item { display: flex; justify-content: space-between; font-size: 0.85rem; }
.stat-label { color: var(--text-muted); }
.stat-value { color: var(--text-primary); }

.progress-bar-container {
  width: 100%; height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
}


/* ============================================================
   PROFILE PICTURE
============================================================ */
.avatar-hud {
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 2px dashed var(--accent-cyan);
  padding: 5px;
  animation: rotateHUD 20s linear infinite;
  object-fit: cover;
}

.avatar-container {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.avatar-container::after {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border: 1px solid var(--accent-cyan-glow);
  border-radius: 50%;
  pointer-events: none;
}

.profile-photo-frame {
  position: relative;
  width: 170px; height: 170px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid #4cc9f0;
  box-shadow:
    0 0 25px rgba(76,201,240,0.6),
    0 0 50px rgba(114,9,183,0.4),
    0 0 80px rgba(67,97,238,0.2),
    inset 0 0 25px rgba(76,201,240,0.2);
  background: linear-gradient(135deg,
    rgba(76,201,240,0.05) 0%,
    rgba(114,9,183,0.05) 50%,
    rgba(67,97,238,0.05) 100%);
  animation: matrixBorder 6s ease-in-out infinite;
  transition: all 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}

.profile-photo-frame:hover {
  transform: scale(1.12) rotate(-3deg);
  cursor: pointer;
  border-radius: 50%;
  border-color: #7209b7;
  box-shadow:
    0 0 40px rgba(76,201,240,0.9),
    0 0 80px rgba(114,9,183,0.7),
    0 0 120px rgba(67,97,238,0.5),
    0 0 160px rgba(72,149,239,0.3),
    inset 0 0 40px rgba(76,201,240,0.4);
}

.profile-photo-frame:hover .profile-photo {
  animation: imageBreathing 2s ease-in-out infinite;
}

.profile-photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(76,201,240,0.15) 0%, transparent 20%,
    rgba(114,9,183,0.15) 40%, transparent 60%,
    rgba(67,97,238,0.15) 80%, transparent 100%
  );
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.profile-photo-frame:hover::after {
  opacity: 1;
  animation: glitch-out 0.4s ease-in-out;
}

/* Frame corners */
.frame-corner {
  position: absolute;
  width: 24px; height: 24px;
  border-color: #4cc9f0;
  pointer-events: none;
  z-index: 8;
  transition: all 0.4s ease;
}

.frame-corner.tl { top:-3px;    left:-3px;   border-top:3px solid; border-left:3px solid;   border-radius: 50% 0 0 0; animation: cornerPulse 3s ease-in-out infinite 0s; }
.frame-corner.tr { top:-3px;    right:-3px;  border-top:3px solid; border-right:3px solid;  border-radius: 0 50% 0 0; animation: cornerPulse 3s ease-in-out infinite 0.75s; }
.frame-corner.bl { bottom:-3px; left:-3px;   border-bottom:3px solid; border-left:3px solid; border-radius: 0 0 0 50%; animation: cornerPulse 3s ease-in-out infinite 1.5s; }
.frame-corner.br { bottom:-3px; right:-3px;  border-bottom:3px solid; border-right:3px solid;border-radius: 0 0 50% 0; animation: cornerPulse 3s ease-in-out infinite 2.25s; }

.profile-photo-frame:hover .frame-corner {
  border-color: #7209b7 !important;
  width: 30px; height: 30px;
  box-shadow: 0 0 25px rgba(114,9,183,1);
}

.profile-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(5%) contrast(1.1) brightness(1.08) saturate(1.1);
  transition: all 0.6s ease;
  position: relative;
  z-index: 1;
}

.network-illustration {
  width: 100%; height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  opacity: 0.85;
  transition: var(--transition);
}

@media (max-width: 600px) {
  .hero-identity { gap: 1.5rem; }
  .profile-photo-frame { width: 110px; height: 110px; border-width: 1.5px; }
}


/* ============================================================
   TYPEWRITER & FOCUS TAGS
============================================================ */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  background-color: #4cc9f0;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  height: 1.1em;
  box-shadow: 0 0 8px rgba(76,201,240,0.8);
}

.focus-category { margin-bottom: 1rem; }

.focus-category-title {
  color: #4cc9f0;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(76,201,240,0.5);
}

.focus-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.focus-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(76,201,240,0.02);
  transition: all 0.3s ease;
}

.focus-tag:hover {
  border-color: #ffd700;
  color: #ffd700;
  background: rgba(255,215,0,0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255,215,0,0.3);
}


/* ============================================================
   SKILL PILLS
============================================================ */
.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.skill-pill i { font-size: 1rem; line-height: 1; }
.skill-pill i.colored { filter: grayscale(35%) saturate(85%); opacity: 0.9; }
.skill-pill:hover { border-color: #5fadb4; color: var(--text-primary); transform: translateY(-1px); }
.skill-pill:hover i.colored { filter: none; opacity: 1; }


/* ============================================================
   ABOUT PAGE
============================================================ */
.hero-identity { display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; }

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

.bio-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1.05rem;
}

.skills-icon-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.meta-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.cert-card {
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  color: var(--text-secondary);
}


/* ============================================================
   CONTACT LINKS
============================================================ */
.contact-links { display: flex; flex-direction: column; gap: 0.8rem; }

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: all 0.3s ease;
  background: rgba(76,201,240,0.02);
}

.contact-link i { font-size: 1.1rem; width: 20px; text-align: center; transition: all 0.3s ease; }
.contact-link span { flex: 1; }

.contact-link:hover {
  border-color: #4cc9f0;
  color: #4cc9f0;
  background: rgba(76,201,240,0.08);
  transform: translateX(5px);
  box-shadow: 0 0 20px rgba(76,201,240,0.2);
}

.contact-link:hover i { transform: scale(1.2); color: #4cc9f0; }

.contact-link.github:hover   { border-color: #8b5cf6; color: #8b5cf6; box-shadow: 0 0 20px rgba(139,92,246,0.2); }
.contact-link.github:hover i { color: #8b5cf6; }
.contact-link.twitter:hover   { border-color: #1da1f2; color: #1da1f2; box-shadow: 0 0 20px rgba(29,161,242,0.2); }
.contact-link.twitter:hover i { color: #1da1f2; }
.contact-link.linkedin:hover   { border-color: #0077b5; color: #0077b5; box-shadow: 0 0 20px rgba(0,119,181,0.2); }
.contact-link.linkedin:hover i { color: #0077b5; }
.contact-link.instagram:hover   { border-color: #e4405f; color: #e4405f; box-shadow: 0 0 20px rgba(228,64,95,0.2); }
.contact-link.instagram:hover i { color: #e4405f; }
.contact-link.email:hover   { border-color: #ea4335; color: #ea4335; box-shadow: 0 0 20px rgba(234,67,53,0.2); }
.contact-link.email:hover i { color: #ea4335; }


/* ============================================================
   WRITEUP READER
============================================================ */
.writeup-container       { display: none; }
.writeup-container.active{ display: block; }

.writeup-hero { margin-bottom: 2rem; }

.writeup-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.writeup-meta span { display: flex; align-items: center; gap: 0.3rem; }

.writeup-content {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  line-height: 1.7;
}

.writeup-content h1,
.writeup-content h2,
.writeup-content h3 { font-family: var(--font-mono); color: var(--text-primary); margin: 1.5rem 0 0.8rem; }
.writeup-content h1  { font-size: 1.8rem; }
.writeup-content h2  { font-size: 1.4rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.3rem; }
.writeup-content h3  { font-size: 1.1rem; }
.writeup-content p   { margin-bottom: 1rem; color: var(--text-secondary); }

.writeup-content code {
  background: rgba(255,255,255,0.05);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--text-primary);
}

.writeup-content pre {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.writeup-content pre code { background: none; padding: 0; }

.writeup-content img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin: 1rem 0;
  display: block;
}

.writeup-content img.img-missing { border-color: rgba(255,62,62,0.4); }

.img-error-placeholder {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px dashed rgba(255,62,62,0.5);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-red);
  background: rgba(255,62,62,0.04);
}

.img-error-placeholder code {
  background: rgba(255,62,62,0.08);
  color: inherit;
  font-size: 0.75rem;
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

.writeup-content blockquote {
  border-left: 3px solid var(--accent-blue);
  background: rgba(88,166,255,0.05);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
}

.writeup-content blockquote.callout         { border-left: 3px solid var(--accent-blue); background: rgba(88,166,255,0.08); padding: 0.9rem 1rem 0.9rem 1.1rem; }
.writeup-content blockquote.callout-warning  { border-left-color: var(--accent-orange, #d2991d); background: rgba(210,153,29,0.08); }
.writeup-content blockquote.callout-danger   { border-left-color: var(--accent-red, #ff3e3e); background: rgba(255,62,62,0.08); }

.writeup-content .callout-title {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  display: block;
}

.writeup-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.writeup-nav a,
.writeup-nav span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.writeup-nav a {
  color: var(--accent-blue);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.writeup-nav a:hover { color: var(--text-primary); }

.back-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 1.5rem;
  color: var(--accent-green);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1;
}

.back-btn:hover { text-decoration: underline; }

.post-badge.draft-badge {
  background: rgba(210,153,29,0.1);
  color: var(--accent-orange);
  border-color: rgba(210,153,29,0.3);
}

/* Loading spinner */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Responsive fixes */
@media (max-width: 680px) {
  .post-item {
    flex-direction: column;
    gap: 0.6rem;
  }
  .post-meta {
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
  }
  .post-arrow {
    position: absolute;
    top: 1.2rem;
    right: 1.4rem;
  }
  .writeup-content {
    padding: 1.2rem;
  }
}

/* ============================================================
   PROJECTS PAGE
============================================================ */
.projects-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(255,62,62,0.18);
}

.project-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0.5rem;
  border-bottom: 1px solid rgba(255,62,62,0.18);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: glitch-slice-in 0.55s steps(10, end) forwards;
}

.project-row:nth-of-type(1) { animation-delay: 0.45s; }
.project-row:nth-of-type(2) { animation-delay: 0.62s; }
.project-row:nth-of-type(3) { animation-delay: 0.79s; }

.project-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,62,62,0.12), transparent);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.project-row:hover,
.project-row:focus-visible { background: rgba(255,62,62,0.05); animation: none; opacity: 1; }

.project-row:hover::before,
.project-row:focus-visible::before { opacity: 1; animation: glitch-sweep 0.5s ease-out 1; }

.project-row:hover .row-title,
.project-row:focus-visible .row-title { animation: glitch-rgb-split 0.5s steps(6,end) 1; }

.row-index { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.85rem; width: 2.4rem; flex-shrink: 0; }
.row-main  { flex: 1; min-width: 0; }

.row-title-line {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.row-title { font-size: 1.3rem; font-weight: 500; color: var(--text-primary); display: inline-block; }

.card-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--accent);
  white-space: nowrap;
}

.card-lang.lang-cpp    { color: var(--accent2); }
.card-lang.lang-docker { color: var(--accent3); }

.row-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; max-width: 640px; }
.row-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

.row-action {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid rgba(255,62,62,0.5);
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.project-row:hover .row-action,
.project-row:focus-visible .row-action {
  background: rgba(255,62,62,0.1);
  border-color: var(--accent);
  animation: flicker-burst 0.4s steps(3,end) 1;
}

.article-view { max-width: 720px; margin: 0 auto; padding-top: 0.5rem; }

#projectsView.glitching-out { animation: glitch-out 0.32s steps(8,end) 1 forwards; }

.view-transition-flash {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.08) 0px, transparent 2px, transparent 5px),
    linear-gradient(120deg, rgba(0,217,255,0.08), rgba(255,62,62,0.1));
  mix-blend-mode: screen;
}

.view-transition-flash.firing { animation: flicker-burst 0.32s steps(4,end) 1; opacity: 1; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.back-link:hover,
.back-link:focus-visible { color: var(--accent); animation: glitch-rgb-split 0.45s steps(6,end) 1; }

.article-eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  opacity: 0;
  animation: glitch-slice-in 0.45s steps(8,end) 0.08s forwards;
}

.article-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 1rem;
  opacity: 0;
  animation: glitch-slice-in 0.5s steps(10,end) 0.16s forwards,
             flicker-burst 6s steps(2,end) 1.2s 1;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  opacity: 0;
  animation: glitch-slice-in 0.4s steps(8,end) 0.26s forwards;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.2rem;
  opacity: 0;
  animation: glitch-slice-in 0.4s steps(8,end) 0.32s forwards;
}

.article-lede {
  font-size: 1.15rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 1.6rem;
  font-weight: 400;
  opacity: 0;
  animation: glitch-slice-in 0.45s steps(8,end) 0.4s forwards;
}

.article-body {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.85;
  opacity: 0;
  animation: glitch-slice-in 0.45s steps(8,end) 0.5s forwards;
}

.article-body h2      { font-size: 1.3rem; font-weight: 500; color: var(--text-primary); margin: 2rem 0 0.9rem; }
.article-body p       { margin-bottom: 1.2rem; }
.article-body strong  { color: var(--accent); font-weight: 500; }
.article-body ul      { margin: 0 0 1.2rem 1.3rem; }
.article-body li      { margin-bottom: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .back-link:hover, .back-link:focus-visible { animation: none; }
  .article-eyebrow, .article-title, .article-meta,
  .article-tags, .article-lede, .article-body {
    opacity: 1;
    animation: none;
  }
  .article-view { animation: none; }
  #projectsView.glitching-out { animation: none; }
  .view-transition-flash { display: none; }
}


/* ============================================================
   FOOTER
============================================================ */
.footer,
footer {
  border-top: 1px solid rgba(255,62,62,0.3);
  background: var(--bg-primary);
  margin-top: auto;
  padding: 4rem 0 2rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-col { display: flex; flex-direction: column; gap: 0.8rem; }

.footer-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.95rem;
  width: fit-content;
}

.footer-link:hover { color: var(--accent-cyan); transform: translateX(3px); }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
  border-top: 1px solid rgba(255,255,255,0.03);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer:not(.footer) {
  padding: 2rem 1.8rem;
  text-align: center;
  font-size: 0.8rem;
  color: #475569;
}


/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 680px) {
  .post-item  { flex-direction: column; gap: 0.6rem; }
  .post-meta  { flex-direction: row; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
  .post-arrow { position: absolute; top: 1.2rem; right: 1.4rem; }
  .writeup-content { padding: 1.2rem; }
}

@media (max-width: 600px) {
  .project-row { flex-wrap: wrap; }
  .row-action  { margin-left: calc(2.4rem + 1.5rem); }
}