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

:root {
  color-scheme: dark;
  --bg: #080c14;
  --bg2: #0d1220;
  --bg3: #111827;
  --surface: #151d2e;
  --border: #1e2d45;
  --accent: #38bdf8;
  --accent2: #7c3aed;
  --glow: #38bdf880;
  --text: #e2e8f0;
  --muted: #93a4bc;
  --white: #ffffff;
  --inverse-text: #ffffff;
  --nav-bg: rgba(8, 12, 20, 0.85);
  --panel-bg: rgba(10, 17, 30, 0.92);
  --chip-bg: rgba(8, 12, 20, 0.55);
  --control-bg: rgba(8, 12, 20, 0.85);
  --modal-backdrop: rgba(2, 6, 23, 0.8);
  --grid-line: rgba(56, 189, 248, 0.03);
  --noise-opacity: 0.4;
  --surface-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --surface-shadow-strong: 0 24px 60px rgba(0, 0, 0, 0.45);
  --card-hover-shadow: 0 12px 40px rgba(56, 189, 248, 0.12);
  --footer-muted: #c3cfde;
  --image-overlay: linear-gradient(
    to top,
    rgba(8, 12, 20, 0.8) 0%,
    transparent 50%
  );
  --media-stage-bg: #000;
  --cert-card-bg: linear-gradient(
    145deg,
    rgba(8, 12, 20, 0.82),
    rgba(17, 24, 39, 0.74)
  );
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f8fd;
  --bg2: #eaf1f8;
  --bg3: #dfe7f2;
  --surface: #ffffff;
  --border: #c0d2e4;
  --accent: #38bdf8;
  --accent2: #2563eb;
  --glow: #38bdf855;
  --text: #061427;
  --muted: #324c67;
  --white: #041224;
  --inverse-text: #ffffff;
  --nav-bg: rgba(244, 248, 253, 0.9);
  --panel-bg: rgba(255, 255, 255, 0.95);
  --chip-bg: rgba(244, 248, 253, 0.92);
  --control-bg: rgba(255, 255, 255, 0.94);
  --modal-backdrop: rgba(15, 23, 42, 0.42);
  --grid-line: rgba(2, 132, 199, 0.08);
  --noise-opacity: 0.18;
  --surface-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
  --surface-shadow-strong: 0 24px 60px rgba(15, 23, 42, 0.24);
  --card-hover-shadow: 0 16px 34px rgba(2, 132, 199, 0.2);
  --footer-muted: #2c4661;
  --image-overlay: linear-gradient(
    to top,
    rgba(241, 247, 255, 0.22) 0%,
    transparent 55%
  );
  --media-stage-bg: #e8eff8;
  --cert-card-bg: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.96),
    rgba(231, 240, 250, 0.92)
  );
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Syne", sans-serif;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  cursor: none;
}

img,
video {
  max-width: 100%;
}
body.modal-open {
  overflow: hidden;
}

/* ─── CUSTOM CURSOR ─────────────────────────────── */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
}
.cursor-dot {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: transform 0.1s;
}
[data-theme="light"] .cursor-dot {
  background: #000;
}
/* Remove the custom cursor on touch devices and at mobile viewport widths */
@media (hover: none) and (pointer: coarse), (max-width: 900px) {
  body {
    cursor: auto;
  }
  .cursor {
    display: none !important;
  }
}

/* ─── NOISE OVERLAY ─────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: var(--noise-opacity);
}

/* ─── GRID PATTERN ──────────────────────────────── */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ─── NAV ───────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.28rem 1.25rem;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.theme-toggle-slot {
  display: flex;
  align-items: center;
}
/* Lives inside .nav-actions (left of Resume); spacing comes from its gap. */
.theme-toggle-slot--desktop {
  margin: 0;
}
.theme-toggle-slot--mobile {
  display: none;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.45rem 0.72rem;
  border: 1px solid var(--accent);
  background: var(--panel-bg);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--glow);
  transform: translateY(-1px);
}
.theme-toggle:hover .theme-toggle__icon svg {
  transform: scale(1.06);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle__icon {
  width: 1.05rem;
  height: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle__icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: transform 0.2s ease;
}
.theme-toggle__stroke {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px var(--glow));
}
.theme-toggle__fill {
  fill: var(--accent);
  filter: drop-shadow(0 0 5px var(--glow));
}
.theme-toggle__spark {
  fill: var(--accent);
  opacity: 0.95;
  filter: drop-shadow(0 0 5px var(--glow));
}
.theme-toggle__icon--sun {
  display: none;
}
.theme-toggle__text {
  display: none;
}
[data-theme="light"] .theme-toggle__icon--moon {
  display: none;
}
[data-theme="light"] .theme-toggle__icon--sun {
  display: inline;
}
[data-theme="light"] .theme-toggle {
  border-color: var(--text);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}
