/* ============================================================
   KASUM BAJRAMI — PORTFOLIO
   ============================================================ */

/* 1. DESIGN TOKENS (CSS VARIABLES)
   ============================================================ */
:root {
  /* Light Mode Colours */
  --bg:            #f4f4f7;
  --bg-card:       #ffffff;
  --bg-subtle:     #ececf1;
  --bg-hover:      #e2e2ea;
  --text:          #0e0e16;
  --text-muted:    #62626f;
  --accent:        #4f46e5;
  --accent-hover:  #4338ca;
  --accent-light:  #e3e2fb;
  --accent-text:   #3730a3;
  --border:        #e2e2ec;
  --border-hover:  #cfcfdd;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.05);

  /* Spacing (8pt grid) */
  --s1:  4px;  --s2:  8px;  --s3:  12px; --s4:  16px;
  --s5:  20px; --s6:  24px; --s8:  32px; --s10: 40px;
  --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;

  /* Typography */
  --font-sans:  'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Fraunces', 'Playfair Display', Georgia, serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', 'Fira Code', Consolas, monospace;

  /* Radii */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Motion */
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --t-fast:   150ms;
  --t-base:   250ms;
  --t-theme:  300ms;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg:           #0a0e1a;
  --bg-card:      #111729;
  --bg-subtle:    #151c30;
  --bg-hover:     #1d2740;
  --text:         #e7e8f1;
  --text-muted:   #8a90a8;
  --accent:       #a5b4fc;
  --accent-hover: #c7d2fe;
  --accent-light: #272a55;
  --accent-text:  #c7d2fe;
  --border:       #1e2740;
  --border-hover: #2c3a5c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35), 0 1px 4px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.35);
}

/* 2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background var(--t-theme) var(--ease-out), color var(--t-theme) var(--ease-out);
  -webkit-font-smoothing: antialiased;
}

img   { display: block; max-width: 100%; }
a     { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* 3. LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s6);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* 4. NAVBAR
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-theme) var(--ease-out), border-color var(--t-theme) var(--ease-out);
}

.navbar-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  height: 64px; gap: var(--s4);
}

.nav-logo {
  display: flex; align-items: center;
  gap: var(--s3); color: var(--text);
  font-size: 15px; font-weight: 500;
  letter-spacing: -.01em; flex-shrink: 0;
  transition: opacity var(--t-fast);
}
.nav-logo:hover { opacity: .7; }

.nav-initials {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--text); color: var(--bg);
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700;
  letter-spacing: .03em; flex-shrink: 0;
  transition: background var(--t-theme) var(--ease-out), color var(--t-theme) var(--ease-out);
}

.nav-name { white-space: nowrap; }

.nav-links { display: flex; align-items: center; gap: var(--s1); }

.nav-link {
  padding: var(--s2) var(--s3);
  font-size: 14px; font-weight: 500;
  color: var(--text-muted); border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover { color: var(--text); background: var(--bg-subtle); }

.nav-controls {
  display: flex; align-items: center;
  gap: var(--s2); flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: color var(--t-fast), background var(--t-fast);
}
.theme-toggle:hover { color: var(--text); background: var(--bg-subtle); }
.theme-toggle svg { width: 16px; height: 16px; }

.icon-moon { display: block; }
.icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: block; }

/* Language Switcher */
.lang-switcher { position: relative; }

.lang-btn {
  display: flex; align-items: center; gap: 5px;
  padding: var(--s2) var(--s3);
  font-size: 12px; font-weight: 700;
  letter-spacing: .06em; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.lang-btn:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg-subtle); }
.lang-btn svg { width: 10px; height: 10px; transition: transform var(--t-fast) var(--ease-out); }
.lang-switcher.open .lang-btn svg { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute; top: calc(100% + var(--s2)); right: 0;
  min-width: 76px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 200;
  opacity: 0; transform: translateY(-4px) scale(.97);
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.lang-switcher.open .lang-dropdown {
  opacity: 1; transform: none; pointer-events: auto;
}

.lang-option {
  display: block; width: 100%;
  padding: var(--s2) var(--s4);
  font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-align: left;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.lang-option:hover  { background: var(--bg-subtle); color: var(--text); }
.lang-option.active { color: var(--accent); font-weight: 700; }

/* Hamburger */
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: var(--s2);
}
.nav-hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--text); border-radius: 1px;
  transition: transform var(--t-base) var(--ease-out), opacity var(--t-fast);
}

