:root {
  --bg:         #0d0d0d;
  --bg-card:    #161616;
  --bg-hover:   #1c1c1c;
  --border:     #2a2a2a;
  --accent:     #00d4ff;
  --purple:     #7c3aed;
  --text:       #e5e5e5;
  --muted:      #888;
  --dim:        #555;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  /* subtle glow */
  background-image:
    radial-gradient(60rem 40rem at 50% -10%, rgba(0, 212, 255, 0.06), transparent 70%),
    radial-gradient(50rem 35rem at 100% 110%, rgba(124, 58, 237, 0.06), transparent 70%);
}

/* Full-page particle background. The LAYER's opacity is a left-to-right gradient
   (opaque on the left, translucent through the middle, faded off on the right),
   done with a mask so it is the layer, not the particle density, that fades.
   position: fixed keeps it a full-viewport background behind everything. */
#particles-js {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;  /* links stay clickable; particles use window-level events */
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 80%);
          mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 80%);
}

/* ── Home: two full-height snap panels; scrolling swipes the current one up ── */
#home {
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}
.panel {
  position: relative;
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* content to the right; particles own the left */
}
.panel-inner {
  width: 100%;
  max-width: 760px;
  padding: 56px 24px;
  margin-right: clamp(24px, 12vw, 220px);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dim);
  margin-bottom: 16px;
}

/* ── Intro ── */
.intro h1 {
  font-size: clamp(34px, 7vw, 48px);
  font-weight: 700;
  letter-spacing: -1px;
}
.intro h1 span { color: var(--accent); }
.bio {
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  max-width: 620px;
}
.bio strong { color: var(--text); font-weight: 600; }

/* ── Projects ── */
.projects { margin-top: 48px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.card:hover { border-color: #3a3a3a; background: var(--bg-hover); transform: translateY(-2px); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-name { font-size: 17px; font-weight: 600; }
.card-tag {
  flex-shrink: 0; white-space: nowrap;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 3px 8px; border-radius: 20px;
}
.card-tag.fd { background: rgba(0, 212, 255, 0.14); color: var(--accent); }
.card-tag.cp { background: rgba(124, 58, 237, 0.16); color: #a87bff; }
.card p { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.card-link { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--accent); }

/* ── Links footer ── */
.links {
  margin-top: 48px;
  display: flex;
  gap: 22px;
  font-size: 14px;
}
.links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.links a:hover { color: var(--accent); }

/* ── Scroll cue ── */
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 44px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue span { font-size: 15px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* ── Writing list (Substack-style) ── */
/* The article surfaces (the writing index + the reader) use DM Sans; the rest
   of the site stays on Inter. */
.article-list, .reader { font-family: 'DM Sans', 'Inter', system-ui, sans-serif; }
.article-list { display: flex; flex-direction: column; }
.article-row {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 22px 0;
  border-top: 1px solid var(--border);
  transition: opacity 0.15s;
}
.article-row:first-child { border-top: none; padding-top: 4px; }
.article-row:hover { opacity: 0.85; }
.article-row:hover .article-title { color: var(--accent); }
.article-date { font-size: 12px; color: var(--dim); letter-spacing: 0.3px; }
.article-title { font-size: 19px; font-weight: 600; margin-top: 4px; transition: color 0.15s; }
.article-excerpt { margin-top: 8px; font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }

/* ── Article reader ── */
.reader {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 120px;
}
.reader .back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 28px;
}
.reader .back:hover { color: var(--accent); }
.reader .article-meta {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--accent);
  margin-bottom: 10px;
}

.article-body { color: #cfd6dd; font-size: 17px; line-height: 1.75; }
.article-body h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); margin: 8px 0 20px; }
.article-body h2 { font-size: 22px; font-weight: 600; color: var(--text); margin: 36px 0 12px; }
.article-body h3 { font-size: 18px; font-weight: 600; color: var(--text); margin: 28px 0 10px; }
.article-body p { margin: 16px 0; }
.article-body ul, .article-body ol { margin: 16px 0; padding-left: 24px; }
.article-body li { margin: 6px 0; }
.article-body blockquote {
  margin: 20px 0;
  padding: 6px 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.article-body a { color: var(--accent); }
.article-body code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.9em;
}
.article-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 20px 0;
}
.article-body pre code { background: none; border: none; padding: 0; }
