/* === Variables === */
/* Light theme (default) */
:root {
  --bg: #f6f6fb;
  --bg2: #ececf5;
  --card: #ffffff;
  --card-h: #f5f4fb;
  --border: rgba(124,111,247,0.16);
  --border-h: rgba(124,111,247,0.32);
  --accent: #7c6ff7;
  --accent-b: #6650e0;
  --accent-dim: rgba(124,111,247,0.1);
  --accent-glow: rgba(124,111,247,0.25);
  --text: #1c1a30;
  --text-m: #5b5876;
  --text-d: #9794ad;
  --live: #0a9b6c;
  --live-bg: rgba(10,155,108,0.1);
  --done: #2563eb;
  --done-bg: rgba(37,99,235,0.1);
  --dev: #c2790a;
  --dev-bg: rgba(194,121,10,0.1);
  --mvp: #0891b2;
  --mvp-bg: rgba(8,145,178,0.1);
  --pause: #dc2626;
  --pause-bg: rgba(220,38,38,0.1);
  --nav-bg: rgba(246,246,251,0.8);
  --nav-bg-solid: rgba(246,246,251,0.97);
  --overlay-btn-bg: rgba(255,255,255,0.6);
  --r: 14px;
  --r-lg: 22px;
  --t: 0.28s ease;
  --nav-h: 64px;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0b0b12;
  --bg2: #10101a;
  --card: #14141f;
  --card-h: #1a1a2e;
  --border: rgba(140,130,255,0.1);
  --border-h: rgba(140,130,255,0.22);
  --accent: #7c6ff7;
  --accent-b: #a096ff;
  --accent-dim: rgba(124,111,247,0.18);
  --accent-glow: rgba(124,111,247,0.35);
  --text: #e8e6ff;
  --text-m: #9896b8;
  --text-d: #5c5a7a;
  --live: #00e5a0;
  --live-bg: rgba(0,229,160,0.12);
  --done: #60a5fa;
  --done-bg: rgba(96,165,250,0.12);
  --dev: #fbbf24;
  --dev-bg: rgba(251,191,36,0.12);
  --mvp: #22d3ee;
  --mvp-bg: rgba(34,211,238,0.12);
  --pause: #f87171;
  --pause-bg: rgba(248,113,113,0.12);
  --nav-bg: rgba(11,11,18,0.8);
  --nav-bg-solid: rgba(11,11,18,0.97);
  --overlay-btn-bg: rgba(11,11,18,0.55);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--t), color var(--t);
}
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }
a { color: inherit; text-decoration: none; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 99px; }

/* === Navbar === */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t);
}
#navbar.scrolled { border-bottom-color: var(--border); }

.nav-logo {
  font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-b), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex; align-items: center; gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.9rem; color: var(--text-m);
  transition: color var(--t);
}
.nav-links a:hover { color: var(--text); }

.nav-right { display: flex; align-items: center; gap: 1rem; }

.lang-toggle {
  display: flex; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 2px;
}
.lang-btn {
  padding: 4px 10px; border-radius: 6px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-m);
  transition: all var(--t);
}
.lang-btn.active {
  background: var(--accent-dim); color: var(--accent-b);
}

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-m); transition: all var(--t);
}
.theme-toggle:hover { border-color: var(--border-h); background: var(--card-h); color: var(--accent-b); }
.theme-toggle .theme-icon { display: flex; }
.theme-toggle .theme-icon svg { width: 16px; height: 16px; }
.theme-toggle .theme-icon-moon { display: none; }
.theme-toggle.is-dark .theme-icon-sun { display: none; }
.theme-toggle.is-dark .theme-icon-moon { display: flex; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 4px; }
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-m); border-radius: 2px;
  transition: all var(--t);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--nav-bg-solid); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 5%; z-index: 99;
  flex-direction: column; gap: 1.2rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { font-size: 1rem; color: var(--text-m); padding: 0.4rem 0; }
.mobile-nav-controls { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }

/* === Sections === */
section { padding: 100px 5%; }
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.section-sub {
  color: var(--text-m); font-size: 1rem;
  margin-bottom: 3rem;
}

/* === About / Hero (merged) === */
#about {
  position: relative; overflow: hidden;
  padding: calc(var(--nav-h) + 56px) 5% 100px;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 78% 30%, rgba(124,111,247,0.14) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 15% 80%, rgba(96,165,250,0.08) 0%, transparent 60%);
}

