/* ==========================================================================
   Shafin Ahmed — Portfolio
   Theme: deep-navy dark with an electric-blue accent (from the "S" logo)
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #070b16;
  --bg-soft: #0b1120;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-solid: #101a2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text: #e8eefb;
  --muted: #93a1bd;
  --faint: #64748b;

  /* Brand */
  --accent: #1ea7e6;
  --accent-2: #4fd6ff;
  --accent-3: #6c8cff;
  --navy: #001a4d;
  --accent-grad: linear-gradient(120deg, #1ea7e6 0%, #4fd6ff 55%, #6c8cff 100%);
  --accent-glow: rgba(30, 167, 230, 0.35);

  /* System */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --maxw: 1140px;
  --nav-h: 72px;
  --font-head: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 55% at 80% -5%, rgba(30, 167, 230, 0.18), transparent 60%),
    radial-gradient(50% 50% at 8% 10%, rgba(108, 140, 255, 0.14), transparent 60%),
    radial-gradient(45% 45% at 50% 110%, rgba(79, 214, 255, 0.10), transparent 60%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 .5H40M.5 0V40' fill='none' stroke='%23ffffff' stroke-opacity='0.02'/%3E%3C/svg%3E");
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1f2c47; border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c3f66; }

/* ---------- Layout helpers ---------- */
.container { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.015), transparent); }

.kicker {
  font-family: var(--font-head);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 600;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent-grad); border-radius: 2px; }

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.section-title .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-head { margin-bottom: 52px; max-width: 720px; }
.section-head p { color: var(--muted); margin-top: 14px; font-size: 1.02rem; }

/* ---------- Buttons ---------- */
.btn {
  --bh: 52px;
  display: inline-flex; align-items: center; gap: 10px;
  height: var(--bh); padding: 0 26px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600; font-size: 0.96rem;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent-grad); color: #04121f; box-shadow: 0 12px 30px -10px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 44px -12px var(--accent-glow); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); color: #fff; background: rgba(30,167,230,0.08); }
.btn-sm { --bh: 42px; padding: 0 18px; font-size: 0.86rem; }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7, 11, 22, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 6px 18px -6px rgba(0,0,0,0.6); }
.brand span b { color: var(--accent-2); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a:not(.btn) {
  position: relative; padding: 9px 15px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 0.94rem;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:not(.btn):hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: #fff; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 2px;
  height: 2px; background: var(--accent-grad); border-radius: 2px;
}
.nav-cta { margin-left: 8px; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 44px; height: 44px; color: var(--text); }
.nav-toggle span { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px auto; border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Scroll progress bar */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 200; background: var(--accent-grad); box-shadow: 0 0 12px var(--accent-glow); transition: width 0.1s linear; }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: calc(var(--nav-h) + 30px); padding-bottom: 60px; position: relative; overflow: hidden; }
.hero-glow {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(52% 58% at 80% 22%, rgba(30,167,230,0.38), transparent 65%),
    radial-gradient(42% 45% at 62% 78%, rgba(108,140,255,0.20), transparent 70%),
    radial-gradient(30% 30% at 15% 90%, rgba(79,214,255,0.08), transparent 70%);
}
.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.25fr 0.9fr; gap: 56px; align-items: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.83rem; color: var(--muted); margin-bottom: 26px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #22e39a; box-shadow: 0 0 0 4px rgba(34,227,154,0.16); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(34,227,154,0); } }

