/* ============================================================
   RABAIL ALI BHATTI — PORTFOLIO
   Professional branded theme: ink navy + signature blue
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  /* Brand palette */
  --ink: #0f1b2d;
  /* deep navy ink — headings */
  --ink-soft: #283447;
  /* body emphasis */
  --slate: #5b6675;
  /* muted body text */
  --slate-light: #5f6b7a;
  /* light labels (darkened to meet WCAG AA 4.5:1 on white) */

  --brand: #1d4ed8;
  /* signature blue */
  --brand-dark: #1e3a8a;
  /* darker brand for hovers */
  --brand-soft: #eff4ff;
  /* tinted backgrounds */
  --accent: #0ea5e9;
  /* secondary sky accent */

  --line: #e3e8f0;
  /* borders */
  --line-soft: #eef2f7;

  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  /* section bands */
  --surface: #ffffff;
  /* cards */
  --surface-tint: #f6f8fc;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.04), 0 2px 8px rgba(15, 27, 45, 0.05);
  --shadow: 0 6px 24px -8px rgba(15, 27, 45, 0.12), 0 2px 6px rgba(15, 27, 45, 0.05);
  --shadow-lg: 0 20px 48px -16px rgba(29, 78, 216, 0.18);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --max: 1120px;

  /* Typography + detail-page tokens (referenced by Phase 3 detail CSS).
     Defined here so the design language stays consistent everywhere. */
  --font-body: "Open Sans", system-ui, sans-serif;
  --font-display: "Sora", system-ui, sans-serif;
  --muted: var(--slate);
  --border: var(--line);
}

[data-theme="dark"] {
  --ink: #e8edf5;
  --ink-soft: #c8d0dc;
  --slate: #94a3b8;
  --slate-light: #8290a8;
  /* light labels (lightened to meet WCAG AA 4.5:1 on dark) */

  --brand: #60a5fa;
  --brand-dark: #3b82f6;
  --brand-soft: #1e293b;
  --accent: #38bdf8;

  --line: #1e293b;
  --line-soft: #1a2332;

  --bg: #0f172a;
  --bg-alt: #131c31;
  --surface: #1a2332;
  --surface-tint: #1e293b;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 6px 24px -8px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 48px -16px rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .hero {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(56, 189, 248, 0.08), transparent 60%),
    radial-gradient(700px 400px at 5% 20%, rgba(96, 165, 250, 0.07), transparent 60%),
    var(--bg);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: "Open Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--slate);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

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

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

ul {
  list-style: none;
}

/* Visible keyboard focus for every interactive element (accessibility).
   Replaces any suppressed default outline with a clear brand ring. */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sm {
  padding: 11px 20px;
  font-size: 0.88rem;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(29, 78, 216, 0.5);
}

.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(29, 78, 216, 0.55);
}

.btn-ghost {
  background: var(--bg);
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 16px 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 11px 0;
}

[data-theme="dark"] .navbar.scrolled {
  background: rgba(15, 23, 42, 0.9);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.logo-text {
  color: var(--ink);
  font-size: 1.02rem;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--slate);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.nav-link.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.nav-cta {
  padding: 9px 20px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-cta:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: none;
  border: 1.5px solid var(--line);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--slate);
  font-size: 1rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  width: 24px;
  height: 2.5px;
  background: var(--ink);
  border-radius: 4px;
  transition: var(--transition);
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 170px 0 90px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(14, 165, 233, 0.07), transparent 60%),
    radial-gradient(700px 400px at 5% 20%, rgba(29, 78, 216, 0.06), transparent 60%),
    var(--bg);
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero-content {
  flex: 1.2;
}

.hero-visual {
  flex: 0.8;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-img-wrap {
  width: 100%;
  max-width: 360px;
  position: relative;
}

.hero-img-wrap img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.hero-img-wrap::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: calc(var(--radius) + 10px);
  background: linear-gradient(135deg, var(--brand-soft) 0%, transparent 80%);
  z-index: 0;
}

.hero-greeting {
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 14px;
  font-size: 1.02rem;
}

.hero-name,
.hero-title {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.8rem, 5.2vw, 3.3rem);
  font-weight: 800;
  line-height: 1.12;
  color: var(--ink);
  margin-bottom: 22px;
  letter-spacing: -0.8px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.hero-desc {
  font-size: 1.08rem;
  max-width: 720px;
  margin-bottom: 36px;
  color: var(--slate);
}

.hero-desc strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

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

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

