/* ============================================================
   stefanyasin.github.io - shared stylesheet
   Static site. No frameworks, no trackers, no cookies.
   ============================================================ */

/* ---------- fonts (self-hosted, Geist) ---------- */
@font-face { font-family: "Geist"; src: url("../fonts/Geist-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/Geist-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --bg: #0b0f14;
  --surface: #11161d;
  --surface-2: #151b23;
  --border: #1e2630;
  --border-strong: #2d3743;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3fb950;
  --accent-dim: #2ea043;
  --on-accent: #0b0f14;
  --radius-card: 12px;
  --radius-pill: 999px;
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --nav-h: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface-2: #eef1f4;
  --border: #d0d7de;
  --border-strong: #afb8c1;
  --text: #1f2328;
  --muted: #59636e;
  --accent: #1a7f37;
  --accent-dim: #1f883d;
  --on-accent: #ffffff;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff;
    --surface: #f6f8fa;
    --surface-2: #eef1f4;
    --border: #d0d7de;
    --border-strong: #afb8c1;
    --text: #1f2328;
    --muted: #59636e;
    --accent: #1a7f37;
    --accent-dim: #1f883d;
    --on-accent: #ffffff;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(900px 420px at 18% -8%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%);
  pointer-events: none;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 8px 16px; border-radius: 0 0 8px 0; z-index: 100; }
.skip:focus { left: 0; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
main { display: block; }
section { padding: 84px 0; scroll-margin-top: calc(var(--nav-h) + 16px); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 600; }
p { margin: 0 0 16px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
.ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 7px; flex: none; }

/* scroll progress (CSS scroll-driven; no JS) */
.progress {
  position: fixed; top: 0; left: 0; z-index: 70;
  width: 100%; height: 2px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
}
@keyframes grow { to { transform: scaleX(1); } }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: 1080px; margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-weight: 700; color: var(--text); font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 500; transition: color 0.15s ease; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  white-space: nowrap;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.theme-toggle {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ---------- hero ---------- */
.hero { padding-top: clamp(4rem, 9vh, 6rem); padding-bottom: clamp(2.5rem, 6vh, 4rem); }
.hero h1 { font-size: clamp(2.7rem, 7vw, 4.6rem); font-weight: 700; margin-bottom: 20px; }
.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 32px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-pill);
  padding: 11px 22px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-dim); }
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }
.hero-anim { animation: rise 0.7s var(--ease) both; }
.hero-anim:nth-child(2) { animation-delay: 0.08s; }
.hero-anim:nth-child(3) { animation-delay: 0.16s; }
.hero-anim:nth-child(4) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- metrics strip ---------- */
.metrics { padding: 0; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) { .metrics-grid { grid-template-columns: repeat(2, 1fr); } }
.metric { padding: 22px 24px 22px 0; border-right: 1px solid var(--border); margin-right: 24px; }
.metric:last-child { border-right: none; margin-right: 0; }
@media (max-width: 768px) {
  .metric { padding: 18px 16px 18px 0; margin-right: 0; border-right: none; }
  .metric:nth-child(odd) { border-right: 1px solid var(--border); margin-right: 16px; }
  .metric:nth-child(n+3) { padding-top: 22px; border-top: 1px solid var(--border); }
}
.metric .num { font-family: var(--font-mono); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 500; color: var(--text); line-height: 1.2; }
.metric .num em { font-style: normal; color: var(--accent); }
.metric .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- about ---------- */
.about p { color: var(--muted); max-width: 65ch; font-size: 17px; }
.about strong { color: var(--text); font-weight: 600; }
.status-line { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; margin-top: 8px; }

/* ---------- experience ---------- */
.exp-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.exp-row:first-of-type { border-top: 1px solid var(--border); }
@media (max-width: 768px) { .exp-row { grid-template-columns: 1fr; gap: 8px; } }
.exp-row h3 { font-size: 16.5px; font-weight: 600; margin: 0 0 4px; }
.exp-row .co { font-size: 14px; color: var(--muted); margin: 0; }
.exp-row .years { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); display: block; margin-top: 6px; }
.exp-row p.scope { color: var(--muted); font-size: 14.5px; margin: 0; }
.exp-row p.scope strong { color: var(--text); font-weight: 600; }

/* ---------- skills ---------- */
.skill-group { margin-bottom: 28px; }
.skill-group h3 { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  transition: border-color 0.15s ease;
}
.chip:hover { border-color: var(--border-strong); }
.chip b { color: var(--accent); font-weight: 500; margin-right: 4px; }

