:root {
  --bg: #fdfcf9;
  --bg-card: #ffffff;
  --bg-nav: rgba(253, 252, 249, 0.85);
  --text: #0a0c10;
  --text-muted: #52525b;
  --text-dim: #71717a;
  --accent: #e8533a;
  --accent-soft: rgba(232, 83, 58, 0.1);
  --accent-2: #3b82f6;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 50px -15px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --font-heading: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #0a0c10;
  --bg-card: #111418;
  --bg-nav: rgba(10, 12, 16, 0.85);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: #f07259;
  --accent-soft: rgba(240, 114, 89, 0.15);
  --accent-2: #60a5fa;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px -15px rgba(0, 0, 0, 0.7);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.2, 1, 0.3, 1), transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #d64a33;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(232, 83, 58, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: -1px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

.nav-links a.active::after,
.nav-links a:hover::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Theme Toggle */
.theme-toggle {
  width: 48px; height: 26px;
  background: var(--border);
  border: none;
  border-radius: 99px;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 4px; left: 4px;
  width: 18px; height: 18px;
  background: var(--text);
  border-radius: 50%;
  transition: var(--transition);
}

[data-theme="dark"] .theme-toggle {
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

[data-theme="dark"] .theme-toggle::after {
  transform: translateX(22px);
  background: var(--accent);
}

.theme-icon {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 80px; left: 0; right: 0;
    background: var(--bg-nav);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--border);
    gap: 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
  }
}

.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Helper Classes */
.pt-navbar {
    padding-top: 100px;
}

.section {
  padding: 8rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
  max-width: 800px;
}

.section-divider {
  width: 60px; height: 4px;
  background: var(--accent);
  margin: 2rem 0 4rem;
  border-radius: 2px;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 120px 2rem 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.5rem 1.25rem;
  border-radius: 99px;
  margin-bottom: 2rem;
  border: 1px solid var(--accent-soft);
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.95;
  margin-bottom: 2rem;
  max-width: 900px;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 3rem;
  line-height: 1.6;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 6rem;
  align-items: flex-start;
}

.about-img-wrap {
  position: relative;
  z-index: 1;
}

.about-img-wrap::after {
  content: "";
  position: absolute;
  inset: 20px -20px -20px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  z-index: -1;
  opacity: 0.3;
}

.about-img {
  width: 100%;
  border-radius: var(--radius);
  filter: grayscale(1);
  transition: var(--transition);
  display: block;
}

.about-img:hover {
  filter: grayscale(0);
  transform: scale(1.02);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.stat-card {
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-img-wrap {
    max-width: 280px;
    margin: 0 auto;
  }
}

.tech-category {
  font-family: "Syne", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 3rem 0 1.5rem;
  text-align: center;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Slightly wider items */
  gap: 4.5rem; /* Extreme breathing room between tech icons */
  max-width: 1200px; /* Even wider container */
  margin: 5rem auto 0; /* Dramatic top separation */
}

.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem; /* Airy card interior */
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tech-card:hover {
  border-color: var(--accent);
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  background: var(--bg-body);
}

.tech-card img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  margin-bottom: 0.8rem;
  filter: grayscale(20%);
  transition: filter 0.3s ease;
}

.tech-card:hover img {
  filter: grayscale(0%);
}

.tech-card span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

/* Cleaned up duplicate tech-grid definitions */

.timeline {
  position: relative;
  padding-left: 3rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 4rem;
}

.timeline-dot {
  position: absolute;
  left: -3rem; top: 0.5rem;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: var(--transition);
}

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

.tag {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============================================
   Services
   ============================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 5.5rem; /* Ultra-luxury separation */
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4rem 3.5rem; /* Premium balanced padding */
  transition: var(--transition);
}

.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.service-icon {
  width: 54px; height: 54px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.service-card:hover .service-icon {
  background: var(--accent);
  color: #fff;
  transform: rotate(-5deg);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: minmax(220px, auto);
  gap: 2rem;
}

.bento-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.bento-item:hover {
  border-color: var(--accent);
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.bento-wide { grid-column: span 2; }
.bento-tall { grid-row: span 2; }

@media (max-width: 900px) {
  .bento-wide { grid-column: span 1; }
}

.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  margin-top: 1.5rem;
}

.portfolio-link:hover { gap: 0.8rem; }

.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 6rem;
}

.contact-info h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
  color: var(--text-muted);
}

