@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.66);
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --accent: #0ea5e9;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #e5e9f0;
  --shadow-color: 220 30% 15%;

  /* Type */
  --font-fa: "Vazirmatn", "Inter", sans-serif;
  --font-en: "Inter", "Vazirmatn", sans-serif;
  --font-body: var(--font-fa);

  /* Scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.14vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.13rem + 0.35vw, 1.4rem);
  --step-2: clamp(1.44rem, 1.32rem + 0.6vw, 1.8rem);
  --step-3: clamp(1.9rem, 1.65rem + 1.1vw, 2.5rem);
  --step-4: clamp(2.4rem, 2rem + 1.9vw, 3.5rem);
  --step-5: clamp(3rem, 2.4rem + 2.8vw, 4.6rem);

  /* Layout */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --container: 1160px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

html.dark {
  --bg: #0b0f17;
  --surface: #10151f;
  --surface-glass: rgba(16, 21, 31, 0.62);
  --primary: #3b82f6;
  --accent: #38bdf8;
  --text: #f3f5f8;
  --text-secondary: #9aa4b2;
  --border: #22293a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.4s var(--ease),
    color 0.4s var(--ease);
}

/* .disabled-section {
  filter: blur(2px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
} */

html[lang="en"] body {
  --font-body: var(--font-en);
  line-height: 1.65;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* Skip link */
.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -60px;
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top 0.25s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

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

/* Section rhythm */
.section {
  padding: clamp(4rem, 9vw, 7.5rem) 0;
}

.section-alt {
  background: color-mix(in srgb, var(--surface) 60%, var(--bg));
}

.section-head {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.section-title {
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-desc {
  margin-top: 0.85rem;
  color: var(--text-secondary);
  font-size: var(--step-0);
}

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

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav-wrap {
  position: fixed;
  top: 14px;
  inset-inline: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding-inline: 1rem;
}

.nav {
  width: 100%;
  max-width: var(--container);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.9rem 0.65rem 1.3rem;
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 10px 30px -18px hsl(var(--shadow-color) / 0.35);
}

html[dir="rtl"] .nav {
  padding: 0.65rem 1.3rem 0.65rem 0.9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: var(--step-0);
}

.logo-dark {
  display: none;
}

.dark .logo-dark {
  display: block;
}

.dark .logo-light {
  display: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-links a {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  transition:
    color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: var(--border);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.nav-toggle {
  display: none;
}

.nav-drawer {
  display: none;
}

@media (max-width: 880px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .nav-drawer {
    position: fixed;
    top: calc(var(--nav-h) + 14px);
    inset-inline: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px -20px hsl(var(--shadow-color) / 0.4);
    padding: 0.75rem;
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    z-index: 99;
  }

  .nav-drawer.open {
    display: flex;
  }

  .nav-drawer a {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--text);
  }

  .nav-drawer a:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + 4.5rem);
  padding-bottom: 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(
    ellipse 70% 60% at 50% 20%,
    black 30%,
    transparent 85%
  );
  opacity: 0.5;
}

.hero-blob {
  position: absolute;
  z-index: -1;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
}

.hero-blob.one {
  background: var(--primary);
  top: -140px;
  inset-inline-end: -120px;
}

.hero-blob.two {
  background: var(--accent);
  bottom: -180px;
  inset-inline-start: -160px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-figure {
    order: -1;
    margin-inline: auto;
  }

  .hero-actions,
  .hero-socials {
    justify-content: center;
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.1rem;
}

.hero-eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 25%, transparent);
}

.dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 4px #22c55e;
    opacity: 1;
  }

  50% {
    box-shadow: 0 0 14px #22c55e;
    opacity: 0.7;
  }
}

.hero-title {
  font-size: var(--step-5);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-title .accent-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-typing {
  margin-top: 0.9rem;
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--text-secondary);
  min-height: 1.5em;
}

