/*-----------------------------------------------------------
* Modern enhancement layer for nsemwa.com portfolio
* Loaded AFTER style.css — additive overrides only.
* Theme: "modern security" — deep slate base, teal→cyan accent,
*        technical mono accents, glass cards, accessible focus.
*------------------------------------------------------------*/

/* ===== Modern fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ===== Design tokens ===== */
:root {
  --bg: #0a0b10;
  --bg-2: #0d0f16;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #e8ebf2;
  --muted: #9aa3b4;

  --accent: #2dd4bf;          /* teal */
  --accent-2: #38bdf8;        /* sky  */
  --accent-soft: rgba(45, 212, 191, 0.14);
  --gradient: linear-gradient(135deg, #2dd4bf 0%, #38bdf8 100%);
  --glow: 0 0 0 1px rgba(45, 212, 191, 0.25), 0 14px 40px -12px rgba(45, 212, 191, 0.35);

  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Space Grotesk", "Quicksand", sans-serif;
  --font-body: "Inter", "Quicksand", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

/* ===== Base ===== */
body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.1px;
}

#page,
.bg-light { background-color: var(--bg) !important; }
.bg-dark { background: var(--bg-2) !important; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); letter-spacing: -0.01em; }

p, span { color: var(--text); }
p { color: var(--muted); }

a { transition: color 0.2s var(--ease); }
a:hover { color: var(--accent); }

/* Accessible focus rings everywhere (a11y: focus-states) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Scrollbar + selection accent */
::-webkit-scrollbar-thumb { background: var(--accent) !important; }
::selection { background: var(--accent); color: #04201d; }
::-moz-selection { background: var(--accent); color: #04201d; }

/* ===== Ambient background glow ===== */
#page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 420px at 12% -5%, rgba(45, 212, 191, 0.10), transparent 60%),
    radial-gradient(680px 460px at 100% 8%, rgba(56, 189, 248, 0.08), transparent 60%);
}
#page > * { position: relative; z-index: 1; }

/* ===== Section heading watermark + accent bars ===== */
.heading-meta-sub {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.07;
  font-family: var(--font-display);
}
.heading h2,
.intro-heading,
.counters .heading-section h2 { font-weight: 600; }

.header-page h2:before,
.header-page h2:after,
.header-page span:after { background-color: var(--accent); border-color: var(--accent); }

/* Intro "About Me" box → modern pill */
.intro-heading {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 22px;
}

/* ===== Buttons ===== */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.2px;
  border-radius: 999px;
  padding: 12px 26px;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
              background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent) !important; }

.btn-primary,
#banner .flexslider .slider-text .btn-primary {
  background: var(--gradient);
  color: #04201d !important;
  border: none;
  box-shadow: 0 10px 30px -10px rgba(45, 212, 191, 0.5);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--gradient) !important;
  color: #04201d !important;
  border: none !important;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -10px rgba(56, 189, 248, 0.55);
}

/* ===== Navigation + logo ===== */
header .navbar-brand .logo,
#main-nav h1 .logo {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-toggle i,
.nav-toggle i:before,
.nav-toggle i:after { background: var(--accent) !important; }
#main-nav ul li a:hover { color: var(--accent) !important; }

/* ===== Banner ===== */
#banner .flexslider .slider-text > .slider-text-inner h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #c7d0de 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
#banner .flexslider .slider-text > .slider-text-inner h3 { color: var(--muted); }
#banner .flexslider .slider-text > .slider-text-inner span,
#typed-slide-1, #typed-slide-2 {
  font-family: var(--font-mono) !important;
  color: var(--accent) !important;
  font-weight: 500;
}
.social-links:after { background: var(--accent) !important; }
.social-links li a:hover { color: var(--accent) !important; }

/* Kill FlexSlider's default white container/border + restyle dots */
.flexslider {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.flex-control-paging li a {
  background: rgba(255, 255, 255, 0.25) !important;
  box-shadow: none !important;
}
.flex-control-paging li a.flex-active { background: var(--accent) !important; }

/* ===== About: profile image + skills ===== */
.post-image {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.8);
}
#about .post-entry { gap: 1rem; }

.skill-item h5,
#resume .skill-item h5 { font-family: var(--font-body); color: var(--text); font-weight: 600; }
.skill-item span,
#resume .skill-item span { font-family: var(--font-mono); color: var(--accent); }

.progress,
#resume .progress {
  height: 6px !important;
  background: var(--surface-2) !important;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar,
#resume .progress-bar {
  background: var(--gradient) !important;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.5);
}