.contact-item i {
  width: 40px; height: 40px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 83, 58, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .contact-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

footer {
  padding: 6rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-inner p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 0.8rem;
}

.social-links a {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.social-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}


/* ── Back-to-top: floats above chatbot button ──────────── */
.back-to-top {
  position: fixed;
  bottom: calc(2rem + 60px + 0.75rem); /* always above chatbot toggle */
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(232, 83, 58, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition:
    opacity 0.35s,
    transform 0.35s;
  z-index: 999;
}

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

.back-to-top:hover {
  transform: translateY(-3px);
}

.cursor-glow {
  pointer-events: none;
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(232, 83, 58, 0.07) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  z-index: 0;
  transition:
    left 0.12s ease,
    top 0.12s ease;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.4);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-6px);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 7rem 1.5rem 4rem;
    gap: 0;
  }
  .hero-visual {
    display: none;
  }
  .hero-content {
    max-width: 100%;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about-img-wrap {
    max-width: 260px;
    margin: 0 auto;
  }

  .contact-wrap {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  /* Section */
  .section {
    padding: 4rem 1.25rem;
  }
  .section-title {
    font-size: 1.75rem;
    letter-spacing: -0.5px;
  }
  .section-divider {
    margin-bottom: 2rem;
  }

  /* Navbar */
  .navbar-inner {
    padding: 0 1.25rem;
  }

  .nav-links.open {
    padding: 1.25rem;
    gap: 1rem;
  }
  .nav-links.open a {
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.4rem 0;
  }

  /* Hero */
  .hero {
    padding: 6rem 1.25rem 3.5rem;
    min-height: 100svh;
  }
  .hero h1 {
    font-size: 2.4rem;
    letter-spacing: -1px;
  }
  .hero p {
    font-size: 1rem;
  }
  .hero-cta {
    flex-direction: column;
    gap: 0.75rem;
  }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-scroll {
    display: none;
  }

  /* About */
  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
  .stat-num {
    font-size: 1.5rem;
  }
  .stat-label {
    font-size: 0.72rem;
  }

  /* Tech Stack */
  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
  .tech-card {
    padding: 1rem 0.5rem;
  }
  .tech-card img {
    width: 32px;
    height: 32px;
  }
  .tech-card span {
    font-size: 0.72rem;
  }

  /* Timeline */
  .timeline {
    padding-left: 1.5rem;
  }
  .timeline-card {
    padding: 1.1rem 1.2rem;
  }
  .timeline-title {
    font-size: 0.98rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .service-card {
    padding: 1.5rem 1.25rem;
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Contact */
  .form-row {
    grid-template-columns: 1fr;
  }
  .contact-info h3 {
    font-size: 1.15rem;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Back to Top */
  .back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: 2rem;
  }
  .about-stats {
    gap: 0.5rem;
  }
  .stat-num {
    font-size: 1.3rem;
  }
  .hero-badge {
    font-size: 0.72rem;
  }
}

@media (hover: none) {
  .service-card:hover,
  .portfolio-card:hover,
  .tech-card:hover,
  .stat-card:hover,
  .timeline-item:hover .timeline-card,
  .btn-primary:hover,
  .btn-outline:hover {
    transform: none;
    box-shadow: none;
  }

  .service-card:hover::before {
    transform: scaleX(0);
  }

  .service-card:active {
    transform: scale(0.98);
  }
  .portfolio-card:active {
    transform: scale(0.98);
  }
  .btn:active {
    transform: scale(0.97);
    opacity: 0.85;
  }
}

.form-status {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0;
  border-radius: 8px;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    padding 0.3s ease;
}

.form-status.success,
.form-status.error {
  max-height: 60px;
  padding: 0.75rem 1rem;
}

.form-status.success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.form-status.error {
  background: rgba(232, 83, 58, 0.08);
  color: var(--accent);
  border: 1px solid rgba(232, 83, 58, 0.2);
}

[data-theme="dark"] .form-status.success {
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loader-geo {
  width: 72px;
  height: 72px;
}

.loader-tri {
  animation: loaderSpin 1.8s linear infinite;
  transform-origin: 50px 50px;
}

.loader-ring {
  animation: loaderSpin 2.4s linear infinite reverse;
  transform-origin: 50px 50px;
}

.loader-dot {
  animation: loaderPulse 1.2s ease-in-out infinite;
  transform-origin: 50px 50px;
}

.loader-text {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--text);
  letter-spacing: -0.5px;
  animation: loaderFade 1.4s ease-in-out infinite alternate;
}

.loader-text span {
  color: var(--accent);
}

@keyframes loaderSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes loaderPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
}

@keyframes loaderFade {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}

.orbit-container {
  position: relative;
  width: 400px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-center {
  width: 100px;
  height: 100px;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; /* Blob shape */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: blobMorph 8s linear infinite;
  box-shadow: var(--shadow);
}

.center-icon {
  width: 50px;
}

.orbit-ring {
  position: absolute;
  border: 1px dashed var(--accent);
  border-radius: 50%;
  opacity: 0.3;
}

.ring-1 {
  width: 220px;
  height: 220px;
  animation: spin 15s linear infinite;
}

.ring-2 {
  width: 350px;
  height: 350px;
  animation: spin 25s linear infinite reverse;
}

.orbit-icon {
  position: absolute;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: counter-spin 15s linear infinite;
}

.ring-1 .orbit-icon:nth-child(1) {
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
}
.ring-1 .orbit-icon:nth-child(2) {
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
}
.ring-2 .orbit-icon:nth-child(1) {
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  animation-duration: 25s;
  animation-direction: reverse;
}
.ring-2 .orbit-icon:nth-child(2) {
  top: 50%;
  right: -20px;
  transform: translateY(-50%);
  animation-duration: 25s;
  animation-direction: reverse;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes counter-spin {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}
@keyframes blobMorph {
  0%, 100% { border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%; }
  50% { border-radius: 60% 40% 40% 60% / 60% 60% 40% 40%; }
}

@media (max-width: 900px) {
  .hero {
    display: flex;
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 5rem;
  }

  .hero-visual {
    display: flex !important;
    transform: scale(0.7);
    margin-bottom: -50px;
    margin-top: -30px;
  }

  .hero-content {
    align-items: center;
    display: flex;
    flex-direction: column;
  }
}

.center-glow {
  position: absolute;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.2;
  filter: blur(15px);
  z-index: -1;
  animation: pulseGlow 4s ease-in-out infinite;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.5;
  filter: blur(1px);
}

.p1 {
  top: 10%;
  left: 20%;
  animation: floatParticle 6s infinite ease-in-out;
}
.p2 {
  top: 80%;
  left: 15%;
  animation: floatParticle 8s infinite ease-in-out reverse;
}
.p3 {
  top: 30%;
  right: 10%;
  animation: floatParticle 7s infinite ease-in-out 1s;
}
.p4 {
  bottom: 20%;
  right: 20%;
  animation: floatParticle 9s infinite ease-in-out 0.5s;
}

@keyframes floatParticle {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translate(20px, -30px) scale(1.5);
    opacity: 0.7;
  }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.2; }
  50% { transform: scale(1.15); opacity: 0.35; }
}

@media (max-width: 900px) {
  .hero {
    display: flex !important;
    flex-direction: column-reverse !important;
    text-align: center;
    gap: 0;
  }
  .hero-visual {
    display: flex !important;
    justify-content: center;
    transform: scale(0.55); /* Reduced scale to prevent 'meleber' */
    margin-top: -60px;
    margin-bottom: -80px;
    width: 100%;
  }
}
/* Terminal Intro Overlay */
.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d1117;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.5s ease;
}

.terminal-overlay.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.terminal-content {
    width: 90%;
    max-width: 600px;
    background: #161b22;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 1px solid #30363d;
}

.terminal-header {
    background: #21262d;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
    color: #8b949e;
    font-size: 12px;
    font-family: monospace;
    margin-left: 10px;
}

.terminal-body {
    padding: 20px;
    color: #e6edf3;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    min-height: 200px;
}

.terminal-line {
    margin-bottom: 5px;
    word-break: break-all;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: #27c93f;
    margin-left: 5px;
    vertical-align: middle;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.text-accent { color: #e8533a; }
.text-success { color: #23c55e; }
.text-dim { color: #8b949e; }

/* Terminal Input */
.terminal-input-line {
    display: flex;
    gap: 10px;
    align-items: center;
}
.terminal-prompt { color: #27c93f; }
.terminal-input {
    background: transparent;
    border: none;
    color: #e6edf3;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    width: 100%;
}

/* Audio Player */
.audio-player {
    position: fixed;
    bottom: 30px;
    right: 90px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 15px;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.audio-visualizer {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 15px;
}

.vis-bar {
    width: 3px;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

.audio-player.playing .vis-bar {
    animation: visAnim 0.8s ease-in-out infinite alternate;
}

.audio-player.playing .vis-bar:nth-child(2) { animation-delay: 0.2s; }
.audio-player.playing .vis-bar:nth-child(3) { animation-delay: 0.4s; }

@keyframes visAnim {
    0% { height: 20%; }
    100% { height: 100%; }
}

.audio-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Snake Game Styles */
.game-container {
    max-width: 600px;
    margin: 100px auto;
    background: #000;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(232, 83, 58, 0.2);
    text-align: center;
}

#snakeCanvas {
    background: #111;
    border: 2px solid #333;
    display: block;
    margin: 20px auto;
}

.game-info {
    color: #fff;
    font-family: 'Syne', sans-serif;
    margin-bottom: 15px;
}

.score-box {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}

/* Matrix Easter Egg */
[data-theme="matrix"] {
    --bg: #000;
    --bg-nav: rgba(0, 20, 0, 0.9);
    --text: #00ff41;
    --accent: #00ff41;
    --border: #003b00;
    --bg-card: #050505;
}

[data-theme="matrix"] * {
    font-family: 'Courier New', monospace !important;
    text-shadow: 0 0 5px #00ff41;
}

/* Theme Transition Overlay */
.theme-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--bg);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.8s ease-in, height 0.8s ease-in;
}

.theme-overlay.active {
    width: 300vmax;
    height: 300vmax;
}

/* RPG Skill Tree */
.skill-tree {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.skill-node {
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease;
}

.skill-node:hover {
    transform: scale(1.05);
    border-color: var(--accent);
}

.skill-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.skill-level-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    margin-top: 15px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--accent);
    width: 0;
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.1, 0.5, 0.1, 1);
}

.skill-node.visible .skill-progress {
    width: var(--percent);
}

/* Level 3: Modern Patterns */
.noise-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.05;
    pointer-events: none;
    z-index: 100;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 200px);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 2rem auto;
}

.bento-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.bento-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.bento-large { grid-column: span 2; grid-row: span 2; }
.bento-wide { grid-column: span 2; }
.bento-tall { grid-row: span 2; }

/* GitHub Stats Widgets */
.stats-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border);
    min-width: 140px;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    font-family: 'Syne', sans-serif;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Floating Contact Button */