.about-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-areas:
    "badge  photo"
    "name   photo"
    "bio    photo"
    "skills photo"
    "btns   photo";
  column-gap: 4.5rem; row-gap: 1.1rem;
  align-items: start;
}

.ah-badge { grid-area: badge; margin-bottom: 0; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-dim); border: 1px solid var(--border-h);
  border-radius: 99px; padding: 5px 14px;
  font-size: 0.82rem; color: var(--accent-b); font-weight: 500;
}
.hero-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-b);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ah-name { grid-area: name; margin-bottom: 0; }
.hero-name {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800; letter-spacing: -0.04em;
  line-height: 1.1;
}
.hero-name span {
  background: linear-gradient(135deg, var(--accent-b) 0%, var(--accent) 60%, #c084fc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.ah-bio { grid-area: bio; margin: 0; max-width: 600px; font-size: 1.05rem; }
.about-bio { color: var(--text-m); line-height: 1.75; margin-bottom: 1.5rem; }

.ah-skills { grid-area: skills; margin-bottom: 0; }
.skills-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-chip {
  background: var(--accent-dim); border: 1px solid var(--border-h);
  color: var(--accent-b); padding: 5px 14px;
  border-radius: 99px; font-size: 0.82rem; font-weight: 500;
  transition: all var(--t);
}
.skill-chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent); box-shadow: 0 6px 16px var(--accent-glow);
}

.ah-btns { grid-area: btns; }
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent); color: #fff;
  padding: 12px 28px; border-radius: 10px;
  font-size: 0.95rem; font-weight: 600;
  transition: all var(--t);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-b);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}
.btn-secondary {
  background: var(--card); border: 1px solid var(--border-h);
  color: var(--text); padding: 12px 28px; border-radius: 10px;
  font-size: 0.95rem; font-weight: 600;
  transition: all var(--t);
}
.btn-secondary:hover {
  background: var(--card-h); border-color: var(--accent);
  transform: translateY(-2px);
}

/* Photo column: portrait card + playful sticker + floating stats */
.ah-photo { grid-area: photo; position: relative; }
.ah-photo::before {
  content: ''; position: absolute; inset: -15% -20% 5%;
  background:
    radial-gradient(circle at 28% 25%, rgba(124,111,247,0.4), transparent 60%),
    radial-gradient(circle at 80% 85%, rgba(96,165,250,0.3), transparent 55%);
  filter: blur(34px); z-index: 0;
}
.about-photo-wrap {
  position: relative; z-index: 1;
  width: 100%; aspect-ratio: 4 / 4.6;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
}
.about-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.about-photo-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--accent-dim), rgba(96,165,250,0.1));
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-b);
}
.about-photo-placeholder svg { width: 25%; height: 25%; }
.ah-sticker {
  position: absolute; top: -14px; right: -14px; z-index: 2;
  background: linear-gradient(135deg, var(--accent-b), var(--accent));
  color: #fff; font-size: 0.78rem; font-weight: 700;
  padding: 9px 16px; border-radius: 14px; max-width: 190px;
  box-shadow: 0 12px 26px var(--accent-glow);
  transform: rotate(-6deg);
  animation: sticker-float 5s ease-in-out infinite;
}
@keyframes sticker-float {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(-4px); }
}
.ah-stats {
  position: absolute; z-index: 2;
  left: 50%; bottom: -26px; transform: translateX(-50%);
  width: 86%; display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}
.ah-stats > div:not(.ah-stats-divider) { flex: 1; text-align: center; }
.ah-stats .stat-value { font-size: 1.3rem; }
.ah-stats .stat-label { font-size: 0.68rem; }
.ah-stats-divider { width: 1px; height: 26px; background: var(--border); flex-shrink: 0; }
.stat-value {
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-b), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.82rem; color: var(--text-m); }

/* Shared name/bio styles (also used by Contacts section) */
.about-name {
  font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}

/* === Portfolio === */
#portfolio {}