.hero-typing .cursor {
  display: inline-block;
  width: 2px;
  background: var(--text-secondary);
  margin-inline-start: 3px;
  animation: blink 1s steps(1) infinite;
  height: 1em;
  vertical-align: -0.15em;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-subtitle {
  margin-top: 1.3rem;
  max-width: 52ch;
  color: var(--text-secondary);
  font-size: var(--step-1);
}

@media (max-width: 900px) {
  .hero-subtitle {
    margin-inline: auto;
  }
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.8rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: var(--step--1);
  border: 1px solid transparent;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 14px 28px -14px
    color-mix(in srgb, var(--primary) 70%, transparent);
}

.btn-primary:hover {
  box-shadow: 0 18px 34px -14px
    color-mix(in srgb, var(--primary) 80%, transparent);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--primary);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.hero-socials {
  margin-top: 2rem;
  display: flex;
  gap: 0.6rem;
}

.hero-figure {
  position: relative;
  width: min(360px, 80vw);
}

.hero-photo-wrap {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 1 / 1.08;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

.hero-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.2);
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--primary) 12%, var(--surface)),
    color-mix(in srgb, var(--accent) 10%, var(--surface))
  );
  color: var(--text-secondary);
  text-align: center;
  padding: 1.5rem;
  font-size: var(--step--1);
}

.photo-placeholder svg {
  width: 56px;
  height: 56px;
  color: var(--primary);
}

.hero-card {
  position: absolute;
  padding: 0.7rem 1rem;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 34px -18px hsl(var(--shadow-color) / 0.35);
  font-size: var(--step--1);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: float 7s ease-in-out infinite;
}

@media (max-width: 900px) {
  .hero-card {
    display: none;
  }
}

/* ==========================================================================
   About
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-quote {
  position: relative;
  padding: 2rem clamp(1.5rem, 3vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--step-1);
  line-height: 1.9;
  color: var(--text);
}

.about-quote::before {
  content: "";
  position: absolute;
  top: 3rem;
  inset-inline-start: 0;
  width: 5px;
  height: 72px;
  background: linear-gradient(var(--primary), var(--accent));
  border-radius: 0 4px 4px 0;
}

html[dir="rtl"] .about-quote::before {
  border-radius: 4px 0 0 4px;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1rem;
  text-align: center;
}

.stat-num {
  font-size: var(--step-3);
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  margin-top: 0.3rem;
  font-size: var(--step--1);
  color: var(--text-secondary);
}

/* ==========================================================================
   Glass cards (skills / services)
   ========================================================================== */
.grid-cards {
  display: grid;
  gap: 1.15rem;
}

.skills-grid {
  grid-template-columns: repeat(3, 1fr);
}

.services-grid {
  grid-template-columns: repeat(3, 1fr);
}

.hidden-service {
  display: none;
}

.services-grid.show-all .hidden-service {
  display: block;
}

.show-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 32px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.show-more-btn svg {
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease;
}

.show-more-btn:hover svg {
  transform: translateY(5px);
}

.show-more-btn svg {
  width: 32px;
  height: 32px;
  animation: bounceArrow 1s infinite;
}

@keyframes bounceArrow {
  0% {
    transform: translateY(0);
  }

  45% {
    transform: translateY(10px);
  }

  50% {
    transform: translateY(10px);
  }

  95% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .skills-grid,
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .skills-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }
}