.nav-logo img {
  /* The PNG is mostly transparent padding (artwork is ~31% of its height),
     so the layout height stays 120px and the nav bar doesn't grow; the
     transform scales the rendered image inside that padding instead.
     translateX keeps the artwork's left edge where it was, margin-right
     makes room so the scaled artwork doesn't run into the logo text. */
  height: 120px;
  width: auto;
  transform-origin: left center;
  transform: translateX(-13px) scale(1.6);
  margin-right: 31px;
}
.nav-logo-text {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent);
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  width: 100%;
}
.nav-cta {
  padding: 0.5rem 1.4rem;
  margin-left: 1.2rem;
  margin-right: 2rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  animation: navCtaBorderGlow 2.2s ease-in-out infinite;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}
.nav-cta:hover {
  animation: none;
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 18px var(--glow);
}

/* ===== ADDED: compact mobile/tablet "Resume" nav button. Hidden by
   default (desktop); shown and placed via the RESPONSIVE section below.
   CHANGED: now reuses .btn-primary — same filled-accent look as the "My
   Resume" button above the contact form — with a compact size override for
   the navbar. `display` lives on the compound .btn-primary.nav-resume
   selector everywhere (base + both responsive overrides below), because
   .btn-primary's own `display: inline-block` has the same specificity as a
   plain `.nav-resume` rule and would otherwise win by source order. */
.btn-primary.nav-resume {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  /* Deliberately smaller than .nav-cta ("Contact Me": padding 0.5rem 1.4rem
     / 0.78rem font at this width) — no min-height override either, so it's
     sized purely off its own smaller padding/font like nav-cta is. */
  padding: 0.4rem 0.7rem;
  font-size: 0.68rem;
}
/* Same fix as .resume-cta__btn: .btn-primary's default color: var(--bg) is
   unreadable on the accent fill in the light theme. */
[data-theme="light"] .nav-resume {
  color: var(--text);
}
.nav-resume:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-resume__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.nav-resume:hover .nav-resume__icon,
.nav-resume:focus-visible .nav-resume__icon {
  transform: translateY(2px);
}
@media (prefers-reduced-motion: reduce) {
  .nav-resume__icon {
    transition: none;
  }
  .nav-resume:hover .nav-resume__icon,
  .nav-resume:focus-visible .nav-resume__icon {
    transform: none;
  }
}
/* ===== ADDED: desktop-only copy of the compact nav resume button, left of
   Contact Me (same slot as the mobile .nav-resume above — they swap at the
   900px breakpoint, never both visible). Visible by default (desktop);
   hidden ≤900px in the RESPONSIVE section below. Same compact sizing/look
   as .nav-resume; spacing comes from .nav-actions' own flex gap. ===== */
.btn-primary.nav-resume-desktop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.68rem;
}
[data-theme="light"] .nav-resume-desktop {
  color: var(--text);
}
.nav-resume-desktop:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-resume-desktop__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.nav-resume-desktop:hover .nav-resume-desktop__icon,
.nav-resume-desktop:focus-visible .nav-resume-desktop__icon {
  transform: translateY(2px);
}
@media (prefers-reduced-motion: reduce) {
  .nav-resume-desktop__icon {
    transition: none;
  }
  .nav-resume-desktop:hover .nav-resume-desktop__icon,
  .nav-resume-desktop:focus-visible .nav-resume-desktop__icon {
    transform: none;
  }
}

@keyframes navCtaBorderGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(56, 189, 248, 0.28),
      0 0 10px rgba(56, 189, 248, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(56, 189, 248, 0.58),
      0 0 22px rgba(56, 189, 248, 0.5);
  }
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.28rem;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--accent);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.nav-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.18);
}
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.mobile-nav-menu {
  display: none;
}

/* ─── SECTIONS ──────────────────────────────────── */
section {
  position: relative;
  z-index: 1;
}

/* ─── HERO ──────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 3rem 4rem;
  overflow: hidden;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
  animation: fadeUp 0.6s ease both;
}
.hero-badge {
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}
.hero-badge:hover,
.hero-badge:focus-visible {
  border-color: var(--accent);
}
/* Keep the form clear of the fixed nav when jumped to */
#contactForm {
  scroll-margin-top: 6rem;
}

.hero-title {
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  animation: fadeUp 0.7s 0.1s ease both;
}
.hero-title .line1 {
  display: block;
  color: var(--white);
}
.hero-title .line2 {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
}
.hero-title .line3 {
  display: block;
  color: var(--accent);
}

.hero-mobile-portrait {
  display: none;
  margin-top: 1.2rem;
}

.hero-mobile-portrait-frame {
  width: min(68vw, 220px);
  height: min(82vw, 280px);
  background: var(--accent);
  padding: 2px;
  clip-path: polygon(
    0 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% 100%,
    12px 100%,
    0 calc(100% - 12px)
  );
}

.hero-mobile-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  clip-path: polygon(
    0 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% 100%,
    10px 100%,
    0 calc(100% - 10px)
  );
}

