:root {
  --bg-dark: #050608;
  --bg-card-dark: rgba(15, 15, 22, 0.85);
  --bg-card-light: rgba(255, 255, 255, 0.94);

  --accent: #ff5c7c;
  --accent-soft-dark: rgba(255, 92, 124, 0.18);
  --accent-soft-light: rgba(255, 92, 124, 0.12);

  --border-soft-dark: rgba(255, 255, 255, 0.08);
  --border-soft-light: rgba(15, 23, 42, 0.06);

  --text-muted-dark: #a6a8b5;
  --text-muted-light: #6b7280;

  --text-main-dark: #f9fafb;
  --text-main-light: #0f172a;
}

/* Base */
* { scroll-behavior: smooth; }

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main-dark);
  background:
    radial-gradient(circle at top left, #262a49 0, transparent 55%),
    radial-gradient(circle at bottom right, #ff5c7c22 0, transparent 55%),
    var(--bg-dark);
}

body[data-theme="light"] {
  color: var(--text-main-light);
  background:
    radial-gradient(circle at top left, #e0f2fe 0, transparent 55%),
    radial-gradient(circle at bottom right, #fee2e2 0, transparent 55%),
    #f3f4f6;
}

/* GLOBAL LINK RESET */
body a,
body a:link,
body a:visited {
  color: inherit;
  text-decoration: none;
}

body a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Navbar */
.navbar {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(5, 6, 12, 0.9), rgba(5, 6, 12, 0.3));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.navbar-scrolled {
  background: rgba(5, 6, 12, 0.98);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.04);
}

body[data-theme="light"] .navbar {
  background: rgba(248, 250, 252, 0.96);
  border-color: rgba(15, 23, 42, 0.06);
}

body[data-theme="light"] .navbar-scrolled {
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  font-size: 1rem;
}

.nav-link {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.nav-link.active { color: var(--accent) !important; }

body[data-theme="light"] .navbar.navbar-dark .navbar-brand,
body[data-theme="light"] .navbar.navbar-dark .navbar-nav .nav-link {
  color: #0f172a !important;
}

body[data-theme="light"] .navbar.navbar-dark .navbar-nav .nav-link:hover {
  color: #020617 !important;
}

body[data-theme="light"] .navbar .navbar-toggler-icon { filter: invert(0.85); }

/* Theme Toggle */
.theme-toggle-btn {
  border-radius: 999px;
  padding-inline: 0.9rem;
  padding-block: 0.35rem;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-width: 1.5px;
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn i { font-size: 1rem; color: inherit; }

.theme-toggle-btn .theme-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.85;
}

.theme-toggle-btn.theme-toggle-animating i { animation: themeToggleSpin 0.35s ease-out; }

.theme-toggle-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0);
  opacity: 0;
}

.theme-toggle-btn.theme-toggle-animating::after { animation: themeToggleRipple 0.35s ease-out; }

body[data-theme="dark"] .theme-toggle-btn {
  border-color: rgba(249, 250, 251, 0.85);
  color: #f9fafb;
  background: rgba(15, 23, 42, 0.7);
}

body[data-theme="dark"] .theme-toggle-btn:hover { background: rgba(15, 23, 42, 0.95); }

body[data-theme="light"] .theme-toggle-btn {
  border-color: #0f172a;
  color: #0f172a;
  background: rgba(248, 250, 252, 1);
}

body[data-theme="light"] .theme-toggle-btn:hover { background: #e5e7eb; }

.theme-toggle-btn.btn-outline-light {
  border-color: inherit !important;
  color: inherit !important;
  background: inherit !important;
}

@keyframes themeToggleSpin {
  0% { transform: rotate(0deg) scale(1); }
  40% { transform: rotate(14deg) scale(1.1); }
  100% { transform: rotate(0deg) scale(1); }
}

@keyframes themeToggleRipple {
  0% { opacity: 0.0; border-color: rgba(255, 255, 255, 0.0); }
  30% { opacity: 0.6; border-color: rgba(255, 255, 255, 0.45); }
  100% { opacity: 0; border-color: rgba(255, 255, 255, 0.0); }
}

body[data-theme="light"] .theme-toggle-btn.theme-toggle-animating::after {
  border-color: rgba(15, 23, 42, 0.5);
}

/* Sections */
section { padding-top: 5rem; padding-bottom: 5rem; }

.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted-dark);
}