.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -22px hsl(var(--shadow-color) / 0.35);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.skill-card h3 {
  font-size: var(--step-0);
  font-weight: 700;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.skill-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.skill-icon svg {
  width: 18px;
  height: 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

html[lang="fa"] .tag {
  font-family: var(--font-en);
}

.tag {
  direction: ltr;
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.service-card .skill-icon {
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: var(--step-0);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.service-card p {
  color: var(--text-secondary);
  font-size: var(--step--1);
}

/* ==========================================================================
   Timeline (experience / education)
   ========================================================================== */
.timeline {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  padding-inline-start: 2.2rem;
  border-inline-start: 2px solid var(--border);
}

html[dir="rtl"] .timeline {
  padding-inline-start: 2.2rem;
}

.timeline-item {
  position: relative;
  padding-bottom: 2.6rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  inset-inline-start: -2.75rem;
  top: 0.15rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
}

.timeline-date {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.5rem;
}

.timeline-card h3 {
  font-size: var(--step-0);
  font-weight: 700;
}

.timeline-card .org {
  color: var(--text-secondary);
  font-size: var(--step--1);
  margin-top: 0.2rem;
}

.timeline-card p.desc {
  margin-top: 0.7rem;
  color: var(--text-secondary);
  font-size: var(--step--1);
}

.cert-badge-placeholder {
  width: 84px;
  height: 84px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--primary) 14%, var(--surface)),
    color-mix(in srgb, var(--accent) 12%, var(--surface))
  );
  border: 1px solid var(--border);
  color: var(--primary);
}

.cert-badge-placeholder svg {
  width: 34px;
  height: 34px;
}

/* ==========================================================================
   Certificates
   ========================================================================== */
.certificates-grid {
  grid-template-columns: repeat(3, 1fr);
}

.certificates-grid .hidden-certificate {
  display: none !important;
}

.certificates-grid.show-all .hidden-certificate {
  display: block !important;
}

@media (max-width: 900px) {
  .certificates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .certificates-grid {
    grid-template-columns: 1fr;
  }
}

.certificate-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.certificate-card .cert-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.certificate-card h3 {
  font-size: var(--step-0);
  font-weight: 700;
  line-height: 1.4;
}

.certificate-card .cert-issuer {
  color: var(--text-secondary);
  font-size: var(--step--1);
}

.certificate-card .cert-date {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--primary);
}

.certificate-card .cert-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--primary);
  align-self: flex-start;
  margin-top: auto;
}

.certificate-card .cert-link svg {
  width: 15px;
  height: 15px;
}

.cert-thumb {
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 0.4rem;
}

.cert-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Featured project
   ========================================================================== */
.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

@media (max-width: 860px) {
  .featured {
    grid-template-columns: 1fr;
  }
}

.featured-media {
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--primary) 14%, var(--surface)),
    color-mix(in srgb, var(--accent) 12%, var(--surface))
  );
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  color: var(--text-secondary);
  padding: 2rem;
  text-align: center;
}

.featured-media img {
  display: block;
  margin: auto;
  object-fit: cover;
}

.featured-body {
  padding: clamp(1.8rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-body h3 {
  font-size: var(--step-2);
  margin: auto;
  font-weight: 800;
}

.featured-body p.desc {
  margin-top: 0.9rem;
  color: var(--text-secondary);
}

.featured-body .tag-row {
  margin-top: 1.2rem;
}

.featured-body .btn {
  margin-top: 1.6rem;
  align-self: flex-start;
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

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

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 42px -22px hsl(var(--shadow-color) / 0.35);
}

.project-thumb {
  aspect-ratio: 16/10;
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--primary) 10%, var(--surface)),
    color-mix(in srgb, var(--accent) 8%, var(--surface))
  );
  display: grid;
  place-items: center;
  color: var(--primary);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(0.6) translateY(-100px);
  display: block;
}

.project-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
}

.project-body h3 {
  font-size: var(--step-0);
  margin: auto;
  font-weight: 700;
}

.project-body p {
  color: var(--text-secondary);
  font-size: var(--step--1);
  flex: 1;
}

.project-links {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.project-links a {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 0.35rem;
}

.project-links a svg {
  width: 15px;
  height: 15px;
  transform: translateY(-2px);
}

.placeholder-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* ==========================================================================
   Resume / Contact / CTA
   ========================================================================== */
.resume-box,
.cta-box {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 92%, black),
    color-mix(in srgb, var(--accent) 85%, black)
  );
  border-radius: var(--radius-lg);
  padding: clamp(2.2rem, 5vw, 3.5rem);
  text-align: center;
  color: #fff;
}