.hero-sub {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 480px;
  animation: fadeUp 0.7s 0.2s ease both;
}
.hero-sub-accent {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  will-change: transform;
  animation-name: heroSubBounce;
  animation-duration: 3.9s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.hero-sub-accent--1 {
  animation-delay: 0s;
}

.hero-sub-accent--2 {
  animation-delay: 1.3s;
}

.hero-sub-accent--3 {
  animation-delay: 2.6s;
}

.hero-sub-accent--white {
  color: var(--white);
}

@keyframes heroSubBounce {
  0%,
  20%,
  100% {
    transform: translateY(0);
  }
  8% {
    transform: translateY(-0.65em);
  }
  14% {
    transform: translateY(0.08em);
  }
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2.4rem;
  flex-wrap: wrap;
  animation: fadeUp 0.7s 0.3s ease both;
}
/* ===== ADDED: wraps .hero-actions + the new resume button; .hero-actions
   itself is untouched above, so "View My Work"/"Let's Talk" keep their
   exact prior spacing and behavior. ===== */
.hero-cta-group {
  display: flex;
  flex-direction: column;
  /* Left-aligned: the resume button and the social icons each start at the
     left edge of "View My Work". Re-centered ≤900px (RESPONSIVE section),
     where the resume button is hidden. */
  align-items: flex-start;
  /* Shrinks the group to the width of the "View My Work"/"Let's Talk" row
     (its widest child). */
  width: fit-content;
  gap: 0.9rem;
}
.hero-resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
/* .btn-ghost.hero-resume-btn (not just .hero-resume-btn) so this beats
   .btn-ghost's own border-color/color on specificity, not source order —
   .btn-ghost is defined further down the file and would otherwise win.
   Lighter than "Let's Talk" so it reads as tertiary, not a stray 3rd CTA. */
.btn-ghost.hero-resume-btn {
  /* var(--muted) instead of var(--border): matches the text color and
     stays clearly visible against the surface, while var(--border) alone
     was nearly indistinguishable from the background. */
  border-color: var(--muted);
  color: var(--muted);
}
.hero-resume-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.hero-resume-btn__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.hero-resume-btn:hover .hero-resume-btn__icon,
.hero-resume-btn:focus-visible .hero-resume-btn__icon {
  transform: translateY(3px);
}
@media (prefers-reduced-motion: reduce) {
  .hero-resume-btn__icon {
    transition: none;
  }
  .hero-resume-btn:hover .hero-resume-btn__icon,
  .hero-resume-btn:focus-visible .hero-resume-btn__icon {
    transform: none;
  }
}
.btn-primary {
  padding: 0.8rem 2rem;
  background: var(--accent);
  color: var(--bg);
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transform-origin: center;
  box-shadow: 0 0 24px var(--glow);
  transition:
    box-shadow 0.2s,
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.btn-primary:hover {
  background: transparent;
  border-width: 2px;
  border-color: var(--accent);
  color: var(--white);
  box-shadow: 0 0 40px var(--glow);
  transform: scale(1.06);
}

.btn-ghost {
  padding: 0.8rem 2rem;
  background: transparent;
  color: var(--text);
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transform-origin: center;
  transition:
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.35);
  transform: scale(1.06);
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  animation: fadeUp 0.7s 0.4s ease both;
}
.hero-socials {
  display: flex;
  gap: 0.7rem;
  /* No margin-top: now a child of .hero-cta-group, whose flex `gap` already
     provides spacing and whose align-items positions this row. */
  animation: fadeUp 0.7s 0.5s ease both;
}
.hero-socials-mobile {
  display: none;
}
.hero-social {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  display: grid;
  place-items: center;
  text-decoration: none;
  transition:
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s,
    transform 0.15s;
}
.hero-social svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}
.hero-social:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--glow);
  transform: translateY(-2px);
}
.stat-num {
  font-family: "Rajdhani", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero-tagline {
  margin-top: 3rem;
  animation: fadeUp 0.7s 0.4s ease both;
}
.hero-tagline-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: 0.9rem;
}

/* Hero right - visual */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.8s 0.4s ease both;
}
.hero-visual-frame {
  position: relative;
}
.hero-photo-wrap {
  position: relative;
  width: 340px;
  height: 420px;
}
.hero-photo-wrap::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: var(--accent);
  clip-path: polygon(
    0 0,
    calc(100% - 16px) 0,
    100% 16px,
    100% 100%,
    16px 100%,
    0 calc(100% - 16px)
  );
}
.hero-photo-inner {
  position: absolute;
  inset: 2px;
  background: var(--surface);
  clip-path: polygon(
    0 0,
    calc(100% - 16px) 0,
    100% 16px,
    100% 100%,
    16px 100%,
    0 calc(100% - 16px)
  );
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Replace src with: ChadSelfie.png */
.hero-photo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(15%);
}
.hero-photo-inner .photo-placeholder {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  text-align: center;
}
.hero-photo-inner .photo-placeholder.visible {
  display: flex;
}
.hero-photo-inner .photo-placeholder svg {
  opacity: 0.3;
}