.stat-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.stat-num {
  font-family: "Sora", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}

.stat-plus {
  color: var(--brand);
  font-size: 2.2rem;
  font-weight: 800;
  font-family: "Sora", sans-serif;
}

.stat-label {
  color: var(--slate-light);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 7px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---------- Sections ---------- */
.section {
  padding: 96px 0;
  position: relative;
}

.about,
.experience,
.certs {
  background: var(--bg-alt);
}

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

.section-tag {
  display: inline-block;
  color: var(--brand);
  font-family: "Sora", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.section-sub {
  color: var(--slate);
  margin-top: 12px;
  max-width: 560px;
  margin-inline: auto;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-text p {
  color: var(--slate);
  margin-bottom: 18px;
}

.about-text strong {
  color: var(--ink-soft);
}

.about-meta {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-meta li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--slate);
  font-size: 0.95rem;
  font-weight: 500;
}

.about-meta i {
  color: var(--brand);
  width: 18px;
}

.about-cards {
  display: grid;
  gap: 16px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.info-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.info-card i {
  font-size: 1.4rem;
  color: var(--brand);
  margin-bottom: 4px;
}

.info-card h3 {
  font-size: 1.05rem;
  color: var(--ink);
  font-family: "Sora", sans-serif;
}

.info-card p {
  color: var(--slate);
  font-size: 0.9rem;
}

/* ---------- Skills ---------- */
.skills-group+.skills-group {
  margin-top: 38px;
}

.skills-sub {
  font-family: "Sora", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 18px;
  padding-left: 14px;
  border-left: 3px solid var(--brand);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.skill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 26px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.skill:hover {
  transform: translateY(-6px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.skill i {
  font-size: 2.1rem;
  color: var(--brand);
  transition: var(--transition);
}

.skill:hover i {
  transform: scale(1.12);
  color: var(--brand-dark);
}

.skill span {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding-left: 36px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  margin-bottom: 26px;
}

.timeline-dot {
  position: absolute;
  left: -36px;
  top: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  border: 4px solid var(--bg-alt);
  box-shadow: 0 0 0 2px var(--brand);
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.timeline-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--brand);
  transform: translateX(4px);
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.timeline-top h3 {
  font-family: "Sora", sans-serif;
  font-size: 1.1rem;
  color: var(--ink);
}

.timeline-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 12px;
  border-radius: 50px;
}

.timeline-org {
  color: var(--brand);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 4px 0 8px;
}

.timeline-card>p {
  color: var(--slate);
  font-size: 0.92rem;
}

/* ---------- Projects ---------- */
.projects-subhead {
  font-family: "Sora", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 8px 0 18px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 56px;
}

.featured-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.featured-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
}

.featured-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--brand);
}

.featured-card h3 {
  font-family: "Sora", sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.featured-card>p {
  color: var(--slate);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.featured-card strong {
  color: var(--ink-soft);
}

.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tech-chips span {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--slate);
  background: var(--surface-tint);
  border: 1px solid var(--line);
  padding: 4px 11px;
  border-radius: 50px;
}

.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 22px;
}

.filter-btn {
  padding: 9px 20px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--slate);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.filter-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.cat-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.cat-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate);
  transition: var(--transition);
}

.cat-stat:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.cat-stat .cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
}

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

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

.project-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 12px 40px -12px rgba(29, 78, 216, 0.25);
  border-color: var(--brand);
  text-decoration: none;
}

.project-thumb {
  position: relative;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-thumb i {
  font-size: 2.8rem;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
}

.project-card:hover .project-thumb i {
  transform: translateY(-6px) scale(1.1);
}

.project-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
}

/* Floating dots decoration */
.project-thumb::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -20px;
  right: -20px;
  z-index: 0;
}