/* ===== Resume cards ===== */
#resume .item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
#resume .item:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 212, 191, 0.4);
  background: var(--surface-2);
  box-shadow: 0 24px 50px -25px rgba(0, 0, 0, 0.9), var(--glow);
}
#resume .item h4 { font-size: 19px; font-weight: 600; line-height: 1.4; }
#resume .item .item-icon { color: var(--accent); }
#resume .item .meta {
  font-family: var(--font-mono);
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  letter-spacing: 0.5px;
}
#resume .item h5 { color: var(--muted); opacity: 1; }

/* ===== Service cards ===== */
#services .service,
#services .service:hover {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 32px 26px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
#services .service:hover {
  transform: translateY(-6px);
  border-color: rgba(45, 212, 191, 0.4);
  background: var(--surface-2);
  box-shadow: 0 24px 55px -25px rgba(0, 0, 0, 0.9), var(--glow);
}
#services .service .icon {
  position: static;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 191, 0.25);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#services .service .icon i { color: var(--accent); font-size: 26px; height: auto; display: inline; }
#services .service .text { padding-left: 0; }
#services .service .text h3 {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 12px;
}
#services .service .text p { color: var(--muted); }
#services .service .box-num { top: 26px; left: auto; right: 26px; transform: none; }
#services .service .box-num h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.06);
}

/* ===== Counters ===== */
.counters { background: var(--bg-2); border-block: 1px solid var(--border); }
.counters .counter {
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.counters .counter-label { color: var(--muted); letter-spacing: 3px; font-size: 13px; }

/* ===== Contact: info + form card ===== */
#contact .contact-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
}
#contact .contact-info li { color: var(--text); font-size: 16px; }
#contact .contact-info li i { color: var(--accent); }
#contact .contact-info li a:hover { color: var(--accent); }

#contactForm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
}
.form-control {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 12px 16px !important;
  font-family: var(--font-body);
  font-size: 16px !important;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
textarea.form-control { height: auto !important; }
input.form-control { height: 50px !important; }
.form-control::placeholder { color: var(--muted); }
.form-control:focus,
.form-control:active {
  border: 1px solid var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

/* Form alerts on dark */
#form-messages.alert {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 15px;
}
#form-messages.alert-success {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.45);
  color: #aef0e6;
}
#form-messages.alert-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

/* ===== Footer ===== */
#footer { background: var(--bg-2); border-top: 1px solid var(--border); }
#footer .footer-logo {
  font-family: var(--font-mono);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   CINEMATIC GLASS HERO
   ============================================================ */
.is-hidden { display: none !important; }

#hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px 0 90px;
}

/* --- Background layers --- */
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: floaty 12s ease-in-out infinite;
}
.hero-orb.orb-1 {
  width: 520px; height: 520px;
  top: -120px; left: -100px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.55), transparent 65%);
}
.hero-orb.orb-2 {
  width: 560px; height: 560px;
  bottom: -160px; right: -120px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45), transparent 65%);
  animation-delay: -6s;
}
.hero-gridlines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 50px 50px;
  -webkit-mask-image: radial-gradient(circle at 50% 38%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 38%, #000 0%, transparent 78%);
}
.hero-grain {
  position: absolute; inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Vertical socials --- */
.hero-social {
  position: absolute;
  left: 34px; bottom: 40px;
  z-index: 3;
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 18px;
  font-size: 18px;
}
.hero-social::after {
  content: ""; display: block;
  width: 1px; height: 70px;
  margin: 8px auto 0;
  background: linear-gradient(var(--accent), transparent);
}
.hero-social a { color: var(--muted); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.hero-social a:hover { color: var(--accent); transform: translateY(-3px); }

/* --- Layout --- */
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

/* --- Copy --- */
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text);
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  margin-bottom: 26px;
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulseRing 1.8s ease-out infinite;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
  color: #f3f5fa;
}
.hero-title .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-title .amp { color: var(--accent); font-style: italic; font-weight: 500; }

/* Hide the leftover template scroll-icon (hero has its own cue) */
.scroll-icon { display: none !important; }

/* Logo emoji must render in full color, not be clipped by the gradient text */
.logo .logo-emoji {
  -webkit-text-fill-color: initial;
  color: initial;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  animation: none;
  margin-left: 5px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--muted) !important;
  margin: 0 0 14px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-typed { font-family: var(--font-mono); color: var(--accent); font-weight: 500; }
.hero-desc {
  color: var(--muted) !important;
  max-width: 540px;
  font-size: 16px;
  margin: 0 0 30px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 38px; }