.hero-tag {
  position: absolute;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
}
.hero-tag.t1 {
  top: -12px;
  left: -40px;
}
.hero-tag.t2 {
  bottom: 30px;
  right: -50px;
}
.hero-logo-badge {
  position: absolute;
  bottom: -20px;
  left: -30px;
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hero-logo-badge img {
  height: 48px;
  /* Negative margins cancel the extra 16px height (and ~11px width of the
     2:3 logo) so the logo grows into the padding without resizing the badge. */
  margin: -8px -5px;
}
.hero-logo-badge span {
  font-family: "Rajdhani", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Decorative corner lines */
.corner-tl,
.corner-br {
  position: absolute;
  width: 24px;
  height: 24px;
}
.corner-tl {
  top: -8px;
  left: -8px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}
.corner-br {
  bottom: -8px;
  right: -8px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

/* ─── SCROLLING TICKER ──────────────────────────── */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
  background: var(--bg2);
  position: relative;
  z-index: 2;
}
.ticker-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: ticker 22s linear infinite;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.ticker-item span {
  color: var(--accent);
}
@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ─── ABOUT ─────────────────────────────────────── */
#about {
  padding: 7rem 3rem;
  background: var(--bg);
}
.about-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 5rem;
  align-items: center;
}
.about-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.about-label::before {
  content: "//";
  opacity: 0.5;
}
.contact-label-center {
  justify-content: center;
}

.section-title {
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 1.5rem;
}
.section-title em {
  color: var(--accent);
  font-style: normal;
}

.about-text {
  color: var(--muted);
  line-height: 1.8;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 2rem;
}
.skill-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--text);
  letter-spacing: 0.06em;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.skill-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.skill-chip::before {
  content: "▹";
  color: var(--accent);
  font-size: 0.65rem;
}

.about-img-area {
  position: relative;
  display: flex;
  justify-content: center;
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem;
  position: relative;
  max-width: 420px;
  width: 100%;
}
.about-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.about-card-title {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
}
.about-services {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.service-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}
.service-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.service-icon {
  font-size: 1.3rem;
  line-height: 1;
  min-width: 28px;
  text-align: center;
}
.service-name {
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.service-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ─── PROJECTS ──────────────────────────────────── */
#projects {
  padding: 7rem 3rem;
  background: var(--bg2);
}
.projects-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  margin-bottom: 3.5rem;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
  cursor: pointer;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--card-hover-shadow);
}
.project-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.project-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg3);
  position: relative;
}
.project-card.featured .project-img {
  aspect-ratio: auto;
  min-height: 280px;
}
.project-img img,
.project-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
  filter: saturate(85%);
}
.project-video-wrap video {
  filter: saturate(90%);
}
.project-card:hover .project-img img,
.project-card:hover .project-video-wrap video {
  transform: scale(1.04);
}
.project-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-align: center;
  padding: 1rem;
}
.project-overlay {
  position: absolute;
  inset: 0;
  background: var(--image-overlay);
}
.img-hint {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  z-index: 2;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--chip-bg);
  border: 1px solid var(--border);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.2s;
}
.project-card:hover .img-hint {
  opacity: 1;
}
.project-body {
  padding: 1.5rem;
}
.project-card.featured .project-body {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.project-type {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
.project-title {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 0.7rem;
}
.project-card.featured .project-title {
  font-size: 1.9rem;
}
.project-desc {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.project-links {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.project-link {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: scale(1);
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}
button.project-link {
  appearance: none;
  cursor: pointer;
}
.project-link:hover {
  transform: scale(1.06);
}
.project-link-live {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.project-link-live:hover {
  box-shadow: 0 0 16px var(--glow);
}
.project-link-code {
  background: transparent;
  color: var(--text);
  border: 1px solid rgb(129, 125, 125);
}
.project-link-code:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.project-link-disabled {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}
.project-link-disabled:hover {
  transform: scale(1);
  border-color: rgb(129, 125, 125);
  color: var(--text);
}
.tag {
  padding: 0.25rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.project-arrow {
  display: none;
}

/* before/after strip */
.ba-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--border);
}
.ba-pane {
  overflow: hidden;
  position: relative;
}
.ba-label {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  z-index: 2;
}
.ba-label.before {
  background: rgba(100, 116, 139, 0.8);
  color: var(--inverse-text);
}
.ba-label.after {
  background: rgba(56, 189, 248, 0.85);
  color: var(--bg);
}
.ba-pane img,
.ba-pane video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ba-pane-contain {
  background: var(--bg3);
}
.ba-pane-contain img {
  object-fit: contain;
}

/* ─── PROCESS ───────────────────────────────────── */
#process {
  padding: 7rem 3rem;
  background: var(--bg);
}
.process-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}
.process-step {
  width: 100%;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  appearance: none;
  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.process-step:hover,
.process-step:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.3),
    0 0 24px rgba(56, 189, 248, 0.35),
    0 0 48px rgba(56, 189, 248, 0.2);
  outline: none;
}
.step-num {
  font-family: "Rajdhani", sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
  transition: color 0.2s;
}
.process-step:hover .step-num {
  color: var(--accent);
}
.step-title {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}
.step-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.65;
}
.step-connector {
  position: absolute;
  top: 50%;
  right: -20px;
  width: 20px;
  height: 1px;
  background: var(--border);
  z-index: 2;
}
.process-step:last-child .step-connector {
  display: none;
}

