:root {
  --bg: #070b11;
  --bg-elev: #0d131f;
  --bg-card: rgba(15, 22, 36, 0.86);
  --bg-card-solid: #0f1624;
  --bg-subtle: rgba(255, 255, 255, 0.035);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(56, 189, 248, 0.35);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-soft: #cbd5e1;
  --accent: #38bdf8;
  --accent-2: #d4af68;
  --accent-grad: linear-gradient(135deg, #38bdf8 0%, #60a5fa 45%, #d4af68 100%);
  --gold-grad: linear-gradient(135deg, #e5c98e 0%, #c9a156 100%);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.48);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
  --nav-bg: rgba(7, 11, 17, 0.82);
  --grid-line: rgba(148, 163, 184, 0.055);
  --badge-bg: rgba(56, 189, 248, 0.11);
  --badge-text: #7dd3fc;
  --gold-bg: rgba(212, 175, 104, 0.12);
  --gold-text: #e6cb92;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-ar: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', sans-serif;
}

[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-solid: #ffffff;
  --bg-subtle: rgba(23, 72, 102, 0.045);
  --border: rgba(23, 72, 102, 0.14);
  --border-strong: rgba(23, 72, 102, 0.35);
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #334155;
  --accent: #174866;
  --accent-2: #b48636;
  --accent-grad: linear-gradient(135deg, #174866 0%, #0284c7 55%, #b48636 100%);
  --gold-grad: linear-gradient(135deg, #174866 0%, #0f364d 100%);
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
  --nav-bg: rgba(246, 248, 251, 0.88);
  --grid-line: rgba(23, 72, 102, 0.045);
  --badge-bg: rgba(23, 72, 102, 0.08);
  --badge-text: #174866;
  --gold-bg: rgba(180, 134, 54, 0.1);
  --gold-text: #946920;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color 0.28s ease, color 0.28s ease;
}

html[lang="ar"] body {
  font-family: var(--font-ar);
}

html[lang="ar"] .rtl-zone {
  direction: rtl;
  text-align: right;
}

html[lang="ar"] .rtl-zone .project-stack,
html[lang="ar"] .rtl-zone .exp-tags,
html[lang="ar"] .rtl-zone .skill-pills {
  direction: rtl;
}

/* Ambient tech-luxury background */
.bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(circle at 12% 14%, rgba(56, 189, 248, 0.13), transparent 42%),
    radial-gradient(circle at 86% 18%, rgba(212, 175, 104, 0.11), transparent 38%),
    radial-gradient(circle at 50% 92%, rgba(56, 189, 248, 0.08), transparent 44%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 56px 56px, 56px 56px;
}

[data-theme="light"] .bg-canvas {
  background-image:
    radial-gradient(circle at 14% 12%, rgba(2, 132, 199, 0.08), transparent 40%),
    radial-gradient(circle at 88% 16%, rgba(180, 134, 54, 0.08), transparent 38%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 56px 56px, 56px 56px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 70px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1rem;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-grad);
  color: #070b11;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
}

[data-theme="light"] .brand-mark {
  color: #ffffff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-subtle);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.lang-btn.active {
  background: var(--accent);
  color: #070b11;
}

[data-theme="light"] .lang-btn.active {
  color: #ffffff;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 11px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent-grad);
  color: #060a10;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(56, 189, 248, 0.22);
}

[data-theme="light"] .btn-primary {
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(23, 72, 102, 0.22);
}

.btn-gold {
  background: var(--gold-grad);
  color: #0b0e14;
  font-weight: 700;
  padding: 8px 14px;
  font-size: 0.82rem;
}

[data-theme="light"] .btn-gold {
  color: #ffffff;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.mobile-menu-btn {
  display: none;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--bg-card-solid);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 22px;
  z-index: 55;
  box-shadow: var(--shadow);
}

.mobile-drawer.open {
  display: block;
}

.mobile-drawer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-drawer a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  background: var(--bg-subtle);
}

/* Hero */
.hero {
  padding: 58px 0 46px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 36px;
  align-items: center;
}

.hero-grid > *,
.projects-grid > *,
.timeline > *,
.skills-grid > *,
.edu-grid > *,
.contact-grid > * {
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 18px;
  max-width: 100%;
  line-height: 1.35;
}

[data-theme="light"] .status-pill {
  background: rgba(5, 150, 105, 0.1);
  color: #047857;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.22);
  animation: pulseDot 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); }
  50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.08); }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 8px;
  display: block;
}

html[lang="ar"] .eyebrow {
  font-family: var(--font-ar);
  letter-spacing: 0.04em;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.85rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
}

html[lang="ar"] .hero-name {
  font-family: var(--font-ar);
  letter-spacing: 0;
  line-height: 1.2;
}

