/* Cir0cuit personal site — dark cyber aesthetic */
:root {
  --bg-0: #000000;
  --bg-1: #000000;
  --bg-2: #000000;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --ink-0: #f5f7fb;
  --ink-1: #c8cfdc;
  --ink-2: #8590a6;
  --ink-3: #5a6478;
  --accent: #3B82F6;        /* logo blue */
  --accent-hot: #93c5fd;
  --accent-glow: rgba(59, 130, 246, 0.45);
  --magenta: #ff3d8a;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg-0); color: var(--ink-0); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent); color: #03060d; }

/* ─────────  Backdrop  ───────── */
.backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    #000000;
}
.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
}
.scanlines {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ─────────  Layout shell  ───────── */
main { position: relative; z-index: 2; }
.shell { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .shell { padding: 0 20px; } }

/* ─────────  Nav  ───────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav .logo {
  height: 28px; width: auto; display: block;
}
.nav-links {
  display: flex; gap: 32px; align-items: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2);
}
.nav-links a {
  position: relative; padding: 8px 0; transition: color 0.2s;
}
.nav-links a::before {
  content: "/"; color: var(--accent); margin-right: 6px; opacity: 0.6;
}
.nav-links a:hover { color: var(--ink-0); }
.nav-links a:hover::before { opacity: 1; }
.nav .gh-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--ink-0);
  transition: all 0.2s;
}
.nav .gh-btn:hover {
  border-color: var(--accent);
  background: rgba(59,130,246,0.1);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.08);
}
@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ─────────  Hero  ───────── */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 0 64px;
}
.hero-meta {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  color: var(--accent); text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.hero-meta .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.6); }
  50%      { box-shadow: 0 0 0 10px rgba(59,130,246,0); }
}
.hero-logo-wrap {
  position: relative;
  margin-bottom: 36px;
}
.hero-logo {
  width: min(720px, 90%); height: auto; display: block;
  filter: drop-shadow(0 0 40px rgba(59,130,246,0.25));
}
.hero-logo .glitch-clone {
  position: absolute; inset: 0;
  mix-blend-mode: screen;
}
.hero-tagline {
  font-size: clamp(22px, 3.2vw, 38px);
  font-weight: 500; line-height: 1.25;
  max-width: 820px;
  color: var(--ink-0);
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.hero-tagline .accent { color: var(--accent); }
.hero-tagline .magenta { color: var(--magenta); }
.hero-tagline .cursor {
  display: inline-block; width: 0.5ch; height: 1em; vertical-align: -2px;
  background: var(--accent); margin-left: 4px;
  animation: blink 1.05s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  color: var(--ink-2); font-size: 17px; line-height: 1.6;
  max-width: 580px;
  margin-bottom: 40px;
  font-family: var(--mono);
}
.hero-sub .prompt { color: var(--accent); margin-right: 8px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 10px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
}
.btn-primary {
  background: var(--accent); color: #03060d;
  box-shadow: 0 8px 30px -8px var(--accent-glow), 0 0 0 1px var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hot);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -8px var(--accent-glow), 0 0 0 1px var(--accent-hot);
}
.btn-ghost {
  border: 1px solid var(--line-strong); color: var(--ink-0);
  background: rgba(255,255,255,0.02);
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(59,130,246,0.08); }

/* hero badges - decorative corner stats */
.hero-stats {
  position: absolute; bottom: 60px; right: 0;
  display: flex; gap: 28px;
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.hero-stats .stat-num {
  display: block; color: var(--ink-0); font-size: 20px; font-weight: 500;
  letter-spacing: 0; text-transform: none; margin-bottom: 2px;
}
@media (max-width: 720px) {
  .hero-stats { position: static; margin-top: 60px; flex-wrap: wrap; }
}

/* ─────────  Section primitives  ───────── */
.section {
  padding: 56px 0;
  position: relative;
}
.section-eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em;
  color: var(--accent); text-transform: uppercase;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px;
}
.section-eyebrow::before {
  content: ""; display: block; width: 32px; height: 1px;
  background: var(--accent);
}
.section-title {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 600; line-height: 1.1; letter-spacing: -0.02em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.section-title .accent { color: var(--accent); }
.section-lede {
  color: var(--ink-1); font-size: 18px; line-height: 1.6;
  max-width: 680px;
  margin-bottom: 32px;
  text-wrap: pretty;
}

/* ─────────  DevToys teaser  ───────── */
.devtoys {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    #000000;
  padding: 72px 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.devtoys::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(59,130,246,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59,130,246,0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 70% 100% at 80% 50%, #000, transparent);
}
.devtoys-tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  border: 1px solid rgba(59,130,246,0.4);
  background: rgba(59,130,246,0.08);
  border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--accent-hot);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.devtoys-tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-hot); animation: pulse 2.4s infinite; }
.devtoys h3 {
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 600; line-height: 1.1; letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.devtoys h3 .accent { color: var(--accent); }
.devtoys p {
  color: var(--ink-1); font-size: 17px; line-height: 1.6; max-width: 480px;
  margin-bottom: 28px;
}
.devtoys-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 32px;
}
.chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
  background: rgba(255,255,255,0.02);
}