.process-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.process-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.process-modal__backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.process-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--surface-shadow);
}
.process-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}
.process-modal__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.process-modal__eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.process-modal__title {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.8rem;
}
.process-modal__text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--muted);
}

/* case study modal */
.case-study-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 1250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.case-study-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.case-study-modal__backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.case-study-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: 85vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--surface-shadow);
}
.case-study-modal__body {
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
}
.case-study-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
}
.case-study-modal__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.case-study-modal__eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.case-study-modal__title {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.2rem;
}
.case-study-modal__content h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.4rem 0 0.5rem;
}
.case-study-modal__content h4:first-child {
  margin-top: 0;
}
.case-study-modal__content p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.case-study-modal__content ul {
  margin: 0 0 0.75rem 1.1rem;
}
.case-study-modal__content li {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.project-link-case-study {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.project-link-case-study:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 16px var(--glow);
}

.submit-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.submit-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.submit-modal__backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.submit-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem;
  box-shadow: var(--surface-shadow);
  text-align: center;
}
.submit-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}
.submit-modal__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.submit-modal__eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
  text-align: center;
}
.submit-modal__title {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.8rem;
  text-align: center;
}
.submit-modal__text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 1.4rem;
  text-align: center;
}
.submit-modal__button {
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  margin-inline: auto;
}
.submit-modal__button:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 16px var(--glow);
}

/* ===== ADDED: shared resume popup — same fixed/backdrop/dialog structure
   as .submit-modal above, plus a subtle dialog scale-in and two stacked
   option buttons. ===== */
.resume-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.resume-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.resume-modal__backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.resume-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--surface-shadow);
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}
.resume-modal.is-open .resume-modal__dialog {
  transform: none;
}
.resume-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.resume-modal__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.resume-modal__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.resume-modal__title {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.6rem;
  text-align: center;
}
.resume-modal__text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 1.7rem;
  text-align: center;
}
.resume-modal__options {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.resume-modal__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  width: 100%;
  padding: 0.85rem 1.2rem;
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}
.resume-modal__option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.resume-modal__option-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.resume-modal__option--primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--bg);
  box-shadow: 0 0 20px var(--glow);
}
.resume-modal__option--primary:hover,
.resume-modal__option--primary:focus-visible {
  background: transparent;
  border-color: var(--accent);
  color: var(--white);
  box-shadow: 0 0 32px var(--glow);
}
/* Same fix as .resume-cta__btn: var(--bg) text on an accent-filled button
   is unreadable in the light theme, so pin it to var(--text) there instead. */
[data-theme="light"] .resume-modal__option--primary {
  color: var(--text);
}
.resume-modal__option--secondary {
  background: transparent;
  border-color: var(--accent);
  /* var(--text), not var(--accent): matches .btn-ghost's convention (border
     carries the accent, text stays var(--text)) — accent-colored text on a
     light surface fails contrast, same class of bug var(--primary) has. */
  color: var(--text);
}
.resume-modal__option--secondary:hover,
.resume-modal__option--secondary:focus-visible {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 20px var(--glow);
}
[data-theme="light"] .resume-modal__option--secondary:hover,
[data-theme="light"] .resume-modal__option--secondary:focus-visible {
  color: var(--text);
}
@media (prefers-reduced-motion: reduce) {
  .resume-modal,
  .resume-modal__dialog {
    transition: none;
  }
}

.video-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 1300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.video-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.video-modal__backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.video-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem;
  box-shadow: var(--surface-shadow);
}
.video-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
}
.video-modal__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.video-modal__player {
  width: 100%;
  display: block;
  background: var(--media-stage-bg);
}

.image-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 1350;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.image-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.image-modal__backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.image-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  box-shadow: var(--surface-shadow-strong);
}
.image-modal__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
}
.image-modal__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.image-modal__stage {
  position: relative;
  background: var(--media-stage-bg);
  min-height: min(60vh, 620px);
  display: grid;
  place-items: center;
}
.image-modal__preview {
  width: 100%;
  height: min(60vh, 620px);
  object-fit: contain;
  display: block;
}
.image-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text);
  font-size: 1.35rem;
  cursor: pointer;
  z-index: 2;
}
.image-modal__nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.image-modal__nav--prev {
  left: 0.7rem;
}
.image-modal__nav--next {
  right: 0.7rem;
}
.image-modal__nav.is-hidden {
  display: none;
}
.image-modal__thumbs {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.image-modal__thumb {
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 0;
  width: 78px;
  height: 54px;
  cursor: pointer;
  flex: 0 0 auto;
}
.image-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(85%);
}
.image-modal__thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