/* Mobile nav */
.nav-mobile-menu {
  display: none; flex-direction: column; gap: var(--s1);
  padding: var(--s4) var(--s6); border-top: 1px solid var(--border);
}
.nav-mobile-menu.open { display: flex; }

.nav-mobile-link {
  padding: var(--s3) var(--s2); font-size: 15px; font-weight: 500;
  color: var(--text-muted); border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-mobile-link:hover { color: var(--text); background: var(--bg-subtle); }

/* 5. HERO
   ============================================================ */
.hero { padding: var(--s20) 0 var(--s16); }

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s16); align-items: center;
}

.hero-badge {
  position: absolute;
  top: -16px; left: var(--s5);
  z-index: 2;
  display: inline-flex; align-items: center;
  gap: var(--s2); padding: var(--s2) var(--s4);
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-md);
}

.hero-badge-dot {
  width: 7px; height: 7px;
  background: #22c55e; border-radius: 50%;
  flex-shrink: 0; animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  60%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.hero-greeting {
  font-size: 18px; font-weight: 400;
  color: var(--text-muted); margin-bottom: var(--s1);
  letter-spacing: -.01em;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(42px, 5.8vw, 72px);
  font-weight: 900; color: var(--text);
  line-height: 1.02; letter-spacing: -.02em;
  margin-bottom: var(--s4);
}

.hero-title {
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.7vw, 18px);
  font-style: normal; font-weight: 600;
  color: var(--accent); margin-bottom: var(--s6);
  letter-spacing: .005em; line-height: 1.4;
}
.hero-title::before {
  content: ''; flex-shrink: 0;
  width: 26px; height: 2px;
  background: var(--accent); border-radius: 2px;
}

.hero-bio {
  font-size: 15px; color: var(--text-muted);
  line-height: 1.8; max-width: 440px;
  margin-bottom: var(--s8);
}

.hero-actions {
  display: flex; flex-wrap: wrap;
  gap: var(--s3); margin-bottom: var(--s8);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 11px var(--s6); font-size: 14px; font-weight: 600;
  border-radius: var(--r-full); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  letter-spacing: .01em;
}
.btn-primary {
  background: var(--text); color: var(--bg);
  border: 1px solid var(--text);
}
.btn-primary:hover {
  background: var(--accent); border-color: var(--accent);
  transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text); background: var(--bg-subtle);
  transform: translateY(-1px);
}

.hero-socials { display: flex; gap: var(--s3); }

.social-link {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  color: var(--text-muted); border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: color var(--t-fast), border-color var(--t-fast),
              background var(--t-fast), transform var(--t-fast);
}
.social-link:hover {
  color: var(--text); border-color: var(--border-hover);
  background: var(--bg-subtle); transform: translateY(-2px);
}
.social-link svg { width: 16px; height: 16px; }

/* Hero photo/initials */
.hero-photo-wrap { position: relative; }

.hero-photo {
  width: 260px; height: 320px;
  object-fit: cover; border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}

.hero-initials-block {
  width: 260px; height: 320px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 80px; font-weight: 800;
  color: var(--border-hover);
  letter-spacing: -.04em;
  transition: background var(--t-theme), border-color var(--t-theme);
  user-select: none;
}

/* 6. SECTIONS (shared layout)
   ============================================================ */
section { padding: var(--s24) 0; }

.section-header {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--s10); gap: var(--s4);
}

.section-meta { display: flex; flex-direction: column; gap: var(--s2); }

.section-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800; color: var(--text);
  letter-spacing: -.025em; line-height: 1.1;
}

.section-link {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: var(--s1);
  padding-bottom: 2px; border-bottom: 1px solid var(--border);
  transition: color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.section-link:hover { color: var(--text); border-color: var(--text); }

/* Credential / document link (e.g. certificate PDF in About) */
.cred-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s5);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.cred-link:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.cred-link svg.lead { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); transition: color var(--t-fast); }
.cred-link:hover svg.lead { color: var(--accent); }
.cred-link .cred-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.cred-link .cred-label { font-size: 14px; font-weight: 600; color: var(--text); }
.cred-link .cred-sub { font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--text-muted); }
.cred-link svg.arrow { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); opacity: .6; transition: transform var(--t-fast), opacity var(--t-fast); }
.cred-link:hover svg.arrow { transform: translate(2px, -2px); opacity: 1; color: var(--accent); }

