/* ============================================================
   MOBILE.CSS — True Mobile-First Responsive Design System
   Siddharth Remidala Portfolio
   Breakpoints: 320px, 360px, 375px, 390px, 414px, 430px, 480px, 768px
   ============================================================ */

/* ── GLOBAL MOBILE RESETS ─────────────────────────────────── */
html {
  scroll-padding-top: 64px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}

/* ── PREFERS-REDUCED-MOTION ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .animate-fade-up {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .skill-fill, .skill-full-fill, .resume-bar-fill {
    transition: none !important;
  }
}

/* ============================================================
   NAVBAR — MOBILE-FIRST STICKY GLASS NAVBAR
   ============================================================ */
@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
    height: 58px;
    background: var(--nav-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .nav-links, .nav-cta {
    display: none !important;
  }

  .hamburger {
    display: flex !important;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    padding: 10px;
  }

  /* Mobile nav drawer — smooth slide-in */
  .nav-mobile {
    top: 58px;
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease,
                visibility 0.3s ease;
  }

  .nav-mobile.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
    visibility: visible;
  }

  .nav-mobile a {
    padding: 13px 16px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    min-height: 50px;
    display: flex;
    align-items: center;
  }

  .nav-mobile-footer {
    margin-top: 12px;
    padding-top: 12px;
  }

  body.nav-open {
    overflow: hidden;
  }

  /* Overlay backdrop */
  .nav-mobile-overlay {
    position: fixed;
    inset: 0;
    top: 58px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .nav-mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
  }
}

@media (max-width: 390px) {
  .navbar { padding: 0 14px; height: 54px; }
  html { scroll-padding-top: 54px; }
  .nav-mobile { top: 54px; }
  .nav-mobile-overlay { top: 54px; }
  .logo-mark { width: 32px; height: 32px; font-size: 0.75rem; }
  .nav-logo span { font-size: 0.88rem; }
}

@media (max-width: 360px) {
  .navbar { padding: 0 12px; }
  .nav-logo span { font-size: 0.82rem; font-weight: 700; }
  .logo-mark { width: 30px; height: 30px; font-size: 0.72rem; }
}

/* ============================================================
   HERO SECTION — COMPACT MOBILE HERO (no 100vh)
   ============================================================ */