/* ─── CONTACT ───────────────────────────────────── */
#contact {
  padding: 7rem 3rem;
  background: var(--bg2);
}
.contact-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.contact-title {
  font-family: "Rajdhani", sans-serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 1rem;
}
.contact-title em {
  color: var(--accent);
  font-style: normal;
}
.contact-sub {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 3rem;
  max-width: 520px;
  margin-inline: auto;
  margin-bottom: 3rem;
}

/* ===== ADDED: Resume download callout ("Quick Access") ===== */
.resume-cta {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  text-align: center;
  overflow: hidden;
}
.resume-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.resume-cta__text {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.6rem;
}
.resume-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 44px;
}
/* Dark theme: .btn-primary's default color: var(--bg) already reads as
   near-black on the accent fill (~9:1). Light theme: that same var(--bg)
   would be near-white and unreadable, so var(--text) (dark navy) is used
   there instead — both pass WCAG AA without inventing a new color. */
[data-theme="light"] .resume-cta__btn {
  color: var(--text);
}
.resume-cta__icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.resume-cta__btn:hover .resume-cta__icon,
.resume-cta__btn:focus-visible .resume-cta__icon {
  transform: translateY(3px);
}
.resume-cta__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.resume-cta__meta {
  display: block;
  margin-top: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .resume-cta__icon {
    transition: none;
  }
  .resume-cta__btn:hover .resume-cta__icon,
  .resume-cta__btn:focus-visible .resume-cta__icon {
    transform: none;
  }
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3rem;
  text-align: left;
}
.form-note {
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.08),
    rgba(124, 58, 237, 0.08)
  );
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  font-family: "Syne", sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted);
}
.form-group select {
  appearance: none;
}
/* A <select> has no ::placeholder. While the empty "Select a contact
   method..." option is chosen the required select is :invalid, so that
   state stands in for the placeholder color; real options stay var(--text). */
.form-group select:required:invalid {
  color: var(--muted);
}
.form-group select option {
  color: var(--text);
}

.form-group.full {
  grid-column: span 2;
}
.form-submit {
  margin-top: 1.5rem;
  width: 100%;
  padding: 1rem;
  background: var(--accent);
  color: var(--bg);
  font-family: "Rajdhani", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 24px var(--glow);
  animation: formSubmitGlow 2.2s ease-in-out infinite;
  transition:
    box-shadow 0.2s,
    transform 0.15s;
}
.form-submit:hover {
  animation: none;
  box-shadow: 0 0 40px var(--glow);
  transform: translateY(-2px);
}

.certifications-cta-wrap {
  margin-top: 1.6rem;
  display: flex;
  justify-content: center;
}

.certifications-cta {
  display: inline-block;
  min-width: 240px;
  text-align: center;
  text-decoration: none;
  padding: 0.92rem 1.6rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: "Rajdhani", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 rgba(56, 189, 248, 0);
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.certifications-cta:hover {
  color: var(--bg);
  background: var(--accent);
  box-shadow: 0 0 26px var(--glow);
  transform: translateY(-2px);
}

@keyframes formSubmitGlow {
  0%,
  100% {
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.4);
  }
  50% {
    box-shadow: 0 0 34px rgba(56, 189, 248, 0.8);
  }
}

/* ─── FOOTER ────────────────────────────────────── */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2.5rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.footer-logo img {
  height: 112px;
}
.footer-logo-text {
  font-family: "Rajdhani", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-copy {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--footer-muted);
  letter-spacing: 0.08em;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--footer-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-socials {
  display: flex;
  gap: 0.7rem;
}

.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: calc(4.6rem + var(--btt-lift, 0px));
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent);
  background: var(--control-bg);
  color: var(--accent);
  font-family: "Rajdhani", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

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

.back-to-top:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 18px var(--glow);
}