.hero-cta .btn { margin: 0; }
.btn-ghost {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-ghost i { margin-left: 8px; transition: transform 0.2s var(--ease); }
.btn-ghost:hover i { transform: translateX(4px); }

/* --- Hero stat strip --- */
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; position: relative; padding-right: 30px; }
.hero-stat:not(:last-child)::after {
  content: ""; position: absolute; right: 0; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.hero-stat-num {
  font-family: var(--font-mono);
  font-size: 30px; font-weight: 700; line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-stat-num sup { font-size: 0.5em; -webkit-text-fill-color: var(--accent); }
.hero-stat-label { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* --- Visual: photo + floating glass cards --- */
.hero-visual { position: relative; }
.hero-photo-wrap {
  position: relative;
  border-radius: 24px;
  padding: 10px;
  background: linear-gradient(150deg, rgba(45, 212, 191, 0.35), rgba(56, 189, 248, 0.12), transparent);
  border: 1px solid var(--border);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
}
.hero-photo {
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  background-size: cover;
  background-position: center top;
  filter: saturate(1.05) contrast(1.03);
}
.hero-float {
  position: absolute;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(16, 18, 26, 0.72);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 45px -20px rgba(0, 0, 0, 0.85);
  animation: floaty 6s ease-in-out infinite;
}
.hero-float i { color: var(--accent); font-size: 20px; }
.hero-float strong { display: block; font-size: 14px; color: var(--text); }
.hero-float span { font-size: 12px; color: var(--muted); }
.hero-float-1 { top: 8%; left: -10%; animation-delay: -1s; }
.hero-float-2 { bottom: 14%; left: -14%; animation-delay: -3s; }
.hero-float-3 { bottom: 6%; right: -8%; animation-delay: -5s; }

/* --- Scroll cue --- */
.hero-scroll {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted);
}
.hero-scroll:hover { color: var(--accent); }
.hero-mouse {
  width: 24px; height: 38px;
  border: 2px solid currentColor; border-radius: 14px;
  position: relative;
}
.hero-mouse::before {
  content: ""; position: absolute; left: 50%; top: 7px;
  width: 3px; height: 7px; border-radius: 2px;
  background: currentColor; transform: translateX(-50%);
  animation: scrollDot 1.4s ease-in-out infinite;
}
.hero-scroll-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }

/* Hero video nav — click a bar to scroll through the background clips */
.hero-vid-nav {
  position: absolute;
  right: 34px; bottom: 48px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.hero-vid-name {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-vid-name::before { content: "\25B6"; color: var(--accent); margin-right: 7px; font-size: 8px; }
.hero-vid-dots { display: flex; gap: 8px; }
.hero-vid-dots button {
  width: 20px; height: 3px; padding: 0;
  border: none; border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: width 0.25s var(--ease), background 0.25s var(--ease);
}
.hero-vid-dots button:hover { background: rgba(255, 255, 255, 0.55); }
.hero-vid-dots button.active {
  width: 34px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.6);
}
@media (max-width: 768px) { .hero-vid-nav { display: none; } }

/* --- Hero entrance stagger --- */
.hero-copy > * { animation: fadeUp 0.8s var(--ease) both; }
.hero-copy > .hero-badge { animation-delay: 0.05s; }
.hero-copy > .hero-title { animation-delay: 0.15s; }
.hero-copy > .hero-sub { animation-delay: 0.28s; }
.hero-copy > .hero-desc { animation-delay: 0.38s; }
.hero-copy > .hero-cta { animation-delay: 0.48s; }
.hero-copy > .hero-stats { animation-delay: 0.58s; }
.hero-visual { animation: fadeUp 0.9s var(--ease) 0.4s both; }

/* ============================================================
   COMPACT PAGE HERO (about / contact)
   ============================================================ */
#page-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 58vh;
  min-height: 58dvh;
  padding: 150px 0 80px;
  text-align: center;
}
.page-hero-inner { position: relative; z-index: 2; max-width: 840px; margin: 0 auto; }
.page-hero-inner .hero-badge { margin-bottom: 22px; }
.page-hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  color: #f3f5fa;
}
.page-hero-title .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero-sub {
  color: var(--muted) !important;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  max-width: 660px;
  margin: 0 auto;
}
.page-hero-inner > * { animation: fadeUp 0.8s var(--ease) both; }
.page-hero-inner > .hero-badge { animation-delay: 0.05s; }
.page-hero-inner > .page-hero-title { animation-delay: 0.15s; }
.page-hero-inner > .page-hero-sub { animation-delay: 0.28s; }

/* ============================================================
   TECH MARQUEE
   ============================================================ */