@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: 85px 16px 40px;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    background: #050b14;
    position: relative;
    overflow: hidden;
  }

  /* Hide background portrait layer to prevent any facial overlap or dimming */
  .hero-portrait-layer {
    display: none !important;
  }

  /* ────────────────────────────────────────────────────────────
     HERO FEATURED MOBILE PORTRAIT CARD
     Ensures 100% facial sharpness, clarity & zero text overlap
     ──────────────────────────────────────────────────────────── */
  .hero-mobile-portrait-card {
    display: block;
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 18px 0 22px 0;
    align-self: flex-start;
  }

  .hero-mobile-portrait-glow {
    position: absolute;
    inset: -8px;
    background: radial-gradient(circle at 50% 30%, rgba(14, 165, 233, 0.35) 0%, rgba(30, 64, 175, 0.16) 55%, transparent 75%);
    filter: blur(24px);
    z-index: 0;
    pointer-events: none;
    border-radius: 28px;
  }

  .hero-mobile-portrait-frame {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 380px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: #08101e;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.85), 0 0 25px rgba(14, 165, 233, 0.15);
  }

  .hero-mobile-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 12%; /* Perfectly centers head, face, eyes, smile and blazer */
    display: block;
    filter: contrast(1.05) brightness(1.02);
  }

  .hero-mobile-portrait-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, transparent 68%, rgba(5, 11, 20, 0.72) 100%);
    pointer-events: none;
  }

  .hero-mobile-portrait-badge {
    position: absolute;
    bottom: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: rgba(5, 11, 20, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.32);
    border-radius: 50px;
    font-size: 11.5px;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  }

  .hero-live-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulseStatus 2s infinite ease-in-out;
  }

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

  .hero-main-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    margin-bottom: 20px;
  }

  .hero-bottom-strip {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }

  .hero-together-badge {
    width: 100%;
    justify-content: center;
  }

  .hero-content {
    max-width: 100%;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .hero-tag-line {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    margin-bottom: 8px;
    gap: 10px;
  }

  .hero-tag-dash { width: 28px; }

  .hero-name-main {
    font-size: clamp(2.3rem, 9.2vw, 3.1rem);
    margin-bottom: 10px;
    line-height: 1.08;
    letter-spacing: -0.025em;
  }

  .hero-sub-roles {
    font-size: 0.88rem;
    gap: 8px;
    margin-bottom: 0px;
    flex-wrap: wrap;
  }

  .hero-desc-clean {
    font-size: 0.94rem;
    line-height: 1.65;
    max-width: 100%;
    margin-top: 4px;
    margin-bottom: 22px;
  }

  .hero-actions-row {
    gap: 12px;
    margin-bottom: 24px;
    flex-direction: column;
    width: 100%;
  }

  .btn-explore, .btn-cv-glass {
    width: 100%;
    justify-content: center;
    font-size: 0.92rem;
    padding: 14px 20px;
    min-height: 50px;
  }

  .hero-capsule-strip {
    width: 100%;
    padding: 12px 14px;
    gap: 8px 16px;
    border-radius: 16px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .capsule-sep { display: none; }
  .capsule-val { font-size: 0.92rem; }
  .capsule-lbl { font-size: 0.7rem; }

  .hero-skills-glass-card {
    width: 100%;
    padding: 18px 16px;
    border-radius: 18px;
    animation: fadeUp 0.7s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .skills-card-header { margin-bottom: 16px; }
  .skills-card-header h3 { font-size: 1rem; }
  .skills-bars-group { gap: 12px; }
  .skill-row { gap: 5px; }
  .skill-title { font-size: 0.8rem; }
  .skill-pct { font-size: 0.78rem; }
  .skill-track { height: 6px; }
}

@media (max-width: 480px) {
  .hero { padding: 76px 14px 40px; }
  .hero-name-main { font-size: clamp(2rem, 10vw, 2.8rem); }
  .hero-mobile-portrait-frame { height: 350px; border-radius: 20px; }
}

@media (max-width: 390px) {
  .hero { padding: 70px 14px 36px; gap: 22px; }
  .hero-name-main { font-size: clamp(1.85rem, 10.5vw, 2.5rem); }
  .hero-sub-roles { font-size: 0.84rem; }
  .hero-desc-clean { font-size: 0.88rem; }
  .hero-mobile-portrait-frame { height: 330px; }
}

@media (max-width: 360px) {
  .hero { padding: 68px 12px 32px; }
  .hero-name-main { font-size: 1.8rem; }
  .hero-mobile-portrait-frame { height: 300px; border-radius: 18px; }
}

@media (max-width: 320px) {
  .hero { padding: 64px 12px 28px; }
  .hero-name-main { font-size: 1.65rem; }
  .hero-tag-line { font-size: 0.66rem; }
  .hero-skills-glass-card { padding: 14px 12px; }
}

/* ============================================================
   ABOUT SECTION — LUXURY REDESIGN MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .about {
    padding: 48px 16px;
  }

  .about-lux-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .about-lux-card-bio {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .about-bio-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about-bio-visual-col {
    align-items: center;
    width: 100%;
  }

  .about-photo-neon-wrap {
    width: 100%;
    max-width: 260px;
    height: 320px;
    margin: 0 auto;
  }

  .about-lux-signature {
    margin-top: 18px;
    text-align: center;
  }

  .about-lux-title {
    font-size: 1.75rem;
  }

  .about-lux-text {
    font-size: 0.85rem;
    line-height: 1.65;
  }

  .about-lux-panel-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .lux-row-item {
    padding: 10px 12px;
    gap: 10px;
  }

  .lux-row-name {
    font-size: 0.84rem;
    white-space: normal;
  }

  .lux-row-desc {
    font-size: 0.72rem;
  }

  .lux-meta-date {
    font-size: 0.68rem;
  }
}

@media (max-width: 480px) {
  .about {
    padding: 40px 12px;
  }

  .about-photo-neon-wrap {
    max-width: 220px;
    height: 280px;
  }

  .sig-name {
    font-size: 2rem;
  }

  .sig-stroke {
    width: 140px;
  }

  .about-lux-title {
    font-size: 1.55rem;
  }

  .pill-glow-circle {
    width: 38px;
    height: 38px;
  }

  .lux-badge-icon {
    width: 38px;
    height: 38px;
  }
}

/* ============================================================
   SERVICES SECTION — 2-COLUMN COMPACT MOBILE GRID
   ============================================================ */
@media (max-width: 768px) {
  .services {
    padding: 48px 16px;
  }

  .services-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    padding: 0;
    margin-bottom: 24px;
    grid-template-columns: unset;
  }

  .services-header-left {
    width: 100%;
  }

  .services-header .view-all-btn {
    align-self: flex-start;
    margin-top: 4px;
  }

  .services-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .services-header-right,
  .services-bottom-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
    margin-top: 0;
  }

  .service-card {
    padding: 16px 14px;
    border-radius: 14px;
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
  }

  .service-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .service-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .service-arrow {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .service-arrow svg {
    width: 10px;
    height: 10px;
  }

  .service-card h3 {
    font-size: 0.88rem;
    line-height: 1.25;
    margin-bottom: 6px;
  }

  .service-card p {
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--text-secondary);
  }
}