/* ─── FADE ANIMATIONS ───────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 900px) {
  #hero,
  #about,
  #projects,
  #process,
  #contact {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  nav {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 0.75rem 1.2rem;
  }
  .nav-logo-text {
    display: none;
  }
  .nav-logo img {
    /* Grow the logo visually without enlarging the nav row: layout height
       stays small, transform scales the rendered image so it overflows. */
    height: 84px;
    transform: scale(1.75);
    margin-right: 0;
  }
  .nav-actions {
    justify-self: end;
    width: auto;
    justify-content: flex-end;
    margin-left: 0;
    gap: 0.75rem;
  }
  .theme-toggle-slot--desktop {
    display: none;
  }
  .nav-cta {
    margin-right: 0;
    margin-left: 0;
    order: 1;
  }
  /* ADDED: swap the hero resume button for the compact navbar one at the
     same breakpoint where the navbar itself becomes the mobile/hamburger
     version. */
  .hero-resume-btn {
    display: none;
  }
  /* Keep the social icons centered under the CTA row here, as before. */
  .hero-cta-group {
    align-items: center;
  }
  .btn-primary.nav-resume {
    display: inline-flex;
    order: 0;
  }
  /* ADDED: the desktop copy (right of the theme toggle) is the mirror image
     — visible by default, hidden here where the mobile one takes over. */
  .btn-primary.nav-resume-desktop {
    display: none;
  }
  #hero {
    padding-top: 8.5rem;
  }
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
    order: 2;
  }
  .mobile-nav-menu {
    display: flex;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    max-height: 0;
    overflow: hidden;
    margin-top: 0.3rem;
    padding: 0 0.35rem;
    border-top: 1px solid transparent;
    opacity: 0;
    pointer-events: none;
    transition:
      max-height 0.25s ease,
      opacity 0.2s ease,
      padding 0.2s ease,
      border-color 0.2s ease;
  }
  nav.mobile-nav-open .mobile-nav-menu {
    max-height: 24rem;
    min-height: 17rem;
    padding: 1rem 0.35rem 0.5rem;
    border-top-color: var(--border);
    opacity: 1;
    pointer-events: auto;
  }
  .theme-toggle-slot--mobile {
    display: flex;
    width: 100%;
    margin-top: auto;
    padding: 0.65rem 0.4rem 0.2rem;
    justify-content: flex-start;
  }
  .mobile-nav-menu .theme-toggle {
    min-width: 46px;
    min-height: 42px;
    padding: 0.45rem;
    justify-content: center;
  }
  .mobile-nav-menu .theme-toggle__text {
    display: none;
  }
  .mobile-nav-menu a {
    color: var(--muted);
    text-decoration: none;
    font-family: "JetBrains Mono", monospace;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-left: 0.35rem;
  }
  .mobile-nav-menu a:hover,
  .mobile-nav-menu a[aria-current="page"] {
    color: var(--accent);
  }
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    display: none;
  }
  .hero-mobile-portrait {
    display: block;
  }
  .hero-sub,
  .about-text,
  .contact-sub {
    max-width: none;
  }
  .about-inner {
    grid-template-columns: 1fr;
  }
  .about-card {
    max-width: none;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-card.featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }
  .project-card.featured .ba-strip {
    grid-template-columns: 1fr;
  }
  .project-card.featured .ba-pane {
    min-height: 180px;
  }
  .project-card.featured .ba-pane img,
  .project-card.featured .ba-pane video {
    object-fit: contain;
    background: var(--bg3);
  }
  .project-card.featured .project-body {
    padding: 1.75rem;
  }
  .process-steps {
    grid-template-columns: 1fr 1fr;
  }
  .step-connector {
    display: none;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-group.full {
    grid-column: span 1;
  }
  .contact-form {
    padding: 1.5rem;
  }
  /* ADDED: resume callout mobile sizing */
  .resume-cta {
    padding: 1.75rem;
  }
  .resume-cta__btn {
    width: 100%;
    max-width: 380px;
  }
  .certifications-cta {
    width: 100%;
    max-width: 380px;
  }
  footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 2.5rem 1.5rem;
  }
  .footer-left {
    flex-direction: column;
    justify-content: center;
    width: 100%;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer-socials {
    justify-content: center;
    width: 100%;
  }
  .back-to-top {
    right: 0.9rem;
    bottom: calc(3.9rem + var(--btt-lift, 0px));
  }
  .image-modal {
    padding: 0.75rem;
  }
  .image-modal__dialog {
    padding: 0.65rem;
  }
  .image-modal__preview,
  .image-modal__stage {
    height: min(54vh, 460px);
    min-height: min(54vh, 460px);
  }
  .image-modal__thumb {
    width: 66px;
    height: 48px;
  }
}

