/* =========================================================================
   Ivan Murashka - personal site
   Design: editorial, premium, engineering-minded. Light + dark themes.
   ========================================================================= */

/* ----- Theme tokens ----- */
:root {
  /* Light theme (default) */
  --bg:            #f8fafc;
  --bg-elev:       #ffffff;
  --bg-alt:        #f1f5f9;
  --text:          #0f172a;
  --text-muted:    #475569;
  --text-soft:     #64748b;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;
  --accent:        #4f46e5;
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --accent-ink:    #3730a3;
  --accent-soft:   rgba(79, 70, 229, 0.06);
  --shadow:        0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg:     0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --ring:          rgba(79, 70, 229, 0.4);
  --grid-color:    rgba(79, 70, 229, 0.03);
  --aurora-1:      rgba(79, 70, 229, 0.04);
  --aurora-2:      rgba(6, 182, 212, 0.04);

  --maxw: 1120px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --heading: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --radius: 16px;
  --radius-sm: 10px;
}

/* Dark via system preference, unless the user forced light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #09090b;
    --bg-elev:       #121215;
    --bg-alt:        #18181b;
    --text:          #f4f4f5;
    --text-muted:    #a1a1aa;
    --text-soft:     #71717a;
    --border:        #27272a;
    --border-strong: #3f3f46;
    --accent:        #818cf8;
    --accent-gradient: linear-gradient(135deg, #818cf8 0%, #22d3ee 100%);
    --accent-ink:    #c7d2fe;
    --accent-soft:   rgba(129, 140, 248, 0.10);
    --shadow:        0 1px 3px rgba(0,0,0,0.3), 0 8px 20px -5px rgba(0,0,0,0.5);
    --shadow-lg:     0 20px 25px -5px rgba(0,0,0,0.6), 0 10px 10px -5px rgba(0,0,0,0.5);
    --ring:          rgba(129, 140, 248, 0.5);
    --grid-color:    rgba(255, 255, 255, 0.015);
    --aurora-1:      rgba(99, 102, 241, 0.07);
    --aurora-2:      rgba(6, 182, 212, 0.07);
  }
}

/* Dark when explicitly toggled */
:root[data-theme="dark"] {
  --bg:            #09090b;
  --bg-elev:       #121215;
  --bg-alt:        #18181b;
  --text:          #f4f4f5;
  --text-muted:    #a1a1aa;
  --text-soft:     #71717a;
  --border:        #27272a;
  --border-strong: #3f3f46;
  --accent:        #818cf8;
  --accent-gradient: linear-gradient(135deg, #818cf8 0%, #22d3ee 100%);
  --accent-ink:    #c7d2fe;
  --accent-soft:   rgba(129, 140, 248, 0.10);
  --shadow:        0 1px 3px rgba(0,0,0,0.3), 0 8px 20px -5px rgba(0,0,0,0.5);
  --shadow-lg:     0 20px 25px -5px rgba(0,0,0,0.6), 0 10px 10px -5px rgba(0,0,0,0.5);
  --ring:          rgba(129, 140, 248, 0.5);
  --grid-color:    rgba(255, 255, 255, 0.015);
  --aurora-1:      rgba(99, 102, 241, 0.07);
  --aurora-2:      rgba(6, 182, 212, 0.07);
}

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: clamp(0.975rem, 0.95rem + 0.15vw, 1.05rem);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at 10% 15%, var(--aurora-1) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, var(--aurora-2) 0%, transparent 45%),
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 45px 45px, 45px 45px;
}

h1, h2, h3, h4 { 
  font-family: var(--heading);
  line-height: 1.15; 
  font-weight: 700; 
  letter-spacing: -0.02em; 
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
em { font-style: italic; color: var(--text); }

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

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

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ----- Header / nav ----- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 70px; }

.brand { display: inline-flex; align-items: center; gap: .7rem; font-weight: 700; letter-spacing: -.02em; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-gradient); color: #ffffff;
  font-family: var(--mono); font-size: .88rem; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}
.brand-name { font-family: var(--heading); font-size: 1.05rem; }