.floating-cta {
    position: fixed;
    bottom: 30px;
    right: 90px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.cta-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 25px rgba(232, 83, 58, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-btn:hover {
    transform: scale(1.1) rotate(15deg);
    filter: brightness(1.1);
}

/* Glassmorphism for Blog */
.blog-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

[data-theme="light"] .blog-card {
    background: rgba(0, 0, 0, 0.05);
}

/* =============================================
   AI Chatbot
   ============================================= */
.chatbot-container {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem; /* Restoring to original right position */
    z-index: 1000;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle.active {
    transform: rotate(90deg) scale(0);
}

.chatbot-panel {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    background: rgba(17, 20, 24, 0.85); /* Dark Glassmorphism */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: bottom right;
}

[data-theme="light"] .chatbot-panel {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chatbot-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

.chatbot-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.chatbot-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.bot-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.chatbot-header h4 {
    font-size: 1rem;
    margin: 0;
}
.status-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.close-chat {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-left: auto;
    cursor: pointer;
}

.chatbot-messages {
    height: 350px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.message {
    max-width: 85%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    position: relative;
    animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.user-message {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.msg-time {
    display: block;
    font-size: 0.65rem;
    margin-top: 0.4rem;
    opacity: 0.7;
    text-align: right;
}

.error-msg {
    border-color: #ef4444;
    color: #ef4444;
}

.chatbot-input-area {
    display: flex;
    padding: 1rem;
    gap: 0.5rem;
    border-top: 1px solid var(--border);
}

.chatbot-input-area input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.8rem 1rem;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    transition: var(--transition);
}

.chatbot-input-area input:focus {
    border-color: var(--accent);
}

.chatbot-input-area button {
    width: 45px;
    height: 45px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}
.chatbot-input-area button:hover {
    transform: scale(1.05);
}

.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* =============================================
   Music Player V2
   ============================================= */
.music-player-v2 {
    position: fixed;
    bottom: 2.5rem;
    left: 2.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: var(--bg-nav);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.music-player-v2:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.music-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.music-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.music-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 15px;
    width: 40px;
}

.music-visualizer .bar {
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
    height: 3px;
    transition: height 0.2s;
}

.music-visualizer.playing .bar {
    animation: visualize 0.8s ease-in-out infinite alternate;
}
.music-visualizer.playing .bar:nth-child(2) { animation-delay: 0.1s; }
.music-visualizer.playing .bar:nth-child(3) { animation-delay: 0.2s; }
.music-visualizer.playing .bar:nth-child(4) { animation-delay: 0.3s; }
.music-visualizer.playing .bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes visualize {
    0% { height: 3px; }
    100% { height: 15px; }
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.volume-slider {
    width: 0;
    opacity: 0;
    transition: var(--transition);
    appearance: none;
    background: var(--border);
    height: 4px;
    border-radius: 2px;
}
.music-player-v2:hover .volume-slider {
    width: 60px;
    opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.m-btn-play, .m-btn-next {
    background: var(--accent-soft);
    color: var(--accent);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.m-btn-play:hover, .m-btn-next:hover {
    background: var(--accent);
    color: white;
}

/* =============================================
   Mobile Specific Adjustments
   ============================================= */
@media (max-width: 640px) {
    .chatbot-panel {
        position: fixed;
        bottom: 0; right: 0; left: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        z-index: 10000;
        padding-top: env(safe-area-inset-top);
    }
    .chatbot-header {
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
    .chatbot-messages {
        flex: 1;
        height: auto;
    }
    .music-player-v2 {
        bottom: max(1.5rem, env(safe-area-inset-bottom));
        left: 1.5rem;
        top: auto;
        transform: none;
        padding: 0.6rem 1rem;
    }
    .music-player-v2:hover {
        transform: translateY(-2px);
    }
    .chatbot-toggle {
        width: 52px;
        height: 52px;
        font-size: 1.2rem;
    }
    .floating-cta {

        bottom: calc(env(safe-area-inset-bottom) + 1.5rem);
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        right: auto;
        gap: 1rem;
    }
    .chatbot-input-area input {
        font-size: 16px; /* Prevent iPhone zoom */
    }
    html, body {
        /* Fix mobile vh for Safari */
        min-height: -webkit-fill-available;
    }
    .hero {
        min-height: -webkit-fill-available;
    }
    .hero.hero-grid {
        grid-template-columns: 1fr;
        padding-top: 100px;
        gap: 3.5rem; /* Increased mobile gap */
        text-align: center;
    }
    .hero-cta {
        flex-direction: column !important; /* Stack vertically on mobile */
        gap: 2rem !important;
        align-items: center;
    }
    .premium-bento-grid {
        grid-template-columns: 1fr;
        gap: 3rem; /* More mobile vertical breathing room */
    }
    .bento-stat-card {
        padding: 4rem 2.5rem; /* Generous mobile card padding */
        justify-content: center;
    }
}

/* =============================================
   V3 Redesign Additions - Premium Index
   ============================================= */

/* Animated Mesh Background */
.mesh-bg {
    position: absolute;
    top: 0; left: 0; right: 0; height: 100vh;
    background: radial-gradient(circle at 15% 50%, rgba(232, 83, 58, 0.08), transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.08), transparent 50%);
    z-index: -1;
    pointer-events: none;
    animation: pulseMesh 15s ease-in-out infinite alternate;
}
@keyframes pulseMesh {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

/* Hero Grid Layout */
.hero.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 4rem;
    padding-top: 140px;
    position: relative;
    min-height: 100vh;
}

.hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #ff9a9e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Typewriter cursor */
.typewriter-text {
    color: var(--text);
    font-weight: 700;
    position: relative;
}
.typewriter-text::after {
    content: '|';
    position: absolute;
    right: -8px;
    color: var(--accent);
    animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Hero Visual Fixes */
.hero-visual-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}
.hero-visual-wrapper .orbit-container {
    position: relative;
    transform: scale(1.1);
}
.section {
    padding: 15vh 10% !important; /* Standardized premium spacing */
    position: relative;
    max-width: 1750px; 
    margin: 0 auto;
    width: 100%;
}

.premium-bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5.5rem; /* Ultra-airy luxury gap */
    width: 100%;
    margin: 6rem auto 0; /* Dramatic separation from hero */
}

.bento-stat-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 3rem; /* Balanced luxury padding */
    display: flex;
    align-items: center;
    gap: 2.5rem;
    transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .bento-stat-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.bento-stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-soft), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 0;
}

.bento-stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 20px 40px -10px rgba(232, 83, 58, 0.15);
}

.bento-stat-card:hover::before {
    opacity: 1;
}

.bento-stat-card > * {
    position: relative;
    z-index: 1;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    transition: transform 0.5s;
}

.bento-stat-card:hover .stat-icon {
    transform: rotate(10deg) scale(1.1);
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.2rem;
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pt-0 { padding-top: 0 !important; }

/* Responsive V3 */
@media (max-width: 960px) {
    .hero.hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
        padding-top: 120px;
    }
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .hero-visual-wrapper .orbit-container {
        transform: scale(0.9);
    }
    .premium-bento-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Projects Page & Case Study Styles
   ============================================= */

/* Projects Page Hero */
.projects-hero { padding-top: 160px; padding-bottom: 2rem; }
.projects-hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; line-height: 1; margin-bottom: 1rem; }
.projects-hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; line-height: 1.7; }

/* Filter Bar */
.project-filter-bar { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 3rem; }
.filter-btn { padding: 0.5rem 1.25rem; border-radius: 99px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted); font-size: 0.875rem; font-weight: 600; font-family: var(--font-heading); cursor: pointer; transition: all 0.3s; }
.filter-btn:hover, .filter-btn.active { background: var(--accent); border-color: var(--accent); color: white; box-shadow: 0 4px 15px rgba(232,83,58,.3); }

/* Projects Grid */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }

/* Project Cards */
.project-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: all 0.4s cubic-bezier(0.2,1,0.3,1); position: relative; overflow: hidden; }
.project-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--accent-soft), transparent 50%); opacity: 0; transition: opacity 0.4s; pointer-events: none; }
.project-card:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: 0 24px 48px -12px rgba(232,83,58,.15); }
.project-card:hover::before { opacity: 1; }
.project-card.featured { grid-column: span 2; }
.project-card-inner { padding: 2rem; display: flex; flex-direction: column; height: 100%; position: relative; z-index: 1; }
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; }
.project-icon-wrap { width: 52px; height: 52px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.icon-link { color: var(--text-muted); font-size: 1.1rem; transition: color 0.2s; padding: 0.25rem; }
.icon-link:hover { color: var(--accent); }
.project-badge { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.75rem; border-radius: 99px; margin-bottom: 0.75rem; width: fit-content; }
.featured-badge { background: rgba(232,83,58,.1); color: var(--accent); border: 1px solid rgba(232,83,58,.3); }
.wip-badge { background: rgba(245,158,11,.1); color: #f59e0b; border: 1px solid rgba(245,158,11,.3); }
.project-card h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 0.75rem; font-family: var(--font-heading); line-height: 1.2; }
.project-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; flex: 1; margin-bottom: 1.5rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.project-card-footer { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: auto; }

/* Status Card */
.status-card { background: linear-gradient(135deg, rgba(232,83,58,.06), rgba(59,130,246,.06)); border-color: var(--accent); border-style: dashed; }
.status-inner { justify-content: center; align-items: center; text-align: center; min-height: 200px; }
.status-pulse-dot { width: 14px; height: 14px; background: #22c55e; border-radius: 50%; margin: 0 auto 1rem; animation: pulseDot 2s infinite; }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); } 50% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } }

/* =============================================
   Case Study Sub-page Styles
   ============================================= */
.case-study-hero { padding-top: 160px; padding-bottom: 3rem; }
.cs-hero-inner { max-width: 720px; }
.cs-back { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-muted); font-size: 0.9rem; font-weight: 600; margin-bottom: 2rem; transition: color 0.2s; }
.cs-back:hover { color: var(--accent); }
.cs-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(232,83,58,.1); color: var(--accent); border: 1px solid rgba(232,83,58,.3); padding: 0.4rem 1rem; border-radius: 99px; font-size: 0.8rem; font-weight: 700; margin-bottom: 1.5rem; }
.case-study-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.cs-subtitle { font-size: 1.1rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 1.5rem; }
.cs-meta { display: flex; gap: 2rem; flex-wrap: wrap; }
.cs-meta span { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); }
.cs-meta i { color: var(--accent); }

