/* ─── Design Tokens ─── */
:root {
  --bg: #09090B;
  --surface: #18181B;
  --surface-el: #27272A;
  --accent: #DC2626;
  --accent-dark: #B91C1C;
  --accent-light: #FCA5A5;
  --accent-glow: rgba(220, 38, 38, 0.2);
  --text: #FAFAFA;
  --text-muted: #A1A1AA;
  --border: #3F3F46;
  --radius: 12px;
}

/* ─── Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─── Hero ─── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-bottom: 1px solid rgba(220, 38, 38, 0.25);
  overflow: visible;
}

/* Radial red glow behind the name */
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 45% at 50% 50%, rgba(220, 38, 38, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
  max-width: 700px;
  width: 100%;
}

/* ─── Floating rune parallax objects ─── */
.rune-floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.rune-float-wrap {
  position: absolute;
  width: 24px;
  height: 24px;
  color: rgba(200, 20, 20, 0.38);
}

.rune-float-inner {
  width: 100%;
  height: 100%;
  animation: rune-idle 4s ease-in-out infinite;
}

.rune-float-inner svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes rune-idle {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-9px); }
}

/* ─── Hero entrance animations ─── */
@keyframes hero-enter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-handle  { animation: hero-enter 0.6s ease 0.05s both; }
.hero-subtitle { animation: hero-enter 0.6s ease 0.7s  both; }
.hero-tagline  { animation: hero-enter 0.6s ease 0.9s  both; }
.hero-ctas     { animation: hero-enter 0.6s ease 1.1s  both; }

.hero-handle {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-name {
  font-size: clamp(5.5rem, 18vw, 11rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 1.5rem;
  text-shadow:
    0 0 40px rgba(220, 38, 38, 0.55),
    0 0 80px rgba(220, 38, 38, 0.28),
    0 0 130px rgba(220, 38, 38, 0.12);
  animation: hero-enter 0.8s ease 0.35s both, pulse-glow 3.5s ease-in-out 1.3s infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    text-shadow:
      0 0 40px rgba(220, 38, 38, 0.55),
      0 0 80px rgba(220, 38, 38, 0.28),
      0 0 130px rgba(220, 38, 38, 0.12);
  }
  50% {
    text-shadow:
      0 0 30px rgba(220, 38, 38, 0.38),
      0 0 60px rgba(220, 38, 38, 0.18),
      0 0 100px rgba(220, 38, 38, 0.08);
  }
}

.hero-subtitle {
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.hero-tagline {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ─── Anti-magic rune circle (background decoration) ─── */
.hero-rune-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.hero-rune {
  width: min(680px, 88vw);
  height: min(680px, 88vw);
  animation: rune-spin 50s linear infinite;
}

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

/* ─── Hero CTA buttons ─── */
.hero-ctas {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2.25rem;
  flex-wrap: wrap;
}

.btn-cta {
  display: inline-block;
  padding: 0.62rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  text-decoration: none;
}

.btn-cta:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--accent-glow);
  color: #fff;
}

.btn-cta.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-cta.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-muted);
  box-shadow: none;
  transform: translateY(-2px);
}

/* ─── Scroll-in animations ─── */
.animate-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.animate-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger each project card slightly */
.project-grid .animate-up:nth-child(1) { transition-delay: 0s; }
.project-grid .animate-up:nth-child(2) { transition-delay: 0.12s; }
.project-grid .animate-up:nth-child(3) { transition-delay: 0.24s; }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  animation: bounce 2.2s ease-in-out infinite;
  opacity: 0.5;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s;
}

.scroll-hint:hover {
  color: var(--accent-light);
  opacity: 0.9;
}

.scroll-hint svg {
  width: 100%;
  height: 100%;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50%       { transform: translateX(-50%) translateY(7px); opacity: 0.8; }
}

/* Anti-magic void boundary */
.hero-void {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 2;
  height: 80px;
}

.void-fracture {
  display: block;
  width: 100%;
  height: 80px;
}

/* Floating void particles — magic dissolving */
.void-particles {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  height: 60px;
}

.vp {
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 5px;
  background: rgba(200, 20, 20, 0.75);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
  animation: void-rise linear infinite;
}

@keyframes void-rise {
  0%   { transform: rotate(45deg) scale(1);   opacity: 0.8; bottom: 0; }
  60%  { opacity: 0.4; }
  100% { transform: rotate(45deg) scale(0.2); opacity: 0;   bottom: 55px; }
}

/* ─── Projects ─── */
.projects {
  padding: 80px 24px 120px;
  background: var(--bg);
}

.section-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  margin-top: 0.5rem;
  border-radius: 1px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Live project card */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: block;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.project-card:not(.placeholder):hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.project-card-top {
  margin-bottom: 1.25rem;
}

.project-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(220, 38, 38, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.project-icon {
  width: 36px;
  height: 36px;
  color: var(--accent);
  margin-bottom: 1rem;
}

.project-icon svg {
  width: 100%;
  height: 100%;
}

.project-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.project-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-light);
  transition: color 0.2s;
}

.project-card:hover .project-link {
  color: var(--accent);
}

/* Placeholder card */
.project-card.placeholder {
  border-style: dashed;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  cursor: default;
  opacity: 0.6;
}

.placeholder-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Social Dock ─── */
.social-dock {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
  padding: 0;
  font-family: inherit;
}

.social-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.social-btn:hover {
  color: var(--text);
  background: var(--surface-el);
  border-color: rgba(220, 38, 38, 0.5);
  transform: scale(1.1);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.social-btn.twitch:hover {
  border-color: rgba(145, 71, 255, 0.6);
  color: #9147FF;
  box-shadow: 0 4px 16px rgba(145, 71, 255, 0.2);
}

.social-btn.kofi:hover {
  border-color: rgba(255, 94, 91, 0.6);
  color: #FF5E5B;
  box-shadow: 0 4px 16px rgba(255, 94, 91, 0.2);
}

/* ─── Ko-fi Modal ─── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.25rem 2rem;
  text-align: center;
  max-width: 320px;
  width: 90%;
  transform: scale(0.94) translateY(8px);
  transition: transform 0.2s;
}

.modal-backdrop.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.modal-box h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.modal-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

.modal-close {
  background: var(--surface-el);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .hero-tagline {
    font-size: 0.875rem;
  }

  .projects {
    padding: 60px 16px 100px;
  }

  .social-dock {
    bottom: 1rem;
    right: 1rem;
  }
}
