@media (max-width: 768px) {
  /* Hide scrollbar on mobile and prevent horizontal scroll */
  html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-x: hidden;
    max-width: 100vw;
    touch-action: pan-y pinch-zoom;
  }
  
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  
  body {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }

  html.theme-switching-mobile *,
  html.theme-switching-mobile *::before,
  html.theme-switching-mobile *::after {
    transition: none !important;
    animation: none !important;
  }

  :root {
    --mobile-gutter: clamp(18px, 5vw, 26px);
    --mobile-card-width: min(100%, 24rem);
    --mobile-carousel-card: min(58vw, 286px);
    --mobile-carousel-half: min(29vw, 143px);
  }

  html {
    font-size: 16px;
  }

  body {
    letter-spacing: -0.01em;
  }

  nav {
    padding: calc(12px + env(safe-area-inset-top)) var(--mobile-gutter) 12px;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    background: linear-gradient(to bottom, rgba(8, 11, 18, 0.96), rgba(8, 11, 18, 0.72) 72%, transparent);
  }

  [data-theme="light"] nav {
    background: linear-gradient(to bottom, rgba(245, 244, 240, 0.96), rgba(245, 244, 240, 0.72) 72%, transparent);
  }

  .logo {
    font-size: 1.25rem;
    letter-spacing: 0.04em;
  }

  .nav-links {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
  }

  .nav-hamburger {
    width: 44px;
    height: 44px;
    margin-right: 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  [data-theme="light"] .nav-hamburger {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  }

  .theme-switch-wrapper {
    margin-left: 0;
  }

  .nav-mobile-menu {
    padding: calc(88px + env(safe-area-inset-top)) var(--mobile-gutter) calc(28px + env(safe-area-inset-bottom));
    justify-content: flex-start;
    gap: 14px;
  }

  .nav-mobile-menu a {
    width: min(100%, 28rem);
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    font-size: clamp(1.25rem, 6vw, 1.7rem);
    text-align: left;
  }

  [data-theme="light"] .nav-mobile-menu a {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.62);
  }

  .hero {
    padding-top: calc(88px + env(safe-area-inset-top));
    padding-bottom: 32px;
  }

  .hero-container {
    gap: 0;
  }

  .hero-image-wrapper {
    height: min(50svh, 480px);
    min-height: 260px;
    padding: 0 var(--mobile-gutter);
  }

  .hero-image-wrapper::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: clamp(92px, 18vw, 140px);
    background: linear-gradient(
      to bottom,
      rgba(245, 244, 240, 0) 0%,
      rgba(245, 244, 240, 0.56) 38%,
      var(--bg-dark) 100%
    );
    pointer-events: none;
    z-index: 3;
  }

  [data-theme="dark"] .hero-image-wrapper::after {
    background: linear-gradient(
      to bottom,
      rgba(8, 11, 18, 0) 0%,
      rgba(8, 11, 18, 0.6) 38%,
      var(--bg-dark) 100%
    );
  }

  .hero-comments-layer {
    display: block;
    inset: calc(18px + env(safe-area-inset-top)) 0 auto 0;
    height: min(50svh, 390px);
    overflow: hidden;
  }

  .hero-comment {
    width: clamp(104px, 28vw, 142px);
  }

  .hero-image {
    width: min(90vw, 560px);
  }

  .hero-content {
    padding: 0 var(--mobile-gutter) 0;
    max-width: 32rem;
    margin: -24px auto 0;
    position: relative;
    z-index: 3;
  }

  .hero-subtitle {
    margin-bottom: 12px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
  }

  .hero-title {
    font-size: clamp(2.2rem, 11.5vw, 3.25rem);
    margin-bottom: 16px;
    line-height: 0.92;
    letter-spacing: -0.03em;
  }

  .hero-line-one {
    white-space: normal;
  }

  .hero-description {
    max-width: 32ch;
    margin: 0 auto 24px;
    font-size: 0.96rem;
    line-height: 1.68;
    text-wrap: balance;
  }

  .hero-description br {
    display: none;
  }

  .hero-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
  }

  .hero-stats .stat:first-child {
    grid-column: 1 / -1;
  }

  .stat {
    padding: 8px 0;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  [data-theme="light"] .stat {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .stat-number {
    font-size: clamp(1.45rem, 7vw, 2rem);
    line-height: 0.95;
    display: block;
  }

  .stat-label {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    margin-top: 6px;
    display: block;
  }

  .portfolio {
    height: auto;
    padding: 52px 0 32px;
  }

  .portfolio-sticky {
    position: relative;
    top: 0;
    height: auto;
  }

  .portfolio-title {
    position: static;
    margin: 0 auto 18px;
    padding: 0 var(--mobile-gutter);
    font-size: clamp(1.75rem, 8.6vw, 2.35rem);
    line-height: 0.98;
  }

  .portfolio-swipe-indicator {
    position: absolute;
    top: 50%;
    left: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-secondary);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-50%);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 4;
  }

  [data-theme="dark"] .portfolio-swipe-indicator {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  }

  .portfolio-swipe-indicator.is-dismissed {
    opacity: 0;
    transform: translateY(calc(-50% - 6px));
    pointer-events: none;
  }

  .swipe-chevron {
    width: 12px;
    height: 12px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    opacity: 0.9;
  }

  .swipe-chevron-right {
    transform: rotate(45deg);
    animation: swipeChevronRight 1.4s ease-in-out infinite;
  }

  @keyframes swipeChevronRight {
    0%, 100% {
      transform: translateX(0) rotate(45deg);
      opacity: 0.45;
    }
    50% {
      transform: translateX(5px) rotate(45deg);
      opacity: 1;
    }
  }

  .about-text p,
  .contact p,
  .longform-subtitle {
    font-size: 0.98rem;
    line-height: 1.68;
  }

  .video-cards-shell {
    display: block;
    position: relative;
  }

  .video-cards {
    position: relative;
    height: auto;
    display: flex;
    gap: 0;
    padding: 18px calc(50vw - var(--mobile-carousel-half)) 18px;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: calc(50vw - var(--mobile-carousel-half));
    /* Allow vertical page scroll while still supporting horizontal swipe. */
    touch-action: auto;
    perspective: 1200px;
    transform-style: preserve-3d;
    overscroll-behavior-x: contain;
  }

  @supports (-webkit-overflow-scrolling: touch) {
    .video-cards {
      -webkit-overflow-scrolling: touch;
    }
  }

  @supports (scrollbar-width: none) {
    .video-cards {
      scrollbar-width: none;
    }
  }

  .video-cards::-webkit-scrollbar {
    display: none;
  }

  .video-cards::-webkit-scrollbar.mobile-break {
    display: inline;
  }

  .video-card {
    position: relative;
    top: auto;
    left: auto;
    flex: 0 0 var(--mobile-carousel-card);
    width: var(--mobile-carousel-card);
    max-width: var(--mobile-carousel-card);
    margin: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    transform-origin: center center;
    transition:
      transform 0.36s cubic-bezier(0.23, 1, 0.32, 1),
      opacity 0.28s ease;
  }

  .video-card-inner {
    height: auto;
    aspect-ratio: 9 / 16;
    border-radius: 22px;
    box-shadow:
      0 20px 42px rgba(0, 0, 0, 0.22),
      0 0 0 1px rgba(0, 0, 0, 0.05);
  }

  .unmute-btn {
    left: 14px;
    right: auto;
    bottom: 14px;
    transform: none;
    min-width: 96px;
    min-height: 36px;
    padding: 9px 13px;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
  }


  .longform {
    padding: 28px var(--mobile-gutter) 24px;
  }

  .longform-title,
  .about-title {
    font-size: clamp(1.8rem, 8.8vw, 2.45rem);
    line-height: 0.98;
  }

  .longform-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .longform-card {
    border-radius: 10px;
    overflow: hidden;
  }

  .about {
    padding: 60px var(--mobile-gutter);
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 22px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    padding: 18px 18px 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  }

  [data-theme="dark"] .about-content {
    background: rgba(16, 24, 38, 0.86);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  }

  .feedback {
    padding: 44px 0 54px;
  }

  .feedback-title {
    font-size: clamp(1.8rem, 8.8vw, 2.45rem);
    line-height: 0.98;
    margin-bottom: 10px;
    padding: 0;
  }

  .feedback-subtitle {
    font-size: 0.96rem;
    line-height: 1.65;
    margin-bottom: 16px;
    padding: 0;
  }

  .testimonials-accordion {
    width: 100%;
    gap: 9px;
  }

  .testimonial-card {
    border-radius: 8px;
  }

  .testimonial-trigger {
    min-height: 68px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .testimonial-avatar {
    width: 40px;
    height: 40px;
  }

  .testimonial-copy {
    padding: 10px 13px 17px;
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .feedback-role {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
  }

  .about-title {
    margin-bottom: 12px;
    line-height: 1;
  }

  .about-text p {
    margin-bottom: 14px;
    font-size: 0.96rem;
    line-height: 1.72;
  }

  .about-image {
    max-width: 14.5rem;
    margin: 0 auto;
  }

  .about-image img {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  }

  .about-image-mobile {
    display: block;
    float: none;
    width: min(58vw, 230px);
    max-width: min(58vw, 230px);
    margin: 0 auto 16px;
  }

  .about-image-desktop {
    display: none;
  }

  .about-image::before {
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 100%;
    opacity: 1;
    z-index: 3;
  }

  .about-image-mobile::before {
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 100%;
    opacity: 1;
    z-index: 3;
  }

  .about-text::after {
    content: "";
    display: block;
    clear: both;
  }

  .skills-grid {
    display: none;
    gap: 12px;
  }

  .worked-with {
    padding: 58px var(--mobile-gutter) 66px;
  }

  .worked-with-kicker {
    margin-bottom: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
  }

  .worked-with-title {
    display: none;
    font-size: clamp(1.8rem, 8.8vw, 2.45rem);
  }

  
  
  .skill-item {
    padding: 16px 12px;
    border-radius: 16px;
  }

  .contact {
    padding: 30px var(--mobile-gutter) 10px;
  }

  .contact h2 {
    font-size: clamp(1.5rem, 8vw, 2.2rem);
    white-space: normal;
    line-height: 0.94;
    margin-bottom: 8px;
  }

  .cta-buttons,
  .contact-buttons {
    gap: 10px;
    display: flex;
    flex-direction: column;
    max-width: 26rem;
    margin: 0 auto;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 14px 18px;
    font-size: 0.82rem;
    border-radius: 18px;
  }

  .statement-banner {
    padding: 6px var(--mobile-gutter) 0;
  }

  .footer-top {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px 20px 0;
  }

  .footer-left {
    font-size: 0.7rem;
    max-width: 280px;
    text-align: center;
  }

  .footer-left p {
    font-size: 0.7rem;
    white-space: normal;
    line-height: 1.4;
    max-width: 260px;
  }

  .mobile-break {
    display: inline;
  }

  .footer-socials {
    gap: 20px;
  }

  .footer-socials a {
    font-size: 1.9rem;
  }

  .end-brand {
    height: 18vh;
  }

  .end-brand-text {
    width: 40vw;
    bottom: 0%;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(2.05rem, 12vw, 2.8rem);
  }

  .hero-content {
    margin-top: -16px;
  }

  .stat {
    padding: 13px 14px;
  }

  .portfolio-title,
  .longform-title,
  .about-title {
    font-size: clamp(1.65rem, 8.8vw, 2.1rem);
  }

  .contact h2 {
    font-size: clamp(1.75rem, 10vw, 2.35rem);
  }

  .statement-banner p {
    font-size: clamp(1.45rem, 11vw, 2.35rem);
    white-space: normal;
    line-height: 0.92;
    overflow-wrap: break-word;
  }

  .hero-description {
    font-size: 0.92rem;
  }
}
