/* Stable header and About layouts. Loaded last to isolate them from legacy CSS. */

/* Header ------------------------------------------------------------------ */
.header {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  z-index: 1000;
}

.navbar-custom {
  min-height: 72px;
}

.navbar-custom .nav-shell {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(22px, 3vw, 44px);
  min-height: 76px;
  width: min(calc(100% - 64px), 1320px);
}

.navbar-custom .navbar-brand {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  width: max-content;
  padding: 10px 0;
  float: none !important;
}

.navbar-custom .navbar-brand > img {
  width: 148px;
  height: auto;
}

.navbar-custom .navbar-collapse {
  display: block !important;
  grid-column: 2;
  grid-row: 1;
  width: min(100%, 720px);
  min-width: 0;
  padding: 0;
  justify-self: center;
  visibility: visible;
  overflow: visible;
}

.navbar-custom .navbar-nav {
  display: flex !important;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 0.55vw, 8px);
  width: 100%;
  margin: 0 !important;
  padding: 0;
  float: none !important;
}

[dir="rtl"] .navbar-custom .navbar-nav { justify-content: center; }

.navbar-custom .navbar-nav > li {
  flex: 0 0 auto;
  float: none !important;
}

.navbar-custom .navbar-nav > li > a {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px clamp(12px, 1.25vw, 18px);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.navbar-custom .navbar-nav > li > a::after { display: none; }

.navbar-custom .navbar-nav > li.active > a,
.navbar-custom .navbar-nav > li > a:hover {
  color: var(--title-color);
  background: var(--indigo-dim);
}

.nav-language {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px !important;
  border: 1px solid var(--border-md) !important;
  border-radius: var(--radius-full) !important;
  color: var(--indigo-light) !important;
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.navbar-custom .theme-toggle-button,
.nav-mobile-actions .theme-toggle-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.nav-mobile-actions {
  display: flex;
  grid-column: 3;
  grid-row: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.navbar-custom .navbar-toggle { display: none; }

/* Hero -------------------------------------------------------------------- */
#home {
  min-height: 720px;
  height: max(720px, 100svh);
  padding: 112px 0 78px;
  background:
    radial-gradient(circle at 15% 24%, rgba(99, 102, 241, 0.19), transparent 34%),
    radial-gradient(circle at 82% 70%, rgba(34, 211, 238, 0.11), transparent 30%),
    var(--bg);
}

#home::before {
  background: linear-gradient(180deg, rgba(6, 10, 20, 0.08), rgba(6, 10, 20, 0.34));
}

#home::after {
  content: "";
  position: absolute;
  inset: 12% auto auto 52%;
  z-index: 1;
  width: min(42vw, 590px);
  aspect-ratio: 1;
  border: 1px solid rgba(99, 102, 241, 0.10);
  border-radius: 50%;
  box-shadow:
    0 0 0 60px rgba(99, 102, 241, 0.025),
    0 0 0 120px rgba(34, 211, 238, 0.018);
  pointer-events: none;
}

.hero-layout {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  align-items: center;
  gap: clamp(46px, 7vw, 94px);
}

.intro.hero-copy {
  width: auto;
  max-width: 650px;
  margin: 0;
  padding: 0;
  text-align: start;
}

.hero-copy .hero-badge {
  margin-bottom: 24px;
}

.hero-copy .intro-sub {
  width: fit-content;
  margin: 0 0 16px;
  color: var(--indigo-light);
  font-size: clamp(13px, 1.5vw, 16px);
  text-shadow: none;
}