.hero h1 { font-family: var(--font-head); font-size: clamp(2.6rem, 6.2vw, 4.4rem); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; }
.hero h1 .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-role { font-family: var(--font-head); font-size: clamp(1.15rem, 2.6vw, 1.7rem); font-weight: 600; margin-top: 16px; min-height: 1.6em; color: var(--text); }
.hero-role .type { color: var(--accent-2); }
.hero-role .cursor { display: inline-block; width: 3px; height: 1.1em; background: var(--accent-2); margin-left: 3px; vertical-align: -0.15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-tagline { color: var(--muted); font-size: 1.08rem; margin-top: 22px; max-width: 46ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-socials { display: flex; gap: 12px; margin-top: 30px; }
.social-btn {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); transition: all 0.25s var(--ease);
}
.social-btn:hover { color: #fff; border-color: var(--accent); transform: translateY(-4px); background: rgba(30,167,230,0.1); box-shadow: 0 12px 24px -12px var(--accent-glow); }
.social-btn svg { width: 21px; height: 21px; }

/* Hero portrait — polaroid */
.hero-photo { justify-self: end; position: relative; }
@keyframes floaty { 50% { transform: translateY(-16px); } }
.polaroid {
  width: min(30vw, 420px); margin-left: auto; transform: rotate(-3deg);
  filter: drop-shadow(0 40px 70px rgba(0,0,0,0.6));
  animation: floaty 7s ease-in-out infinite;
}
.polaroid-window {
  position: relative; border: 16px solid #f4f4f2; border-bottom: 0;
  border-radius: 10px 10px 0 0; aspect-ratio: 1/1; background: transparent; overflow: visible;
}
.polaroid-window img {
  position: absolute; left: 50%; bottom: 0; top: -46%; height: 146%; width: auto; max-width: none;
  transform: translateX(-50%); object-fit: contain; object-position: bottom;
}
.polaroid-caption { background: #f4f4f2; border-radius: 0 0 10px 10px; padding: 18px 8px 22px 24px; }
.polaroid-caption .cap-row { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; font-size: 0.92rem; color: #1a1c22; }
.polaroid-caption .cap-row.sub { margin-top: 8px; font-weight: 600; font-size: 0.86rem; color: #5b5e66; }
.polaroid-caption .ic { font-size: 1rem; }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: var(--faint); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-cue .mouse { width: 24px; height: 38px; border: 2px solid var(--border-strong); border-radius: 14px; position: relative; }
.scroll-cue .mouse::before { content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 4px; height: 7px; background: var(--accent-2); border-radius: 3px; animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about-text p { color: var(--muted); margin-bottom: 18px; }
.about-text p:first-child { color: var(--text); font-size: 1.12rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fact {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px; transition: transform 0.25s var(--ease), border-color 0.25s;
}
.fact:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.fact .ic { font-size: 1.5rem; }
.fact .lbl { color: var(--faint); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.12em; margin: 10px 0 4px; }
.fact .val { font-weight: 600; font-family: var(--font-head); font-size: 0.98rem; line-height: 1.35; }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; margin-left: 8px; margin-top: 48px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), transparent); }
.tl-item { position: relative; padding: 0 0 34px 38px; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(30,167,230,0.12);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-period { font-family: var(--font-head); font-size: 0.8rem; color: var(--accent-2); letter-spacing: 0.05em; text-transform: uppercase; }
.tl-role { font-family: var(--font-head); font-weight: 700; font-size: 1.16rem; margin-top: 4px; }
.tl-org { color: var(--accent); font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
.tl-desc { color: var(--muted); font-size: 0.96rem; }

/* ---------- Ongoing works ---------- */
.ongoing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.ongoing-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 30px 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.ongoing-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent-grad);
}
.ongoing-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.ongoing-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ongoing-type {
  font-family: var(--font-head); font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2);
}
.ongoing-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px; font-size: 0.76rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.ongoing-status .dot { width: 7px; height: 7px; border-radius: 50%; background: #22e39a; box-shadow: 0 0 0 4px rgba(34,227,154,0.16); animation: pulse 2s infinite; }
.ongoing-card h3 { font-family: var(--font-head); font-size: 1.22rem; line-height: 1.35; letter-spacing: -0.01em; margin-bottom: 14px; }
.ongoing-card p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.ongoing-highlight {
  align-self: flex-start; margin-top: 20px;
  padding: 7px 14px; border-radius: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 0.86rem;
  background: rgba(30,167,230,0.12); color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(30,167,230,0.28);
}
@media (max-width: 900px) { .ongoing-grid { grid-template-columns: 1fr; } }

/* ---------- Animated stat cards (Experience section + Projects page) ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-card {
  display: block;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 28px 26px; transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
a.stat-card:hover { background: rgba(30,167,230,0.06); }
.stat-num { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.1rem, 4vw, 2.7rem); line-height: 1; color: var(--accent-2); }
.stat-label { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--text); margin-top: 16px; }
.stat-sub { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }

/* Neon icon badge — used on the Projects page category stat cards */
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 18px;
  display: grid; place-items: center;
  background: rgba(30,167,230,0.12);
  box-shadow: inset 0 0 0 1px rgba(30,167,230,0.28);
  color: var(--accent-2);
}
.stat-icon svg { width: 24px; height: 24px; filter: drop-shadow(0 0 7px rgba(30,167,230,0.65)); }

/* ---------- Skills ---------- */
.skill-group { margin-bottom: 34px; }
.skill-group h3 { font-family: var(--font-head); font-size: 1.05rem; color: var(--text); margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.skill-group h3::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent-grad); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.skill {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.skill:hover { transform: translateY(-4px); border-color: var(--accent); background: rgba(30,167,230,0.06); }
.skill-ic {
  width: 42px; height: 42px; flex: none; border-radius: 11px;
  background: #fff; display: grid; place-items: center; padding: 7px;
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.4);
}
.skill-ic img { width: 100%; height: 100%; object-fit: contain; }
.skill-ic .badge { font-family: var(--font-head); font-weight: 700; color: var(--navy); font-size: 0.9rem; }
.skill span { font-weight: 600; font-family: var(--font-head); font-size: 0.94rem; }

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 24px; }
.projects-cta { text-align: center; margin-top: 40px; }

/* Category subtitles on the full Projects page */
.project-category { margin-bottom: 56px; }
.project-category:last-child { margin-bottom: 0; }
.cat-title {
  font-family: var(--font-head); font-weight: 700; font-size: 1.4rem;
  margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.cat-title::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent-grad); flex: none; }
.pcard {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
  opacity: 1;
}
.pcard:hover { transform: translateY(-8px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.pcard-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); }
.pcard-media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.pcard:hover .pcard-media img { transform: scale(1.06); }
.pcard-media .ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.pcard-ph-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(30,167,230,0.22), rgba(108,140,255,0.16)), var(--bg-soft);
}
.pcard-ph-bg::after { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 .5H24M.5 0V24' fill='none' stroke='%23ffffff' stroke-opacity='0.05'/%3E%3C/svg%3E"); }
.pcard-ph-mono { position: relative; font-family: var(--font-head); font-weight: 700; font-size: 2rem; color: rgba(255,255,255,0.85); letter-spacing: 0.02em; }
.pcard-cat {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 5px 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  font-family: var(--font-head); background: rgba(7,11,22,0.78); backdrop-filter: blur(6px);
  border: 1px solid var(--border-strong); color: var(--accent-2);
}
.pcard-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.pcard-meta { font-size: 0.78rem; color: var(--faint); font-family: var(--font-head); letter-spacing: 0.03em; display: flex; gap: 8px; flex-wrap: wrap; }
.pcard-meta .org { color: var(--accent); }
.pcard h3 { font-family: var(--font-head); font-size: 1.2rem; line-height: 1.25; margin: 10px 0 10px; }
.pcard p { color: var(--muted); font-size: 0.9rem; flex: 1; }
.pcard-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 18px; }
.tag { font-size: 0.72rem; padding: 4px 10px; border-radius: 7px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--muted); font-weight: 500; }
.pcard-links { display: flex; gap: 10px; margin-top: auto; }
.pcard-links a {
  display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; font-weight: 600;
  font-family: var(--font-head); padding: 9px 15px; border-radius: 9px;
  border: 1px solid var(--border-strong); color: var(--text); transition: all 0.2s;
}
.pcard-links a:hover { border-color: var(--accent); color: var(--accent-2); background: rgba(30,167,230,0.08); }
.pcard-links a svg { width: 16px; height: 16px; }
.pcard-links a.primary { background: rgba(30,167,230,0.12); border-color: transparent; }