.devtoys-visual {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 360px;
}
.devtoys-icon-frame {
  position: relative;
  width: 320px; height: 320px;
  display: flex; align-items: center; justify-content: center;
}
.devtoys-icon-frame::before {
  content: ""; position: absolute; inset: -40px;
  background: radial-gradient(circle, rgba(59,130,246,0.35), transparent 60%);
  filter: blur(20px);
}
.devtoys-icon-frame img {
  position: relative;
  width: 280px; height: 280px;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
}

.devtoys-orbit {
  position: absolute; inset: 0;
  border: 1px dashed rgba(59,130,246,0.2);
  border-radius: 50%;
  animation: spin 30s linear infinite;
}
.devtoys-orbit-2 {
  position: absolute; inset: 30px;
  border: 1px dashed rgba(255,61,138,0.15);
  border-radius: 50%;
  animation: spin 22s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gp-badge {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 22px 14px 18px;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  transition: all 0.2s;
  cursor: not-allowed;
  opacity: 0.85;
}
.gp-badge:hover { opacity: 1; border-color: var(--accent); }
.gp-badge svg { width: 28px; height: 28px; flex-shrink: 0; }
.gp-badge .gp-text { display: flex; flex-direction: column; align-items: flex-start; }
.gp-badge .gp-small { font-family: var(--mono); font-size: 10px; color: var(--ink-2); letter-spacing: 0.1em; text-transform: uppercase; }
.gp-badge .gp-big { font-size: 17px; font-weight: 500; color: var(--ink-0); letter-spacing: -0.01em; }

@media (max-width: 880px) {
  .devtoys { grid-template-columns: 1fr; padding: 48px 28px; }
  .devtoys-icon-frame { width: 260px; height: 260px; }
  .devtoys-icon-frame img { width: 220px; height: 220px; }
}

/* ─────────  Projects  ───────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 880px) { .projects-grid { grid-template-columns: 1fr; } }

.proj-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005));
  padding: 32px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 340px;
}
.proj-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(circle 400px at var(--mx, 50%) var(--my, 50%), rgba(59,130,246,0.12), transparent 60%);
  transition: opacity 0.3s;
  pointer-events: none;
}
.proj-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.proj-card:hover::before { opacity: 1; }
.proj-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px;
}
.proj-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  color: var(--accent);
  flex-shrink: 0;
}
.proj-icon img { width: 100%; height: 100%; border-radius: 10px; }
.proj-status {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 6px;
}
.status-live { color: #6ee7a4; background: rgba(110,231,164,0.08); border: 1px solid rgba(110,231,164,0.2); }
.status-soon { color: var(--accent-hot); background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); }
.proj-title {
  font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.proj-sub {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  letter-spacing: 0.04em; margin-bottom: 14px;
}
.proj-desc {
  color: var(--ink-1); font-size: 15px; line-height: 1.6;
  margin-bottom: 22px;
  flex-grow: 1;
}
.proj-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
}
.proj-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.proj-link {
  color: var(--ink-0); display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.2s;
}
.proj-link:hover { color: var(--accent); }

/* ─────────  Research / writing  ───────── */
.research-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
}
.research-row {
  display: grid;
  grid-template-columns: 100px 1fr 140px 24px;
  align-items: center;
  gap: 24px;
  padding: 24px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.research-row:hover { background: rgba(59,130,246,0.04); padding-left: 20px; }
.research-row .r-date { font-family: var(--mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.06em; }
.research-row .r-title { font-size: 17px; font-weight: 500; color: var(--ink-0); }
.research-row .r-tag {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  letter-spacing: 0.08em; text-transform: uppercase;
  text-align: right;
}
.research-row .r-arrow { color: var(--ink-3); transition: all 0.2s; }
.research-row:hover .r-arrow { color: var(--accent); transform: translateX(4px); }
.research-row .r-status-soon {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--ink-3); text-transform: uppercase;
  margin-left: 10px;
  padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px;
}
@media (max-width: 720px) {
  .research-row { grid-template-columns: 1fr 24px; gap: 4px; }
  .research-row .r-date, .research-row .r-tag { font-size: 11px; text-align: left; }
  .research-row .r-tag { grid-column: 1 / 2; }
}

.research-note {
  margin-top: 36px;
  padding: 20px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-family: var(--mono); font-size: 13px;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 14px;
}
.research-note::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

/* ─────────  Footer  ───────── */
footer {
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding: 60px 0 48px;
  position: relative;
  z-index: 2;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 48px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }
.footer-logo { height: 22px; opacity: 0.9; margin-bottom: 14px; }
.footer-text { color: var(--ink-2); font-size: 14px; line-height: 1.6; max-width: 320px; }
.footer-col h5 {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col a {
  display: block; padding: 6px 0; color: var(--ink-1); font-size: 14px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); padding-top: 24px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.06em;
}
.footer-bottom .right { display: flex; gap: 18px; align-items: center; }

/* ─────────  Reveal animation  ───────── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-1 { transition-delay: 0.05s; }
.reveal-2 { transition-delay: 0.15s; }
.reveal-3 { transition-delay: 0.25s; }
.reveal-4 { transition-delay: 0.35s; }