.tech-marquee {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  padding: 18px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.tech-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.tech-track span {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--muted);
  white-space: nowrap;
  position: relative;
}
.tech-track span::before {
  content: "◆";
  color: var(--accent);
  margin-right: 48px;
  font-size: 8px;
  vertical-align: middle;
  opacity: 0.7;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- "+" suffix on selected counters (accent, not gradient-clipped) --- */
.has-plus::after {
  content: "+";
  -webkit-text-fill-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   EXTENDED GLASSMORPHISM
   ============================================================ */
/* Frosted fixed header (overrides custom.js inline background) */
header.header {
  background: rgba(10, 11, 16, 0.5) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease);
  padding: 11px 0 !important;
}
header .navbar-brand { height: auto !important; min-height: 0 !important; }
header .navbar-brand .row { margin: 0; }
header .navbar-brand h1 { line-height: 1; margin: 0; }
header .navbar-brand .logo, #main-nav h1 .logo { font-size: 19px; line-height: 1; }
.header .nav-toggle { margin-top: 0; }

/* Frosted full-screen mobile nav overlay */
#main-nav {
  background: rgba(10, 11, 16, 0.72) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  backdrop-filter: blur(22px) saturate(1.2);
}

/* About "My skill" panel → glass card */
.post-entry .desc {
  background: var(--surface-2) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.9) !important;
}
.post-entry .desc h3 { font-size: 28px; line-height: 1.3; }

/* Contact info items: subtle glass row hover */
#contact .contact-info li { border-radius: 10px; transition: background 0.2s var(--ease); padding-top: 4px; padding-bottom: 4px; }

/* Frosted footer */
#footer {
  background: rgba(13, 15, 22, 0.6) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* --- Hero responsive --- */
@media (max-width: 992px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 420px; margin: 0 auto; }
  .hero-float-1 { left: 0; }
  .hero-float-2 { left: 0; }
  .hero-social { display: none; }
}
@media (max-width: 600px) {
  #hero { padding: 110px 0 80px; text-align: left; }
  .hero-float { display: none; }
  .hero-stats { gap: 22px; }
  .hero-stat { padding-right: 22px; }
  .hero-scroll { display: none; }
}

/* ============================================================
   BENTO "OVERVIEW" SECTION
   ============================================================ */
#overview { padding-top: 80px; padding-bottom: 80px; }

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(118px, auto);
  gap: 16px;
  grid-template-areas:
    "id id ctf   place"
    "id id skill skill"
    "now now skill skill"
    "loc focus cta cta";
}
.ga-id { grid-area: id; }
.ga-ctf { grid-area: ctf; }
.ga-place { grid-area: place; }
.ga-skill { grid-area: skill; }
.ga-now { grid-area: now; }
.ga-loc { grid-area: loc; }
.ga-focus { grid-area: focus; }
.ga-cta { grid-area: cta; }

.bento-item {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.bento-item:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 212, 191, 0.4);
  background: var(--surface-2);
  box-shadow: 0 24px 50px -25px rgba(0, 0, 0, 0.9), var(--glow);
}
.bento-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

/* Identity tile */
.bento-id {
  flex-direction: row;
  gap: 22px;
  align-items: center;
  padding: 26px;
}
.bento-id-photo {
  flex: 0 0 130px;
  align-self: stretch;
  min-height: 150px;
  border-radius: 14px;
  background-size: cover;
  background-position: center top;
  border: 1px solid var(--border);
}
.bento-id-body h3 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
}
.bento-role { color: var(--text) !important; font-weight: 600; margin: 0 0 6px; }
.bento-tag { color: var(--muted) !important; font-size: 14px; margin: 0 0 14px; }
.bento-id-social { display: flex; gap: 14px; font-size: 18px; }
.bento-id-social a { color: var(--muted); }
.bento-id-social a:hover { color: var(--accent); transform: translateY(-2px); }

/* Stat tiles */
.bento-stat { align-items: flex-start; gap: 2px; }
.bento-stat > i { font-size: 20px; color: var(--accent); margin-bottom: 8px; }
.bento-num {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bento-num sup { font-size: 0.5em; -webkit-text-fill-color: var(--accent); }
.bento-label { color: var(--muted) !important; font-size: 13px; margin-top: 6px; line-height: 1.35; }
.bento-accent { background: linear-gradient(135deg, rgba(45,212,191,0.12), rgba(56,189,248,0.06)); }

/* Skills tile */
.bento-skills { justify-content: flex-start; gap: 0; }
.bento-skill { margin-bottom: 16px; }
.bento-skill:last-child { margin-bottom: 0; }
.bento-skill-top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}
.bento-skill-top span:first-child { color: var(--text); font-weight: 500; }
.bento-skill-top span:last-child { font-family: var(--font-mono); color: var(--accent); }
.bento-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bento-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gradient);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.5);
}