/* 7. PROJECTS
   ============================================================ */
#projects {
  background: var(--bg-subtle);
  transition: background var(--t-theme);
}

.projects-grid { display: grid; gap: var(--s6); }

.project-card {
  position: relative;
  display: grid; grid-template-columns: 260px 1fr;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg); transform: translateY(-2px);
}

/* Stretched link — makes the whole card clickable */
.card-stretch::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.project-card a:not(.card-stretch),
.pj-card a:not(.card-stretch) { position: relative; z-index: 2; }

.project-img-wrap {
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; overflow: hidden;
  transition: background var(--t-theme);
}
.project-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.project-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 200px;
  color: var(--border-hover);
}
.project-img-placeholder svg { width: 44px; height: 44px; }

.project-info {
  padding: var(--s8); display: flex;
  flex-direction: column; gap: var(--s4);
}

.project-status {
  font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted);
}

.project-title {
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 700; color: var(--text);
  letter-spacing: -.02em; line-height: 1.2;
}

.project-desc {
  font-size: 14px; color: var(--text-muted); line-height: 1.75;
}

.project-tags {
  display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto;
}

.tag {
  padding: 3px var(--s3); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; color: var(--text-muted);
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--r-full);
  transition: background var(--t-theme), border-color var(--t-theme);
}

.project-links { display: flex; gap: var(--s4); align-items: center; }

.project-link {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: var(--s1);
  transition: color var(--t-fast);
}
.project-link:hover       { color: var(--accent); }
.project-link.primary     { color: var(--accent); }
.project-link.primary:hover { color: var(--accent-hover); }

/* 8. ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--s12); align-items: start;
}

.about-text { display: flex; flex-direction: column; gap: var(--s5); }

.about-text p {
  font-size: 15px; color: var(--text-muted); line-height: 1.85;
}

.about-sub {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700; color: var(--text);
  letter-spacing: -.015em; margin-top: var(--s1);
}

/* Skills sidebar */
.skills-sidebar {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: var(--s4);
}

.skills-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s5);
  transition: background var(--t-theme), border-color var(--t-theme);
}

.skills-card-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: var(--s4);
}

.skills-list { display: flex; flex-direction: column; gap: var(--s3); }

.skill-item {
  display: flex; align-items: center;
  gap: var(--s3); font-size: 13px; font-weight: 500; color: var(--text);
}

.skill-flag {
  width: 20px; height: 14px; object-fit: cover;
  border-radius: 2px; flex-shrink: 0;
}

.skill-level {
  margin-left: auto; font-size: 11px; font-weight: 400;
  color: var(--text-muted); white-space: nowrap;
}

.skills-tags { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* Skill pills with logos */
.tag-skill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  color: var(--text);
}
.skill-logo {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
/* GitHub mark is near-black — flip it in dark mode so it stays visible */
[data-theme="dark"] .skill-logo-mono { filter: invert(1) brightness(1.8); }

/* 9. MODULES
   ============================================================ */
#modules { background: var(--bg-subtle); transition: background var(--t-theme); }

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--s4);
}

.module-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s5);
  display: flex; flex-direction: column; gap: var(--s3);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast),
              background var(--t-theme);
}
.module-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md); transform: translateY(-2px);
}

.module-card-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: var(--s3);
}

.module-number {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--accent); background: var(--accent-light);
  padding: 3px var(--s2); border-radius: var(--r-sm);
  transition: background var(--t-theme);
}

.module-grade-box {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
}
.module-grade-val {
  font-size: 20px; font-weight: 800; color: var(--text);
  letter-spacing: -.03em; line-height: 1;
}
.module-grade-lbl {
  font-size: 9px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
}

.module-title {
  font-size: 13px; font-weight: 500; color: var(--text);
  line-height: 1.5; flex: 1;
}