.project-card[data-category="app"] .project-thumb {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.project-card[data-category="tool"] .project-thumb {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

.project-card[data-category="api"] .project-thumb {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.project-card[data-category="ui"] .project-thumb {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}

/* Number badge */
.project-num {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  font-family: "Sora", sans-serif;
}

.project-info {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.project-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 50px;
  width: fit-content;
}

.project-card h3 {
  font-family: "Sora", sans-serif;
  font-size: 1.08rem;
  color: var(--ink);
}

.project-card p {
  color: var(--slate);
  font-size: 0.88rem;
  flex-grow: 1;
  line-height: 1.5;
}

/* Tech chips */
.project-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.project-chips span {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-tint);
  color: var(--slate-light);
  border: 1px solid var(--line-soft);
  letter-spacing: 0.2px;
}

.project-link {
  margin-top: auto;
  padding-top: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
  border-top: 1px solid var(--line-soft);
}

.project-card:hover .project-link {
  gap: 11px;
}

.project-card.hidden {
  display: none;
}

/* ---------- Certifications ---------- */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.cert-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-left: 4px solid var(--brand);
}

.cert-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.cert-card>i {
  font-size: 1.3rem;
  color: var(--brand);
  margin-bottom: 6px;
}

.cert-card h3 {
  font-family: "Sora", sans-serif;
  font-size: 1.02rem;
  color: var(--ink);
}

.cert-org {
  color: var(--brand);
  font-weight: 600;
  font-size: 0.88rem;
}

.cert-date {
  color: var(--slate-light);
  font-size: 0.82rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-info-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.contact-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.contact-key {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-value {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  word-break: break-all;
}

.contact-value a {
  color: inherit;
  text-decoration: none;
}

.contact-value a:hover {
  color: var(--brand);
}

.cv-download {
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.cv-download a {
  color: var(--brand);
}

.cv-download a:hover {
  text-decoration: underline;
}

.contact-ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.contact-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.contact-cta {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  color: var(--ink);
  font-size: 1.02rem;
}

.socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.social-btn {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  color: var(--slate);
  transition: var(--transition);
}

.social-btn:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-4px);
  border-color: var(--brand);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  background: var(--bg);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand .logo-mark {
  width: 32px;
  height: 32px;
  font-size: 0.82rem;
  border-radius: 7px;
}

.footer p {
  color: var(--slate-light);
  font-size: 0.86rem;
}

.back-top {
  color: var(--slate);
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.back-top:hover {
  color: var(--brand);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ---------- Contact Form ---------- */
.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.contact-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.form-row {
  display: flex;
  gap: 20px;
}

.form-row>div {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-row input {
  flex: 1;
}

/* Honeypot */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form .btn {
  align-self: flex-start;
}

/* ---------- Websites Grid ---------- */
.websites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 8px;
}

.website-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.website-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.website-icon {
  width: 48px;
  height: 48px;
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: var(--brand);
  margin-bottom: 4px;
}

.website-card h3 {
  font-size: 1.1rem;
}

.website-card p {
  color: var(--slate);
  font-size: 0.88rem;
  flex: 1;
}

.website-tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  width: fit-content;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

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

  .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 720px) {

  .nav-links,
  .nav-cta {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    height: 100dvh;
    width: 78%;
    max-width: 320px;
    background: var(--bg);
    border-left: 1px solid var(--line);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 2rem 1.5rem;
    transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-cta {
    display: none;
  }

  .nav-link {
    font-size: 1.05rem;
    width: 100%;
    text-align: center;
  }

  .menu-toggle {
    display: flex;
    z-index: 1000;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 24px;
  }

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

@media (max-width: 560px) {

  .featured-grid,
  .projects-grid,
  .skills-grid,
  .certs-grid,
  .websites-grid {
    grid-template-columns: 1fr;
  }

  .cat-stats {
    gap: 8px;
  }

  .cat-stat {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

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

  .contact-card {
    padding: 18px 16px;
    gap: 14px;
  }

  .contact-value {
    font-size: 0.95rem;
  }

  .form-row {
    flex-direction: column;
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .stat-num,
  .stat-plus {
    font-size: 1.8rem;
  }

  .timeline {
    padding-left: 32px;
  }

  .timeline-dot {
    left: -32px;
  }
}

/* --- Detail pages (Phase 3) --- */
.breadcrumb {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.detail-head {
  max-width: 760px;
  margin: 0 auto 2rem;
  text-align: center;
}

.detail-tag {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  padding: .3rem .8rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.detail-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--ink);
  margin-bottom: .75rem;
  font-family: var(--font-display);
}

.detail-lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.detail-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.detail-shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.detail-shots img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.detail-body {
  max-width: 760px;
  margin: 0 auto;
}

.detail-body h2 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 2rem 0 .75rem;
  font-size: 1.5rem;
}

.detail-body p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.coming-soon {
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.detail-related {
  margin-top: 3rem;
}

/* ---------- Mobile menu backdrop ---------- */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 98;
}

.nav-backdrop.show {
  opacity: 1;
  visibility: visible;
}

body.menu-open {
  overflow: hidden;
}

/* ---------- Reduced motion ---------- */
@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;
  }

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