/* Now / status tile */
.bento-now { justify-content: center; }
.bento-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.bento-status .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulseRing 1.8s ease-out infinite;
}
.bento-now h4 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.bento-now p { color: var(--muted) !important; font-size: 14px; margin: 0; }

/* Mini tiles */
.bento-mini { gap: 4px; }
.bento-mini > i { font-size: 18px; color: var(--accent); margin-bottom: 8px; }
.bento-mini-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.bento-mini-value { color: var(--text) !important; font-weight: 600; font-size: 15px; line-height: 1.35; }

/* CTA tile */
.bento-cta { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bento-cta h4 { margin: 4px 0 0; font-size: 22px; font-weight: 600; }
.bento-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bento-cta-actions .btn { margin: 0; }

/* Tablet */
@media (max-width: 992px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "id id"
      "ctf place"
      "skill skill"
      "now now"
      "loc focus"
      "cta cta";
  }
}

/* Mobile */
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; grid-template-areas: none; }
  .bento-item { grid-area: auto !important; }
  .bento-id { flex-direction: column; text-align: center; }
  .bento-id-photo { width: 100%; flex-basis: 180px; }
  .bento-id-social { justify-content: center; }
  .bento-cta { flex-direction: column; align-items: flex-start; }
}

/* ===== Reveal on scroll (added by modern.js) ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   MOTION SYSTEM  (all gated behind prefers-reduced-motion)
   ============================================================ */

/* --- Keyframes --- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(45, 212, 191, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}
@keyframes scrollDot { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(10px); } }

/* --- Scroll progress bar (element injected by modern.js) --- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 2000;
  background: var(--gradient);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.6);
  transition: width 0.1s linear;
}

/* --- Animated gradient on key accent text --- */
header .navbar-brand .logo,
#main-nav h1 .logo,
.counters .counter,
#footer .footer-logo {
  background: linear-gradient(135deg, #2dd4bf, #38bdf8, #2dd4bf);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s linear infinite alternate;
}

/* --- Hero entrance stagger --- */
#banner .slider-text-inner h2 { animation: fadeUp 0.8s var(--ease) both; }
#banner .slider-text-inner h3 { animation: fadeUp 0.8s var(--ease) 0.15s both; }
.social-links li { animation: fadeUp 0.6s var(--ease) both; }
.social-links li:nth-child(1) { animation-delay: 0.35s; }
.social-links li:nth-child(2) { animation-delay: 0.45s; }
.social-links li:nth-child(3) { animation-delay: 0.55s; }
.social-links li:nth-child(4) { animation-delay: 0.65s; }

/* --- Profile image gentle float --- */
.post-image { animation: floaty 7s ease-in-out infinite; }

/* --- Nav links: animated underline --- */
#main-nav ul li a { position: relative; }
#main-nav ul li a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  height: 2px; width: 0;
  background: var(--gradient);
  transition: width 0.3s var(--ease);
}
#main-nav ul li a:hover::after { width: 100%; }
#main-nav ul li a.active { color: var(--accent) !important; }
#main-nav ul li a.active::after { width: 100%; }

/* --- Social icons: lift + glow on hover --- */
.social-links li a,
.social-icon a,
#footer .social-icon a { display: inline-block; transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.social-links li a:hover,
.social-icon a:hover,
#footer .social-icon a:hover {
  transform: translateY(-3px) scale(1.12);
  color: var(--accent) !important;
}

/* --- Button shimmer sweep on hover --- */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s var(--ease);
}
.btn-primary:hover::after { left: 140%; }

/* --- Service icon tile: pulse ring on card hover --- */
#services .service:hover .icon { animation: pulseRing 1.4s var(--ease) 1; }
#services .service .icon { transition: transform 0.25s var(--ease); }
#services .service:hover .icon { transform: translateY(-2px) scale(1.06); }

/* --- Scroll-down mouse indicator subtle pulse --- */
.scroll-icon .mouse { transition: opacity 0.3s var(--ease); }
.scroll-icon:hover .mouse { opacity: 0.7; }

/* --- Back-to-top button --- */
#back-to-top {
  background: var(--surface-2) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--accent) !important;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
#back-to-top:hover {
  transform: translateY(-3px);
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

/* --- Typed-text caret blink (mono role) --- */
.typed-cursor { color: var(--accent); font-weight: 400; }

/* ============================================================
   DESIGN POLISH PASS
   ============================================================ */

/* --- Cleaner section headings: watermark sits clearly behind --- */
.heading-meta-sub { opacity: 0.045; }
.header-page { position: relative; z-index: 1; }
.heading h2 { position: relative; z-index: 1; }