.resume-box h2,
.cta-box h2 {
  font-size: var(--step-3);
  font-weight: 800;
}

.resume-box p,
.cta-box p {
  margin-top: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 52ch;
  margin-inline: auto;
}

.resume-box .btn,
.cta-box .btn {
  margin-top: 1.6rem;
}

.resume-box .btn-primary,
.cta-box .btn-primary {
  background: #fff;
  color: var(--primary-600);
  box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.35);
}

.cta-box .btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.cta-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

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

@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition:
    border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.contact-card:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  transform: translateY(-3px);
}

.contact-card .skill-icon {
  width: 42px;
  height: 42px;
}

.contact-card .label {
  font-size: var(--step--1);
  color: var(--text-secondary);
}

.contact-card .value {
  font-weight: 700;
  word-break: break-word;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.6rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: var(--step--1);
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-socials {
  display: flex;
  gap: 0.5rem;
}

.footer-bottom {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: var(--step--1);
  color: var(--text-secondary);
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-end: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease);
  z-index: 90;
  box-shadow: 0 14px 28px -16px hsl(var(--shadow-color) / 0.4);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

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

/* =========================================================
   DEMO MODAL — THEME AWARE / macOS STYLE
   Uses your existing :root and html.dark variables
   ========================================================= */

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgb(0 0 0 / 52%);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.25s var(--ease),
    visibility 0.25s ease;
}

.demo-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* =========================================================
   WINDOW
   ========================================================= */

.demo-window {
  position: relative;

  width: min(1400px, 95vw);
  height: min(850px, 92vh);

  display: flex;
  flex-direction: column;

  overflow: hidden;

  background: var(--surface);

  color: var(--text);

  border: 1px solid var(--border);
  border-radius: var(--radius-md);

  isolation: isolate;

  -webkit-mask-image: -webkit-radial-gradient(white, black);

  box-shadow:
    0 30px 100px hsl(var(--shadow-color) / 0.28),
    0 8px 30px hsl(var(--shadow-color) / 0.14);

  transform: scale(0.96) translateY(12px);

  transition:
    transform 0.28s var(--ease),
    background 0.2s ease,
    border-color 0.2s ease;
}

.demo-modal.active .demo-window {
  transform: scale(1) translateY(0);
}

/* =========================================================
   HEADER
   ========================================================= */

.demo-header {
  position: relative;

  flex: 0 0 48px;

  height: 48px;
  min-height: 48px;

  display: flex;
  align-items: center;

  padding: 0 12px;

  background: var(--surface-glass);

  color: var(--text);

  border-bottom: 1px solid var(--border);

  /*
   * Gives the header the glass effect
   * already used by the website.
   */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  user-select: none;
  -webkit-user-select: none;
}

/* =========================================================
   MACOS TRAFFIC LIGHTS
   ========================================================= */

.window-controls {
  position: absolute;

  left: 13px;
  top: 50%;

  transform: translateY(-50%);

  display: flex;
  align-items: center;

  gap: 7px;

  z-index: 10;
}

.window-controls span {
  display: block;

  width: 12px;
  height: 12px;

  min-width: 12px;
  min-height: 12px;

  flex: 0 0 12px;

  padding: 0;
  margin: 0;

  border: 0;
  border-radius: 50%;

  box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 20%);

  transition:
    filter 0.15s ease,
    transform 0.15s ease;
}

/* macOS red */
.window-controls span:nth-child(1) {
  background: #ff5f57;
}

/* macOS yellow */
.window-controls span:nth-child(2) {
  background: #febc2e;
}

/* macOS green */
.window-controls span:nth-child(3) {
  background: #28c840;
}

/* =========================================================
   TITLE
   ========================================================= */

