:root {
  --bg:      #080810;
  --surface: #0d0d1a;
  --card:    #0f0f1e;
  --border:  #1a1a2e;
  --border2: #252540;
  --orange:  #f97316;
  --purple:  #818cf8;
  --cyan:    #22d3ee;
  --green:   #4ade80;
  --text:    #e2e8f0;
  --muted:   #4a5568;
  --muted2:  #718096;
}

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

html { scroll-behavior: smooth; }

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

/* ── Dot grid background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #1e1e38 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* ── Ambient glow blobs ── */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}
.glow-1 {
  width: 600px; height: 600px;
  background: var(--orange);
  top: -200px; left: -100px;
  animation: driftA 20s ease-in-out infinite alternate;
}
.glow-2 {
  width: 500px; height: 500px;
  background: var(--purple);
  bottom: 10%; right: -150px;
  animation: driftB 18s ease-in-out infinite alternate;
}
@keyframes driftA { to { transform: translate(60px, 80px); } }
@keyframes driftB { to { transform: translate(-40px, -60px); } }

/* ── Hero ── */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero-title {
  font-size: clamp(3.5rem, 11vw, 9rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.5s forwards;
}

.hero-title em { font-style: italic; }

.plural-s {
  display: inline-block;
  opacity: 0;
  transform: translateX(-0.15em);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.plural-s.visible {
  opacity: 1;
  transform: none;
}

.counter-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--orange);
  min-width: 1.6ch;
  display: inline-block;
  transition: color 0.2s;
}

.counter-num.glitching {
  animation: glitch 0.3s ease-out forwards;
  will-change: transform, opacity;
}

@keyframes glitch {
  0%   { transform: translate(-3px, 0) skewX(-5deg); opacity: 0.7; color: var(--purple); }
  25%  { transform: translate(3px, 0)  skewX(3deg);  opacity: 1; }
  50%  { transform: translate(-1px, 0) skewX(-2deg); color: var(--orange); }
  75%  { transform: translate(1px, 0)  skewX(1deg); }
  100% { transform: none; opacity: 1; color: var(--orange); }
}

.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--muted2);
  max-width: 500px;
  line-height: 1.75;
  margin-bottom: 3.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.9s forwards;
}

/* ── Overall progress bar ── */
.overall-progress {
  width: min(440px, 90vw);
  opacity: 0;
  animation: fadeUp 0.8s ease 1.3s forwards;
}

.prog-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.prog-track {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--orange));
  border-radius: 99px;
  width: 0;
  transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Scroll hint ── */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 1s ease 2.5s both;
}

.scroll-arrow {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.2); }
}

/* ── Section layout ── */
.section {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
}

/* ── Project cards ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.25s;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%),
    rgba(129, 140, 248, 0.04), transparent 60%);
}

.card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(129,140,248,0.1);
}

.card:hover::after { opacity: 1; }

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.card:hover::before { opacity: 1; }

.card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}

.badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
}

.badge-live    { background: rgba(34,211,238,0.08); color: var(--cyan);   border: 1px solid rgba(34,211,238,0.2); }
.badge-wip     { background: rgba(249,115,22,0.08); color: var(--orange); border: 1px solid rgba(249,115,22,0.2); }
.badge-paused  { background: rgba(74,85,104,0.2);   color: var(--muted2); border: 1px solid var(--border); }

.card-since {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
}

.card-name {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--muted2);
  line-height: 1.65;
  margin-bottom: 1.5rem;
  flex: 1;
}

.card-progress { margin-top: auto; }

.card-prog-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.card-prog-track {
  height: 2px;
  background: var(--border);
  border-radius: 99px;
}

.card-prog-fill {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-cyan   { background: linear-gradient(90deg, var(--purple), var(--cyan)); }
.fill-orange { background: linear-gradient(90deg, var(--purple), var(--orange)); }

/* ── Backlog list ── */
.backlog-list { display: flex; flex-direction: column; }

.backlog-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted2);
  transition: color 0.2s;
}

.backlog-item:hover { color: var(--text); }
.backlog-item:last-child { border-bottom: none; }

.backlog-cb {
  width: 13px; height: 13px;
  border: 1px solid var(--border2);
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
}

.backlog-item.done .backlog-cb {
  background: var(--muted);
  border-color: var(--muted);
}

.backlog-item.done .backlog-cb::after {
  content: '';
  position: absolute;
  left: 2px; top: 1px;
  width: 7px; height: 4px;
  border-left: 1.5px solid var(--bg);
  border-bottom: 1.5px solid var(--bg);
  transform: rotate(-45deg);
}

.backlog-item.done > span { text-decoration: line-through; opacity: 0.4; }

.backlog-text { flex: 1; }

.backlog-tag {
  font-size: 0.6rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: auto;
}

.tag-hot    { background: rgba(249,115,22,0.1); color: var(--orange); }
.tag-soon   { background: rgba(129,140,248,0.1); color: var(--purple); }
.tag-someday { background: var(--border); color: var(--muted); }

/* ── Idea injector ── */
.idea-inject {
  background: rgba(249,115,22,0.04);
  border: 1px dashed rgba(249,115,22,0.2);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-top: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--orange);
  opacity: 0;
  transition: opacity 0.5s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.idea-inject.visible { opacity: 1; }

.idea-dot {
  width: 6px; height: 6px;
  background: var(--orange);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* ── Quote ── */
.quote-section {
  position: relative;
  z-index: 1;
  padding: 5rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, transparent, rgba(129,140,248,0.03), transparent);
}

.quote-text {
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  font-weight: 300;
  font-style: italic;
  color: var(--muted2);
  max-width: 680px;
  margin: 0 auto 1.25rem;
  line-height: 1.65;
}

.quote-text strong {
  color: var(--text);
  font-style: normal;
  font-weight: 500;
}

.quote-attr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ── Status ticker ── */
.status-bar {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.ticker {
  display: flex;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
}

.ticker-inner {
  display: flex;
  flex-shrink: 0;
}

.ticker-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding: 0.6rem 2rem;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ticker-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

footer a { color: var(--muted2); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: var(--text); }
.footer-completion { opacity: 0.45; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  max-width: 260px;
  z-index: 50;
  transform: translateY(calc(100% + 2rem));
  transition: transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.toast.up { transform: translateY(0); }

.toast-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--orange);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toast-head::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 1.5s ease-in-out infinite;
}

.toast-body {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
}

/* ── Utilities ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn { to { opacity: 1; } }

/* ── Responsive ── */
@media (max-width: 640px) {
  .projects-grid { grid-template-columns: 1fr; }
  .hero-title { letter-spacing: -0.02em; }
}