body[data-theme="light"] .section-label { color: var(--text-muted-light); }

.section-title {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1.4rem;
}

/* Hero */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 5rem;
  position: relative;
  overflow: hidden;
}

.hero-tagline {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted-dark);
}

body[data-theme="light"] .hero-tagline { color: var(--text-muted-light); }

.hero-title {
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title span { color: var(--accent); }

.hero-subtitle {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  color: var(--text-muted-dark);
  max-width: 32rem;
}

body[data-theme="light"] .hero-subtitle { color: var(--text-muted-light); }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 15, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted-dark);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 92, 124, 0.8);
}

body[data-theme="light"] .hero-badge {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  color: var(--text-muted-light);
}

/* Cards */
.card-surface {
  background: var(--bg-card-dark);
  border-radius: 1.2rem;
  border: 1px solid var(--border-soft-dark);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.8);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.card-surface:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 92, 124, 0.7);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9);
  background: radial-gradient(circle at top, #22263c, #0a0b11);
}

body[data-theme="light"] .card-surface {
  background: var(--bg-card-light);
  border-color: var(--border-soft-light);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .card-surface:hover {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.9);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.16);
}

/* Icon pill */
.icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 92, 124, 0.12);
  border: 1px solid rgba(255, 92, 124, 0.6);
  font-size: 1.1rem;
}

.icon-pill i { font-size: 1.1rem; }

/* Tags */
.tag {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-muted-dark);
}

body[data-theme="light"] .tag {
  border-color: rgba(148, 163, 184, 0.7);
  color: var(--text-muted-light);
}

/* Services */
.service-title { font-size: 1.05rem; font-weight: 500; }