.category-tabs {
  display: flex; gap: 4px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px;
  margin-bottom: 2.5rem; width: fit-content;
}
.tab-btn {
  padding: 8px 24px; border-radius: 9px;
  font-size: 0.9rem; font-weight: 600; color: var(--text-m);
  transition: all var(--t);
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.tab-btn:hover:not(.active) { color: var(--text); }

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  align-items: start;
}
@media (max-width: 980px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* Card */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  transition: all var(--t);
  display: flex; flex-direction: column;
}
.card:hover {
  border-color: var(--border-h);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* Horizontal (default) layout: title + text on top, image below, read-more at the bottom */
.card-media-wrap { padding: 0 1.8rem 1.6rem; }

/* Vertical (mobile-app) layout: title + text left, image right */
.card-vertical {
  display: grid;
  grid-template-columns: 1fr min(40%, 359px);
  column-gap: 1.2rem;
  align-items: start;
  align-self: start;
  max-height: 800px;
  overflow: hidden;
}
.card-vertical .card-info { min-width: 0; }
.card-vertical .card-media-wrap {
  padding: 1.6rem 1.4rem 1.6rem 0; box-sizing: border-box;
}
.card-vertical .card-carousel { width: 100%; height: auto; aspect-ratio: 9 / 20; max-height: calc(800px - 3.2rem); min-height: unset; }
@media (max-width: 768px) {
  .card-vertical { grid-template-columns: 1fr; column-gap: 0; }
  .card-vertical .card-media-wrap { grid-column: 1; padding: 1rem 1.6rem 1.4rem; display: flex; justify-content: center; }
  .card-vertical .card-carousel { height: auto; aspect-ratio: 9 / 20; width: 55%; flex-shrink: 0; }
}

/* Card carousel */
.card-carousel {
  position: relative; height: 260px; overflow: hidden;
  background: var(--bg2); flex-shrink: 0; cursor: pointer;
  border-radius: var(--r-lg);
}
.carousel-track {
  display: flex; height: 100%;
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}
.carousel-slide {
  min-width: 100%; height: 100%; object-fit: cover;
}
.carousel-slide.contain { object-fit: contain; background: var(--bg2); }
.card-placeholder {
  height: 260px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--card-h), var(--bg2));
  color: var(--text-d);
}
.card-placeholder svg { width: 46px; height: 46px; }
.carousel-btn {
  position: absolute; top: 0; bottom: 0;
  width: 68px; border: none;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--t);
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.card-vertical .card-carousel .carousel-btn { width: 46px; }
.card-carousel:hover .carousel-btn { opacity: 1; }
.carousel-btn.prev {
  left: 0; border-radius: var(--r-lg) 0 0 var(--r-lg);
  background: linear-gradient(to right, rgba(255,255,255,0.22), rgba(255,255,255,0));
  -webkit-mask-image: linear-gradient(to right, black, transparent);
  mask-image: linear-gradient(to right, black, transparent);
}
.carousel-btn.next {
  right: 0; border-radius: 0 var(--r-lg) var(--r-lg) 0;
  background: linear-gradient(to left, rgba(255,255,255,0.22), rgba(255,255,255,0));
  -webkit-mask-image: linear-gradient(to left, black, transparent);
  mask-image: linear-gradient(to left, black, transparent);
}
.carousel-btn::before {
  content: ''; width: 16px; height: 16px;
  border-right: 3.5px solid #fff;
  border-bottom: 3.5px solid #fff;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.85)) drop-shadow(0 0 8px rgba(0,0,0,0.55));
  transition: border-color var(--t), filter var(--t);
}
.carousel-btn:hover::before {
  border-color: var(--accent-b);
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.9)) drop-shadow(0 0 9px rgba(0,0,0,0.6));
}
.carousel-btn.prev::before { transform: rotate(135deg); margin-left: 10px; }
.carousel-btn.next::before { transform: rotate(-45deg); margin-right: 10px; }
.carousel-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.35); cursor: pointer;
  transition: all var(--t);
}
.dot.active { background: var(--accent-b); width: 18px; border-radius: 3px; }

/* Card body */
.card-info {
  padding: 1.6rem 1.8rem 1.4rem; display: flex; flex-direction: column; gap: 1rem;
  flex: 1;
}

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.card-title { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }

.status-badge {
  font-size: 0.76rem; font-weight: 600;
  padding: 4px 11px; border-radius: 99px;
  white-space: nowrap; flex-shrink: 0;
}
.status-live   { background: var(--live-bg);  color: var(--live);  border: 1px solid rgba(0,229,160,0.25); }
.status-completed { background: var(--done-bg); color: var(--done); border: 1px solid rgba(96,165,250,0.25); }
.status-in-development { background: var(--dev-bg); color: var(--dev); border: 1px solid rgba(251,191,36,0.25); }
.status-mvp { background: var(--mvp-bg); color: var(--mvp); border: 1px solid rgba(34,211,238,0.25); }
.status-paused { background: var(--pause-bg); color: var(--pause); border: 1px solid rgba(248,113,113,0.25); }

.card-desc { font-size: 1.1rem; color: var(--text-m); line-height: 1.65; }

.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tags-row { margin-bottom: 4px; }
.tag-chip {
  font-size: 0.76rem; font-weight: 700; font-family: var(--font-mono, 'Courier New', monospace);
  background: var(--accent-dim); border: 1.5px solid var(--border-h);
  color: var(--accent-b); padding: 2px 9px; border-radius: 4px;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.chip {
  font-size: 0.8rem; font-weight: 500;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text-m); padding: 4px 11px; border-radius: 6px;
}

.card-meta { display: flex; flex-direction: column; gap: 0.5rem; }
.meta-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.88rem; color: var(--text-m);
}
.meta-icon { display: flex; flex-shrink: 0; margin-top: 1px; }
.meta-icon svg { width: 15px; height: 15px; display: block; }
.integrations-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.int-chip {
  font-size: 0.8rem; font-weight: 500;
  background: var(--accent-dim); border: 1px solid var(--border-h);
  color: var(--accent-b);
  padding: 4px 11px; border-radius: 6px;
}

/* Read more accordion */
.full-desc-details summary {
  cursor: pointer; list-style: none;
  font-size: 0.88rem; font-weight: 600; color: var(--accent-b);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
}
.full-desc-details summary::-webkit-details-marker { display: none; }
.full-desc-details summary .chevron {
  flex-shrink: 0; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform var(--t);
}
.full-desc-details[open] summary .chevron { transform: rotate(225deg); }
.full-desc-details summary:hover { color: var(--text); }
.card-full-desc {
  font-size: 0.92rem; color: var(--text-m); line-height: 1.7;
  margin-top: 0.7rem; white-space: pre-line;
}

.card-link-line {
  display: flex; align-items: center; gap: 6px;
  color: var(--accent-b); font-size: 0.86rem; font-weight: 600;
  text-decoration: none; width: fit-content;
  transition: color var(--t);
}
.card-link-line .link-icon { display: flex; line-height: 1; }
.card-link-line .link-icon svg { width: 15px; height: 15px; display: block; }
.card-link-line:hover { color: var(--text); text-decoration: underline; }

.no-projects {
  grid-column: 1/-1; text-align: center;
  padding: 4rem; color: var(--text-d);
}
.no-projects-icon { display: flex; justify-content: center; margin-bottom: 1rem; color: var(--text-d); }
.no-projects-icon svg { width: 48px; height: 48px; }

/* === Contacts === */
#contacts { background: var(--bg2); }
.contacts-inner {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: start;
}
.contacts-info-list { display: flex; flex-direction: column; gap: 1rem; }
.contact-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); transition: all var(--t);
  text-decoration: none;
}
.contact-item:hover { border-color: var(--border-h); transform: translateX(4px); }
.contact-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-dim); display: flex; align-items: center; justify-content: center;
  color: var(--accent-b); flex-shrink: 0;
  transition: all var(--t);
}
.contact-icon svg { width: 19px; height: 19px; }
.contact-item:hover .contact-icon { background: var(--accent); color: #fff; }
.contact-label { font-size: 0.78rem; color: var(--text-d); }
.contact-value { font-size: 0.92rem; font-weight: 500; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.82rem; color: var(--text-m); }
.form-group input,
.form-group textarea {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px;
  border-radius: 10px; font: inherit; font-size: 0.9rem;
  resize: vertical; outline: none;
  transition: border-color var(--t);
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 120px; }
.form-submit {
  background: var(--accent); color: #fff;
  padding: 11px 24px; border-radius: 10px;
  font-size: 0.92rem; font-weight: 600;
  transition: all var(--t);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.form-submit:hover {
  background: var(--accent-b); transform: translateY(-2px);
}
.form-msg { font-size: 0.85rem; padding: 8px 12px; border-radius: 8px; display: none; }
.form-msg.success { background: var(--live-bg); color: var(--live); display: block; }
.form-msg.error { background: var(--pause-bg); color: var(--pause); display: block; }

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--card); border: 1px solid var(--border-h);
  border-radius: var(--r-lg);
  width: 100%; max-width: 720px; max-height: 88vh;
  overflow-y: auto; display: flex; flex-direction: column;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--t);
}
.modal-overlay.open .modal { transform: none; }