/* KPI Grid */
.cs-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 4rem; }
.cs-kpi-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center; transition: all 0.3s; }
.cs-kpi-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.cs-kpi-num { display: block; font-size: 2rem; font-weight: 800; font-family: var(--font-heading); margin-bottom: 0.5rem; }
.cs-kpi-label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

/* Two Col */
.cs-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 4rem; }
.cs-panel { padding: 2.5rem 2rem; border-radius: var(--radius-lg); }
.cs-panel-icon { width: 50px; height: 50px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1.25rem; }
.cs-panel h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.75rem; }
.cs-panel p { color: var(--text-muted); line-height: 1.7; }

/* Section Blocks */
.cs-section-block { margin-bottom: 4rem; }
.cs-section-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; font-family: var(--font-heading); }

/* Code Block */
.cs-code-block { padding: 0; overflow: hidden; border-radius: var(--radius-lg); }
.cs-code-header { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1.5rem; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.cs-code-dots { display: flex; gap: 6px; }
.cs-code-dots span { width: 12px; height: 12px; border-radius: 50%; }
.cs-code-dots span:nth-child(1) { background: #ff5f56; }
.cs-code-dots span:nth-child(2) { background: #ffbd2e; }
.cs-code-dots span:nth-child(3) { background: #27c93f; }
.cs-code-filename { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }
.cs-code-block pre { margin: 0; padding: 1.75rem; font-size: 0.875rem; line-height: 1.7; color: var(--accent); overflow-x: auto; }

/* Tech Stack */
.cs-tech-grid { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.cs-tech-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; font-size: 0.85rem; font-weight: 700; transition: all 0.3s; }
.cs-tech-item:hover { border-color: var(--accent); transform: translateY(-3px); }
.cs-tech-item img { width: 40px; height: 40px; }

/* Features Grid */
.cs-features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.cs-feature-item { padding: 2rem; border-radius: var(--radius-lg); }
.cs-feature-item i { font-size: 1.5rem; display: block; margin-bottom: 1rem; }
.cs-feature-item h4 { font-weight: 700; margin-bottom: 0.5rem; }
.cs-feature-item p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* Responsive */
@media (max-width: 960px) {
    .projects-grid { grid-template-columns: 1fr; }
    .project-card.featured { grid-column: span 1; }
    .cs-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .cs-two-col { grid-template-columns: 1fr; }
    .cs-features-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .project-card-footer { flex-direction: column; }
    .filter-btn { font-size: 0.8rem; padding: 0.4rem 0.9rem; }
}

/* =============================================
   About Page – New Redesign
   ============================================= */

.about-hero-section { padding-top: 160px; }
.about-hero-grid { display: grid; grid-template-columns: 1fr 420px; gap: 4rem; align-items: center; }
.about-hero-text h1 { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; line-height: 1.1; margin: 0.75rem 0 1.25rem; }
.about-hero-sub { font-size: 1.1rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 1.5rem; }
.about-hero-chips { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }
.about-chip { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 600; padding: 0.4rem 1rem; border-radius: 99px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); }

/* Photo Card */
.about-hero-photo { display: flex; align-items: center; justify-content: center; }
.photo-card-wrap { position: relative; width: 320px; }
.about-img { width: 100%; border-radius: 24px; border: 2px solid var(--border); display: block; position: relative; z-index: 1; }
.photo-accent-ring { position: absolute; inset: -12px; border-radius: 32px; border: 2px dashed var(--accent); opacity: 0.3; z-index: 0; animation: spin 20s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.photo-badge-card { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: 99px; font-size: 0.875rem; font-weight: 700; white-space: nowrap; z-index: 2; }
.photo-badge-card i { font-size: 1.1rem; }

/* About Stats Bento - Cleaned up redundant small-gap overrides */

@media (max-width: 960px) {
    .about-hero-grid { grid-template-columns: 1fr; text-align: center; }
    .about-hero-chips { justify-content: center; }
    .about-hero-text .btn { margin-left: 0 !important; margin-top: 0.5rem; }
    .about-hero-text [style*="margin-left"] { margin-left: 0 !important; }
    .about-hero-photo { margin-top: 2rem; }
    .photo-card-wrap { width: 260px; }
    .premium-bento-grid { grid-template-columns: 1fr; }
}

/* =============================================
   Blog Page – New Redesign
   ============================================= */

.blog-page-hero { padding-top: 160px; padding-bottom: 2rem; }
.blog-page-hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; line-height: 1; margin: 0.75rem 0 1rem; }
.blog-hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; line-height: 1.7; }

.blog-list { display: flex; flex-direction: column; gap: 2rem; max-width: 800px; }

.blog-card-v3 { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem 2.5rem; transition: all 0.3s; position: relative; overflow: hidden; }
.blog-card-v3::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: 0; transition: opacity 0.3s; }
.blog-card-v3:hover { border-color: var(--accent); transform: translateX(6px); }
.blog-card-v3:hover::before { opacity: 1; }
.blog-card-v3.featured-post { border-color: rgba(232,83,58,.3); background: linear-gradient(135deg, rgba(232,83,58,.04), var(--bg-card)); }
.blog-card-v3.featured-post::before { opacity: 1; }

.blog-card-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.blog-tag-pill { font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.75rem; border-radius: 99px; }
.blog-tag-pill.laravel { background: rgba(255,45,32,.1); color: #ff2d20; }
.blog-tag-pill.api { background: rgba(59,130,246,.1); color: #3b82f6; }
.blog-tag-pill { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.blog-read-time { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }

.blog-card-v3 h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.75rem; }
.blog-card-v3 h2 a { color: var(--text); transition: color 0.2s; }
.blog-card-v3 h2 a:hover { color: var(--accent); }
.blog-card-v3 p { color: var(--text-muted); line-height: 1.7; font-size: 0.95rem; }
.blog-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; }
.blog-date { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }
.blog-read-link { color: var(--accent); font-size: 0.875rem; font-weight: 700; display: flex; align-items: center; gap: 0.4rem; transition: gap 0.2s; }
.blog-read-link:hover { gap: 0.7rem; }

/* =============================================
   Blog Detail Page
   ============================================= */

.blog-detail-hero { padding-top: 160px; padding-bottom: 3rem; }
.blog-detail-inner { max-width: 720px; }
.blog-detail-tags { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.blog-detail-hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; line-height: 1.15; margin-bottom: 1.5rem; }
.blog-detail-meta { display: flex; gap: 2rem; flex-wrap: wrap; }
.blog-detail-meta span { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); }
.blog-detail-meta i { color: var(--accent); }

.blog-article-wrap { max-width: 800px; margin: 0 auto; }
.blog-article { padding: 2.5rem 3rem; border-radius: var(--radius-lg); }
.blog-article p { font-size: 1.05rem; line-height: 1.85; margin-bottom: 1.5rem; color: var(--text); }
.blog-article h3 { font-size: 1.25rem; font-weight: 800; margin: 2.5rem 0 1rem; color: var(--text); }
.blog-article code { background: var(--bg); color: var(--accent); padding: 0.2em 0.45em; border-radius: 4px; font-family: monospace; font-size: 0.9em; }
.blog-article strong { color: var(--text); }
.blog-code-block { margin: 1.5rem 0 2rem; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.blog-code-block .cs-code-header { background: var(--bg-card); padding: 0.75rem 1.5rem; }
.blog-code-block pre { margin: 0; padding: 1.5rem; font-size: 0.875rem; line-height: 1.7; background: var(--bg); color: var(--accent); overflow-x: auto; }
.blog-code-block code { background: none; color: inherit; padding: 0; }

@media (max-width: 640px) {
    .blog-article { padding: 1.5rem; }
}

/* =============================================
   Contact Page – New Redesign
   ============================================= */

.contact-hero { padding-top: 160px; padding-bottom: 2rem; }
.contact-hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; line-height: 1; margin: 0.75rem 0 1rem; }
.contact-hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; line-height: 1.7; }