/* ---------- Certifications ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.ccard {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.ccard:hover { transform: translateY(-8px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.ccard-media { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft); overflow: hidden; }
.ccard-media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.ccard-media .ph { position: absolute; inset: 0; display: grid; place-items: center; }
.ccard-ph-badge {
  width: 84px; height: 84px; border-radius: 20px; display: grid; place-items: center; position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: #fff;
  font-family: var(--font-head); font-weight: 700; font-size: 1.9rem;
  box-shadow: 0 16px 34px -14px var(--accent-glow);
}
.ccard-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.ccard-issuer { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ccard-issuer .logo { width: 34px; height: 34px; flex: none; border-radius: 9px; background: #fff; display: grid; place-items: center; color: var(--navy); font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; overflow: hidden; }
.ccard-issuer .logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.ccard-issuer .who b { display: block; font-family: var(--font-head); font-size: 0.92rem; }
.ccard-issuer .who small { color: var(--faint); font-size: 0.78rem; }
.ccard h3 { font-family: var(--font-head); font-size: 1.12rem; line-height: 1.3; margin-bottom: 14px; flex: 1; }
.ccard-skills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.ccard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.cred-id { font-size: 0.78rem; color: var(--faint); font-family: var(--font-head); }
.cred-id b { color: var(--muted); }

/* ---------- Contact ---------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; }
.contact-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px; position: relative; overflow: hidden;
}
.contact-card.cta { background: linear-gradient(150deg, rgba(30,167,230,0.14), rgba(108,140,255,0.08)); border-color: var(--border-strong); }
.contact-card h3 { font-family: var(--font-head); font-size: 1.5rem; margin-bottom: 12px; }
.contact-card p { color: var(--muted); margin-bottom: 24px; }
.contact-list { display: flex; flex-direction: column; gap: 14px; }
.contact-row { display: flex; align-items: center; gap: 15px; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); transition: all 0.25s var(--ease); }
.contact-row:hover { border-color: var(--accent); transform: translateX(5px); }
.contact-row .ic { width: 44px; height: 44px; flex: none; border-radius: 11px; background: rgba(30,167,230,0.12); display: grid; place-items: center; color: var(--accent-2); }
.contact-row .ic svg { width: 20px; height: 20px; }
.contact-row .lbl { display: block; font-size: 0.72rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 2px; }
.contact-row .val { display: block; font-weight: 600; font-family: var(--font-head); font-size: 0.96rem; word-break: break-word; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 44px 0 32px; margin-top: 30px; }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer .brand img { width: 34px; height: 34px; }
.footer-socials { display: flex; gap: 10px; }
.footer-socials a { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: all 0.2s; }
.footer-socials a:hover { color: #fff; border-color: var(--accent); }
.footer-socials svg { width: 19px; height: 19px; }
.footer-copy { color: var(--faint); font-size: 0.85rem; text-align: center; margin-top: 22px; }
.footer-copy b { color: var(--muted); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 48px; height: 48px; border-radius: 14px; cursor: pointer;
  background: var(--accent-grad); color: #04121f; border: 0;
  display: grid; place-items: center; box-shadow: 0 14px 30px -12px var(--accent-glow);
  opacity: 0; transform: translateY(20px) scale(0.8); pointer-events: none;
  transition: all 0.3s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 22px; height: 22px; }

/* ---------- Page header (certifications page) ---------- */
.page-hero { padding-top: calc(var(--nav-h) + 70px); padding-bottom: 20px; text-align: center; }
.page-hero .kicker { justify-content: center; }
.page-hero h1 { font-family: var(--font-head); font-size: clamp(2.2rem, 5.5vw, 3.4rem); letter-spacing: -0.02em; }
.page-hero h1 .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-hero p { color: var(--muted); max-width: 620px; margin: 16px auto 0; }
.breadcrumb { display: flex; justify-content: center; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--faint); margin-bottom: 22px; }
.breadcrumb a:hover { color: var(--accent-2); }

