/* ═══════════════════════════════════════════════════════
   Mohamed Yehia — Portfolio Stylesheet
   ═══════════════════════════════════════════════════════
   Architecture : BEM + CSS Custom Properties
   Themes       : Dark (default), Light
   ═══════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   0. RESET & BASE
   ───────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%; /* Satisfies the Safari warning */
  -moz-text-size-adjust: 100%; /* Satisfies the Firefox warning */
  text-size-adjust: 100%; /* Standard syntax goes last */
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.25s ease;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ─────────────────────────────────────────────
   1. DESIGN TOKENS (CSS Variables)
   ───────────────────────────────────────────── */

/* Corporate Blue accent palette */
:root {
  --accent-h: 217;
  --accent-s: 91%;
  --accent-l: 60%;
  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-hover: hsl(var(--accent-h), var(--accent-s), 52%);
  --accent-soft: hsl(var(--accent-h), 70%, 95%);
  --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  --container-max: 1140px;
  --header-height: 72px;
}

/* ─── Dark Theme (default) ─── */
[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1a2234;
  --bg-card-hover: #1f2a40;
  --bg-input: #1a2234;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-color: rgba(148, 163, 184, 0.12);
  --border-focus: var(--accent);

  --header-bg: rgba(11, 15, 25, 0.82);
  --header-border: rgba(148, 163, 184, 0.08);

  --tag-bg: rgba(59, 130, 246, 0.12);
  --tag-color: hsl(217, 91%, 72%);

  --accent-soft: hsl(217, 60%, 18%);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* ─── Light Theme ─── */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --border-color: rgba(15, 23, 42, 0.08);
  --border-focus: var(--accent);

  --header-bg: rgba(248, 250, 252, 0.85);
  --header-border: rgba(15, 23, 42, 0.06);

  --tag-bg: rgba(59, 130, 246, 0.08);
  --tag-color: hsl(217, 91%, 50%);

  --accent-soft: hsl(217, 80%, 95%);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ─────────────────────────────────────────────
   2. LAYOUT UTILITIES
   ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

.section__header {
  text-align: center;
  margin-bottom: 56px;
}

.section__tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.section__title {
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

/* ─────────────────────────────────────────────
   3. BUTTONS
   ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn svg {
  flex-shrink: 0;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn--secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn--secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn--outline:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn--full {
  width: 100%;
  justify-content: center;
}

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ─────────────────────────────────────────────
   4. HEADER
   ───────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
  background: transparent;
}

.header--scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--shadow-sm);
}

.header--hidden {
  transform: translateY(-100%);
}

.header__container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
  gap: 0;
}

/* ─── CLI Terminal Logo ─── */
.cli-logo {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  font-family:
    "JetBrains Mono", "Fira Code", "Cascadia Code", "SF Mono", "Consolas",
    monospace;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  color: var(--text-primary);
  padding: 6px 0px 6px 12px;
  border-radius: var(--radius-sm);
  transition:
    background var(--transition-fast),
    font-size 0.15s ease;
}

.cli-logo:hover {
  background: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.06);
}

.cli-logo__prompt {
  color: var(--accent);
  margin-right: 6px;
  -webkit-user-select: none;
  user-select: none;
  flex-shrink: 0;
}

.cli-logo__text {
  color: var(--text-primary);
  text-shadow:
    0 0 8px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.4),
    0 0 20px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.15);
}

.cli-logo__cursor {
  display: inline-block;
  width: 8px;
  height: 1.15em;
  margin-left: 1px;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 1px;
  vertical-align: text-bottom;
  box-shadow:
    0 0 8px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5),
    0 0 20px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.2);
  animation: cli-blink 1s step-end infinite;
}
 /* ❯ _ */
/* .cli-logo__cursor {

  display: inline-block;
  width: 10px;
  height: 3px;
  margin-left: 3px;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 1px;
  
  /* THE FIX: Pushes the block down from the vertical center to the baseline */
  /* transform: translateY(6px); 

  box-shadow:
    0 0 8px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5),
    0 0 20px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.2);
  animation: cli-blink 1s step-end infinite;
} */ 
@keyframes cli-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.header__nav {
  justify-self: center;
}