.nav { display: flex; align-items: center; }
.nav-menu { list-style: none; display: flex; gap: clamp(.4rem, 2vw, 1.6rem); padding: 0; }
.nav-menu a {
  font-size: .95rem; font-weight: 500; color: var(--text-muted); padding: .4rem .3rem; position: relative; transition: color .2s ease;
}
.nav-menu a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--accent-gradient);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-menu a:hover { color: var(--text); }
.nav-menu a:hover::after, .nav-menu a.active::after { transform: scaleX(1); }
.nav-menu a.active { color: var(--text); font-weight: 600; }

.nav-toggle { display: none; }

.theme-switcher {
  display: inline-flex;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
  gap: 3px;
  box-shadow: var(--shadow);
  flex: none;
}
.theme-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.theme-btn:hover {
  color: var(--text);
}
.theme-btn:active {
  transform: scale(.92);
}
.theme-btn.active {
  background: var(--bg-elev);
  color: var(--accent);
  box-shadow: var(--shadow);
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .75rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-gradient); color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35); filter: brightness(1.05); }
.btn-ghost { background: var(--bg-elev); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--bg-alt); }

/* ----- Hero ----- */
.hero { padding-top: clamp(3.5rem, 9vw, 7.5rem); padding-bottom: clamp(3rem, 7vw, 5rem); position: relative; }
.hero-inner { display: grid; grid-template-columns: 1fr 280px; gap: 3.5rem; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .85rem; font-weight: 600; letter-spacing: .01em; color: var(--text-soft); margin-bottom: 1.2rem;
}
.eyebrow a { color: var(--accent); text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.eyebrow .dot {
  width: 9px; height: 9px; border-radius: 50%; background: #10b981; 
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); 
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

#hero-title { 
  font-size: clamp(2.8rem, 7.5vw, 4.8rem); 
  letter-spacing: -.03em; 
  margin-bottom: .6rem; 
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-lead { font-size: clamp(1.25rem, 2.8vw, 1.75rem); font-weight: 600; letter-spacing: -.01em; color: var(--text); max-width: 38ch; margin-bottom: 1.2rem; line-height: 1.4; }
.hero-sub { color: var(--text-muted); max-width: 58ch; font-size: 1.075rem; line-height: 1.65; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

.hero-social { list-style: none; display: flex; gap: .8rem; padding: 0; margin-top: 2rem; }
.hero-social a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--bg-elev);
  box-shadow: var(--shadow);
  transition: color .2s ease, border-color .2s ease, transform .15s ease, background-color .2s ease;
}
.hero-social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); background-color: var(--bg-alt); }

.hero-aside { display: grid; place-items: center; }
.avatar-frame {
  position: relative;
  border-radius: 28px;
  padding: 5px;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
.avatar-frame:hover {
  transform: translateY(-6px) rotate(1deg);
  box-shadow: 0 25px 40px -15px rgba(79, 70, 229, 0.3);
}
.avatar-img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 23px;
  border: 4px solid var(--bg-elev);
}

/* ----- Stats ----- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: clamp(3rem, 7vw, 5rem);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border);
  box-shadow: var(--shadow-lg);
}
.stat { 
  background: var(--bg-elev); padding: 1.5rem 1.6rem; 
  transition: background-color .2s ease, transform .2s ease;
}
.stat:hover { background: var(--bg-alt); }
.stat dt { font-size: .85rem; color: var(--text-soft); font-weight: 500; letter-spacing: .01em; margin-bottom: .4rem; }
.stat dd { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; font-family: var(--mono); color: var(--text); }
.stat dd .unit { color: var(--accent); }

/* ----- Sections ----- */
main section[id], #main { scroll-margin-top: 90px; }
.section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
#about.section { padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); position: relative; }
.section-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 3rem; }
.section-num { font-family: var(--mono); font-size: .9rem; color: var(--accent); font-weight: 700; }
.section-head h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); letter-spacing: -.025em; font-weight: 800; color: var(--text); }
.section-intro { color: var(--text-muted); max-width: 64ch; font-size: 1.1rem; line-height: 1.65; margin-top: -1.5rem; margin-bottom: 3rem; }
.subhead {
  display: flex; align-items: center; gap: .7rem;
  font-size: 1.1rem; font-family: var(--mono); font-weight: 700; color: var(--text);
  letter-spacing: 0; margin: 3rem 0 1.8rem; text-transform: lowercase;
}
.subhead::before { content: ""; width: 22px; height: 3px; background: var(--accent-gradient); border-radius: 2px; flex: none; }
.subhead:first-of-type { margin-top: 0; }

