/* ==========================================================================
   Portfolio stylesheet
   Everything is driven by the CSS variables in :root — change those first
   before touching anything below.
   ========================================================================== */

:root {
  /* --- Brand colours (edit these) --- */
  --accent: #22d3a5;          /* primary accent: links, buttons, highlights */
  --accent-soft: #22d3a51a;   /* same colour at ~10% alpha for backgrounds */
  --accent-alt: #60a5fa;      /* secondary accent for tags / gradients */
  --on-accent: #06120e;       /* text drawn ON the accent colour */
  --warn: #f0b429;            /* "in progress" badges */

  /* --- Dark theme (default) --- */
  --bg: #0b0f14;
  --bg-elev: #121820;
  --bg-elev-2: #18202b;
  --border: #223041;
  --text: #e6edf3;
  --text-muted: #93a4b8;
  --text-faint: #7b8ca3;      /* kept above 4.5:1 on --bg — don't darken further */

  /* --- Type ---
     Space Grotesk + JetBrains Mono are loaded from Google Fonts in each
     page <head>. Remove those two <link> tags and this falls back to system
     fonts cleanly — the site still looks fine. */
  --font-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, monospace;

  /* --- Layout --- */
  --maxw: 1080px;
  --radius: 12px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .22);
}

/* Light theme — applied when <html data-theme="light"> */
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f7f9fb;
  --bg-elev-2: #eef2f6;
  --border: #dfe6ee;
  --text: #101821;
  --text-muted: #4a5a6d;
  --text-faint: #5d6b7a;
  --accent: #077257;
  --accent-soft: #07725714;
  --accent-alt: #1d4ed8;
  --on-accent: #ffffff;
  --warn: #8a5a00;
  --shadow: 0 1px 2px rgba(16, 24, 33, .06), 0 8px 24px rgba(16, 24, 33, .07);
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-weight: 650;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

code, kbd, pre { font-family: var(--font-mono); font-size: .875em; }

code {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .12em .38em;
}

pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

::selection { background: var(--accent); color: var(--on-accent); }

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

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }

.section { padding-block: clamp(3rem, 8vw, 5rem); }
.section--tight { padding-block: clamp(2rem, 5vw, 3rem); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.section-head h2 { margin: 0; }
.section-head .eyebrow { margin-bottom: .35rem; }

/* Numbered section headings — <h2><span class="num">01</span>Projects</h2> */
h2 .num {
  font-family: var(--font-mono);
  font-size: .58em;
  font-weight: 500;
  color: var(--accent);
  margin-right: .6em;
  vertical-align: .12em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .6rem;
}

.lede { font-size: 1.08rem; color: var(--text-muted); max-width: 62ch; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: .6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 62px;
}

.nav__brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .98rem;
  color: var(--text);
  letter-spacing: -.02em;
  margin-right: auto;
}
.nav__brand:hover { text-decoration: none; }
.nav__brand .user { color: var(--accent); }
.nav__brand .path { color: var(--text-faint); }

.nav__links {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  display: block;
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .92rem;
  font-weight: 500;
}
.nav__links a:hover { color: var(--text); background: var(--bg-elev-2); text-decoration: none; }
.nav__links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.nav__actions { display: flex; align-items: center; gap: .4rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }

.nav__toggle { display: none; }

@media (max-width: 720px) {
  .nav__toggle { display: inline-grid; }
  .nav__links {
    position: absolute;
    inset: 62px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: .5rem 1.25rem 1rem;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .7rem .5rem; font-size: 1rem; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .62rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .16s ease, border-color .16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 16px; height: 16px; }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.08); }

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

.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding-block: clamp(3rem, 9vw, 6rem) clamp(2rem, 6vw, 4rem); position: relative; overflow: hidden; }

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 40% 40% -10%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  pointer-events: none;
}

.hero__inner { position: relative; display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 880px) {
  .hero__inner { grid-template-columns: 1.35fr .9fr; align-items: center; }
}

.hero h1 { margin-bottom: .6rem; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-alt));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__role { font-family: var(--font-mono); color: var(--text-muted); font-size: .95rem; margin-bottom: 1.1rem; }

.availability {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: .3rem .7rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.availability .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Terminal card in the hero */
.terminal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: .8rem;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}
.terminal__bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.terminal__bar .title { width: auto; height: auto; background: none; margin-left: .5rem; color: var(--text-faint); font-size: .74rem; }
.terminal__bar .r { background: #f87171; }
.terminal__bar .y { background: #fbbf24; }
.terminal__bar .g { background: #34d399; }
.terminal__body { padding: .9rem 1rem 1.1rem; line-height: 1.9; }
.terminal__body .p { color: var(--accent); }
.terminal__body .c { color: var(--text); }
.terminal__body .o { color: var(--text-muted); }
.terminal__body .k { color: var(--accent-alt); }

/* Blinking cursor */
.terminal__body .cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  margin-left: .35em;
  vertical-align: -.15em;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* --------------------------------------------------------------------------
   Cards & grids
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: border-color .16s ease, transform .16s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-2px); }

.card__top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }

.card__cat {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.card h3 { margin: 0; font-size: 1.05rem; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }

.card p { color: var(--text-muted); font-size: .92rem; margin: 0; flex: 1; }

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .35rem;
  padding-top: .8rem;
  border-top: 1px solid var(--border);
  font-size: .82rem;
}

.tags { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.tag {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .18rem .55rem;
}

.status {
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .16rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-faint);
  white-space: nowrap;
}
.status--live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.status--wip {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}

