/* =====================================================
   Muhammed Esat Demir — Portföy
   Custom design system · Vanilla CSS
   ===================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Palette · Dark (default) */
  --bg:            #0B0D12;
  --bg-elev:      #0F1218;
  --surface:      #151921;
  --surface-2:    #1B2030;
  --border:       rgba(255, 255, 255, 0.08);
  --border-strong:rgba(255, 255, 255, 0.14);

  --text:         #E7EAF3;
  --text-muted:   #8A93A6;
  --text-dim:     #6B7487;

  --primary:      #7C8CFF;
  --primary-2:    #A0AAFF;
  --primary-soft: rgba(124, 140, 255, 0.14);
  --primary-ring: rgba(124, 140, 255, 0.35);

  --accent:       #6EE7B7;
  --accent-soft:  rgba(110, 231, 183, 0.14);

  --warn:         #F5B971;
  --danger:       #FF7A8A;

  --grad-primary: linear-gradient(135deg, #7C8CFF 0%, #A855F7 100%);
  --grad-accent:  linear-gradient(135deg, #6EE7B7 0%, #7C8CFF 100%);

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.25);
  --shadow-md:   0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg:   0 20px 60px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 0 1px var(--primary-ring), 0 20px 60px rgba(124,140,255,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --container: 1200px;
  --pad: clamp(1.25rem, 3vw, 2rem);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 300ms;
}

[data-theme="light"] {
  --bg:            #FBFBFD;
  --bg-elev:      #FFFFFF;
  --surface:      #FFFFFF;
  --surface-2:    #F3F5FA;
  --border:       rgba(11, 13, 18, 0.08);
  --border-strong:rgba(11, 13, 18, 0.16);

  --text:         #0F1218;
  --text-muted:   #5A6274;
  --text-dim:     #8891A1;

  --primary:      #5B6CFF;
  --primary-2:    #7C8CFF;
  --primary-soft: rgba(91, 108, 255, 0.10);
  --primary-ring: rgba(91, 108, 255, 0.25);

  --accent:       #10B981;
  --accent-soft:  rgba(16, 185, 129, 0.10);

  --shadow-sm:   0 2px 6px rgba(15, 18, 24, 0.06);
  --shadow-md:   0 8px 24px rgba(15, 18, 24, 0.08);
  --shadow-lg:   0 20px 50px rgba(15, 18, 24, 0.10);
  --shadow-glow: 0 0 0 1px var(--primary-ring), 0 16px 40px rgba(91,108,255,0.12);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--primary); }

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

ul, ol { list-style: none; padding: 0; margin: 0; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0; }

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

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

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.section {
  padding: clamp(4rem, 8vw, 7rem) 0;
  position: relative;
}

.section--alt {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section--cta {
  background:
    radial-gradient(1200px 500px at 50% 0%, var(--primary-soft) 0%, transparent 60%),
    var(--bg);
}

.section__head {
  max-width: 820px;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.section__head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section__kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--primary-ring);
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  margin-bottom: 1rem;
}

.section__title {
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  font-weight: 800;
  color: var(--text);
}

.section__lede {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  max-width: 65ch;
}
.section__lede--compact {
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(0.85rem, 1.1vw, 1rem);
}
@media (max-width: 640px) {
  .section__lede--compact {
    white-space: normal;
    font-size: 0.85rem;
  }
}

.accent {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus,
.skip-link:focus-visible {
  width: auto;
  height: auto;
  padding: 8px 14px;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  outline: 2px solid var(--primary, #7c5cff);
  outline-offset: 2px;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav.is-scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nav__brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad-primary);
  color: white;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}
.nav__brand-text { font-size: 0.95rem; color: var(--text); }

.nav__links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.nav__links a {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
}
.nav__links a:hover,
.nav__links a.is-active {
  color: var(--text);
  background: var(--surface);
}

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

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all var(--dur) var(--ease);
}
.theme-toggle:hover {
  border-color: var(--primary-ring);
  color: var(--primary);
  transform: translateY(-1px);
}

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.nav__burger span {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero__bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.35;
  pointer-events: none;
}
.hero__glow--a { top: -180px; right: -120px; background: radial-gradient(circle, var(--primary) 0%, transparent 60%); }
.hero__glow--b { bottom: -220px; left: -160px; background: radial-gradient(circle, var(--accent) 0%, transparent 60%); opacity: 0.25; }

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 880px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.2s var(--ease) infinite;
}