.hero-role {
  font-size: clamp(1.06rem, 2vw, 1.32rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-bio {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 620px;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  backdrop-filter: blur(10px);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Terminal Card */
.terminal-card {
  background: #090e17;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  direction: ltr;
  text-align: left;
}

[data-theme="light"] .terminal-card {
  background: #0f172a;
  border-color: rgba(23, 72, 102, 0.28);
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.terminal-dots {
  display: flex;
  gap: 7px;
}

.terminal-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ef4444; }
.terminal-dots span:nth-child(2) { background: #f59e0b; }
.terminal-dots span:nth-child(3) { background: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: #94a3b8;
}

.terminal-body {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.7;
  color: #e2e8f0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  max-width: 100%;
}

.t-key { color: #7dd3fc; }
.t-str { color: #e6cb92; }
.t-bool { color: #34d399; }
.t-punc { color: #64748b; }

/* Sections */
section.band {
  padding: 56px 0;
}

.section-head {
  margin-bottom: 28px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.2vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

html[lang="ar"] .section-heading {
  font-family: var(--font-ar);
  letter-spacing: 0;
}

.section-sub {
  color: var(--text-muted);
  max-width: 660px;
  font-size: 0.96rem;
}

/* Filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #070b11;
}

[data-theme="light"] .filter-btn.active {
  color: #ffffff;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.project-media {
  position: relative;
  height: 196px;
  overflow: hidden;
  background: linear-gradient(135deg, #0b1322 0%, #16243b 100%);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.project-card:hover .project-media img {
  transform: scale(1.05);
}

.project-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(212, 175, 104, 0.18), transparent 55%),
    #0b1220;
  color: #7dd3fc;
}

.project-media-placeholder span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #cbd5e1;
  letter-spacing: 0.08em;
}

.project-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.pill-platform {
  background: rgba(7, 11, 17, 0.8);
  backdrop-filter: blur(8px);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.pill-kind {
  background: rgba(212, 175, 104, 0.9);
  color: #0b0e14;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
}

.project-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.32;
}

html[lang="ar"] .project-title {
  font-family: var(--font-ar);
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
  flex: 1;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid transparent;
}

.project-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.project-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.82rem;
}

/* Experience Timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.exp-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.exp-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--gold-text);
  border: 1px solid rgba(212, 175, 104, 0.25);
}

html[lang="ar"] .exp-period {
  font-family: var(--font-ar);
}

.exp-company {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.exp-role {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

html[lang="ar"] .exp-role {
  font-family: var(--font-ar);
}

.exp-loc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.exp-bullets {
  padding-inline-start: 18px;
  margin-bottom: 16px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.exp-bullets li {
  margin-bottom: 6px;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

html[lang="ar"] .skill-card h3 {
  font-family: var(--font-ar);
}

.skill-card h3::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent-grad);
  flex-shrink: 0;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-pill {
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-soft);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.skill-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

/* Education */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.edu-card h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  margin: 10px 0 4px;
}

html[lang="ar"] .edu-card h3 {
  font-family: var(--font-ar);
}

.edu-school {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.edu-details {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Contact */
.contact-shell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 26px 0 24px;
}

.contact-tile {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s, transform 0.2s;
}

.contact-tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.contact-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.contact-val {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text);
  word-break: break-word;
  text-decoration: none;
}

.contact-mini-btn {
  margin-top: 6px;
  align-self: flex-start;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
}

.contact-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Footer */
footer {
  padding: 28px 0 42px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
  border-top: 1px solid var(--border);
  margin-top: 28px;
}

/* Project Detail Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 14, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}

.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.modal-gallery img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.modal-section-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin: 14px 0 8px;
}

.modal-list {
  padding-inline-start: 18px;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.modal-list li {
  margin-bottom: 7px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 120;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .nav-links,
  .nav-cv-desktop {
    display: none;
  }
  .mobile-menu-btn {
    display: grid;
  }
  .timeline,
  .skills-grid,
  .edu-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 14px;
  }
  .nav-inner {
    gap: 8px;
    height: 64px;
  }
  .brand {
    gap: 8px;
    font-size: 0.86rem;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }
  .nav-controls {
    gap: 5px;
  }
  .lang-btn {
    font-size: 0.7rem;
    padding: 4px 7px;
  }
  .icon-btn {
    width: 33px;
    height: 33px;
  }
  .status-pill {
    border-radius: 14px;
    font-size: 0.74rem;
    padding: 6px 12px;
  }
  .hero {
    padding: 32px 0 28px;
  }
  .hero-actions .btn {
    flex: 1 1 auto;
    padding: 10px 14px;
    font-size: 0.84rem;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .contact-shell {
    padding: 22px 16px;
  }
  .terminal-body {
    padding: 14px 15px;
    font-size: 0.72rem;
  }
}