@media (max-width: 560px) {
  #hero,
  #about,
  #projects,
  #process,
  #contact {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }
  nav {
    padding: 0.65rem 0.9rem;
  }
  .nav-logo img {
    height: 68px;
    transform: scale(1.7);
  }
  #hero {
    padding-top: 7.5rem;
  }
  /* ADDED: give the resume popup a bit more width to breathe with on small
     phones — near-full-width with slim side margins. */
  .resume-modal {
    padding: 1rem;
  }
  .resume-modal__dialog {
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
  /* CHANGED: was a 3-column grid (spacer/nav-cta/nav-toggle) sized for two
     items. Now fits nav-resume too: spacer column absorbs the leftover
     space and the three real controls sit flush right, in order. */
  .nav-actions {
    width: 100%;
    margin-left: 0;
    gap: 0.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
  }
  .nav-resume {
    grid-column: 2;
  }
  .nav-cta {
    padding: 0.48rem 0.95rem;
    font-size: 0.78rem;
    grid-column: 3;
    justify-self: center;
    margin-left: 0;
    margin-right: 0;
  }
  .nav-toggle {
    width: 42px;
    height: 42px;
    grid-column: 4;
    justify-self: end;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-tagline {
    margin-top: 2rem;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .about-card {
    padding: 1.5rem;
  }
  .contact-form {
    padding: 1.25rem;
  }
  /* ADDED: resume callout mobile sizing */
  .resume-cta {
    padding: 1.5rem;
  }
  .project-card.featured .project-body {
    padding: 1.5rem;
  }
  .process-steps {
    grid-template-columns: 1fr;
  }
}

/* ===== ADDED: on the narrowest phones (~360-400px) there isn't room for
   icon + "Resume" text next to Contact Me without crowding the hamburger.
   Drop to icon-only; aria-label on the <a> keeps it accessible. ===== */
@media (max-width: 400px) {
  /* .btn-primary.nav-resume (not just .nav-resume): needs to match/beat the
     compound selector's specificity to actually override its padding. */
  .btn-primary.nav-resume {
    padding: 0.4rem;
    gap: 0;
  }
  .nav-resume__icon {
    width: 15px;
    height: 15px;
  }
  .nav-resume__text {
    display: none;
  }
}

/* ===== ADDED: portfolio assistant chat widget, fixed to the bottom-left so
   it never collides with .back-to-top (bottom-right). Not a full modal:
   no backdrop, aria-modal="false", so visitors can keep reading the page
   while the panel is open. ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chatbot-widget {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 1300;
}

.chatbot-launcher {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 24px var(--glow);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
[data-theme="light"] .chatbot-launcher {
  color: var(--text);
}
.chatbot-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px var(--glow);
}
.chatbot-launcher:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.chatbot-launcher::after {
  content: "Click for questions...";
  position: absolute;
  left: calc(100% + 0.65rem);
  top: 50%;
  max-width: calc(100vw - 6rem);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--white);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.3;
  box-shadow: var(--surface-shadow-strong);
  opacity: 0;
  visibility: hidden;
  transform: translate(-0.25rem, -50%);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}
.chatbot-launcher.is-active::after {
  content: "Close chat";
}
.chatbot-launcher:focus-visible::after,
.chatbot-launcher:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}
.chatbot-launcher__icon {
  width: 24px;
  height: 24px;
  grid-area: 1 / 1;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
.chatbot-launcher__icon--close {
  opacity: 0;
  transform: scale(0.6);
}
.chatbot-launcher.is-active .chatbot-launcher__icon--open {
  opacity: 0;
  transform: scale(0.6);
}
.chatbot-launcher.is-active .chatbot-launcher__icon--close {
  opacity: 1;
  transform: scale(1);
}

.chatbot-panel {
  position: absolute;
  left: 0;
  bottom: calc(56px + 0.85rem);
  width: min(360px, calc(100vw - 2.4rem));
  height: min(520px, calc(100vh - 8rem));
  min-width: min(280px, calc(100vw - 2.4rem));
  max-width: calc(100vw - 2.4rem);
  min-height: min(320px, calc(100vh - 8rem));
  max-height: calc(100vh - 8rem);
  display: flex;
  flex-direction: column;
  resize: both;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--surface-shadow-strong);
  animation: chatbotPanelIn 0.18s ease;
}
.chatbot-panel[hidden] {
  display: none;
}
@keyframes chatbotPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chatbot-panel {
    animation: none;
  }
}

.chatbot-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.chatbot-panel__eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.chatbot-panel__title {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
}
.chatbot-panel__close {
  width: 1.8rem;
  height: 1.8rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.chatbot-panel__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chatbot-panel__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chatbot-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chatbot-message {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-line;
  border: 1px solid var(--border);
}
.chatbot-message--bot {
  align-self: flex-start;
  background: var(--bg2);
  color: var(--text);
}
.chatbot-message--user {
  align-self: flex-end;
  background: var(--accent);
  border-color: transparent;
  color: var(--bg);
}
[data-theme="light"] .chatbot-message--user {
  color: var(--text);
}

.chatbot-message--typing {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.9rem;
}
.chatbot-message--typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: chatbotTyping 1.1s infinite ease-in-out;
}
.chatbot-message--typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.chatbot-message--typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes chatbotTyping {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.chatbot-panel__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1.1rem 0.8rem;
}
.chatbot-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.chatbot-chip:hover,
.chatbot-chip:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.chatbot-panel__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
}
.chatbot-panel__input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  background: var(--control-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.95rem;
}
.chatbot-panel__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.chatbot-panel__input:disabled {
  opacity: 0.6;
}
.chatbot-panel__send {
  width: 40px;
  flex-shrink: 0;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    opacity 0.2s,
    box-shadow 0.2s;
}
[data-theme="light"] .chatbot-panel__send {
  color: var(--text);
}
.chatbot-panel__send:hover {
  box-shadow: 0 0 16px var(--glow);
}
.chatbot-panel__send:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}
.chatbot-panel__send svg {
  width: 16px;
  height: 16px;
}

.chatbot-panel__footnote {
  padding: 0 1.1rem 1.3rem;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
}
.chatbot-panel__footnote a {
  color: var(--accent);
}
.chatbot-panel::after {
  content: "Drag corner to resize";
  position: absolute;
  right: 1.25rem;
  bottom: 0.25rem;
  color: var(--white);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  pointer-events: none;
}

@media (max-width: 560px) {
  .chatbot-widget {
    left: 1rem;
    bottom: 1rem;
  }
  .chatbot-panel {
    width: calc(100vw - 1.5rem);
    height: min(70vh, 560px);
  }
}
