/* ==========================================================================
   A TO Z DIGITAL PRODUCTION — RESPONSIVE STYLESHEET
   Breakpoints: 1280px, 1024px, 992px, 768px, 576px, 414px, 390px, 360px
   ========================================================================== */

/* Anchor scroll offset so sticky navbar never obscures section headings */
[id] {
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

/* --- 1. LARGE SCREENS & DESKTOPS (<= 1280px) --- */
@media (max-width: 1280px) {
  .hero-grid {
    gap: 40px;
  }
  .bento-card.span-8 .bento-img {
    height: 300px;
  }
  .clients-selector-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- 2. TABLETS & SMALL DESKTOPS (<= 1024px) --- */
@media (max-width: 1024px) {
  :root {
    --nav-height: 72px;
  }

  .section {
    padding-top: 85px;
    padding-bottom: 85px;
  }

  /* Hero Section */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 50px;
    text-align: left;
  }

  .hero-visual-wrapper {
    min-height: 380px;
    order: -1;
  }

  .aperture-stage {
    width: 320px;
    height: 320px;
  }
  .aperture-outer-ring {
    width: 300px;
    height: 300px;
  }
  .aperture-housing-ring {
    width: 270px;
    height: 270px;
  }
  .aperture-blades-svg {
    width: 230px;
    height: 230px;
  }

  /* About Grid */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Highlights Bar */
  .highlights-bar {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 32px;
  }
  .highlight-box:nth-child(2) {
    border-right: none;
  }

  /* Services Table */
  .service-row {
    grid-template-columns: 60px 1.2fr 1.6fr 40px;
    padding: 24px 16px;
  }

  /* Why Grid */
  .why-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .why-left-sticky {
    position: static;
  }

  /* Client Spotlight */
  .client-spotlight-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* Process Timeline */
  .process-timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
  .process-timeline::before {
    display: none;
  }

  /* Bento Portfolio */
  .bento-card.span-8,
  .bento-card.span-6,
  .bento-card.span-4 {
    grid-column: span 6;
  }

  /* Contact Grid */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* --- 3. MEDIUM TABLETS & PHABLETS (<= 992px) --- */
@media (max-width: 992px) {
  /* Navigation */
  .nav-links-wrap,
  .nav-cta-wrap .btn,
  .nav-phone-link {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  /* Service numbered rows to card-like responsive rows */
  .service-row {
    grid-template-columns: 50px 1fr 30px;
    grid-template-areas: 
      "num title arrow"
      "num desc desc";
    gap: 8px 12px;
    padding: 22px 14px;
  }
  .service-num { grid-area: num; align-self: flex-start; margin-top: 4px; }
  .service-title { grid-area: title; }
  .service-arrow { grid-area: arrow; }
  .service-desc { grid-area: desc; padding-right: 0; }

  /* Client Selector Carousel */
  .clients-selector-bar {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding-bottom: 16px;
  }
  .client-thumb-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
  }

  /* Bento Grid */
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .bento-card.span-8,
  .bento-card.span-6,
  .bento-card.span-4,
  .bento-card.span-12 {
    grid-column: span 1;
  }
  .bento-img,
  .bento-card.span-8 .bento-img {
    height: 240px;
  }
}

/* --- 4. PHONES & SMALL SCREENS (<= 768px) --- */
@media (max-width: 768px) {
  :root {
    --nav-height: 68px;
    --nav-height-scrolled: 62px;
  }

  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .section {
    padding-top: 70px;
    padding-bottom: 70px;
  }

  .section-heading {
    font-size: 2.1rem;
    line-height: 1.18;
  }

  /* Hero Section */
  .hero-section {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 24px);
    padding-bottom: 50px;
  }

  .hero-title {
    font-size: 2.6rem;
    line-height: 1.08;
    margin-bottom: 18px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }
  .hero-actions .btn {
    width: 100%;
  }

  .hero-meta {
    font-size: 0.78rem;
    padding-top: 16px;
  }

  /* Aperture Mobile Scaling */
  .hero-visual-wrapper {
    min-height: 300px;
  }
  .aperture-stage {
    width: 270px;
    height: 270px;
  }
  .aperture-outer-ring {
    width: 260px;
    height: 260px;
  }
  .aperture-housing-ring {
    width: 230px;
    height: 230px;
  }
  .aperture-blades-svg {
    width: 190px;
    height: 190px;
  }
  .aperture-center-core {
    width: 68px;
    height: 68px;
  }
  .aperture-play-icon {
    border-top-width: 10px;
    border-bottom-width: 10px;
    border-left-width: 16px;
  }

  /* Highlights Bar */
  .highlights-bar {
    grid-template-columns: 1fr 1fr;
    padding: 30px 0;
    gap: 20px;
  }
  .highlight-stat {
    font-size: 2.4rem;
  }

  /* Process Vertical Timeline */
  .process-timeline {
    grid-template-columns: 1fr;
    gap: 28px;
    position: relative;
    padding-left: 20px;
  }
  .process-timeline::after {
    content: '';
    position: absolute;
    top: 30px;
    left: 45px;
    bottom: 30px;
    width: 2px;
    background: linear-gradient(180deg, var(--yellow), rgba(255, 200, 0, 0.2));
  }
  .process-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
  }
  .step-num-node {
    width: 52px;
    height: 52px;
    font-size: 1rem;
    flex-shrink: 0;
    margin-bottom: 0;
  }

  /* Client Spotlight */
  .client-spotlight {
    padding: 24px 18px;
  }
  .spotlight-client-name {
    font-size: 1.6rem;
  }
  .spotlight-screenshot-img {
    max-height: 260px;
  }

  /* Contact Form */
  .contact-meta-card,
  .contact-form-wrap {
    padding: 28px 20px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* CTA Banner */
  .cta-banner-section {
    padding: 70px 0;
  }
  .cta-headline {
    font-size: 1.95rem;
  }
  .cta-buttons-wrap {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .cta-buttons-wrap .btn {
    width: 100%;
  }

  /* Footer */
  .footer-top {
    flex-direction: column;
    gap: 30px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  /* Quick Floating Contact adjustments for mobile */
  .floating-contact-dock {
    right: 16px;
    bottom: 74px;
    gap: 12px;
  }

  .floating-action-btn {
    width: 48px;
    height: 48px;
  }

  .floating-svg-icon {
    width: 22px;
    height: 22px;
  }

  .floating-action-tooltip {
    display: none; /* Avoid sticky touch tooltips on mobile */
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }
}

/* --- 5. COMPACT MOBILE SCREENS (<= 480px / 414px / 390px / 360px) --- */
@media (max-width: 480px) {
  .section {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .brand-logo-img {
    height: 40px;
  }

  .hero-title {
    font-size: 2.25rem;
    letter-spacing: -0.02em;
    word-break: break-word;
  }

  .hero-lead {
    font-size: 0.98rem;
    margin-bottom: 24px;
  }

  .section-heading {
    font-size: 1.85rem;
  }

  .about-narrative p {
    font-size: 1rem;
  }

  .about-editorial-visual {
    padding: 24px 18px;
  }

  .highlights-bar {
    grid-template-columns: 1fr;
    border-left: none;
  }
  .highlight-box {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 0;
  }
  .highlight-box:last-child {
    border-bottom: none;
  }

  .showcase-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-showcase {
    padding: 24px 16px;
  }

  .service-pill {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .client-thumb-card {
    flex: 0 0 200px;
    padding: 14px 12px;
  }

  .bento-img {
    height: 200px;
  }

  .bento-title {
    font-size: 1.1rem;
  }

  .bento-desc {
    font-size: 0.82rem;
  }

  .contact-meta-card,
  .contact-form-wrap {
    padding: 22px 14px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 0.9rem;
    padding: 12px 14px;
  }
}

/* Extra small viewport insurance (360px and below) */
@media (max-width: 360px) {
  .hero-title {
    font-size: 2rem;
  }
  .aperture-stage {
    width: 230px;
    height: 230px;
  }
  .aperture-outer-ring {
    width: 220px;
    height: 220px;
  }
  .aperture-housing-ring {
    width: 195px;
    height: 195px;
  }
  .aperture-blades-svg {
    width: 160px;
    height: 160px;
  }
  .step-name {
    font-size: 1.1rem;
  }
}