.hero__title { margin-bottom: 1.5rem; }
.hero__title-line {
  display: block;
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero__title-sub {
  display: block;
  margin-top: 0.75rem;
  font-size: clamp(1.125rem, 2.2vw, 1.625rem);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.hero__lede {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 2rem;
}
.hero__lede strong { color: var(--text); font-weight: 600; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn i { font-size: 0.95em; }

.btn--primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 10px 30px -10px rgba(124, 140, 255, 0.6);
}
.btn--primary:hover { color: white; box-shadow: 0 18px 40px -10px rgba(124,140,255,0.75); }

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  color: var(--primary);
  border-color: var(--primary-ring);
  background: var(--primary-soft);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.hero__meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.hero__meta i { color: var(--primary); }

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  display: grid;
  place-items: center;
  z-index: 1;
  transition: border-color var(--dur) var(--ease);
}
.hero__scroll:hover { border-color: var(--primary); }
.hero__scroll span {
  width: 3px; height: 8px;
  border-radius: 2px;
  background: var(--primary);
  animation: scrollDot 1.8s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
  50%      { box-shadow: 0 0 0 8px transparent; }
}
@keyframes scrollDot {
  0%   { transform: translateY(-8px); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(8px); opacity: 0; }
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}
.about__text p + p { margin-top: 1rem; }
.about__text strong { color: var(--text); font-weight: 600; }
.about__text p { color: var(--text-muted); font-size: 1.05rem; }

.about__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.1rem;
  text-align: left;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.stat:hover { transform: translateY(-3px); border-color: var(--primary-ring); }
.stat__value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stat__label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat__sub {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0.02em;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  bottom: 0.4rem;
  left: 0.5rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-ring), transparent);
  border-radius: 2px;
}

.timeline__item {
  position: relative;
  padding-bottom: 2rem;
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position: absolute;
  left: -1.65rem;
  top: 1.1rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.4rem;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.timeline__card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-ring);
  box-shadow: var(--shadow-md);
}

.timeline__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.55rem;
}
.timeline__role {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.timeline__company {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}
.timeline__desc {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ---------- Chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  padding: 0; margin: 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  letter-spacing: -0.005em;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.chip:hover {
  color: var(--text);
  border-color: var(--primary-ring);
}
.chip--strong {
  background: var(--primary-soft);
  border-color: var(--primary-ring);
  color: var(--primary-2);
  font-weight: 600;
}
.chips--mono .chip { font-family: var(--font-mono); font-size: 0.76rem; }
.chips--sm .chip { padding: 0.25rem 0.6rem; font-size: 0.72rem; }

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.35rem;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-ring);
  box-shadow: var(--shadow-md);
}
.skill-card__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
}
.skill-card__head i {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 10px;
  font-size: 0.95rem;
}
.skill-card__head h3 { font-size: 1.05rem; }

.langs {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.langs__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  padding-right: 0.65rem;
  border-right: 1px solid var(--border);
}
.lang strong { color: var(--text); font-weight: 600; }
.lang-sep { color: var(--text-dim); }

/* ---------- Project disclaimer ---------- */
.proj-disclaimer {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.2rem;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
  background: linear-gradient(135deg, var(--primary-soft), transparent 80%);
  border: 1px solid var(--primary-ring);
  border-left-width: 3px;
  border-radius: var(--radius-md);
}
.proj-disclaimer > i {
  flex-shrink: 0;
  margin-top: 0.2rem;
  color: var(--primary);
  font-size: 1.1rem;
}
.proj-disclaimer p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}
.proj-disclaimer strong { color: var(--text); font-weight: 600; }
.proj-disclaimer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.proj-disclaimer a:hover { color: var(--primary-2); }

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
}

.project {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.65rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.project:hover {
  transform: translateY(-5px);
  border-color: var(--primary-ring);
  box-shadow: var(--shadow-lg);
}
.project:hover::before { opacity: 1; }
.project > * { position: relative; z-index: 1; }

.project__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: space-between;
  align-items: flex-start;
}
.project__titles { flex: 1 1 60%; min-width: 0; }
.project__phase {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}
.project__name {
  font-size: 1.35rem;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: -0.015em;
}
.project__subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.project__desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.project__desc strong { color: var(--text); font-weight: 600; }

.project__highlights {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}
.project__highlights li {
  position: relative;
  padding-left: 1.3rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.project__highlights li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 700;
}
.project__highlights li strong { color: var(--text); font-weight: 600; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge i { font-size: 0.8em; }

.badge--live {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.badge__pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: livePulse 1.8s var(--ease) infinite;
  flex-shrink: 0;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.badge--enterprise {
  color: var(--primary-2);
  background: var(--primary-soft);
  border-color: var(--primary-ring);
}
.badge--gov {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}
.badge--ai {
  color: var(--primary-2);
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  border-color: var(--primary-ring);
}

/* Minor projects */
.minor {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px dashed var(--border);
}
.minor__title {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}
.minor__lede {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.minor__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}
.minor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.1rem;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.minor-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-ring);
}
.minor-card h4 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.minor-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

/* ---------- Education ---------- */
.edu-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(2.25rem, 4vw, 3.25rem);
}