/* --- Resume → premium timeline rail + node dots (desktop) --- */
@media (min-width: 768px) {
  #resume .col-md-12 > .col-md-6 { position: relative; padding-left: 36px; }
  #resume .col-md-12 > .col-md-6::before {
    content: "";
    position: absolute;
    left: 5px; top: 14px; bottom: 54px;
    width: 2px;
    background: linear-gradient(var(--accent), rgba(56, 189, 248, 0.25), transparent);
  }
  #resume .item::before {
    content: "";
    position: absolute;
    left: -37px; top: 30px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  }
  #resume .item:hover::before {
    transform: scale(1.25);
    box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.22), 0 0 14px rgba(45, 212, 191, 0.7);
  }
}
#resume .item { position: relative; }

/* --- Service cards: gradient top line reveals on hover --- */
#services .service::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
#services .service:hover::before { transform: scaleX(1); }

/* --- About profile photo: subtle teal sheen + ring so it reads intentional --- */
#about .post-image {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(45, 212, 191, 0.18);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.85);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
#about .post-entry:hover .post-image {
  transform: translateY(-5px);
  box-shadow: 0 45px 85px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(45, 212, 191, 0.45);
}
/* cinematic teal duotone + bottom fade, matching the hero scrim */
#about .post-image::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(155deg, rgba(45, 212, 191, 0.22), transparent 45%),
    linear-gradient(0deg, rgba(8, 9, 14, 0.55), transparent 52%);
  pointer-events: none;
}
/* scanner corner bracket (security vibe) */
#about .post-image::before {
  content: "";
  position: absolute;
  top: 12px; left: 12px;
  width: 26px; height: 26px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  z-index: 1;
  pointer-events: none;
}

/* --- Contact info: prevent long links overflowing the glass card --- */
#contact .contact-info { display: flex; flex-direction: column; justify-content: center; }
#contact .contact-info li { word-break: break-word; }
#contact .contact-info li a { word-break: break-word; }

/* ============================================================
   ABOUT SECTION REBALANCE
   ============================================================ */
.header-page-about { margin-bottom: 20px; }
.header-page-about::before {
  content: "// about me";
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 12px;
}
.intro-heading {
  border: none !important;
  background: none !important;
  padding: 0 !important;
  display: inline-block;
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.intro-heading::after {
  content: "";
  position: absolute;
  left: 0; bottom: -10px;
  width: 56px; height: 3px;
  border-radius: 3px;
  background: var(--gradient);
}
#about .post-entry > .col-md-6:first-child p { color: var(--muted); max-width: 540px; }
#about .post-entry ul { list-style: none; padding: 0; margin: 0 0 6px; }
#about .post-entry ul li { margin-bottom: 16px; color: var(--text); font-size: 15px; line-height: 1.4; }
#about .post-entry ul li span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
  font-weight: 500;
}
#about .post-entry ul li a { color: var(--text); }
#about .post-entry ul li a:hover { color: var(--accent); }
#about .post-entry hr { border-top: 1px solid var(--border); margin: 16px 0 24px; }
#about .post-image { min-height: 320px; }

/* ============================================================
   PREMIUM SPOTLIGHT CURSOR (desktop, motion-safe; added by modern.js)
   ============================================================ */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.10), rgba(56, 189, 248, 0.05) 40%, transparent 62%);
  mix-blend-mode: screen;
  will-change: transform;
}
@media (max-width: 992px) { .cursor-glow { display: none !important; } }

/* ============================================================
   MOBILE SPACING & TYPE PASS
   ============================================================ */
@media (max-width: 768px) {
  #about, #resume, #services, #contact {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }
  #about { margin-bottom: 0 !important; }
  .heading { margin-bottom: 1.5em; }
  .heading h2 { font-size: 1.9rem; }
  .intro-heading { font-size: 1.8rem !important; }
  .heading-meta-sub { font-size: 42px; top: -28px; }
  .page-hero-sub, .hero-desc { font-size: 15px; }
  #services .service { padding: 24px 20px; }
  #resume .item { padding: 20px; }
  #contact .contact-info, #contactForm { padding: 22px 20px; }
  .post-entry .desc { padding: 1.5em; }
  /* Counters: 2 x 2 grid instead of a tall stack */
  .counters .col-md-12 { display: flex; flex-wrap: wrap; }
  .counters .col-md-3 { width: 50%; margin-bottom: 14px; }
  .counters .counter { font-size: 32px; }
  .tech-track { gap: 32px; }
  .tech-track span::before { margin-right: 32px; }
}
@media (max-width: 480px) {
  .hero-stats { gap: 16px; }
  .hero-stat { padding-right: 16px; }
  .hero-stat-num { font-size: 26px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; text-align: center; }
  .counters .counter { font-size: 28px; }
  .bento-cta-actions .btn, .hero-cta .btn { width: 100%; }
}