.hero-copy h1 {
  max-width: 690px;
  margin: 0 0 24px;
  color: var(--title-color);
  background: none;
  font-size: clamp(46px, 5.8vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  -webkit-text-fill-color: currentColor;
}

[dir="rtl"] .hero-copy h1 {
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.hero-copy h1 span {
  background: linear-gradient(120deg, var(--indigo-light), var(--cyan));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-copy > p {
  max-width: 610px;
  margin: 0;
  color: var(--font-muted);
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.8;
  text-shadow: none;
}

.hero-copy .hero-cta {
  justify-content: flex-start;
  margin-top: 32px;
}

.hero-copy .btn-default {
  border-color: var(--border-md);
  color: var(--title-color);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.hero-copy .btn-default:hover,
.hero-copy .btn-default:focus {
  border-color: var(--border-accent);
  color: var(--indigo-light);
  background: var(--indigo-dim);
  box-shadow: var(--shadow-md);
}

.hero-showcase {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-md);
  border-radius: 24px;
  background: rgba(10, 16, 31, 0.84);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(99, 102, 241, 0.04) inset;
  backdrop-filter: blur(18px);
  transform: rotate(1.2deg);
  transition: transform 280ms ease, border-color 280ms ease, box-shadow 280ms ease;
}

[dir="rtl"] .hero-showcase { transform: rotate(-1.2deg); }

.hero-showcase:hover {
  transform: rotate(0) translateY(-5px);
  border-color: var(--border-accent);
  box-shadow: 0 38px 100px rgba(0, 0, 0, 0.38), 0 0 42px rgba(99, 102, 241, 0.13);
}

.hero-window-bar {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.025);
  direction: ltr;
}

.hero-window-bar > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fb7185;
}

.hero-window-bar > span:nth-child(2) { background: #fbbf24; }
.hero-window-bar > span:nth-child(3) { background: #34d399; }

.hero-window-bar code {
  margin-inline-start: auto;
  color: #7f8ca8;
  font: 500 10px/1 "JetBrains Mono", monospace;
}

.hero-code {
  min-height: 280px;
  padding: 42px 34px 34px;
  color: #c8d3e8;
  font: 500 clamp(12px, 1.3vw, 15px)/2 "JetBrains Mono", monospace;
  direction: ltr;
  text-align: left;
}

.hero-code .code-indent { padding-left: 25px; }
.code-keyword { color: #c084fc; }
.code-string { color: #67e8f9; }
.code-value { color: #fbbf24; }
.code-brace { color: #818cf8; }

.hero-capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 18px 18px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
}

.hero-capabilities span {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  color: #aebbd1;
  background: rgba(10, 16, 31, 0.96);
  font-size: 11px;
  font-weight: 600;
}

.hero-capabilities i { color: #67e8f9; }

.hero-window-footer {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: #67758f;
  background: rgba(99, 102, 241, 0.09);
  font: 500 9px/1 "JetBrains Mono", monospace;
}

.hero-window-footer i {
  margin-inline-end: 6px;
  color: #34d399;
  font-size: 6px;
}

/* Hero social links ------------------------------------------------------- */
.hero-copy .social-icons {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin-top: 30px;
}

.hero-social-label {
  color: var(--font-muted);
  font: 600 10px/1 "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.social-icons .list-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
}

.social-icons .list-inline > li {
  padding: 0;
}

.social-icons a,
.social-icons a i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-icons a i {
  width: 42px;
  height: 42px;
  margin: 0 !important;
  color: var(--font-muted);
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.social-icons a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
  border-radius: 50%;
}

.hero-scroll {
  position: absolute;
  bottom: 22px;
  left: 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--font-muted);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font: 600 9px/1 "JetBrains Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateX(-50%);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.hero-scroll i { color: var(--cyan); animation: hero-scroll 1.6s ease-in-out infinite; }

.hero-scroll.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes hero-scroll {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}

[data-theme="light"] #home {
  background:
    radial-gradient(circle at 14% 24%, rgba(79, 70, 229, 0.14), transparent 34%),
    radial-gradient(circle at 84% 68%, rgba(6, 182, 212, 0.12), transparent 31%),
    #f5f7ff;
}

[data-theme="light"] #home::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(226, 232, 255, 0.22));
}

[data-theme="light"] #threejs-canvas { opacity: 0.68; }

[data-theme="light"] .hero-showcase {
  border-color: rgba(79, 70, 229, 0.17);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 32px 80px rgba(59, 70, 130, 0.17), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

[data-theme="light"] .hero-window-bar {
  border-color: rgba(79, 70, 229, 0.10);
  background: rgba(79, 70, 229, 0.035);
}

[data-theme="light"] .hero-window-bar code,
[data-theme="light"] .hero-window-footer { color: #64748b; }

[data-theme="light"] .hero-code { color: #334155; }
[data-theme="light"] .code-keyword { color: #7c3aed; }
[data-theme="light"] .code-string { color: #04748a; }
[data-theme="light"] .code-value { color: #b45309; }
[data-theme="light"] .code-brace { color: #4f46e5; }

[data-theme="light"] .hero-capabilities {
  border-color: rgba(79, 70, 229, 0.12);
  background: rgba(79, 70, 229, 0.10);
}

[data-theme="light"] .hero-capabilities span {
  color: #475569;
  background: rgba(248, 250, 255, 0.96);
}

[data-theme="light"] .hero-capabilities i { color: #4f46e5; }

[data-theme="light"] .hero-window-footer {
  background: rgba(79, 70, 229, 0.06);
}

/* About ------------------------------------------------------------------- */
.about-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 18%, rgba(34, 211, 238, 0.08), transparent 25%),
    radial-gradient(circle at 92% 76%, rgba(99, 102, 241, 0.10), transparent 30%),
    var(--bg-color);
}

.about-section::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image: radial-gradient(rgba(129, 140, 248, 0.46) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 84%, transparent);
  pointer-events: none;
}

.about-section > .container { position: relative; z-index: 1; }

.about-editorial-head {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: clamp(40px, 8vw, 110px);
  align-items: end;
  max-width: 1120px;
  margin: 0 auto 42px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--border);
}

.about-kicker,
.about-story-label,
.courses-sequence {
  display: inline-block;
  color: var(--indigo-light);
  font: 700 10px/1.4 "JetBrains Mono", monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about-editorial-head .section-title {
  margin: 12px 0 0;
  text-align: start;
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

[dir="rtl"] .about-editorial-head .section-title { letter-spacing: 0; line-height: 1.2; }
.about-editorial-head .section-title::after { display: none; }
.about-editorial-head .section-title span { color: var(--cyan); }

.about-editorial-lead > p {
  margin: 0 0 24px;
  color: var(--font-color);
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.8;
}

.about-focus-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-focus-line span {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--font-muted);
  background: var(--surface);
  font: 600 9px/1 "JetBrains Mono", monospace;
}

.about-bento {
  display: grid;
  grid-template-columns: minmax(280px, 0.68fr) minmax(0, 1.32fr);
  gap: 16px;
  align-items: stretch;
  max-width: 1120px;
  margin-inline: auto;
}

.about-portrait-card,
.about-manifesto {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.about-portrait-card {
  position: relative;
  min-height: 520px;
  margin: 0;
  overflow: hidden;
}

.about-portrait-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  transition: transform 700ms cubic-bezier(.2,.8,.2,1);
}

.about-portrait-card:hover > img { transform: scale(1.035); }

.about-portrait-shade {
  position: absolute;
  inset: 38% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(5, 9, 19, 0.94));
  pointer-events: none;
}

.about-portrait-card figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 20px;
}

.about-portrait-card figcaption strong,
.about-portrait-card figcaption span { display: block; }
.about-portrait-card figcaption strong { margin-bottom: 4px; color: #fff; font-size: 16px; }
.about-portrait-card figcaption div > span { color: rgba(226, 232, 240, 0.66); font-size: 10px; }

.about-location {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  color: rgba(226, 232, 240, 0.72) !important;
  font: 500 9px/1.4 "JetBrains Mono", monospace;
  white-space: nowrap;
}
.about-location i { color: var(--cyan); }

.about-manifesto {
  position: relative;
  padding: clamp(28px, 4vw, 44px);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(99, 102, 241, 0.10), transparent 52%),
    var(--surface);
}

.about-manifesto::after {
  content: "{ }";
  position: absolute;
  top: 25px;
  inset-inline-end: 28px;
  color: rgba(129, 140, 248, 0.10);
  font: 700 60px/1 "JetBrains Mono", monospace;
  pointer-events: none;
}

.about-manifesto h3 {
  position: relative;
  z-index: 1;
  margin: 18px 0 24px;
  color: var(--title-color);
  font-size: clamp(28px, 3vw, 39px);
  line-height: 1.24;
  letter-spacing: -0.025em;
}

[dir="rtl"] .about-manifesto h3 { letter-spacing: 0; line-height: 1.5; }

.about-manifesto > p {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  color: var(--font-muted);
  font-size: 15px;
  line-height: 1.85;
}

.about-capabilities {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.about-capabilities span {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--font-color);
  background: var(--bg-2);
  font-size: 10px;
  font-weight: 600;
}

.about-capabilities i { color: var(--cyan); }

[data-theme="light"] .about-section {
  background:
    radial-gradient(circle at 8% 18%, rgba(6, 182, 212, 0.08), transparent 25%),
    radial-gradient(circle at 92% 76%, rgba(79, 70, 229, 0.10), transparent 30%),
    #f4f7ff;
}

[data-theme="light"] :is(.about-portrait-card, .about-manifesto, .about-focus-line span) {
  border-color: rgba(79, 70, 229, 0.14);
  background-color: rgba(255, 255, 255, 0.94);
}

[data-theme="light"] .about-capabilities span {
  border-color: rgba(79, 70, 229, 0.11);
  background: #f7f9ff;
}

/* Courses ----------------------------------------------------------------- */
.education-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.courses-showcase {
  margin-top: 88px;
  padding: clamp(24px, 4vw, 44px) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.courses-showcase-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.68fr) minmax(0, 1.32fr);
  gap: clamp(40px, 7vw, 90px);
  align-items: start;
}

.courses-intro-panel {
  position: sticky;
  top: 110px;
}

.courses-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 24px 0;
  place-items: center;
  border: 1px solid var(--border-accent);
  border-radius: 16px;
  color: var(--cyan);
  background: var(--indigo-dim);
  font-size: 18px;
}

.courses-intro-panel h3 {
  margin: 0 0 18px;
  color: var(--title-color);
  font-size: clamp(29px, 3.6vw, 43px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

[dir="rtl"] .courses-intro-panel h3 { letter-spacing: 0; line-height: 1.4; }

.courses-intro-panel > p {
  max-width: 310px;
  margin: 0 0 25px;
  color: var(--font-muted);
  font-size: 13px;
  line-height: 1.8;
}

.courses-intro-panel > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: var(--indigo-light);
  font-size: 11px;
  font-weight: 700;
}

.courses-intro-panel > a i { transition: transform 200ms ease; }
.courses-intro-panel > a:hover i { transform: translateX(4px); }
[dir="rtl"] .courses-intro-panel > a:hover i { transform: translateX(-4px); }

.course-directory {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.course-directory li { border-bottom: 1px solid var(--border); }

.course-directory a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 32px;
  gap: 16px;
  min-height: 78px;
  align-items: center;
  padding: 13px 10px;
  color: var(--font-color);
  cursor: pointer;
  transition: background-color 200ms ease, padding 200ms ease;
}

.course-directory a:hover,
.course-directory a:focus-visible {
  padding-inline: 18px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.10), rgba(34, 211, 238, 0.04));
}

.course-number { color: var(--cyan); font: 700 10px/1 "JetBrains Mono", monospace; }
.course-directory strong { color: var(--title-color); font-size: 14px; line-height: 1.5; transition: color 200ms ease; }
.course-directory small { padding: 6px 9px; border: 1px solid var(--border); border-radius: var(--radius-full); color: var(--font-muted); font: 600 8px/1 "JetBrains Mono", monospace; text-transform: uppercase; white-space: nowrap; }
.course-directory a > i { color: var(--font-muted); font-size: 10px; transform: rotate(45deg); transition: color 200ms ease, transform 200ms ease; }
[dir="rtl"] .course-directory a > i { transform: rotate(-45deg); }
.course-directory a:hover strong { color: var(--cyan); }
.course-directory a:hover > i { color: var(--cyan); transform: rotate(45deg) translateY(-3px); }
[dir="rtl"] .course-directory a:hover > i { transform: rotate(-45deg) translateY(-3px); }

[data-theme="light"] .courses-showcase,
[data-theme="light"] :is(.course-directory, .course-directory li) { border-color: rgba(79, 70, 229, 0.14); }
[data-theme="light"] .course-directory a:hover { background: linear-gradient(90deg, rgba(79, 70, 229, 0.08), rgba(6, 182, 212, 0.04)); }

/* Skills ------------------------------------------------------------------ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1080px;
  margin-inline: auto;
}

.skill-card {
  position: relative;
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(99, 102, 241, 0.07), transparent 45%),
    var(--surface);
  box-shadow: var(--shadow-md);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.skill-card::after {
  content: "";
  position: absolute;
  inset: auto -45px -55px auto;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(99, 102, 241, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(99, 102, 241, 0.035);
  pointer-events: none;
}

.skill-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), 0 18px 45px rgba(99, 102, 241, 0.12);
}

.skill-card-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 22px;
}

.skill-card-icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border: 1px solid rgba(99, 102, 241, 0.30);
  border-radius: 14px;
  color: var(--cyan);
  background: var(--indigo-dim);
  font-size: 18px;
}

.skill-card-index {
  display: block;
  margin-bottom: 3px;
  color: var(--font-muted);
  font: 600 10px/1 "JetBrains Mono", monospace;
  letter-spacing: 0.14em;
}

.skill-card h3 {
  margin: 0;
  color: var(--title-color);
  font-size: 18px;
  line-height: 1.25;
}

.skill-card > p {
  min-height: 76px;
  margin: 0 0 25px;
  color: var(--font-muted);
  font-size: 14px;
  line-height: 1.7;
}

.skill-card .skills-chips {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.skill-card .skill-chip {
  padding: 7px 12px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 12px;
}

[data-theme="light"] .skill-card {
  background: linear-gradient(145deg, rgba(79, 70, 229, 0.06), transparent 48%), #fff;
}

/* Works ------------------------------------------------------------------- */
.works-intro {
  max-width: 650px;
  margin: -12px auto 34px;
  color: var(--font-muted);
  font-size: 16px;
  line-height: 1.7;
  text-align: center;
}

.works-section #grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.works-section #grid .portfolio-item,
.works-section .portfolio-bg {
  padding: 0;
  margin: 0;
}

.works-section .portfolio {
  aspect-ratio: 16 / 10;
  justify-content: stretch;
  border-radius: var(--radius-lg);
  isolation: isolate;
}

.works-section .portfolio > img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: top center;
  transition: transform 320ms ease, filter 320ms ease;
}

.works-section .portfolio:hover > img,
.works-section .portfolio:focus-within > img {
  transform: scale(1.035);
  filter: saturate(0.78) brightness(0.62);
}

.works-section .tt-overlay {
  z-index: 1;
  opacity: 1;
  background: linear-gradient(180deg, transparent 38%, rgba(4, 7, 14, 0.92) 100%);
}

.works-section .portfolio-info {
  inset: auto 0 0;
  z-index: 2;
  width: 100%;
  height: auto;
  padding: 44px 20px 18px;
  background: transparent;
  text-align: start;
}

.works-section .portfolio-info h3 {
  overflow: hidden;
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.works-section .links {
  inset: 15px 15px auto auto;
  z-index: 3;
  display: flex;
  width: auto;
  height: auto;
  gap: 8px;
  margin: 0;
  opacity: 0;
  transform: translateY(-7px);
}

[dir="rtl"] .works-section .links {
  right: auto;
  left: 15px;
}

.works-section .links a {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  color: #fff;
  background: rgba(6, 10, 20, 0.74);
  backdrop-filter: blur(8px);
  transition: background 200ms ease, border-color 200ms ease;
}

.works-section .links a:hover,
.works-section .links a:focus-visible {
  border-color: rgba(255, 255, 255, 0.62);
  background: var(--indigo);
}

.works-section .links a i {
  margin: 0;
  color: inherit;
  font-size: 14px;
}

.works-section .links a i::after {
  display: none;
}

.works-section .portfolio:hover .links,
.works-section .portfolio:focus-within .links {
  opacity: 1;
  transform: none;
}

/* Contact ----------------------------------------------------------------- */
.contact-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 9% 80%, rgba(99, 102, 241, 0.10), transparent 34%),
    linear-gradient(180deg, var(--bg-color), var(--bg-2));
}

.contact-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(129, 140, 248, 0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}

.contact-section > .container { position: relative; z-index: 1; }

.contact-heading {
  max-width: 720px;
  margin: 0 auto 46px;
  text-align: center;
}

.contact-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--indigo-light);
  font: 700 11px/1.4 "JetBrains Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-heading .section-title { margin-bottom: 16px; }

.contact-heading > p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--font-muted);
  font-size: 16px;
  line-height: 1.75;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 22px;
  max-width: 1080px;
  margin-inline: auto;
  align-items: stretch;
}