.edu-block__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.certs-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  align-items: start;
}
.certs-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.edu__heading {
  font-size: 1.1rem;
  font-family: var(--font-mono);
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.edu-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.edu-item:hover { border-color: var(--primary-ring); transform: translateY(-2px); }
.edu-item h4 { font-size: 1.05rem; color: var(--text); margin-bottom: 0.2rem; }
.edu-item__role { color: var(--primary); font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.edu-item__meta { color: var(--text-muted); font-size: 0.85rem; }
.edu-item__meta strong { color: var(--text); }

.cert-list {
  display: grid;
  gap: 0.65rem;
}
.cert {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.cert:hover { border-color: var(--primary-ring); transform: translateX(3px); }
.cert i {
  color: var(--primary);
  margin-top: 0.25rem;
  flex-shrink: 0;
}
.cert span { display: flex; flex-direction: column; gap: 0.15rem; }
.cert strong { font-size: 0.92rem; color: var(--text); font-weight: 600; }
.cert em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 320px));
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 900px) {
  .contact { grid-template-columns: repeat(2, minmax(240px, 340px)); }
}
@media (max-width: 560px) {
  .contact { grid-template-columns: minmax(240px, 420px); }
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-ring);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.contact-card i {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.contact-card div { display: flex; flex-direction: column; min-width: 0; }
.contact-card__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}
.contact-card__value {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Project GitHub link ---------- */
.project__link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.25rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  align-self: flex-start;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.project__link:hover {
  border-color: var(--primary-ring);
  color: var(--primary);
  background: var(--primary-soft);
  transform: translateX(2px);
}
.project__link i:first-child { font-size: 1rem; }
.project__link i:last-child { font-size: 0.75rem; transition: transform var(--dur) var(--ease); }
.project__link:hover i:last-child { transform: translateX(3px); }

/* Research badge */
.badge--research {
  color: #D1B3FF;
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
}

/* ---------- Minor subsection titles ---------- */
.minor__subtitle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 2rem 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--border);
}
.minor__subtitle:first-of-type { margin-top: 1.5rem; }
.minor__subtitle i {
  color: var(--primary);
  font-size: 0.95rem;
}
.minor__subtag {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- Collapsible minor subsection ---------- */
.minor__collapse { margin-top: 0; }
.minor__collapse > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.2s ease;
}
.minor__collapse > summary::-webkit-details-marker { display: none; }
.minor__collapse > summary::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 0.4rem;
  color: var(--primary);
  transition: transform 0.2s ease;
}
.minor__collapse[open] > summary::before { transform: rotate(90deg); }
.minor__collapse > summary:hover { color: var(--accent, var(--primary)); }
.minor__collapse-hint {
  margin-left: auto;
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- Certificate groups ---------- */
.cert-group {
  margin-bottom: 1.5rem;
}
.cert-group:last-child { margin-bottom: 0; }

.cert-group__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.cert-group__title i {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 8px;
  font-size: 0.8rem;
}

/* ---------- References ---------- */
.refs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
}
.ref-card {
  display: flex;
  gap: 1.1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ref-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-ring);
  box-shadow: var(--shadow-md);
}
.ref-card__avatar {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad-primary);
  color: white;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px -8px rgba(124, 140, 255, 0.55);
}
.ref-card__body { min-width: 0; flex: 1; }
.ref-card__name {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.ref-card__role {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
.ref-card__meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed var(--border);
}
.ref-card__ctx {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.refs__note {
  margin-top: 1.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.refs__note i { color: var(--primary); }

/* ---------- Language switch ---------- */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}
.lang-switch__btn {
  padding: 0.35rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  min-width: 36px;
}
.lang-switch__btn:hover { color: var(--text); }
.lang-switch__btn.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* ---------- Footer ---------- */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer__built span {
  font-family: var(--font-mono);
  color: var(--primary);
}

/* ---------- To-top button ---------- */
.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 60;
}
.to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.to-top:hover { transform: translateY(-3px) scale(1.05); }

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .about { grid-template-columns: 1fr; }
  .about__stats { grid-template-columns: repeat(4, 1fr); }
  .edu-block__grid { grid-template-columns: 1fr 1fr; }
  .certs-cols { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .edu-block__grid { grid-template-columns: 1fr; }
  .nav__brand-text { display: none; }

  .nav__links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 1rem var(--pad);
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
  }
  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__links a {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  .nav__burger { display: flex; }

  .about__stats { grid-template-columns: repeat(2, 1fr); }

  .timeline { padding-left: 1.5rem; }
  .timeline__dot { left: -1.5rem; }

  .project__head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero__meta { gap: 0.8rem; font-size: 0.82rem; }
  .hero__title-line { font-size: clamp(2rem, 10vw, 2.6rem); }
  .btn { padding: 0.8rem 1.15rem; font-size: 0.9rem; }
  .footer__inner { flex-direction: column; text-align: center; }
  .lang-switch__btn { padding: 0.3rem 0.5rem; font-size: 0.68rem; min-width: 30px; }
  .ref-card { padding: 1.15rem; gap: 0.85rem; }
  .ref-card__avatar { width: 44px; height: 44px; font-size: 0.92rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__scroll span { animation: none; }
  .status-dot, .badge__pulse { animation: none; }
}
