@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap');

body {
  background: #0a0f1c;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  margin: 0;
  padding: 0;
}

:root {
  --brand-dark: #2563eb; /* primary blue */
  --brand-light: #60a5fa; /* light blue */
  --accent-shadow: rgba(37,99,235,0.7);
  --accent-glow: rgba(96,165,250,0.15);
  --accent-1: #3b82f6; /* bright blue */
  --accent-2: #3b82f6; /* emerald */
  --accent-3: #3b82f6; /* purple */
  --bg-gradient: rgba(37,99,235,0.15);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
}
/* Full-page canvas for particles */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}


#intro-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms ease-out;
  z-index: 3;
}

/* Only show overlay on index page when intro is active */
body.index.intro #intro-overlay {
  opacity: 1;
}

/* When intro is active on index, place canvas & overlay above content */
body.index.intro #bg-canvas { z-index: 4; }
body.index.intro #intro-overlay { z-index: 3; }


/* ensure content sits above the canvas */
header, #posts, #viewer, footer {
  position: relative;
  z-index: 2;
}

header {
  text-align: center;
  padding: 2rem;
  /* darker, more neutral backdrop so particles and ASCII effects pop */
  background: rgba(4,6,12,0.78);
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  position: relative; /* allow pseudo-elements */
  overflow: hidden;   /* contain animated blobs */
}

/* Animated decorative layers for header (subtle, performant) */
header::before {
  content: "";
  position: absolute;
  left: -20%;
  top: -30%;
  width: 140%;
  height: 180%;
  background: radial-gradient(circle at 25% 30%, rgba(59,130,246,0.12), transparent 14%),
              radial-gradient(circle at 75% 70%, rgba(139,92,246,0.10), transparent 18%);
  filter: blur(28px);
  transform-origin: center;
  animation: subtleFloat 20s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Slight shifting gradient over the hero to add depth */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(59,130,246,0.06), rgba(139,92,246,0.04) 35%, rgba(16,185,129,0.03) 70%);
  background-size: 200% 200%;
  /* lower opacity so it doesn't compete with the particle/mouseover visuals */
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
  animation: gradientShift 14s ease-in-out infinite;
}

/* Ensure content sits above the decorative layers */
header > .header-top {
  position: relative;
  z-index: 3; /* keep header controls above hero visuals */
}
.hero > .hero-inner {
  position: relative;
  z-index: 2;
}

@keyframes subtleFloat {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-6%) rotate(8deg) scale(1.03); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

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

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  header::before, .hero::before { animation: none; filter: none; }
}