@media (max-width: 480px) {
  .services {
    padding: 40px 14px;
  }

  .services-grid {
    gap: 10px !important;
  }

  .services-header-right,
  .services-bottom-row {
    gap: 10px !important;
  }

  .service-card {
    padding: 14px 11px;
    border-radius: 12px;
  }

  .service-icon {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
    border-radius: 8px;
  }

  .service-arrow {
    width: 22px;
    height: 22px;
  }

  .service-card h3 {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  .service-card p {
    font-size: 0.7rem;
    line-height: 1.4;
  }
}

@media (max-width: 340px) {
  .services-grid {
    grid-template-columns: 1fr !important;
  }
  .services-header-right,
  .services-bottom-row {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   PROJECTS — 2-COLUMN COMPACT GRID
   ============================================================ */
@media (max-width: 768px) {
  .projects { padding: 48px 16px; }

  .projects-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
    grid-template-columns: unset;
  }

  .projects-header .view-all-btn { align-self: flex-start; }

  .projects-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .project-thumb { height: 130px; }
  .project-info { padding: 12px; }
  .project-info h3 { font-size: 0.82rem; margin-bottom: 2px; }
  .project-sub { font-size: 0.7rem; margin-bottom: 8px; }
  .project-tag { font-size: 0.65rem; padding: 2px 8px; }
}

@media (max-width: 480px) {
  .projects { padding: 40px 14px; }
  .projects-grid { gap: 12px; }
  .project-thumb { height: 110px; }
}

@media (max-width: 390px) {
  .projects { padding: 36px 12px; }
}

@media (max-width: 360px) {
  .projects-grid { grid-template-columns: 1fr; gap: 12px; }
  .project-thumb { height: 160px; }
}

/* ============================================================
   CTA BAND — COMPACT
   ============================================================ */
@media (max-width: 768px) {
  .cta-band {
    flex-direction: column;
    text-align: center;
    padding: 40px 16px;
    gap: 20px;
  }
  .cta-band-text h2 { font-size: clamp(1.3rem, 5.5vw, 1.8rem); margin-bottom: 6px; }
  .cta-band-text p { font-size: 0.88rem; }
  .cta-band .btn-primary { min-width: 180px; justify-content: center; }
}

/* ============================================================
   FOOTER — COMPACT CENTERED
   ============================================================ */
@media (max-width: 768px) {
  .footer {
    display: flex;
    flex-direction: column;
    padding: 36px 16px 24px;
    gap: 24px;
    text-align: center;
    grid-template-columns: unset;
  }
  .footer-left { display: flex; flex-direction: column; align-items: center; gap: 8px; }
  .footer-right { align-items: center; gap: 14px; }
  .footer-links { justify-content: center; gap: 16px; }
  .footer-links a { font-size: 0.82rem; }
  .footer-tagline { font-size: 0.8rem; }
  .footer-copy { font-size: 0.74rem; padding-top: 20px; }
  .social-btn { width: 44px; height: 44px; }
}

@media (max-width: 390px) {
  .footer { padding: 32px 14px 20px; gap: 20px; }
}

/* ============================================================
   PAGE HERO — INNER PAGES
   ============================================================ */
@media (max-width: 768px) {
  .page-hero { padding: 86px 16px 36px; text-align: center; }
  .page-hero h1 { font-size: clamp(1.8rem, 7.5vw, 2.6rem); margin: 6px 0 12px; }
  .page-hero p { font-size: 0.9rem; line-height: 1.7; }
}

@media (max-width: 390px) {
  .page-hero { padding: 78px 14px 32px; }
  .page-hero h1 { font-size: clamp(1.6rem, 8vw, 2.2rem); }
}

/* ============================================================
   ABOUT FULL PAGE
   ============================================================ */
@media (max-width: 768px) {
  .about-full { padding: 36px 16px 48px; }

  .about-full-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
    grid-template-columns: unset;
  }

  .about-sidebar-photo { max-width: 200px; margin: 0 auto 20px; }
  .about-sidebar-photo img { aspect-ratio: 3/4; }
  .sidebar-contact-card { padding: 18px 16px; }
  .sidebar-contact-card h4 { font-size: 0.9rem; margin-bottom: 12px; }
  .sidebar-contact-item { font-size: 0.82rem; padding: 9px 0; gap: 9px; }

  .about-story { padding: 22px 18px; margin-bottom: 20px; }
  .about-story h2 { font-size: 1.35rem; margin-bottom: 12px; }
  .about-story p { font-size: 0.9rem; line-height: 1.8; margin-bottom: 12px; }

  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
  .stat-card { padding: 18px 12px; border-top-width: 2px; }
  .stat-number { font-size: 1.7rem; }
  .stat-label { font-size: 0.75rem; }

  .skills-full { padding: 22px 18px; }
  .skills-full h3 { font-size: 1.05rem; margin-bottom: 20px; }
  .skills-full-grid { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 480px) {
  .stat-card { padding: 14px 10px; }
  .stat-number { font-size: 1.5rem; }
  .stat-label { font-size: 0.7rem; }
}

@media (max-width: 390px) {
  .about-full { padding: 32px 14px 40px; }
  .stats-row { gap: 8px; }
  .stat-card { padding: 12px 8px; }
  .stat-number { font-size: 1.35rem; }
}

/* ============================================================
   WORK PAGE
   ============================================================ */
@media (max-width: 768px) {
  .work-section { padding: 36px 16px 48px; }
  .work-filters { gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
  .filter-btn { padding: 8px 16px; font-size: 0.8rem; min-height: 40px; }
  .work-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .work-thumb { height: 150px; }
  .work-info { padding: 14px; }
  .work-info h3 { font-size: 0.9rem; }
  .work-info p { font-size: 0.78rem; }
}

@media (max-width: 480px) {
  .work-section { padding: 32px 14px 40px; }
  .work-grid { gap: 12px; }
  .work-thumb { height: 130px; }
}

@media (max-width: 390px) {
  .work-grid { grid-template-columns: 1fr; gap: 14px; }
  .work-thumb { height: 180px; }
}

/* ============================================================
   GALLERY PAGE
   ============================================================ */
@media (max-width: 768px) {
  .gallery-section {
    padding: 32px 16px 48px;
  }
  .gallery-filters {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 8px !important;
    padding-bottom: 8px !important;
    margin-bottom: 24px !important;
    justify-content: flex-start !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .gallery-filters::-webkit-scrollbar {
    display: none;
  }
  .gallery-filters .filter-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 9px 16px;
    font-size: 0.82rem;
  }
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }
  .gallery-item {
    border-radius: 16px !important;
  }
  .gallery-thumb-wrap {
    height: 200px;
  }
  .gallery-item-content {
    padding: 18px 18px 20px;
  }
  .gallery-item-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
  .gallery-item-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 14px;
    -webkit-line-clamp: 3;
  }
  .gallery-action-btn {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .gallery-section {
    padding: 24px 12px 40px;
  }
  .gallery-thumb-wrap {
    height: 185px;
  }
  .gallery-item-content {
    padding: 16px;
  }
  .gallery-badge {
    padding: 5px 11px;
    font-size: 0.68rem;
    top: 12px;
    left: 12px;
  }
  .gallery-zoom-badge {
    width: 32px;
    height: 32px;
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 360px) {
  .gallery-thumb-wrap {
    height: 165px;
  }
  .gallery-item-content {
    padding: 14px;
  }
  .gallery-item-title {
    font-size: 1.02rem;
  }
}

/* ============================================================
   RESUME PAGE
   ============================================================ */
@media (max-width: 768px) {
  .resume-section {
    display: flex;
    flex-direction: column;
    padding: 36px 16px 48px;
    gap: 32px;
    grid-template-columns: unset;
  }
  .resume-block { margin-bottom: 28px; }
  .resume-block-title { font-size: 1rem; margin-bottom: 16px; padding-bottom: 8px; }
  .resume-entry { padding: 14px 0; }
  .resume-entry h4 { font-size: 0.88rem; }
  .resume-entry p { font-size: 0.81rem; }
  .resume-skills-grid { grid-template-columns: 1fr; gap: 12px; }
  .tool-chip { padding: 5px 12px; font-size: 0.74rem; }
}

@media (max-width: 390px) {
  .resume-section { padding: 32px 14px 40px; }
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
@media (max-width: 768px) {
  .contact-section {
    display: flex;
    flex-direction: column;
    padding: 36px 16px 48px;
    gap: 28px;
    grid-template-columns: unset;
  }
  .contact-card { padding: 16px; margin-bottom: 12px; }
  .contact-card:hover { transform: none; }
  .contact-card-icon { width: 40px; height: 40px; }
  .contact-card h4 { font-size: 0.82rem; }
  .contact-card p { font-size: 0.8rem; }

  .contact-form-wrap { padding: 22px 16px; border-radius: var(--radius-lg); }
  .contact-form-wrap h3 { font-size: 1.15rem; margin-bottom: 18px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-group { margin-bottom: 14px; }
  .form-group label { font-size: 0.8rem; }
  .form-group input, .form-group select, .form-group textarea {
    padding: 11px 14px;
    font-size: 16px !important;
    -webkit-appearance: none;
    appearance: none;
  }
  .form-group textarea { min-height: 100px; }
  .form-submit { padding: 13px 20px; font-size: 0.9rem; min-height: 52px; }
}

@media (max-width: 480px) {
  .contact-section { padding: 32px 14px 40px; }
  .contact-form-wrap { padding: 18px 14px; }
}

@media (max-width: 390px) {
  .contact-section { padding: 28px 12px 36px; }
}

/* ============================================================
   WEBSITES PAGE
   ============================================================ */
@media (max-width: 768px) {
  .websites-section { padding: 36px 0 48px; }

  .website-filters {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 16px 12px;
    justify-content: flex-start;
    margin-bottom: 28px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }

  .website-filters::-webkit-scrollbar { display: none; }

  .website-filters .filter-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 0.78rem;
    min-height: 38px;
  }

  .websites-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px;
    max-width: 100%;
  }

  .website-thumb { height: 180px; }
  .browser-mockup-bar { padding: 8px 12px; }
  .browser-domain-pill { max-width: 140px; font-size: 0.68rem; }
  .website-info { padding: 16px; }
  .website-info h3 { font-size: 1rem; }
  .website-info p.website-desc { font-size: 0.82rem; line-height: 1.6; margin-bottom: 12px; }
  .website-tags { gap: 5px; margin-bottom: 14px; }
  .website-tag { font-size: 0.65rem; padding: 2px 8px; }
  .website-btn-visit { font-size: 0.8rem; padding: 8px 14px; min-height: 36px; }
}

@media (max-width: 480px) {
  .website-thumb { height: 160px; }
  .website-info { padding: 14px; }
}

@media (max-width: 390px) {
  .websites-section { padding: 32px 0 40px; }
  .websites-grid { padding: 0 14px; gap: 14px; }
}

/* 2-column on tablet portrait for websites */
@media (min-width: 481px) and (max-width: 768px) {
  .websites-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 0 16px;
  }
  .work-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* ============================================================
   SECTION HEADINGS — RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .section-title, .section-title.light {
    font-size: clamp(1.45rem, 6vw, 2rem);
  }
  .section-label { font-size: 0.7rem; letter-spacing: 0.18em; }
  .section-desc, .section-desc.light { font-size: 0.9rem; line-height: 1.75; }
  .view-all-btn, .view-all-btn.light { padding: 10px 18px; font-size: 0.82rem; min-height: 42px; }
}

@media (max-width: 390px) {
  .section-title, .section-title.light { font-size: clamp(1.35rem, 6.5vw, 1.8rem); }
}

/* ============================================================
   ANIMATIONS — OPTIMIZED FOR MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .animate-fade-up {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .animate-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   OVERFLOW PREVENTION
   ============================================================ */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100%; }

  section, .hero, .about, .services, .projects, .cta-band,
  .footer, .page-hero, .about-full, .gallery-section, .resume-section,
  .contact-section, .work-section, .websites-section {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* ============================================================
   TOUCH TARGETS — 44px minimum
   ============================================================ */
@media (max-width: 768px) {
  .hamburger { min-width: 44px; min-height: 44px; }
  .social-btn { width: 44px; height: 44px; }
}

/* ============================================================
   LIGHTBOX — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  #lightbox img {
    max-width: 95vw;
    max-height: 82vh;
    border-radius: 10px;
  }
}