/* Dashed "starter — replace me" badge on placeholder projects.
   Set starter: true in projects.js to show it; delete the flag once the
   entry is really yours. */
.status--starter {
  color: var(--text-faint);
  border-style: dashed;
  border-color: var(--text-faint);
  background: none;
  text-transform: none;
  letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   Skills
   -------------------------------------------------------------------------- */
.skill-group { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.skill-group h3 { display: flex; align-items: center; gap: .55rem; font-size: .98rem; margin-bottom: .85rem; }
.skill-group h3 svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.skill-group ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; }
.skill-group li {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: .22rem .55rem;
}

/* Certification strip.
   .earned  = solid pill with a tick
   .pending = dashed pill, muted — for anything in progress */
.certs { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 0; padding: 0; }
.certs li {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: .45rem 1rem;
  color: var(--text-muted);
}
.certs li strong { color: var(--text); font-weight: 600; }
.certs .yr { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); }

.certs .earned {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.certs .earned::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
}
.certs .pending {
  border-style: dashed;
  background: none;
}

/* --------------------------------------------------------------------------
   Homelab section
   -------------------------------------------------------------------------- */
.homelab { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 820px) {
  .homelab { grid-template-columns: 1.25fr .75fr; align-items: stretch; }
}

/* Placeholder panel — swap the whole thing for <img src="assets/img/homelab.png" alt="..."> */
.homelab__diagram {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--text-faint);
  background: repeating-linear-gradient(
    45deg,
    var(--bg-elev),
    var(--bg-elev) 12px,
    var(--bg-elev-2) 12px,
    var(--bg-elev-2) 24px
  );
}
.homelab__diagram img { border-radius: var(--radius); }

.homelab__specs { display: flex; flex-direction: column; gap: .8rem; }
.homelab__spec {
  padding: .9rem 1.1rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.homelab__spec dt {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: .3rem;
}
.homelab__spec dd { margin: 0; font-size: .9rem; color: var(--text-muted); line-height: 1.55; }

/* --------------------------------------------------------------------------
   Filters (projects page)
   -------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.75rem; }
.filter {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .85rem;
  cursor: pointer;
}
.filter:hover { color: var(--text); border-color: var(--accent); }
.filter[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.empty-state { color: var(--text-muted); padding: 2rem 0; font-family: var(--font-mono); font-size: .9rem; }

/* --------------------------------------------------------------------------
   Writeup / article list
   -------------------------------------------------------------------------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--border); }
.post-list li:first-child { border-top: 1px solid var(--border); }

.post-link {
  display: grid;
  gap: .3rem 1.5rem;
  grid-template-columns: 1fr;
  padding: 1.15rem .35rem;
  color: inherit;
}
.post-link:hover { text-decoration: none; background: var(--bg-elev); }
@media (min-width: 700px) {
  .post-link { grid-template-columns: 116px 1fr; align-items: baseline; }
}
.post-link time { font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint); }
.post-link h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.post-link:hover h3 { color: var(--accent); }
.post-link p { margin: 0 0 .5rem; color: var(--text-muted); font-size: .92rem; }

/* Source badge: distinguishes posts hosted here from ones on Medium/dev.to */
.src {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .15rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-faint);
  white-space: nowrap;
  margin-left: .5rem;
}
.src--here {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.post-link .title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .2rem;
}

/* --------------------------------------------------------------------------
   Article body (writeup pages)
   -------------------------------------------------------------------------- */
.article { max-width: 74ch; margin-inline: auto; }
.article header { margin-bottom: 2.5rem; }
.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-faint);
  margin-bottom: 1rem;
}
.article h2 { margin-top: 2.5rem; }
.article h3 { margin-top: 1.75rem; }
.article ul, .article ol { padding-left: 1.25rem; color: var(--text-muted); }
.article li { margin-bottom: .4rem; }
.article blockquote {
  margin: 1.5rem 0;
  padding: .1rem 0 .1rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}
.article table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 1.5rem 0; }
.article th, .article td { border: 1px solid var(--border); padding: .55rem .7rem; text-align: left; }
.article th { background: var(--bg-elev-2); font-weight: 600; }
.article td { color: var(--text-muted); }

.callout {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-alt);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  margin: 1.5rem 0;
  font-size: .93rem;
  color: var(--text-muted);
}
.callout strong { color: var(--text); }

.toc {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 2rem;
  font-size: .9rem;
}
.toc p { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 .5rem; }
.toc ol { margin: 0; padding-left: 1.1rem; color: var(--text-muted); }
.toc li { margin-bottom: .25rem; }

.back-link { font-family: var(--font-mono); font-size: .82rem; display: inline-block; margin-bottom: 1.5rem; }

/* --------------------------------------------------------------------------
   Timeline (about page)
   -------------------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.35rem; border-left: 1px solid var(--border); }
.timeline li { position: relative; padding-bottom: 1.9rem; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -1.35rem;
  top: .5rem;
  transform: translateX(-50%);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline .when { font-family: var(--font-mono); font-size: .76rem; color: var(--text-faint); display: block; }
.timeline h3 { margin: .15rem 0 .1rem; font-size: 1rem; }
.timeline .where { color: var(--accent); font-size: .88rem; }
.timeline p { color: var(--text-muted); font-size: .92rem; margin: .45rem 0 0; }

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}
.cta h2 { margin-bottom: .5rem; }
.cta p { color: var(--text-muted); max-width: 52ch; margin-inline: auto; }
.cta .btn-row { justify-content: center; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-block: 2rem;
  font-size: .87rem;
  color: var(--text-faint);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* Utility */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mt-0 { margin-top: 0; }
.center { text-align: center; }
