/* ==========================================================================
   Full-Stack-Spectrum — site styles
   Palette pulled from the LinkedIn banner.
   ========================================================================== */

:root {
  --bg: #0a0d12;
  --bg-elev: #10151d;
  --bg-card: #121821;
  --line: #222b38;
  --line-strong: #2f3a4b;
  --text: #eef1f6;
  --text-dim: #9aa4b2;
  --text-faint: #646f7f;

  --blue: #4f8cff;
  --blue-soft: #8fb4ff;
  --yellow: #f5c84c;
  --orange: #ff8a3d;
  --red: #ff4d5e;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 10px;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.07) 1px, transparent 0);
  background-size: 28px 28px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--blue-soft); text-decoration: none; }
a:hover { color: var(--text); }
img, svg { display: block; max-width: 100%; }
code, pre, kbd { font-family: var(--font-mono); }

::selection { background: var(--red); color: #fff; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.mono { font-family: var(--font-mono); }

/* Spectrum bar ---------------------------------------------------------- */
.spectrum { display: flex; gap: 6px; }
.spectrum span { width: 28px; height: 8px; border-radius: 1px; }
.spectrum span:nth-child(1) { background: var(--blue); }
.spectrum span:nth-child(2) { background: var(--blue-soft); }
.spectrum span:nth-child(3) { background: var(--yellow); }
.spectrum span:nth-child(4) { background: var(--orange); }
.spectrum span:nth-child(5) { background: var(--red); }
.spectrum--sm span { width: 12px; height: 4px; }

/* Header ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 13, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px; height: 28px; border: 2px solid var(--text); border-radius: 6px;
  display: grid; place-items: center;
}
.brand-mark::after { content: ""; width: 10px; height: 10px; background: var(--text); border-radius: 2px; transition: background .2s; }
.brand:hover .brand-mark::after { background: var(--red); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  font-family: var(--font-mono); font-size: 14px; color: var(--text-dim);
  padding: 8px 12px; border-radius: 6px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--bg-card); }
.nav .nav-gh {
  margin-left: 8px; border: 1px solid var(--line-strong); color: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
}
.nav .nav-gh:hover { border-color: var(--text-dim); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-toggle {
    display: grid; place-items: center; width: 40px; height: 40px;
    background: none; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); cursor: pointer;
  }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .nav .nav-gh { margin: 8px 0 0; justify-content: center; }
}

/* Hero ------------------------------------------------------------------ */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(48px, 8vw, 96px); position: relative; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }

.hero h1 {
  font-size: clamp(48px, 9vw, 112px);
  line-height: 0.95; letter-spacing: -0.04em; font-weight: 700;
  margin: 28px 0 24px;
}
.hero h1 .glitch { position: relative; display: inline-block; }