/* Lightbox (screenshots-only carousel) */
.lightbox-modal {
  position: relative;
  max-width: 1040px; max-height: 90vh;
  background: transparent; border: none; overflow: visible;
}
.lightbox-close {
  position: absolute; top: -16px; right: -16px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border-h);
  color: var(--text); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.lightbox-close:hover { background: var(--accent); color: #fff; }
.lightbox-carousel {
  position: relative; height: min(75vh, 700px); overflow: hidden;
  background: var(--bg2); border-radius: var(--r-lg);
  border: 1px solid var(--border-h);
}
.lightbox-carousel.vertical { height: min(82vh, 760px); }

/* Lightbox zoom transition */
.lightbox-carousel .carousel-slide {
  transition: transform 0.2s ease;
  transform-origin: center center;
}

/* Lightbox toolbar (zoom & fullscreen) */
.lb-toolbar {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  gap: 6px;
}
.lb-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lb-btn:hover { background: var(--accent); border-color: var(--accent); }
.lb-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

@media (max-width: 600px) {
  .lightbox-close { top: -14px; right: 4px; }
  .lightbox-carousel { height: min(70vh, 600px); }
  .lb-toolbar { bottom: 8px; right: 8px; gap: 4px; }
  .lb-btn { width: 32px; height: 32px; }
  .lb-btn svg { width: 14px; height: 14px; }
}

/* Fullscreen lightbox */
.modal-overlay:fullscreen,
.modal-overlay:-webkit-full-screen {
  padding: 0;
  background: #000;
}
.modal-overlay:fullscreen .lightbox-modal,
.modal-overlay:-webkit-full-screen .lightbox-modal {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
}
.modal-overlay:fullscreen .lightbox-carousel,
.modal-overlay:-webkit-full-screen .lightbox-carousel {
  height: 100%;
  border-radius: 0;
  border: none;
}
.modal-overlay:fullscreen .lightbox-close,
.modal-overlay:-webkit-full-screen .lightbox-close {
  top: 12px;
  right: 12px;
}

/* === Footer === */
footer {
  text-align: center; padding: 2rem;
  color: var(--text-d); font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

/* === Mobile carousel mode === */
@media (max-width: 768px) {
  .cards-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 1rem;
    scrollbar-width: none;
  }
  .cards-grid::-webkit-scrollbar { display: none; }
  .card {
    min-width: 82vw; max-width: 82vw;
    scroll-snap-align: start; flex-shrink: 0;
    transform: none !important;
  }
  .card:last-child { margin-right: 5vw; }

  /* Scroll indicator */
  .carousel-hint {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem; color: var(--text-d);
    margin-bottom: 1rem;
  }
  .carousel-hint-dots {
    display: flex; gap: 4px;
  }
  .carousel-hint-dots span {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--text-d);
  }
  .carousel-hint-dots span:first-child { background: var(--accent); }
}

/* === Responsive === */
@media (max-width: 900px) {
  .about-hero {
    grid-template-columns: 1fr;
    grid-template-areas: "badge" "photo" "name" "bio" "skills" "btns";
    row-gap: 1.4rem;
  }
  .ah-photo { max-width: 320px; width: 100%; justify-self: center; margin-bottom: 30px; }
  .ah-bio { max-width: none; }
  .contacts-inner { grid-template-columns: 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  section { padding: 70px 5%; }
  #about { padding: calc(var(--nav-h) + 36px) 5% 60px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .carousel-hint { display: none; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 2rem; }
  .ah-sticker { top: -10px; right: -6px; font-size: 0.7rem; padding: 7px 12px; max-width: 130px; }
  .ah-stats { padding: 10px 6px; width: 92%; }
  .ah-stats .stat-value { font-size: 1.1rem; }
  .modal-body { padding: 1.2rem; }
  .modal-grid { grid-template-columns: 1fr; }
}