.header__nav-list {
  display: flex;
  gap: 8px;
}

.header__nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.header__nav-link:hover,
.header__nav-link--active {
  color: var(--accent);
}

.header__nav-link::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transform: translateX(-50%);
  transition: width var(--transition-base);
}

.header__nav-link:hover::after,
.header__nav-link--active::after {
  width: 50%;
}

.header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1001;
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--tag-bg);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Show sun in dark, moon in light */
[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}
[data-theme="dark"] .theme-toggle__icon--sun {
  display: block;
}
[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}
[data-theme="light"] .theme-toggle__icon--moon {
  display: block;
}

/* Hamburger */
.header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.header__hamburger:hover {
  background: var(--tag-bg);
}

.header__hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition-base);
  transform-origin: center;
}

.header__hamburger--active .header__hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__hamburger--active .header__hamburger-line:nth-child(2) {
  opacity: 0;
}

.header__hamburger--active .header__hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─────────────────────────────────────────────
   5. HERO
   ───────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: calc(var(--header-height) + 40px) 0 120px;
  overflow: hidden;
}

.hero__container {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 780px;
}

.hero__badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(59, 130, 246, 0.15);
  margin-bottom: 28px;
}

.hero__name {
  font-family: "Poppins", sans-serif;
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero__name-accent {
  background: linear-gradient(135deg, var(--accent), hsl(240, 80%, 65%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__title {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero__intro {
  font-size: clamp(0.95rem, 1.8vw, 1.12rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* Scroll indicator */
.hero__scroll {
  position: absolute;
  top: 100%;
  margin-top: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.4;
    transform: scaleY(0.6);
  }
}

/* Background decoration */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__bg-gradient {
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  filter: blur(80px);
  opacity: 0.5;
}

.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    black 30%,
    transparent 75%
  );
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  opacity: 0.4;
}

/* ─────────────────────────────────────────────
   6. ABOUT
   ───────────────────────────────────────────── */
.about__grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 60px;
  align-items: start;
}

.about__image-wrapper {
  position: relative;
}

.about__image {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.about__photo {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.about__image:hover .about__photo {
  transform: scale(1.04);
}

.about__image-decor {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  border: 2px solid var(--accent);
  opacity: 0.2;
  z-index: 0;
  transition:
    opacity 0.4s ease,
    filter 0.4s ease;
}

/* Triggers the glow when hovering anywhere on the photo */
.about__image-wrapper:hover .about__image-decor,
.about__image-wrapper:active .about__image-decor {
  opacity: 0.7; /* Brightens the accent line */
  filter: drop-shadow(0 0 15px var(--accent)); /*Casts the soft glowing light */
}

.about__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about__text {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.85;
}

.about__text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.about__stats {
  display: flex;
  gap: 40px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.about__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.about__stat-number {
  font-family: "Poppins", sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
/* This targets ONLY the number of YOE*/
.about__stat:last-child .about__stat-number::after {
  content: " +";
}

.about__stat-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────────
   7. SKILLS
   ───────────────────────────────────────────── */
.skills {
  background: var(--bg-secondary);
}

.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  transition: all var(--transition-base);
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow:
    var(--shadow-card),
    0 0 0 1px var(--accent-glow);
}

.skill-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--tag-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.skill-card__title {
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

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

.skill-card__item {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tag-color);
  background: var(--tag-bg);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.skill-card:hover .skill-card__item {
  background: var(--accent);
  color: #fff;
}

/* ─────────────────────────────────────────────
   8. PROJECTS
   ───────────────────────────────────────────── */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow:
    var(--shadow-card),
    0 0 0 1px var(--accent-glow);
  border-color: var(--accent);
}

.project-card__image {
  aspect-ratio: 16 / 10;
  background: linear-gradient(
    135deg,
    var(--bg-secondary),
    var(--bg-card-hover)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.project-card__image-placeholder {
  color: var(--text-muted);
  opacity: 0.35;
}

.project-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.project-card__body {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card__title {
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.project-card__desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  flex-grow: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.project-card__tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tag-color);
  background: var(--tag-bg);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  transition: all var(--transition-fast);
}

.project-card__link svg {
  transition: transform var(--transition-fast);
}

.project-card__link:hover {
  color: var(--accent-hover);
}

.project-card__link:hover svg {
  transform: translateX(4px);
}

/* ─────────────────────────────────────────────
   9. EXPERIENCE / TIMELINE
   ───────────────────────────────────────────── */
.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15px;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), var(--border-color));
  border-radius: 1px;
}

.timeline__item {
  position: relative;
  padding-bottom: 48px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__marker {
  position: absolute;
  left: -40px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
  z-index: 1;
}

.timeline__content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  transition: all var(--transition-base);
}

.timeline__content:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}

.timeline__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline__company {
  font-family: "Poppins", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline__date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

.timeline__role {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.timeline__details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline__details li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.timeline__details li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ─────────────────────────────────────────────
   10. SERVICES
   ───────────────────────────────────────────── */
.services {
  background: var(--bg-secondary);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), hsl(240, 80%, 65%));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
  border-color: var(--accent);
}

.service-card__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--tag-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  transition: all var(--transition-base);
}

.service-card:hover .service-card__icon {
  background: var(--accent);
  color: #fff;
}

.service-card__title {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.service-card__desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─────────────────────────────────────────────
   11. CAREER OBJECTIVE
   ───────────────────────────────────────────── */
.objective__card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  position: relative;
  text-align: center;
}

.objective__icon {
  color: var(--accent);
  margin: 0 auto 20px;
  opacity: 0.5;
}

.objective__text {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.9;
}

.objective__text strong {
  color: var(--accent);
  font-weight: 600;
}

/* ─────────────────────────────────────────────
   11a. EDUCATION
   ───────────────────────────────────────────── */
.education {
  background: var(--bg-secondary);
}

.timeline__subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline__subheader .timeline__role {
  margin-bottom: 0;
}

.timeline__gpa {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

/* ─────────────────────────────────────────────
   11b. CERTIFICATIONS
   ───────────────────────────────────────────── */
.certifications__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.cert-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), hsl(240, 80%, 65%));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.cert-card:hover::before {
  transform: scaleX(1);
}

.cert-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}

.cert-card__badge {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: var(--radius-md);
  background: var(--tag-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.cert-card:hover .cert-card__badge {
  background: var(--accent);
  color: #fff;
}

.cert-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cert-card__title {
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.cert-card__issuer {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.cert-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 8px;
  transition: all var(--transition-fast);
}

.cert-card__link svg {
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.cert-card__link:hover {
  color: var(--accent-hover);
}

.cert-card__link:hover svg {
  transform: translate(2px, -2px);
}

/* ─────────────────────────────────────────────
   11c. COLLAPSIBLE GRIDS & EXPAND BUTTONS
   ───────────────────────────────────────────── */

/* Projects: show max 3 items when collapsed */
.projects__grid--collapsed .project-card:nth-child(n + 4) {
  display: none;
}

/* Certifications: show max 6 items when collapsed */
.certifications__grid--collapsed .cert-card:nth-child(n + 7) {
  display: none;
}

/* Expand button wrapper */
.section__expand-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* Hide the button entirely when nothing is collapsed */
.section__expand-wrapper--hidden {
  display: none;
}

/* Expand button styling */
.section__expand-btn {
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
  transition: all var(--transition-base);
}

.section__expand-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.section__expand-btn svg {
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.section__expand-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.contact {
  background: var(--bg-secondary);
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact__form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.contact__input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.contact__input::placeholder {
  color: var(--text-muted);
}

.contact__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.contact__textarea {
  resize: vertical;
  min-height: 120px;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact__info-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
}

.contact__info-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.contact__socials {
  display: flex;
  gap: 12px;
}

.contact__social {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-base);
}

.contact__social:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.contact__social:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.contact__detail {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.contact__detail svg {
  color: var(--accent);
  flex-shrink: 0;
}

.contact__detail a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.contact__detail a:hover {
  color: var(--accent);
}

/* ─────────────────────────────────────────────
   13. FOOTER
   ───────────────────────────────────────────── */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
}

.footer__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer__top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer__top:hover {
  color: var(--accent);
}

/* ─────────────────────────────────────────────
   14. REVEAL / ANIMATIONS
   ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Maintain horizontal center for absolute elements */
.hero__scroll.reveal {
  transform: translate(-50%, 30px);
}

.hero__scroll.reveal.revealed {
  transform: translate(-50%, 0);
}

/* Stagger children */
.skills__grid .reveal:nth-child(2) {
  transition-delay: 0.1s;
}
.skills__grid .reveal:nth-child(3) {
  transition-delay: 0.2s;
}

.projects__grid .reveal:nth-child(2) {
  transition-delay: 0.1s;
}
.projects__grid .reveal:nth-child(3) {
  transition-delay: 0.2s;
}

.services__grid .reveal:nth-child(2) {
  transition-delay: 0.1s;
}
.services__grid .reveal:nth-child(3) {
  transition-delay: 0.2s;
}

.timeline__item.reveal:nth-child(2) {
  transition-delay: 0.15s;
}

.certifications__grid .reveal:nth-child(2) {
  transition-delay: 0.1s;
}
.certifications__grid .reveal:nth-child(3) {
  transition-delay: 0.2s;
}

/* ─────────────────────────────────────────────
   15. RESPONSIVE
   ───────────────────────────────────────────── */

/* ── Tablet ── */
@media (max-width: 1024px) {
  .skills__grid,
  .projects__grid,
  .services__grid,
  .certifications__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about__grid {
    grid-template-columns: 240px 1fr;
    gap: 40px;
  }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .section {
    padding: 72px 0;
  }

  .section__header {
    margin-bottom: 40px;
  }

  /* Header: switch to flex on mobile since nav slides out */
  .header__container {
    display: flex;
    justify-content: space-between;
  }

  .cli-logo {
    margin-right: 12px;
  }

  .header__hamburger {
    display: flex;
  }

  .header__nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: calc(var(--header-height) + 24px) 24px 24px;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: 999;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.2);
  }

  .header__nav--open {
    transform: translateX(0);
  }

  .header__nav-list {
    flex-direction: column;
    gap: 4px;
  }

  .header__nav-link {
    display: block;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .header__nav-link:hover,
  .header__nav-link--active {
    background: var(--tag-bg);
  }

  .header__nav-link::after {
    display: none;
  }

  /* Grids */
  .skills__grid,
  .projects__grid,
  .services__grid,
  .certifications__grid {
    grid-template-columns: 1fr;
  }

  .cert-card {
    padding: 24px 20px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about__image-wrapper {
    max-width: 200px;
    margin: 0 auto;
  }

  .about__content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    gap: 16px;
  }

  .about__text {
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.75;
  }

  .about__stats {
    justify-content: space-around;
    gap: 16px;
    text-align: center;
  }

  .about__stat-number {
    font-size: 1.8rem;
  }

  .contact__grid {
    grid-template-columns: 1fr;
  }

  /* Hero */
  .hero__cta {
    flex-direction: column;
    align-items: center;
  }

  .hero__cta .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .hero__scroll {
    display: flex;
  }

  /* Timeline */
  .timeline {
    padding-left: 30px;
  }

  .timeline::before {
    left: 10px;
  }

  .timeline__marker {
    left: -30px;
  }

  .timeline__content {
    padding: 22px 20px;
  }

  /* Objective */
  .objective__card {
    padding: 32px 24px;
  }

  /* Footer */
  .footer__container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* ── Small phones ── */
@media (max-width: 400px) {
  .container {
    padding: 0 16px;
  }

  .hero__name {
    font-size: 2.4rem;
  }

  .about__stats {
    gap: 24px;
  }
}

/* ─────────────────────────────────────────────
   16. ACCESSIBILITY & FOCUS
   ───────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Skip to main content (hidden, visible on focus) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 12px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}