/* ============================================================
   LEVEL-5 MOTION SYSTEM
   ============================================================ */

/* --- Lenis smooth scroll (minimal required styles) --- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* --- Page transitions: cross-browser curtain + content fade-in --- */
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
#page { animation: pageIn 0.5s var(--ease) both; }
#page-curtain {
  position: fixed;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(100%);
  transition: transform 0.5s var(--ease);
}
#page-curtain.is-active { transform: translateY(0); pointer-events: auto; }
.curtain-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 3px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease) 0.15s, transform 0.3s var(--ease) 0.15s;
}
#page-curtain.is-active .curtain-logo { opacity: 1; transform: none; }

/* --- Branded preloader (0 → 100%) --- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
  animation: introFailsafe 0s linear 4.5s forwards; /* reveal page even if JS never runs */
}
#preloader.is-done { opacity: 0; visibility: hidden; }
@keyframes introFailsafe { to { opacity: 0; visibility: hidden; } }
.loader-inner { width: min(260px, 68vw); text-align: center; }
.loader-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 3px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}
.loader-bar { height: 3px; width: 100%; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.loader-bar i {
  display: block; height: 100%; width: 0;
  background: var(--gradient); border-radius: 999px;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.6);
  transition: width 0.15s linear;
}
.loader-pct { font-family: var(--font-mono); color: var(--muted); font-size: 13px; letter-spacing: 2px; margin-top: 12px; }
.loader-pct::after { content: "%"; }

/* --- Interactive cursor ring (pairs with .cursor-glow) --- */
.cursor-ring { position: fixed; top: 0; left: 0; width: 0; height: 0; pointer-events: none; z-index: 6; }
.cursor-ring::before {
  content: "";
  position: absolute;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border: 1.5px solid rgba(45, 212, 191, 0.55);
  border-radius: 50%;
  opacity: 1;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
              border-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.cursor-ring.is-hover::before {
  transform: scale(1.9);
  background: rgba(45, 212, 191, 0.10);
  border-color: rgba(45, 212, 191, 0.9);
}
/* Contextual label ("View" / "Open" / "Email" / "Call") */
.cursor-label {
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #04201d;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.cursor-ring.has-label::before { opacity: 0; transform: scale(0.4); }
.cursor-ring.has-label .cursor-label { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* --- Kinetic heading reveal (word-by-word clip) --- */
.rw {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.rw-i {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.6s var(--ease);
  will-change: transform;
}
.rw-in .rw-i { transform: none; }

/* ============================================================
   FULL-BLEED VIDEO HERO
   ============================================================ */
.hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #05060a; }
.hero-slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  will-change: opacity;
}
.hero-slide.is-active { opacity: 0.58; }
video.hero-slide { object-fit: cover; }
.hero-slide-img { background-size: cover; background-position: center; }
/* Desktop shows only the cycling video; the poster slides are mobile-only */
@media (min-width: 768px) { .hero-slide-img { display: none; } }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 9, 14, 0.55) 0%, rgba(8, 9, 14, 0.30) 38%, rgba(8, 9, 14, 0.82) 100%),
    radial-gradient(130% 90% at 22% 28%, rgba(8, 9, 14, 0) 0%, rgba(8, 9, 14, 0.55) 100%);
}
#hero .container { position: relative; z-index: 2; }
#hero .hero-inner { display: block; max-width: 860px; }
.hero-social { z-index: 3; }
.hero-title { text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55); }
.hero-desc, .hero-sub { text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45); }

@media (max-width: 768px) {
  /* Slides provide the visuals on mobile — no poster background behind them */
  .hero-media { background: #05060a; }
}

/* ============================================================
   FULL-APP CINEMATIC LAYER
   ============================================================ */

/* Shared lazy background videos (poster shows until played / on mobile) */
.lazy-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 768px) { .lazy-video { display: none; } }