.contact-layout { display: grid; grid-template-columns: 380px 1fr; gap: 2.5rem; align-items: start; }

.contact-sidebar { display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 100px; }
.contact-info-block { padding: 2rem; border-radius: var(--radius-lg); }
.contact-info-block h3 { font-size: 1.25rem; font-weight: 800; }

.contact-info-list { display: flex; flex-direction: column; gap: 1rem; }
.contact-info-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; border-radius: var(--radius); transition: background 0.2s; color: var(--text); }
.contact-info-item:hover { background: var(--bg-hover); }
.contact-info-icon { width: 40px; height: 40px; background: var(--accent-soft); color: var(--accent); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }
.contact-info-label { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.contact-info-value { display: block; font-size: 0.875rem; font-weight: 500; margin-top: 0.15rem; }

/* Availability Badge */
.avail-card { padding: 1rem 1.5rem; border-radius: var(--radius-lg); display: flex; align-items: center; gap: 1rem; border-left: 3px solid #22c55e !important; }
.avail-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; flex-shrink: 0; animation: pulseDot 2s infinite; }

/* Form Card */
.contact-form-card { padding: 2.5rem; border-radius: var(--radius-lg); }
.contact-form-card h3 { font-size: 1.25rem; font-weight: 800; }
.contact-form-card label { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.5rem; }

@media (max-width: 960px) {
    .contact-layout { grid-template-columns: 1fr; }
    .contact-sidebar { position: static; }
}


/* =====================================================
   MOBILE & CROSS-BROWSER COMPATIBILITY LAYER
   Covers: iOS Safari, Chrome Mobile, Firefox, Edge
   ===================================================== */

/* ── Base fixes ─────────────────────────────────── */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent overscroll bounce affecting layout */
    overscroll-behavior-y: none;
}