.demo-title {
  position: absolute;

  left: 50%;
  top: 50%;

  transform: translate(-50%, -50%);

  max-width: 45%;

  overflow: hidden;

  white-space: nowrap;
  text-overflow: ellipsis;

  font-family: var(--font-en);

  font-size: var(--step--1);
  font-weight: 500;

  line-height: 1;

  color: var(--text);

  opacity: 0.9;

  pointer-events: none;
}

/* =========================================================
   RIGHT ACTIONS
   ========================================================= */

.demo-actions {
  position: absolute;

  right: 10px;
  top: 50%;

  transform: translateY(-50%);

  display: flex;
  align-items: center;

  gap: 2px;

  z-index: 10;
}

.demo-actions button {
  width: 32px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  margin: 0;

  border: 0;
  border-radius: var(--radius-sm);

  outline: none;

  background: transparent;

  color: var(--text-secondary);

  font-family: var(--font-en);

  font-size: 18px;
  line-height: 1;

  cursor: pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease;
}

.demo-actions button:hover {
  background: var(--bg);
  color: var(--text);
}

.demo-actions button:active {
  transform: scale(0.92);
}

/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.demo-actions .close-demo:hover,
.demo-actions .close-btn:hover {
  background: #ff5f57;
  color: #fff;
}

/* =========================================================
   IFRAME
   ========================================================= */

#demoFrame {
  flex: 1 1 auto;

  width: 100%;
  height: 100%;

  min-height: 0;

  display: block;

  margin: 0;
  padding: 0;

  border: 0;
  outline: 0;

  background: var(--surface);

  color-scheme: light;

  vertical-align: bottom;
}

/* =========================================================
   MINIMAL APPLE SCROLLBAR
   ========================================================= */

#demoFrame::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

#demoFrame::-webkit-scrollbar-track {
  background: transparent;
}

#demoFrame::-webkit-scrollbar-thumb {
  background: transparent;

  border-radius: 999px;

  transition: background 0.2s ease;
}

/* Light theme */
#demoFrame:hover::-webkit-scrollbar-thumb {
  background: rgb(107 114 128 / 18%);
}

#demoFrame::-webkit-scrollbar-thumb:hover {
  background: rgb(107 114 128 / 30%);
}

#demoFrame::-webkit-scrollbar-corner {
  background: transparent;
}

/* =========================================================
   WINDOW EDGE
   ========================================================= */

.demo-window::after {
  content: "";

  position: absolute;

  inset: 0;

  border-radius: inherit;

  pointer-events: none;

  box-shadow: inset 0 0 0 0.5px hsl(var(--border) / 0.35);

  z-index: 20;
}

/* =========================================================
   DARK THEME
   ========================================================= */

html.dark .demo-modal {
  background: rgb(0 0 0 / 68%);
}

html.dark .demo-window {
  background: var(--surface);

  border-color: var(--border);

  box-shadow:
    0 30px 100px hsl(var(--shadow-color) / 0.55),
    0 8px 30px hsl(var(--shadow-color) / 0.35);
}

html.dark .demo-header {
  background: var(--surface-glass);

  border-bottom-color: var(--border);
}

html.dark #demoFrame {
  background: var(--surface);
}

html.dark #demoFrame:hover::-webkit-scrollbar-thumb {
  background: rgb(156 163 175 / 18%);
}

html.dark #demoFrame::-webkit-scrollbar-thumb:hover {
  background: rgb(156 163 175 / 30%);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {
  .demo-modal {
    padding: 10px;
  }

  .demo-window {
    width: 100%;
    height: 94vh;

    border-radius: var(--radius-md);
  }

  .demo-header {
    flex-basis: 46px;

    height: 46px;
    min-height: 46px;
  }

  .window-controls {
    left: 11px;
    gap: 6px;
  }

  .window-controls span {
    width: 11px;
    height: 11px;

    min-width: 11px;
    min-height: 11px;

    flex-basis: 11px;
  }

  .demo-actions {
    right: 7px;
  }

  .demo-actions button {
    width: 30px;
    height: 30px;
  }

  .demo-title {
    max-width: 40%;
  }
}