/* --- Counters: faint video background --- */
.counters { position: relative; overflow: hidden; }
.counters-media { position: absolute; inset: 0; z-index: 0; }
.counters-media .lazy-video { opacity: 0.22; }
.counters-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(13, 15, 22, 0.85), rgba(13, 15, 22, 0.62));
}
.counters .narrow-content { position: relative; z-index: 1; }
@media (max-width: 768px) {
  .counters-media { background: #05060a url("../videos/poster-datacenter.jpg") center / cover; }
}

/* --- Closing "Let's work together" CTA --- */
#cta-closing { position: relative; overflow: hidden; padding: 110px 0; text-align: center; }
.cta-media { position: absolute; inset: 0; z-index: 0; background: #05060a; }
.cta-video { opacity: 0.4; }
.cta-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 9, 14, 0.82), rgba(8, 9, 14, 0.6) 45%, rgba(8, 9, 14, 0.9)),
    radial-gradient(120% 90% at 50% 0%, transparent, rgba(8, 9, 14, 0.5));
}
#cta-closing .container { position: relative; z-index: 2; }
.cta-inner { max-width: 760px; margin: 0 auto; }
.cta-inner .hero-badge { margin-bottom: 22px; }
.cta-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.05; letter-spacing: -0.03em;
  margin: 0 0 16px; color: #f3f5fa;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}
.cta-title .grad {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.cta-sub { color: var(--muted) !important; font-size: clamp(1rem, 1.5vw, 1.18rem); max-width: 580px; margin: 0 auto 30px; }
#cta-closing .hero-cta { justify-content: center; }
@media (max-width: 768px) {
  .cta-media { background: #05060a url("../videos/poster-matrix.jpg") center / cover; }
  #cta-closing { padding: 80px 0; }
}

/* --- Subpage hero video --- */
#page-hero { overflow: hidden; }
.page-hero-video { opacity: 0.42; }
#page-hero .container { position: relative; z-index: 2; }
@media (max-width: 768px) {
  #page-hero .hero-media { background: #05060a url("../videos/hero-poster.jpg") center / cover; }
  #page-hero .hero-media.pm-fiberoptics { background-image: url("../videos/poster-fiberoptics.jpg"); }
  #page-hero .hero-media.pm-matrix { background-image: url("../videos/poster-matrix.jpg"); }
}

/* --- Section ambiance: gradient orbs + faint grid --- */
#about, #resume, #services, #contact { position: relative; }
#about > *, #resume > *, #services > *, #contact > * { position: relative; z-index: 1; }
#about::before, #resume::before, #services::before, #contact::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(640px 320px at 88% -6%, rgba(45, 212, 191, 0.07), transparent 60%),
    radial-gradient(520px 320px at 6% 106%, rgba(56, 189, 248, 0.05), transparent 60%);
}
#about::after, #resume::after, #services::after, #contact::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(circle at 50% 35%, #000, transparent 78%);
  mask-image: radial-gradient(circle at 50% 35%, #000, transparent 78%);
}

/* --- Service & Resume cards: cursor-spotlight glow --- */
#services .service, #resume .item { overflow: hidden; }
#services .service > *, #resume .item > * { position: relative; z-index: 1; }
#services .service::after, #resume .item::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity 0.3s var(--ease);
  background: radial-gradient(190px circle at var(--mx, 50%) var(--my, 50%), rgba(45, 212, 191, 0.16), transparent 60%);
}
#services .service:hover::after, #resume .item:hover::after { opacity: 1; }

/* --- Cinematic footer --- */
#footer {
  position: relative;
  background: linear-gradient(180deg, rgba(13, 15, 22, 0.6), rgba(6, 7, 11, 0.96)) !important;
  border-top: 1px solid var(--border);
  padding: 56px 0 26px !important;
}
#footer::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: 40px;
  text-align: left;
  align-items: start;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border);
}
.footer-brand .footer-logo { font-size: 26px; }
.footer-tag { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 360px; margin: 14px 0 18px; }
.footer-brand .social-icon { display: flex; gap: 14px; margin: 0; }
.footer-brand .social-icon a { font-size: 18px; color: var(--muted); transition: transform 0.2s var(--ease), color 0.2s var(--ease); }
.footer-brand .social-icon a:hover { color: var(--accent); transform: translateY(-3px); }
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-col-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.footer-col a, .footer-muted { color: var(--muted); font-size: 14px; }
.footer-col a { transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; padding-top: 20px;
}
.footer-bottom p { color: var(--muted); font-size: 13px; margin: 0; }
.footer-bottom p:last-child { font-family: var(--font-mono); letter-spacing: 1px; }
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ===== Reduced motion (a11y) ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  #scroll-progress { display: none !important; }
  /* keep gradient text readable without animation */
  header .navbar-brand .logo, #main-nav h1 .logo,
  .counters .counter, #footer .footer-logo { background-position: 0% 50%; }
  html, body { scroll-behavior: auto; }
}

/* ===== Small screens polish ===== */
@media (max-width: 768px) {
  body { font-size: 15px; }
  #services .service .box-num { top: 22px; right: 22px; }
}