/* Prevent 300ms tap delay on all touch devices */
a, button, input, textarea, select, [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS input zoom (must be >= 16px) */
input, textarea, select {
    font-size: 16px !important;
}

/* Fix iOS Safari: form elements look native — reset */
input, textarea, select, button {
    -webkit-appearance: none;
    appearance: none;
}
button { cursor: pointer; }

/* ── Viewport / Safe Area (notch, home indicator) ─── */
.navbar {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

footer {
    padding-bottom: max(env(safe-area-inset-bottom), 1.5rem);
}

/* Chatbot & back-to-top: respect safe area */
.chatbot-container {
    bottom: max(env(safe-area-inset-bottom, 0px) + 0.5rem, 2rem);
    right: max(env(safe-area-inset-right, 0px) + 0.5rem, 2rem);
}
.back-to-top {
    right: max(env(safe-area-inset-right, 0px) + 0.5rem, 2rem);
}

/* ── Safari backdrop-filter fixes ──────────────── */
.navbar,
.chatbot-panel,
.g-overlay,
.glass-panel,
.cs-panel {
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    backdrop-filter: blur(16px) saturate(1.8);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
    .navbar { background: var(--bg-nav) !important; }
    .chatbot-panel { background: rgba(10,12,16,0.97) !important; }
}

/* ── 100vh / svh fix for iOS Safari ────────────── */
/* iOS Safari's 100vh includes the browser chrome which causes overflow */
.hero, .loader {
    min-height: 100dvh; /* dvh = dynamic viewport height (best) */
    min-height: -webkit-fill-available; /* Safari fallback */
}

/* ── Navbar mobile dropdown ─────────────────────── */
@media (max-width: 768px) {
    .nav-links {
        -webkit-overflow-scrolling: touch;
    }
    /* Prevent layout shift when mobile menu opens */
    .navbar-inner { flex-wrap: nowrap; }
}

/* ── Bento / Grid gap Safari fix ───────────────── */
/* Old Safari (<= 14) doesn't support gap in flex */
.bento-grid, .services-grid, .tech-grid, .skill-tree,
.about-stats, .cs-two-col, .cs-features-grid,
.gh-lang-grid, .premium-bento-grid, .contact-layout,
.about-hero-grid, .blog-list, .project-cards-grid {
    /* gap is supported via grid, but add row-gap fallback */
    grid-gap: inherit; /* use grid-gap as fallback */
}

/* ── Scroll snap on mobile carousels ────────────── */
.project-cards-grid {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

/* ── Mobile-specific layout fixes ────────────────── */
@media (max-width: 640px) {
    /* About hero – stack vertically, center everything */
    .about-hero-section { padding-top: 120px; }
    .about-hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }
    .about-hero-chips { justify-content: center; }
    .about-hero-text [style*="margin-left"] { margin-left: 0 !important; }
    .photo-card-wrap { width: 220px; margin: 0 auto; }

    /* Stats */
    .premium-bento-grid { grid-template-columns: 1fr; gap: 1.25rem; padding: 0 0.5rem; }
    .bento-stat-card { padding: 2rem 1.5rem; }

    /* Services — 2 col on small screens */
    .services-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }

    /* GitHub langs — 2 col */
    .gh-lang-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .gh-stacked-bar { height: 10px; }

    /* Timeline */
    .timeline { padding-left: 1.25rem; }
    .cs-two-col { grid-template-columns: 1fr; }
    .cs-panel { padding: 1.5rem; }

    /* Contact page */
    .contact-hero h1 { font-size: 2.5rem; }
    .contact-form-card { padding: 1.5rem; }
    .contact-info-block { padding: 1.5rem; }

    /* Blog cards */
    .blog-card-v3 { padding: 1.5rem; }
    .blog-card-footer { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

    /* Blog detail */
    .blog-detail-meta { gap: 1rem; }

    /* Case study pages */
    .cs-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem; }
    .cs-features-grid { grid-template-columns: 1fr !important; }
    .project-tech-stack { gap: 0.5rem; }

    /* Projects page filter */
    .filter-bar { gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
    .filter-btn { font-size: 0.75rem; padding: 0.35rem 0.8rem; }
    .project-cards-grid { grid-template-columns: 1fr; }

    /* Chatbot panel wider */
    .chatbot-panel { width: calc(100vw - 3rem); right: 0; left: 0; margin: auto; }
}

@media (max-width: 380px) {
    /* Very small phones (320px) */
    .about-hero-text h1 { font-size: 2rem; }
    .services-grid-4 { grid-template-columns: 1fr !important; }
    .gh-lang-grid { grid-template-columns: 1fr; }
    .cs-kpi-grid { grid-template-columns: 1fr !important; }
    .blog-page-hero h1 { font-size: 2rem; }
    .contact-hero h1 { font-size: 2rem; }
}

/* ── Tablet-specific layout ───────────────────────── */
@media (min-width: 641px) and (max-width: 960px) {
    .about-hero-grid { grid-template-columns: 1fr; text-align: center; }
    .about-hero-chips { justify-content: center; }
    .photo-card-wrap { width: 260px; margin: 0 auto; }
    .premium-bento-grid { grid-template-columns: repeat(3, 1fr); }
    .services-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
    .gh-lang-grid { grid-template-columns: repeat(3, 1fr); }
    .project-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Touch device: disable hover 3D effects ─────── */
@media (hover: none) and (pointer: coarse) {
    .photo-accent-ring { animation: none; }
    .bento-stat-card:hover { transform: none; }
    .gh-lang-card:hover { transform: none; }
    .blog-card-v3:hover { transform: none; }
    .contact-info-item:hover { background: none; }
    .project-card:hover { transform: none; }
}

/* ── Scrollbar (webkit) ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Selection color ────────────────────────────── */
::selection { background: var(--accent); color: #fff; }
::-moz-selection { background: var(--accent); color: #fff; }

/* ── Image rendering ─────────────────────────────── */
img { max-width: 100%; height: auto; display: block; }

/* ── Focus visible for keyboard nav ─────────────── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}
/* Hide ugly default outline on click */
:focus:not(:focus-visible) { outline: none; }

/* ── Chatbot responsive ─────────────────────────── */
@media (max-width: 480px) {
    .chatbot-container {
        bottom: max(env(safe-area-inset-bottom, 0px) + 0.5rem, 1.25rem);
        left: max(env(safe-area-inset-left, 0px) + 0.5rem, 1.25rem);
        right: auto;
    }
    .chatbot-panel {
        bottom: 72px;
        width: calc(100vw - 2.5rem);
        right: 0;
        left: 1.25rem;
        max-height: 60vh;
    }
    .chatbot-messages { max-height: calc(60vh - 140px); }
    .back-to-top {
        bottom: max(env(safe-area-inset-bottom, 0px) + calc(1.25rem + 60px + 0.6rem), calc(2rem + 60px + 0.75rem));
        right: max(env(safe-area-inset-right, 0px) + 0.5rem, 1.25rem);
    }
}