.contact-panel,
.contact-form {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.contact-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px 32px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(99, 102, 241, 0.18), rgba(34, 211, 238, 0.045) 60%),
    var(--surface);
}

.contact-panel::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -90px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(99, 102, 241, 0.035);
  pointer-events: none;
}

[dir="rtl"] .contact-panel::after { right: auto; left: -80px; }

.contact-panel-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid rgba(99, 102, 241, 0.32);
  border-radius: 16px;
  color: var(--cyan);
  background: var(--indigo-dim);
  font-size: 20px;
}

.contact-section .contact-panel-icon > i,
.contact-section .contact-method-icon > i,
.contact-section .contact-form-header > i,
.contact-section .contact-methods > a > i {
  float: none;
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.contact-panel h3 {
  max-width: 300px;
  margin: 0 0 16px;
  color: var(--title-color);
  font-size: 28px;
  line-height: 1.28;
}

.contact-panel > p {
  margin: 0 0 32px;
  color: var(--font-muted);
  font-size: 14px;
  line-height: 1.8;
}

.contact-methods {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.contact-methods > a,
.contact-status {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 13, 26, 0.32);
}

.contact-methods > a {
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.contact-methods > a:hover {
  border-color: var(--border-accent);
  background: var(--indigo-dim);
  transform: translateY(-2px);
}

.contact-method-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  color: var(--indigo-light);
  background: var(--indigo-dim);
  font-size: 14px;
}

.contact-methods small,
.contact-methods strong {
  display: block;
  text-transform: none;
}

.contact-methods small {
  margin-bottom: 4px;
  color: var(--font-muted);
  font-size: 10px;
}

.contact-methods strong {
  overflow: hidden;
  color: var(--title-color);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-methods a[href^="mailto:"] strong {
  direction: ltr;
  text-align: start;
}

.contact-methods > a > i { color: var(--font-muted) !important; font-size: 11px !important; }

.contact-form {
  padding: 32px;
  overflow: hidden;
  background: var(--surface);
}

.contact-form::before { height: 3px; }

.contact-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  color: var(--title-color);
  font-size: 16px;
  font-weight: 700;
}

.contact-form-header > i {
  color: var(--indigo-light) !important;
  font-size: 16px !important;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-form .form-field { margin-bottom: 16px; }

.contact-form .form-control {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg-2);
  box-shadow: none;
}

.contact-form .form-control:focus {
  border-color: var(--border-accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.10);
}

.contact-form .form-field::after { display: none; }

.contact-form .btn {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border-radius: 13px;
}

[dir="rtl"] .form-field label {
  right: 16px;
  left: auto;
  transform-origin: right top;
}

[data-theme="light"] .contact-section {
  background:
    radial-gradient(circle at 9% 80%, rgba(79, 70, 229, 0.10), transparent 34%),
    linear-gradient(180deg, #f5f7ff, #edf2ff);
}

[data-theme="light"] .contact-panel,
[data-theme="light"] .contact-form {
  border-color: rgba(79, 70, 229, 0.14);
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(59, 70, 130, 0.11);
}

[data-theme="light"] .contact-methods > a,
[data-theme="light"] .contact-status {
  border-color: rgba(79, 70, 229, 0.12);
  background: rgba(248, 250, 255, 0.78);
}

[data-theme="light"] .contact-form .form-control {
  border-color: rgba(79, 70, 229, 0.15);
  background: #f8faff;
}

/* Footer ------------------------------------------------------------------ */
.footer-inner {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.footer-connect-col {
  min-width: 250px;
}

.footer-social-row a {
  width: 44px;
  height: 44px;
}

.footer-logo-img { width: 180px; }

[dir="rtl"] .footer-social-row {
  justify-content: flex-start;
}

/* Light theme icon palette ------------------------------------------------ */
[data-theme="light"] {
  --light-icon-accent: #6d28d9;
  --light-icon-bg: rgba(109, 40, 217, 0.09);
  --light-icon-border: rgba(109, 40, 217, 0.22);
}

[data-theme="light"] :is(
  .theme-toggle-button,
  .hero-capabilities i,
  .social-icons a i,
  .about-location i,
  .about-capabilities i,
  .courses-icon,
  .journey-icon,
  .career-meta i,
  .education-location i,
  .skill-card-icon,
  .contact-panel-icon,
  .contact-method-icon,
  .contact-form-header > i,
  .footer-social-row a,
  .scroll-up
) {
  color: var(--light-icon-accent) !important;
}

[data-theme="light"] :is(
  .theme-toggle-button,
  .hero-capabilities span,
  .social-icons a i,
  .about-capabilities span,
  .courses-icon,
  .journey-icon,
  .skill-card-icon,
  .contact-panel-icon,
  .contact-method-icon,
  .scroll-up
) {
  border-color: var(--light-icon-border) !important;
  background-color: var(--light-icon-bg) !important;
}

[data-theme="light"] :is(
  .theme-toggle-button,
  .social-icons a i,
  .courses-icon,
  .journey-icon,
  .skill-card-icon,
  .contact-panel-icon,
  .contact-method-icon,
  .scroll-up
):hover {
  color: #581c87 !important;
  border-color: rgba(88, 28, 135, 0.36) !important;
}

@media (max-width: 1100px) and (min-width: 992px) {
  .navbar-custom .nav-shell { gap: 12px; }
  .navbar-custom .navbar-brand > img { width: 132px; }
  .navbar-custom .navbar-nav > li > a { padding-inline: 8px; font-size: 13px; }
  .hero-layout { grid-template-columns: minmax(0, 1fr) minmax(360px, 0.84fr); gap: 38px; }
  .hero-code { padding-inline: 26px; }
}

@media (max-width: 991px) {
  body.nav-open { overflow: hidden; }

  .navbar-custom,
  .navbar-custom .nav-shell {
    min-height: 58px;
  }

  .navbar-custom .nav-shell {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    width: min(calc(100% - 24px), 1170px);
    padding-block: 6px;
  }

  .navbar-custom .navbar-brand { padding-block: 0; }
  .navbar-custom .navbar-brand > img { width: 114px; }

  #home {
    height: auto;
    min-height: 100svh;
    padding: 120px 0 90px;
  }

  #home::after { display: none; }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 52px;
  }

  .intro.hero-copy {
    max-width: 720px;
    margin-inline: auto;
    text-align: center;
  }

  .hero-copy .intro-sub { margin-inline: auto; }
  .hero-copy .hero-cta,
  .hero-copy .social-icons { justify-content: center; }

  .hero-showcase {
    width: min(100%, 620px);
    margin-inline: auto;
    transform: none;
  }

  .hero-code { min-height: 250px; }

  .nav-mobile-actions {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .navbar-custom .navbar-toggle {
    position: relative;
    grid-column: 3;
    grid-row: 1;
    display: grid;
    width: 44px;
    height: 44px;
    padding: 10px;
    place-content: center;
    border: 1px solid var(--border-md);
    border-radius: 12px;
    float: none !important;
    order: initial;
    cursor: pointer;
  }

  .navbar-custom .navbar-toggle .icon-bar {
    width: 21px;
    height: 2px;
    margin: 2.5px 0;
    transition: transform 200ms ease, opacity 200ms ease;
  }

  .navbar-custom .navbar-toggle.is-active .icon-bar:nth-of-type(2) {
    transform: translateY(7px) rotate(45deg);
  }

  .navbar-custom .navbar-toggle.is-active .icon-bar:nth-of-type(3) {
    opacity: 0;
  }

  .navbar-custom .navbar-toggle.is-active .icon-bar:nth-of-type(4) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .navbar-custom .navbar-collapse {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid !important;
    grid-template-rows: 0fr;
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0;
    justify-self: stretch;
    visibility: hidden;
    overflow: hidden;
    border: 0 solid var(--border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--bg-2);
    box-shadow: none;
    backdrop-filter: none;
    transition: grid-template-rows 220ms ease, visibility 220ms ease, border-width 220ms ease;
  }

  [data-theme="light"] .navbar-custom .navbar-collapse {
    background: #f4f7ff;
  }

  .navbar-custom .navbar-collapse.is-open {
    grid-template-rows: 1fr;
    visibility: visible;
    border-top-width: 1px;
  }

  .navbar-custom .navbar-collapse > .navbar-nav {
    display: flex !important;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 0 8px;
    overflow: hidden;
    transition: padding 220ms ease;
  }

  .navbar-custom .navbar-collapse.is-open > .navbar-nav {
    padding: 10px 8px 14px;
  }

  .navbar-custom .navbar-nav > li,
  .navbar-custom .navbar-nav > li > a {
    width: 100%;
  }

  .navbar-custom .navbar-nav > li > a {
    min-height: 44px;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: 9px;
  }

  .navbar-custom .navbar-nav > li.active > a,
  .navbar-custom .navbar-nav > li > a:hover {
    background: var(--indigo-dim);
  }

  .navbar-custom .navbar-nav > li > a::after { display: none; }
  .about-editorial-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .about-editorial-lead { max-width: 680px; }

  .about-bento {
    grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  }

  .about-portrait-card { min-height: 500px; }

  .courses-showcase-layout {
    grid-template-columns: minmax(220px, 0.58fr) minmax(0, 1.42fr);
    gap: 34px;
  }

  .skills-grid,
  .works-section #grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .education-grid { grid-template-columns: minmax(0, 1fr); }

  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .contact-panel { min-height: 430px; }
}

@media (max-width: 575px) {
  .navbar-custom .nav-shell {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
  }

  .navbar-custom .navbar-brand > img { width: 104px; }
  .nav-mobile-actions { gap: 6px; }
  .nav-language { min-width: 38px; padding-inline: 8px !important; }
  .navbar-custom .theme-toggle-button,
  .nav-mobile-actions .theme-toggle-button { width: 40px; height: 40px; }

  #home { padding: 104px 0 78px; }
  .hero-layout { gap: 36px; }
  .hero-copy h1 { font-size: clamp(38px, 12vw, 52px); }
  .hero-copy > p { font-size: 15px; }
  .hero-copy .hero-cta { display: grid; grid-template-columns: minmax(0, 1fr); }
  .hero-copy .hero-cta .btn { width: 100%; }
  .hero-copy .social-icons { flex-direction: column; }
  .hero-social-label { display: none; }
  .hero-code { min-height: 0; padding: 28px 18px; font-size: 10px; overflow: hidden; }
  .hero-window-bar code { display: none; }
  .hero-capabilities { grid-template-columns: 1fr; }
  .hero-capabilities span { min-height: 48px; }
  .hero-window-footer { font-size: 8px; }
  .hero-scroll { display: none; }

  .about-editorial-head {
    margin-bottom: 24px;
    padding-bottom: 26px;
  }

  .about-editorial-head .section-title { font-size: clamp(38px, 12vw, 50px); }
  .about-editorial-lead > p { font-size: 15px; }

  .about-bento { grid-template-columns: minmax(0, 1fr); }
  .about-portrait-card { min-height: 470px; }
  .about-manifesto { padding: 27px 22px; }
  .about-manifesto h3 { font-size: 29px; }

  .courses-showcase { margin-top: 64px; padding-top: 32px; }
  .courses-showcase-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .courses-intro-panel { position: static; }
  .courses-intro-panel h3 br { display: none; }
  .courses-intro-panel > p { max-width: none; }
  .course-directory a {
    grid-template-columns: 32px minmax(0, 1fr) 22px;
    gap: 11px;
    min-height: 92px;
  }
  .course-directory small { grid-column: 2; width: max-content; }
  .course-directory a > i { grid-column: 3; grid-row: 1 / span 2; }

  .social-icons .list-inline { gap: 7px; }

  .skills-grid,
  .works-section #grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .skill-card {
    min-height: 0;
    padding: 23px 20px;
  }

  .skill-card > p { min-height: 0; }
  .works-intro { margin-top: -6px; font-size: 15px; }
  #filter { border-radius: var(--radius-md); }
  #filter li { margin: 0; }
  #filter li :is(a, button) { padding-inline: 14px; }

  .works-section .links {
    opacity: 1;
    transform: none;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 28px;
  }

  .footer-connect-col { min-width: 0; }

  .contact-heading { margin-bottom: 32px; }
  .contact-heading > p { font-size: 15px; }
  .contact-panel,
  .contact-form { padding: 24px 20px; border-radius: 18px; }
  .contact-panel { min-height: 0; }
  .contact-panel h3 { font-size: 24px; }
  .contact-form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .skill-card,
  .works-section .portfolio > img,
  .works-section .links {
    transition: none;
  }

  .hero-scroll i { animation: none; }
}

/* Page motion ------------------------------------------------------------- */
@keyframes hero-copy-enter {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-showcase-enter {
  from { opacity: 0; transform: translate3d(28px, 12px, 0) rotate(1deg); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-showcase-enter-rtl {
  from { opacity: 0; transform: translate3d(-28px, 12px, 0) rotate(-1deg); }
  to { opacity: 1; transform: none; }
}

.hero-copy {
  animation: hero-copy-enter 700ms cubic-bezier(.2,.8,.2,1) 100ms both;
}

.hero-showcase {
  animation: hero-showcase-enter 760ms cubic-bezier(.2,.8,.2,1) 220ms both;
}

[dir="rtl"] .hero-showcase {
  animation-name: hero-showcase-enter-rtl;
}

.motion-reveal.reveal-ready {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition: opacity 480ms ease, transform 560ms cubic-bezier(.2,.8,.2,1);
}

.motion-reveal.reveal-ready.is-revealed {
  opacity: 1;
  transform: none;
}