.hero-lede {
  font-family: var(--font-mono); font-size: clamp(14px, 1.6vw, 16px);
  color: var(--text-dim); max-width: 52ch; margin: 0 0 32px;
}
.hero-lede .cursor {
  display: inline-block; width: 9px; height: 1.1em; background: var(--red);
  vertical-align: text-bottom; margin-left: 2px; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
  padding: 12px 18px; border-radius: 8px; border: 1px solid var(--line-strong);
  color: var(--text); background: var(--bg-card);
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { color: var(--text); border-color: var(--text-dim); transform: translateY(-1px); }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: #ff6371; border-color: #ff6371; color: #fff; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

.hero-graph { width: 100%; max-width: 480px; justify-self: end; }
.hero-graph .edge { stroke: #2c3646; stroke-width: 2; }
.hero-graph .edge--hot { stroke: var(--red); stroke-width: 2.5; }
.hero-graph .pulse {
  stroke-dasharray: 6 200; stroke-dashoffset: 0; stroke-width: 3; stroke-linecap: round;
  animation: travel 3.2s linear infinite;
}
@keyframes travel { to { stroke-dashoffset: -206; } }
.hero-graph .ring { fill: none; stroke: var(--red); opacity: .55; }
.hero-graph .ring--dash { stroke-dasharray: 4 6; opacity: .3; animation: spin 40s linear infinite; transform-origin: 380px 200px; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-graph .node { transition: transform .3s; transform-box: fill-box; transform-origin: center; }
.hero-graph .node:hover { transform: scale(1.3); }
.hero-graph .core { animation: corePulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes corePulse { 50% { transform: scale(1.08); } }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-graph { justify-self: start; max-width: 420px; order: -1; margin-bottom: -8px; }
}

/* Ticker ---------------------------------------------------------------- */
.ticker {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-elev); overflow: hidden; white-space: nowrap;
  font-family: var(--font-mono); font-size: 13px; color: var(--text-faint);
}
.ticker-track { display: inline-flex; gap: 48px; padding: 14px 0; animation: marquee 40s linear infinite; }
.ticker-track span::before { content: "▪"; color: var(--red); margin-right: 12px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections -------------------------------------------------------------- */
.section { padding: clamp(64px, 10vw, 112px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--red); letter-spacing: .04em; margin: 0 0 12px; }
.eyebrow::before { content: "// "; color: var(--text-faint); }
.section h2 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.03em; margin: 0; }
.section-sub { color: var(--text-dim); max-width: 48ch; margin: 12px 0 0; }

/* Project filter -------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  font-family: var(--font-mono); font-size: 13px; cursor: pointer;
  padding: 7px 12px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line-strong); color: var(--text-dim);
}
.filter:hover { color: var(--text); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

/* Project cards --------------------------------------------------------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }

.card {
  --accent: var(--blue);
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card:hover::before { transform: scaleX(1); }
.card:hover::after { opacity: 1; }
.card[hidden] { display: none; }

.card--featured { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.card--featured::before { transform: scaleX(1); }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 4px; background: var(--bg-elev); color: var(--text-dim); border: 1px solid var(--line);
}
.tag--new { background: var(--red); color: #fff; border-color: var(--red); }
.stars { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); display: inline-flex; align-items: center; gap: 5px; }

.card h3 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 4px; line-height: 1.1; }
.card h3 a { color: var(--text); }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-kicker { font-family: var(--font-mono); font-size: 13px; color: var(--accent); margin: 0 0 12px; }
.card-desc { color: var(--text-dim); font-size: 15px; margin: 0 0 20px; flex: 1; }

.install {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 10px 10px 12px; font-family: var(--font-mono); font-size: 13px;
}
.install code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; color: var(--text); scrollbar-width: none; }
.install code::-webkit-scrollbar { display: none; }
.install .prompt { color: var(--accent); user-select: none; }
.copy {
  flex: none; cursor: pointer; font-family: var(--font-mono); font-size: 11px;
  background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--line-strong);
  border-radius: 4px; padding: 4px 8px;
}
.copy:hover { color: var(--text); }
.copy.done { color: var(--bg); background: var(--yellow); border-color: var(--yellow); }

.card-links { position: relative; z-index: 2; display: flex; gap: 16px; margin-top: 16px; font-family: var(--font-mono); font-size: 13px; }
.card-links a { color: var(--text-dim); }
.card-links a:hover { color: var(--text); }

/* About / stack --------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.about-copy p { color: var(--text-dim); margin: 0 0 16px; }
.about-copy strong { color: var(--text); font-weight: 600; }

.terminal {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font-family: var(--font-mono); font-size: 13.5px;
}
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.terminal-bar i:nth-child(1) { background: var(--red); }
.terminal-bar i:nth-child(2) { background: var(--yellow); }
.terminal-bar i:nth-child(3) { background: var(--blue); }
.terminal-bar span { margin-left: auto; color: var(--text-faint); font-size: 12px; }
.terminal pre { margin: 0; padding: 18px; white-space: pre-wrap; color: var(--text-dim); line-height: 1.75; }
.terminal .c-p { color: var(--red); }
.terminal .c-k { color: var(--blue-soft); }
.terminal .c-v { color: var(--text); }
.terminal .c-y { color: var(--yellow); }
.terminal .c-o { color: var(--orange); }

@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }

/* Blog list ------------------------------------------------------------- */
.posts { display: grid; border-top: 1px solid var(--line); }
.post-row {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 24px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--line); color: var(--text);
  transition: padding .2s, background .2s;
}
.post-row:hover { color: var(--text); padding-left: 12px; padding-right: 12px; background: var(--bg-card); }
.post-date { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); }
.post-title { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.post-excerpt { display: block; font-size: 15px; color: var(--text-dim); font-weight: 400; margin-top: 4px; }
.post-arrow { font-family: var(--font-mono); color: var(--text-faint); transition: color .2s, transform .2s; }
.post-row:hover .post-arrow { color: var(--red); transform: translateX(4px); }

@media (max-width: 640px) {
  .post-row { grid-template-columns: 1fr; gap: 4px; }
  .post-arrow { display: none; }
}

/* CTA / contact --------------------------------------------------------- */
.cta {
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elev);
  padding: clamp(32px, 6vw, 64px); position: relative; overflow: hidden;
}
.cta::before {
  content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--red) 40%, transparent);
}
.cta h2 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 16px; max-width: 18ch; }
.cta p { color: var(--text-dim); margin: 0 0 28px; max-width: 50ch; }

/* Footer ---------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); }
.footer-links { display: flex; gap: 20px; font-family: var(--font-mono); font-size: 13px; }
.footer-links a { color: var(--text-dim); }

/* Article (blog post) --------------------------------------------------- */
.article { padding: clamp(48px, 8vw, 96px) 0; }
.article .wrap { max-width: 760px; }
.article-back { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); display: inline-block; margin-bottom: 32px; }
.article-meta { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); margin: 20px 0 12px; display: flex; gap: 16px; flex-wrap: wrap; }
.article h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 24px; }
.article-body { font-size: 18px; line-height: 1.75; color: #c9d0db; }
.article-body h2 { color: var(--text); font-size: 28px; letter-spacing: -0.02em; margin: 48px 0 12px; }
.article-body h3 { color: var(--text); font-size: 21px; margin: 36px 0 8px; }
.article-body a { color: var(--blue-soft); border-bottom: 1px solid color-mix(in srgb, var(--blue-soft) 40%, transparent); }
.article-body a:hover { border-bottom-color: var(--blue-soft); }
.article-body :not(pre) > code { font-size: .88em; background: var(--bg-card); border: 1px solid var(--line); padding: 2px 6px; border-radius: 4px; color: var(--text); }
.article-body pre {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px; overflow-x: auto; font-size: 14px; line-height: 1.6; color: var(--text);
}
.article-body blockquote { margin: 24px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--red); color: var(--text-dim); }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin: 6px 0; }
.article-body hr { border: 0; height: 1px; background: var(--line); margin: 48px 0; }

/* Reveal on scroll ------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