/* ----- About ----- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: start; }
.about-main .lead { font-size: 1.15rem; font-weight: 600; color: var(--text); margin-bottom: 1rem; line-height: 1.5; }
.about-main p { color: var(--text-muted); margin-bottom: 1.2rem; }
.about-facts { display: grid; gap: 0; margin: 2rem 0; }
.about-facts > div { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--border); }
.about-facts dt { font-family: var(--mono); font-size: .75rem; color: var(--accent); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding-top: .15rem; }
.about-facts dd { color: var(--text-muted); font-size: .98rem; }
.about-contact { font-size: .95rem; color: var(--text-soft); }
.about-contact a { color: var(--accent); font-weight: 600; border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.about-contact a:hover { border-bottom-color: var(--accent); }
.about-exp .subhead { margin-top: 0; }

/* ----- Cards ----- */
.cards { display: grid; gap: 1.5rem; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; display: flex; flex-direction: column; gap: .8rem;
  transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1), border-color .25s ease, box-shadow .25s ease;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.card h4 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.card p { color: var(--text-muted); font-size: .98rem; line-height: 1.55; }
.card.repo:hover, .card.project:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin-top: auto; }
.chips li {
  font-family: var(--sans); font-size: .72rem; color: var(--text-soft); font-weight: 600;
  border: 1px solid var(--border); border-radius: 999px; padding: .2rem .6rem; background: var(--bg-alt);
  letter-spacing: .01em;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.card:hover .chips li { border-color: var(--border-strong); color: var(--text-muted); }

/* Project cards */
.project-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.project-role { font-family: var(--mono); font-size: .8rem; color: var(--accent); font-weight: 600; margin-top: -.2rem; }
.badge {
  font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: .22rem .6rem; flex: none;
  border: 1px solid rgba(79, 70, 229, 0.15);
}
:root[data-theme="dark"] .badge { color: var(--accent); border-color: rgba(129, 140, 248, 0.25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge { color: var(--accent); border-color: rgba(129, 140, 248, 0.25); } }
:root[data-theme="dark"] .badge { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge { color: var(--accent); } }
.project-links { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .3rem; }
.project-links a { font-size: .88rem; font-weight: 600; color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.project-links a:hover { border-bottom-color: var(--accent); }

/* Repo cards */
.repo { cursor: pointer; }
.repo-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stars { font-family: var(--mono); font-size: .85rem; color: var(--accent); font-weight: 600; }
.repo-lang { font-family: var(--mono); font-size: .78rem; color: var(--text-soft); margin-top: auto; font-weight: 500; }
.more-link { margin-top: 2rem; }
.more-link a { font-weight: 700; color: var(--accent); border-bottom: 2px solid transparent; transition: border-color .2s ease; }
.more-link a:hover { border-bottom-color: var(--accent); }

/* ----- About Layout ----- */
.about-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about-main {
  display: flex;
  flex-direction: column;
}
.about-aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.about-facts-card {
  padding: 1.6rem 1.8rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.about-facts-card .about-facts {
  margin: 0;
}
.about-facts-card .about-facts > div:first-child {
  border-top: none;
  padding-top: 0;
}

/* ----- About: career progression stepper ----- */
.about-track {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.about-step {
  position: relative;
  padding-top: 1.7rem;
  text-align: center;
}
.about-step::before {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(-50% - 1rem);
  right: 50%;
  height: 2px;
  background: var(--border);
}
.about-step:first-child::before { display: none; }
.about-step::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
}
.about-step.is-current::after {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.step-year {
  display: block;
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
}
.step-role {
  display: block;
  margin-top: .25rem;
  font-size: .96rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.about-contact-wrapper {
  margin-top: 1.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.about-contact-wrapper h4 {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

/* ----- Work Timeline ----- */
.work-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  padding-left: 2rem;
}
.work-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent) 0%, var(--border) 80%, transparent 100%);
}
.work-item {
  position: relative;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}
.work-item::before {
  content: "";
  position: absolute;
  left: -2rem;
  left: calc(-2rem + 1px);
  top: 0.6rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  z-index: 2;
  transition: transform 0.25s ease, background-color 0.25s ease;
}
.work-item:hover::before {
  transform: scale(1.2);
  background: var(--accent);
}
.work-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: sticky;
  top: 100px;
}
.work-date {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.work-company {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.work-company a { color: inherit; text-decoration: none; }
.work-company a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.work-role {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
}
.work-location {
  font-size: 0.88rem;
  color: var(--text-soft);
  font-weight: 500;
}
.badge-current {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 99px;
  padding: 0.2rem 0.6rem;
  margin-top: 0.4rem;
}
.work-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.work-summary {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.work-details ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.work-details li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.work-details li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.work-details {
  display: grid;
  gap: 1.4rem;
}
.work-detail-group {
  display: grid;
  gap: 0.6rem;
}
.work-detail-label {
  font-family: var(--heading);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin: 0;
}
.work-projects {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  border-top: 1px solid var(--border);
  padding-top: 1.8rem;
  margin-top: 0.5rem;
}
.work-project-category {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.work-project-category h5 {
  font-family: var(--heading);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 0.1rem;
}
.work-project-note {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 62ch;
}
.work-project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.work-project-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.work-project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.work-project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.work-project-card strong {
  font-size: 1rem;
  color: var(--text);
  font-weight: 700;
}
.project-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 99px;
  padding: 0.18rem 0.5rem;
  flex: none;
}
.badge-live {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.15);
}
.work-project-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.work-project-links {
  display: flex;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 0.4rem;
}
.work-project-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.work-project-links a:hover {
  border-bottom-color: var(--accent);
}
.badge-dev {
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--border);
}
.badge-delisted {
  color: var(--text-soft);
  background: transparent;
  border: 1px dashed var(--border);
}
.proj-desc {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.45;
}
.proj-role {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 0.4rem;
  padding-left: 0.7rem;
  border-left: 2px solid var(--border);
}
.proj-role span {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  display: inline-block;
  margin-right: 0.2rem;
}
.proj-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.proj-role-chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-soft);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* ----- Quotes ----- */
.quotes { columns: 2; column-gap: 1.5rem; column-fill: balance; }
.quote {
  break-inside: avoid; margin-bottom: 1.5rem; position: relative;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem;
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.quote:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.quote::before {
  content: "\201C"; position: absolute; top: .5rem; right: 1.5rem;
  font-family: Georgia, serif; font-size: 4rem; line-height: 1;
  color: var(--accent); opacity: .12;
}
.quote blockquote { font-size: 1rem; color: var(--text-muted); line-height: 1.65; position: relative; }
.quote-author { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }

/* Avatar colors for recommendations */
.rec-avatar {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.92rem; flex-shrink: 0; border: 1px solid transparent;
}
.av-1 { background: rgba(79, 70, 229, 0.12); color: #818cf8; border-color: rgba(79, 70, 229, 0.2); }
.av-2 { background: rgba(6, 182, 212, 0.12); color: #22d3ee; border-color: rgba(6, 182, 212, 0.2); }
.av-3 { background: rgba(16, 185, 129, 0.12); color: #34d399; border-color: rgba(16, 185, 129, 0.2); }
.av-4 { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(245, 158, 11, 0.2); }
.av-5 { background: rgba(244, 63, 94, 0.12); color: #fb7185; border-color: rgba(244, 63, 94, 0.2); }
.av-6 { background: rgba(168, 85, 247, 0.12); color: #c084fc; border-color: rgba(168, 85, 247, 0.2); }

:root[data-theme="light"] .av-1 { background: rgba(79, 70, 229, 0.08); color: #4f46e5; border-color: rgba(79, 70, 229, 0.15); }
:root[data-theme="light"] .av-2 { background: rgba(8, 145, 178, 0.08); color: #0891b2; border-color: rgba(8, 145, 178, 0.15); }
:root[data-theme="light"] .av-3 { background: rgba(5, 150, 105, 0.08); color: #059669; border-color: rgba(5, 150, 105, 0.15); }
:root[data-theme="light"] .av-4 { background: rgba(217, 119, 6, 0.08); color: #d97706; border-color: rgba(217, 119, 6, 0.15); }
:root[data-theme="light"] .av-5 { background: rgba(225, 29, 72, 0.08); color: #e11d48; border-color: rgba(225, 29, 72, 0.15); }
:root[data-theme="light"] .av-6 { background: rgba(147, 51, 234, 0.08); color: #9333ea; border-color: rgba(147, 51, 234, 0.15); }

.author-meta { display: grid; gap: 0.1rem; }
.author-meta a { font-weight: 700; font-size: 0.98rem; color: var(--text); border-bottom: 1px solid transparent; transition: color .2s ease, border-color .2s ease; width: fit-content; }
.author-meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.author-meta span { font-family: var(--mono); font-size: .78rem; color: var(--text-soft); }

/* ----- Speaking ----- */
.talk {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.2rem;
  box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1), border-color .25s ease, box-shadow .25s ease;
}
.talk:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.talk-event { font-family: var(--mono); font-size: .8rem; color: var(--accent); font-weight: 600; margin-bottom: .5rem; }
.talk-body h3 { font-size: clamp(1.2rem, 2.6vw, 1.6rem); margin-bottom: .6rem; color: var(--text); }
.talk-body p:last-child { color: var(--text-muted); max-width: 72ch; font-size: .98rem; line-height: 1.6; }
.talk-cta { font-weight: 700; color: var(--accent); white-space: nowrap; border-bottom: 2px solid transparent; transition: border-color .2s ease; }
.talk:hover .talk-cta { border-bottom-color: var(--accent); }

/* ----- Footer ----- */
.site-footer { border-top: 1px solid var(--border); padding-block: 2.5rem; background: var(--bg-alt); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem 1.8rem; flex-wrap: wrap; color: var(--text-soft); font-size: .9rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-muted); font-weight: 500; border-bottom: 1px solid transparent; transition: color .2s ease, border-color .2s ease; }
.footer-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.footer-meta { font-family: var(--mono); font-size: .8rem; }

/* ----- Reveal on scroll (only when JS can switch it back on) ----- */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(0.16, 1, 0.3, 1), transform .7s cubic-bezier(0.16, 1, 0.3, 1); }
html.js .reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* ============================ Responsive ============================ */
@media (max-width: 920px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Nav collapses to a menu button earlier than the layout, so the desktop
   nav never renders cramped. */
@media (max-width: 860px) {
  .nav-menu {
    position: fixed; inset: 70px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: .5rem var(--gutter) 1rem; transform: translateY(-130%); transition: transform .3s ease;
    box-shadow: var(--shadow); max-height: calc(100dvh - 70px); overflow-y: auto;
  }
  .nav-menu.open { transform: translateY(0); }
  .nav-menu li { width: 100%; border-top: 1px solid var(--border); }
  .nav-menu li:first-child { border-top: none; }
  .nav-menu a { display: block; padding: .9rem .2rem; font-size: 1rem; }
  .nav-menu a::after { display: none; }

  .nav-toggle {
    display: grid; place-items: center; width: 40px; height: 40px;
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
    position: relative;
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    content: ""; display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
  }
  .nav-toggle-bar::before { position: absolute; transform: translateY(-6px); }
  .nav-toggle-bar::after  { position: absolute; transform: translateY(6px); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { transform: rotate(-45deg); }

  .work-project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero-aside { order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .about-content { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-track { grid-template-columns: 1fr; gap: 0; margin-top: 2rem; }
  .about-step { text-align: left; padding: .7rem 0 .7rem 1.6rem; }
  .about-step::before { top: 0; bottom: 0; left: 5px; right: auto; width: 2px; height: auto; }
  .about-step:first-child::before { display: block; top: 50%; }
  .about-step:last-child::before { bottom: 50%; }
  .about-step::after { top: 50%; left: 0; transform: translateY(-50%); }
  .work-item { grid-template-columns: 1fr; gap: 1.5rem; }
  .work-meta { position: static; }
  .cards-3, .cards-4 { grid-template-columns: 1fr; }
  .quotes { columns: 1; }
  .talk { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .brand-name { display: none; }
  /* Keep stats two-up even on the narrowest phones - the values are short. */
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 1rem 1rem; }
}