/* ---------- Photo hero (Projects page) ---------- */
.proj-hero {
  position: relative; overflow: hidden;
  min-height: min(78vh, 680px);
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 60px;
}
.proj-hero-media { position: absolute; inset: 0; z-index: 0; }
.proj-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 78% center; }
.proj-hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(7,11,22,0.97) 0%, rgba(7,11,22,0.88) 32%, rgba(7,11,22,0.42) 62%, rgba(7,11,22,0.08) 100%),
    linear-gradient(180deg, rgba(7,11,22,0.55) 0%, transparent 22%, transparent 78%, rgba(7,11,22,0.75) 100%);
}
.proj-hero-content { position: relative; z-index: 1; max-width: 640px; }
.proj-hero-content .breadcrumb { justify-content: flex-start; }
.proj-hero-content .kicker { margin-bottom: 18px; }
.proj-hero-content h1 {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2.4rem, 5.6vw, 3.8rem); line-height: 1.05; letter-spacing: -0.03em;
}
.proj-hero-content h1 .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.proj-hero-content p { color: var(--muted); font-size: 1.05rem; margin-top: 20px; max-width: 50ch; }
@media (max-width: 720px) {
  .proj-hero { min-height: 520px; padding-top: calc(var(--nav-h) + 30px); }
  .proj-hero-media img { object-position: 68% center; }
  .proj-hero-veil { background: linear-gradient(180deg, rgba(7,11,22,0.55) 0%, rgba(7,11,22,0.55) 42%, rgba(7,11,22,0.93) 78%, rgba(7,11,22,0.98) 100%); }
}

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-photo { order: -1; justify-self: center; }
  .polaroid { width: min(60vw, 320px); margin-inline: auto; }
  .hero-actions, .hero-socials, .hero-badge { justify-content: center; }
  .hero-tagline { margin-inline: auto; }
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .contact-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(7, 11, 22, 0.97); backdrop-filter: blur(18px);
    padding: 16px 20px 24px; border-bottom: 1px solid var(--border);
    transform: translateY(-130%); transition: transform 0.35s var(--ease); z-index: -1;
  }
  .nav-links.open { transform: none; }
  .nav-links a:not(.btn) { padding: 13px 15px; font-size: 1rem; }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: var(--surface); }
  .nav-cta { margin: 6px 0 0; }
  .nav-toggle { display: block; }
  .facts { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .section-head { margin-bottom: 38px; }
}
@media (max-width: 460px) {
  .projects-grid, .cert-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; justify-content: center; }
  .hero-actions { flex-direction: column; }
}