.module-done {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-size: 11px; font-weight: 600;
  color: #16a34a; letter-spacing: .03em;
}
[data-theme="dark"] .module-done { color: #4ade80; }
.module-done::before {
  content: ''; display: block; width: 6px; height: 6px;
  background: currentColor; border-radius: 50%;
}

.module-coming {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-size: 11px; font-weight: 600;
  color: var(--text-muted); letter-spacing: .03em;
}
.module-coming::before {
  content: ''; display: block; width: 6px; height: 6px;
  background: var(--border-hover); border-radius: 50%;
}

/* 10. CONTACT
   ============================================================ */
.contact-intro {
  font-size: 15px; color: var(--text-muted);
  max-width: 520px; margin-bottom: var(--s10); line-height: 1.8;
}

.contact-grid {
  display: grid; grid-template-columns: 1fr 300px;
  gap: var(--s12); align-items: start;
}

.contact-form { display: flex; flex-direction: column; gap: var(--s5); }

.form-group { display: flex; flex-direction: column; gap: var(--s2); }

.form-label {
  font-size: 13px; font-weight: 600; color: var(--text);
  letter-spacing: .02em;
}

.form-input, .form-textarea {
  width: 100%; padding: var(--s3) var(--s4);
  font-size: 14px; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast),
              background var(--t-theme), color var(--t-theme);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-textarea { min-height: 120px; resize: vertical; line-height: 1.65; }

.contact-sidebar {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: var(--s3);
}

.contact-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s5);
  display: flex; flex-direction: column; gap: var(--s1);
  transition: background var(--t-theme), border-color var(--t-theme);
}

.contact-card-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted);
}
.contact-card-value {
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: color var(--t-fast);
}
a.contact-card-value:hover { color: var(--accent); }

.contact-social-row {
  display: flex; gap: var(--s3); padding: var(--s5);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: background var(--t-theme), border-color var(--t-theme);
}

/* Form status */
.form-status {
  font-size: 13px; padding: var(--s3) var(--s4);
  border-radius: var(--r-md); display: none;
}
.form-status.success {
  display: block; background: #dcfce7;
  color: #166534; border: 1px solid #bbf7d0;
}
.form-status.error {
  display: block; background: #fee2e2;
  color: #991b1b; border: 1px solid #fecaca;
}
[data-theme="dark"] .form-status.success { background: #14532d; color: #86efac; border-color: #166534; }
[data-theme="dark"] .form-status.error   { background: #450a0a; color: #fca5a5; border-color: #991b1b; }

/* 11. FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border); padding: var(--s8) 0;
  transition: border-color var(--t-theme);
}
.footer-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: var(--s4);
}
.footer-text { font-size: 13px; color: var(--text-muted); }
.footer-text strong { color: var(--text); font-weight: 600; }

/* 12. SCROLL ANIMATION (JS-driven)
   ============================================================ */
.reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

/* Hero stagger (CSS) */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.hero-badge    { animation: fadeUp .5s var(--ease-out) both; animation-delay:   0ms; }
.hero-greeting { animation: fadeUp .5s var(--ease-out) both; animation-delay:  60ms; }
.hero-name     { animation: fadeUp .5s var(--ease-out) both; animation-delay: 120ms; }
.hero-title    { animation: fadeUp .5s var(--ease-out) both; animation-delay: 180ms; }
.hero-bio      { animation: fadeUp .5s var(--ease-out) both; animation-delay: 240ms; }
.hero-actions  { animation: fadeUp .5s var(--ease-out) both; animation-delay: 300ms; }
.hero-socials  { animation: fadeUp .5s var(--ease-out) both; animation-delay: 360ms; }

/* 13. RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-inner         { grid-template-columns: 1fr; gap: var(--s10); }
  .hero-initials-block,
  .hero-photo         { width: 200px; height: 240px; }
  .hero-initials-block { font-size: 60px; }
  .about-grid         { grid-template-columns: 1fr; }
  .skills-sidebar     { position: static; }
  .project-card       { grid-template-columns: 1fr; }
  .project-img-wrap   { min-height: 160px; max-height: 200px; }
  .contact-grid       { grid-template-columns: 1fr; }
  .contact-sidebar    { position: static; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .container { padding: 0 var(--s4); }
  section { padding: var(--s16) 0; }
  .hero { padding: var(--s12) 0; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .modules-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--s2); }
}

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

/* 15. PROJECT DETAIL PAGES
   ============================================================ */
.detail-main { padding: calc(64px + var(--s12)) 0 var(--s24); }

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--s8);
  transition: color var(--t-fast), gap var(--t-fast);
}
.detail-back:hover { color: var(--accent); gap: 11px; }
.detail-back svg { width: 14px; height: 14px; }

.detail-head { margin-bottom: var(--s8); }
.detail-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.detail-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: var(--s3) 0 var(--s4);
}
.detail-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 400;
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.5;
}