/* ---------- projects ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-2px); }
.card h3 { font-size: 18px; font-weight: 600; margin: 0; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { color: var(--muted); font-size: 14.5px; margin: 0; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px 9px; }
.tag-license { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 2px; }
.card-link { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.card-link .arrow { transition: transform 0.18s ease; }
.card:hover .card-link .arrow { transform: translateX(3px); }
.card:hover .card-link { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- writing / post list ---------- */
.post-list { display: grid; gap: 0; }
.post-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.post-row:first-of-type { border-top: 1px solid var(--border); }
@media (max-width: 768px) { .post-row { grid-template-columns: 1fr; gap: 6px; } }
.post-row time { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); padding-top: 5px; }
.post-row h3 { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.post-row h3 a { color: var(--text); }
.post-row h3 a:hover { color: var(--accent); }
.post-row p { color: var(--muted); font-size: 14.5px; margin: 0; }
.view-all { margin-top: 24px; display: inline-block; font-weight: 600; }

/* ---------- homelab ---------- */
.homelab {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.homelab p { color: var(--muted); max-width: 70ch; font-size: 16.5px; }

/* ---------- certs ---------- */
.certs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 768px) { .certs-grid { grid-template-columns: 1fr; } }
.cert-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; }
.cert-col h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.cert-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cert-col li { color: var(--muted); font-size: 14.5px; display: flex; gap: 10px; align-items: baseline; }
.mark { color: var(--accent); font-family: var(--font-mono); font-weight: 700; }
.mark.muted { color: var(--muted); }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 32px; }
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.contact-row .k { font-family: var(--font-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.contact-row .v { font-size: 15px; color: var(--text); text-align: right; word-break: break-word; }
.contact-row .v a { color: var(--text); }
.contact-row .v a:hover { color: var(--accent); }
.contact-note { color: var(--muted); font-size: 14px; margin-top: 20px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 28px 0 44px; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
footer p { color: var(--muted); font-size: 13.5px; margin: 0; }
.foot-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; }
.top { font-size: 13.5px; }

/* ---------- articles (blog + case studies) ---------- */
.article { padding-top: 48px; }
.breadcrumbs { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin: 0 0 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.article h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 700; margin-bottom: 14px; }
.byline { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.byline a { color: var(--muted); }
.byline a:hover { color: var(--accent); }
.prose { max-width: 720px; font-size: 16.5px; line-height: 1.75; }
.prose p { margin: 0 0 20px; color: var(--text); }
.prose h2 { font-size: 1.35rem; margin: 44px 0 14px; font-weight: 650; }
.prose h3 { font-size: 1.08rem; margin: 28px 0 10px; font-weight: 650; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 24px; color: var(--text); }
.prose li { margin-bottom: 8px; }
.prose code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.prose pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px 18px; overflow-x: auto; margin: 0 0 20px; }
.prose pre code { background: none; border: none; padding: 0; font-size: 13.5px; line-height: 1.6; }
.prose blockquote { margin: 0 0 20px; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
.prose .fact { color: var(--muted); }
.post-footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.post-footer p { margin: 0; color: var(--muted); font-size: 14px; }
.article-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.grid-2 .reveal:nth-child(2) { transition-delay: 0.05s; }
.grid-2 .reveal:nth-child(3) { transition-delay: 0.1s; }
.grid-2 .reveal:nth-child(4) { transition-delay: 0.05s; }
.grid-2 .reveal:nth-child(5) { transition-delay: 0.1s; }
.grid-2 .reveal:nth-child(6) { transition-delay: 0.05s; }

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

/* ============================================================
   Aceternity-flavor layer (Aug 2026) — additive, non-destructive.
   Aurora haze, spotlight cards, moving-border CTA, card hover lift.
   ============================================================ */

/* Aurora haze behind the hero (subtle, dark-mode only default) */
.hero .eyebrow { position: relative; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 42% at 12% -5%, rgba(63,185,80,0.10), transparent 62%),
    radial-gradient(ellipse 45% 38% at 92% 18%, rgba(35,134,54,0.07), transparent 62%);
  opacity: 1;
}
:root[data-theme="light"] body::before,
@media (prefers-color-scheme: light) body::before { opacity: 0; }

/* Spotlight tracking on project/themed cards */
.card, .project-card, article {
  position: relative; overflow: hidden;
  transition: transform var(--ease) 0.35s, border-color 0.3s ease;
}
.card:hover, .project-card:hover, article:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.card::after, .project-card::after, article::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.35s ease;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(63,185,80,0.10), transparent 70%);
  pointer-events: none;
}
.card:hover::after, .project-card:hover::after, article:hover::after { opacity: 1; }

/* Moving-border primary CTA (Aceternity signature) */
.btn-primary, .cta-primary, .button-primary {
  position: relative; z-index: 0;
}
.btn-primary::before, .cta-primary::before, .button-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from 0deg, transparent 0 22%, var(--accent) 50%, transparent 78% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin-border 5s linear infinite;
  pointer-events: none;
}
@keyframes spin-border { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  body::before, .card::after, .project-card::after, article::after { transition: none; }
  .btn-primary::before, .cta-primary::before, .button-primary::before { animation: none; }
  .card:hover, .project-card:hover, article:hover { transform: none; }
}


/* ---- Buy me a coffee (footer link, all subpages) ---- */
.bmc-foot { color: var(--accent); text-decoration: none; }
.bmc-foot:hover { text-decoration: underline; }

/* ---- Now / Uses footer links ---- */
.foot-link { color: var(--muted); text-decoration: none; }
.foot-link:hover { color: var(--text); }