/* Header layout */
.header-top {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand h1 { margin: 0; font-size: 1.4rem; }
.brand .tag { margin: 0; font-size: 0.85rem; opacity: 0.9; }
.nav a { color: rgba(255,255,255,0.95); text-decoration: none; margin-left: 1rem; font-weight: 600; }
.nav a:hover { color: var(--brand-light); transform: translateY(-2px); }


/* Hero + blob */
.hero {
  /* slightly larger gap to ensure header controls don't get visually overlapped */
  margin-top: 1.2rem;
  padding: 2rem 1rem;
  position: relative;
  z-index: 2;
  /* darken the hero area so the moving characters and particles are easier to see */
  background: rgba(4,6,12,0.82);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.hero-inner { 
  max-width: 900px; 
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}

.hero-profile {
  position: relative;
}

.hero-image {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(30,111,255,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 48px rgba(30,111,255,0.25);
}

.hero-content {
  position: relative;
}

.hero-title { 
  margin: 0 0 1rem 0; 
  font-size: 2.5rem; 
  color: rgba(255,255,255,0.98);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* Typewriter cursor for hero name */
#hero-name { display: inline-block; }
#hero-name::after {
  content: " ";
  display: inline-block;
  width: 10px;
  height: 1.2em;
  background: var(--text-primary);
  margin-left: 6px;
  vertical-align: middle;
  opacity: 1;
  transition: opacity 0.12s linear;
}

/* When done typing we switch to a blink animation */
.hero-cursor-blink::after {
  animation: blink 0.8s steps(1,start) infinite;
}

@keyframes blink {
  0% { opacity: 1 }
  50% { opacity: 0 }
  100% { opacity: 1 }
}


.title-sub {
  display: block;
  font-size: 1.4rem;
  color: var(--brand-light);
  margin-top: 0.5rem;
  letter-spacing: normal;
}

.hero-sub { 
  margin: 0 0 2rem 0; 
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 600px;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 600;
  color: white;
}

.hero-cta.primary {
  background: var(--brand-dark);
  box-shadow: 0 4px 6px -1px rgba(37,99,235,0.1), 0 2px 4px -1px rgba(37,99,235,0.06);
}

.hero-cta.primary:hover {
  background: var(--accent-1);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(37,99,235,0.25);
}

.hero-cta.secondary {
  background: var(--brand-dark);
  box-shadow: 0 4px 6px -1px rgba(16,185,129,0.1), 0 2px 4px -1px rgba(16,185,129,0.06);
}

.hero-cta.secondary:hover {
  background: var(--accent-1);
    transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(16,185,129,0.25);
}

.hero-cta.tertiary {
  background: var(--brand-dark);
  box-shadow: 0 4px 6px -1px rgba(139,92,246,0.1), 0 2px 4px -1px rgba(139,92,246,0.06);
}

.hero-cta.tertiary:hover {
  background: var(--accent-1);
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(139,92,246,0.25);
}

#blob {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(30,111,255,0.28), transparent 20%),
              radial-gradient(circle at 70% 70%, rgba(95,182,255,0.22), transparent 25%);
  filter: blur(36px);
  mix-blend-mode: screen;
  transition: opacity .25s linear;
  opacity: 0.9;
  z-index: 1;
}


#posts {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  gap: 1.5rem;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding: 2rem 1rem;
  background: linear-gradient(180deg, rgba(10,20,30,0.9), rgba(5,10,18,0.95));
  color: #dfefff;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-left strong { display:block; font-size:1.05rem; }
.footer-left .muted { margin:0; opacity:0.8; font-size:0.9rem; }
.footer-right { text-align:right; }
.footer-nav a { color: var(--brand-light); text-decoration: none; margin-left: .8rem; }
.footer-nav a:hover { text-decoration: underline; }
.copyright { margin: .5rem 0 0 0; opacity:0.8; font-size:0.9rem; }

.post {
  border: 1px solid #222;
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #0f0f12, #0b0b0b);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.18s ease;
  will-change: transform;
}

.post:hover {
  border-color: rgba(30,111,255,0.9);
  cursor: pointer;
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 10px 30px var(--accent-glow), 0 4px 10px rgba(95,182,255,0.04) inset;
}

.post:active { transform: translateY(-2px) scale(.998); }

/* subtle focus for keyboard users */
.post:focus { outline: 3px solid rgba(124,58,237,0.12); }

#viewer {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
}

#viewer.hidden { display: none; }

#content {
  background: #111;
  padding: 2rem;
  border-radius: 8px;
  line-height: 1.6;
}

#content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

#content h1 {
  font-size: 2rem;
  margin: 0 0 2rem 0;
  color: rgba(255,255,255,0.95);
}

#content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem 0;
  color: rgba(255,255,255,0.9);
}

#content p {
  margin: 1rem 0;
  color: rgba(255,255,255,0.85);
}

#content code {
  background: rgba(255,255,255,0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

#content pre {
  background: rgba(0,0,0,0.3);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

#content pre code {
  background: none;
  padding: 0;
}

#content em {
  color: rgba(255,255,255,0.7);
  font-style: italic;
}

/* Page Content Styles */
.page-content {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.content-wrapper {
  background: rgba(17,17,17,0.7);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.page-content h1 {
  font-size: 2rem;
  margin: 0 0 1.5rem 0;
  color: rgba(255,255,255,0.95);
}

.page-content p {
  line-height: 1.7;
  color: rgba(255,255,255,0.85);
  margin: 1rem 0;
}

.action-buttons {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

.page-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-dark);
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 600;
}

.page-cta:hover {
  transform: translateY(-3px);
  background: var(--brand-light);
  box-shadow: 0 4px 12px rgba(30,111,255,0.3);
}

.page-cta.secondary {
  background: rgba(255,255,255,0.1);
}

.page-cta.secondary:hover {
  background: rgba(255,255,255,0.15);
  box-shadow: 0 4px 12px rgba(255,255,255,0.1);
}

/* Contact Links */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.contact-link:hover {
  background: rgba(30,111,255,0.15);
  transform: translateX(5px);
}

.contact-link svg {
  flex-shrink: 0;
}

.link-text {
  font-size: 1.1rem;
}

a { color: var(--brand-light); }
button {
  background: var(--brand-dark);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}
button:hover { background: #155ed6; }

/* Themed back button shown in the post viewer */
#back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(90deg, var(--brand-dark), var(--accent-1));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(37,99,235,0.09);
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
  cursor: pointer;
}
#back:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 46px rgba(37,99,235,0.14);
}
#back:active { transform: translateY(-1px); }
#back:focus {
  outline: 3px solid rgba(59,130,246,0.14);
  outline-offset: 2px;
}
#viewer #back { margin-bottom: 1rem; }