/* Portfolio base */
.portfolio-thumbnail {
  height: 180px;
  border-radius: 0.9rem;
  background: radial-gradient(circle at top left, #35395c, #14151f);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  position: relative;
}

body[data-theme="light"] .portfolio-thumbnail {
  background: radial-gradient(circle at top left, #e5e7eb, #ffffff);
  border-color: rgba(148, 163, 184, 0.8);
}

/* About avatar */
.about-avatar-wrapper {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
}

body[data-theme="light"] .about-avatar-wrapper {
  border-color: rgba(148, 163, 184, 0.7);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.about-avatar { width: 100%; height: 100%; object-fit: cover; }
.about-connect-label { letter-spacing: 0.16em; }

/* Social chips */
.about-social-grid { display: flex; flex-direction: column; gap: 0.5rem; }

.social-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  border-radius: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-muted-dark);
  background: rgba(255, 255, 255, 0.03);
}

.social-chip-main { display: inline-flex; align-items: center; gap: 0.45rem; }
.social-chip i { font-size: 0.95rem; }

.social-chip-handle {
  font-size: 0.65rem;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.85;
}

.social-chip:hover {
  background: rgba(255, 92, 124, 0.15);
  border-color: rgba(255, 92, 124, 0.8);
  color: var(--accent);
  transform: translateY(-1px);
}

body[data-theme="light"] .social-chip {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
}

body[data-theme="light"] .social-chip:hover {
  background: rgba(255, 92, 124, 0.08);
  border-color: rgba(255, 92, 124, 0.7);
  color: #be123c;
}

/* Forms */
.form-control, .form-select {
  background: rgba(5, 6, 12, 0.9);
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f9fafb;
  font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
  border-color: rgba(255, 92, 124, 0.85);
  box-shadow: 0 0 0 0.2rem rgba(255, 92, 124, 0.23);
  background-color: rgba(5, 6, 12, 0.9);
}

.form-control::placeholder { color: #6b6e7e; }

body[data-theme="light"] .form-control,
body[data-theme="light"] .form-select {
  background: #f9fafb;
  border-color: rgba(148, 163, 184, 0.7);
  color: #0f172a;
}

body[data-theme="light"] .form-control:focus,
body[data-theme="light"] .form-select:focus {
  background: #ffffff;
  border-color: rgba(255, 92, 124, 0.8);
  box-shadow: 0 0 0 0.2rem rgba(248, 113, 113, 0.25);
}

body[data-theme="light"] .form-control::placeholder { color: #9ca3af; }

/* Buttons */
.btn-accent {
  border-radius: 999px;
  border: 1px solid rgba(255, 92, 124, 0.9);
  background: radial-gradient(circle at top left, #ff5c7c, #ff2f68);
  color: #050608;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  padding-inline: 1.8rem;
}

.btn-accent:hover { color: #050608; filter: brightness(1.08); }

.btn-ghost {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(5, 6, 12, 0.8);
  color: #f9fafb;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding-inline: 1.6rem;
}

.btn-ghost:hover { background: rgba(15, 17, 26, 0.9); color: #ffffff; }

body[data-theme="light"] .btn-ghost {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.9);
  color: #0f172a;
}

body[data-theme="light"] .btn-ghost:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Footer */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  font-size: 0.85rem;
  color: var(--text-muted-dark);
}

body[data-theme="light"] footer {
  border-color: rgba(15, 23, 42, 0.08);
  color: var(--text-muted-light);
}

footer .footer-links a {
  position: relative;
  display: inline-block;
  color: var(--text-muted-dark) !important;
  text-decoration: none !important;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding-bottom: 0.1rem;
}

body[data-theme="light"] footer .footer-links a {
  color: var(--text-muted-light) !important;
}

footer .footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.05rem;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease-out;
}

footer .footer-links a:hover::after { width: 100%; }
footer .footer-links a:hover { color: var(--accent) !important; }

/* Dividers / Text */
.divider-soft {
  height: 1px;
  background: linear-gradient(to right,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0));
}

body[data-theme="light"] .divider-soft {
  background: linear-gradient(to right,
    rgba(15, 23, 42, 0),
    rgba(15, 23, 42, 0.12),
    rgba(15, 23, 42, 0));
}

.text-soft { color: var(--text-muted-dark); }
body[data-theme="light"] .text-soft { color: var(--text-muted-light); }

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal-visible { opacity: 1; transform: translateY(0); }

/* Contact FAB */
.contact-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  z-index: 1070;
  background: radial-gradient(circle at top left, #ff5c7c, #ff2f68);
  color: #050608;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.contact-fab i { font-size: 1.2rem; }
.contact-fab:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

/* Toast */
.toast-wrapper { pointer-events: none; }
#statusToast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.96);
  color: #f9fafb;
  border-radius: 0.9rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
  padding: 0.35rem 0.35rem 0.35rem 0.75rem;
}
#statusToast.toast-success { border-left: 3px solid #22c55e; }
#statusToast.toast-error { border-left: 3px solid #ef4444; }
body[data-theme="light"] #statusToast { background: #0f172a; color: #e5e7eb; }

/* Responsive tweaks */
@media (max-width: 575.98px) {
  #hero { min-height: auto; padding-top: 6rem; padding-bottom: 4rem; }
  .social-chip-handle { display: none; }
}

/* ===========================
   PORTFOLIO IMAGE FORCE FIX
   =========================== */
body #work .portfolio-card .portfolio-thumbnail {
  position: relative !important;
  width: 100% !important;
  height: 180px !important;
  overflow: hidden !important;
  border-radius: 0.9rem !important;
  display: block !important;
}

body #work .portfolio-card .portfolio-thumbnail > img.portfolio-img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}