.detail-hero-img {
  width: 100%;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--s12);
  background: var(--bg-subtle);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--s12);
  align-items: start;
}

.detail-body { display: flex; flex-direction: column; gap: var(--s8); }
.detail-block-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: var(--s4);
}
.detail-body p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: var(--s4);
}
.detail-body p:last-child { margin-bottom: 0; }

.detail-feature-list { display: flex; flex-direction: column; gap: var(--s3); }
.detail-feature {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.6;
}
.detail-feature svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
}
.detail-feature strong { font-weight: 600; }

.detail-tags { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* Sidebar with links & downloads */
.detail-sidebar { position: sticky; top: 88px; display: flex; flex-direction: column; gap: var(--s4); }
.detail-links-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s6);
  transition: background var(--t-theme), border-color var(--t-theme);
}
.detail-links-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s4);
}
.detail-link-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-top: 1px solid var(--border);
  transition: color var(--t-fast), padding-left var(--t-fast);
}
.detail-link-row:first-of-type { border-top: none; }
.detail-link-row:hover { color: var(--accent); padding-left: 4px; }
.detail-link-row svg.lead { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-muted); transition: color var(--t-fast); }
.detail-link-row:hover svg.lead { color: var(--accent); }
.detail-link-row .lr-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.detail-link-row .lr-label { font-weight: 600; }
.detail-link-row .lr-sub { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.detail-link-row svg.arrow { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); opacity: .6; transition: transform var(--t-fast), opacity var(--t-fast); }
.detail-link-row:hover svg.arrow { transform: translate(2px, -2px); opacity: 1; }

.detail-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  width: 100%;
  padding: 12px var(--s5);
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.detail-cta:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.detail-cta svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; gap: var(--s8); }
  .detail-sidebar { position: static; }
}

/* 16. CODE SNIPPET CARD (spoken languages)
   ============================================================ */
:root {
  --code-bg:    #f6f7f9;
  --code-head:  #eceef1;
  --code-text:  #383a42;
  --tok-kw:     #a626a4;  /* const           */
  --tok-var:    #b76b01;  /* variable name   */
  --tok-prop:   #4078f2;  /* object keys     */
  --tok-str:    #50a14f;  /* string values   */
  --tok-pun:    #8a8f99;  /* punctuation     */
}
[data-theme="dark"] {
  --code-bg:    #0b1120;
  --code-head:  #141d31;
  --code-text:  #c5cee0;
  --tok-kw:     #c678dd;
  --tok-var:    #e5c07b;
  --tok-prop:   #61afef;
  --tok-str:    #98c379;
  --tok-pun:    #7d869c;
}

.code-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--code-bg);
  transition: background var(--t-theme), border-color var(--t-theme);
}
.code-card-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 9px var(--s4);
  background: var(--code-head);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-theme), border-color var(--t-theme);
}
.code-dots { display: inline-flex; gap: 6px; }
.code-dots i {
  width: 11px; height: 11px; border-radius: 50%;
  display: block;
}
.code-dots i:nth-child(1) { background: #ff5f56; }
.code-dots i:nth-child(2) { background: #ffbd2e; }
.code-dots i:nth-child(3) { background: #27c93f; }
.code-file {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .02em;
}
.code-body {
  margin: 0;
  padding: var(--s4) var(--s5);
  overflow-x: auto;
  background: var(--code-bg);
}
.code-body code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--code-text);
  white-space: pre;
  display: block;
  tab-size: 2;
}
.tok-kw   { color: var(--tok-kw);   font-weight: 600; }
.tok-var  { color: var(--tok-var);  }
.tok-prop { color: var(--tok-prop); }
.tok-str  { color: var(--tok-str);  }
.tok-op,
.tok-pun  { color: var(--tok-pun);  }

/* 17. TYPEWRITER GREETING
   ============================================================ */
.hero-greeting .typed { color: var(--text); font-weight: 500; }
.type-caret {
  display: inline-block;
  width: 2px; height: 1.05em;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: -0.12em;
  animation: caretBlink 1.05s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .type-caret { display: none; }
}

/* 18. BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s8);
  font-size: 13px; font-weight: 500;
}
.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--t-fast);
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .crumb-sep { color: var(--text-muted); opacity: .45; }
.breadcrumb .crumb-current { color: var(--text); font-weight: 600; }
