/* ============================================
   CideSys — Responsive Breakpoints
   ============================================ */

/* --- Tablet (768px) --- */
@media (max-width: 768px) {
  /* Mobile keeps mandatory section-by-section snap. The tall sections that
     previously needed a proximity escape (services panels, contact page) are
     split below into per-block snap targets, and the values grid + split slides
     are compressed to fit a single viewport. */

  .split,
  .split--xona {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .split--xona .split__left { max-width: none; }

  /* Cap the stacked split image so text + image fit within 100svh together. */
  .split .media-frame .media-img,
  .split--xona .media-frame .media-img {
    aspect-ratio: auto;
    max-height: 42svh;
    height: 42svh;
  }

  /* Compress split text so longer headings (slide 5) still fit one viewport. */
  .split--xona h2 {
    font-size: 1.35rem;
    line-height: 1.2;
    margin-bottom: 0.6rem;
  }

  .split--xona p {
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 1rem;
  }

  .media-frame--clipped-tr {
    clip-path: polygon(0 0, calc(100% - 36px) 0, 100% 36px, 100% 100%, 0 100%);
  }

  .media-frame--clipped-tl {
    clip-path: polygon(36px 0, 100% 0, 100% 100%, 0 100%, 0 36px);
  }

  .hero__content {
    padding: 0 1.5rem;
  }

  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }

  .section {
    padding: 3rem 0;
  }

  /* Each service panel becomes its own snap target on mobile; the parent
     wrapper no longer snaps so users can step through panel-by-panel. */
  .services-panels {
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 0;
    scroll-snap-align: none;
  }

  /* Touch: disable the flex-grow expansion; every panel is the same height and its list is always visible. */
  .services-panels:hover .service-panel,
  .services-panels:focus-within .service-panel,
  .services-panels .service-panel:hover,
  .services-panels .service-panel:focus-within {
    flex-grow: 1;
  }

  .service-panel {
    flex: 0 0 auto;
    min-height: 100svh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .service-panel__content {
    justify-content: flex-end;
    padding: 2rem 1.5rem;
  }

  .service-panel__list {
    opacity: 1;
    transform: none;
    margin-top: 1rem;
    font-size: 0.95rem;
  }

  .service-panel__list li {
    white-space: normal;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .logos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem 0;
  }

  /* Dividers target the 4-column layout; hide on narrower grids */
  .logo-item:not(:nth-child(4n))::after {
    display: none;
  }

  /* Keep the 5 value cards in a 2-col grid and compress padding/typography so
     the whole .about-hero--values block fits a single 100svh snap target. */
  .about-values {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .about-values .value-card:nth-child(n) { grid-column: auto; }

  .about-hero--values .about-hero__content {
    padding: 5.5rem 0 1.5rem;
  }

  .about-hero--values .about-hero__body {
    margin-bottom: 1rem;
  }

  .about-hero--values .about-hero__body h2 {
    font-size: 1.35rem;
    line-height: 1.2;
  }

  .about-hero--values .value-card {
    padding: 0.7rem 0.75rem 0.85rem;
  }

  .about-hero--values .value-card__number {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
  }

  .about-hero--values .value-card h4 {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
  }

  .about-hero--values .value-card p {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  /* Split the contact page into two snap targets (info + form), each one viewport tall. */
  .contact-page {
    grid-template-columns: 1fr;
    min-height: 0;
    scroll-snap-align: none;
    padding-top: 0;
  }

  .contact-left,
  .contact-right {
    padding: 5rem 1.5rem 2.5rem;
    min-height: 100svh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    justify-content: center;
  }

  .contact-locations {
    margin-top: 2rem;
  }

  .nav-panel {
    max-width: 100%;
  }

  .nav-panel__links a {
    font-size: 1.6rem;
  }

  .header__corner {
    width: 80px;
    height: 80px;
  }

  .header__corner::before {
    border-width: 0 80px 80px 0;
  }

  .contact-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* --- Mobile (480px) --- */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .header {
    padding: 1rem;
  }

  .header--scrolled {
    padding: 0.75rem 1rem;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.2rem; }

  .section {
    padding: 3rem 0;
  }

  .services-panels {
    flex-direction: column;
  }

  /* Each panel is its own 100svh snap target (set at 768px breakpoint). */

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .logos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 0;
  }

  /* Keep the values grid 2-col on small phones too — single-column would put 5
     cards at ~150svh and break section-by-section snap. */
  .about-values {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .about-hero--values .value-card {
    padding: 0.6rem 0.7rem 0.7rem;
  }

  .about-hero--values .value-card p {
    font-size: 0.7rem;
  }

  .split {
    gap: 1.25rem;
  }

  .split .media-frame .media-img,
  .split--xona .media-frame .media-img {
    height: 42svh;
    max-height: 42svh;
  }

  .accent-line {
    padding-left: 1.5rem;
  }

  .accent-line::before {
    width: 1rem;
  }

  .hero__content p {
    font-size: 1rem;
  }

  .nav-panel {
    padding: 5rem 2rem 2rem;
  }

  .nav-panel__links a {
    font-size: 1.3rem;
  }

  .header__corner {
    width: 60px;
    height: 60px;
  }

  .header__corner::before {
    border-width: 0 60px 60px 0;
  }

  .contact-left,
  .contact-right {
    padding: 2rem 1rem;
  }

  .cta-section {
    padding: 4rem 1rem;
  }

  .play-overlay__btn {
    width: 50px;
    height: 50px;
  }

  .play-overlay__btn svg {
    width: 18px;
    height: 18px;
  }
}

/* --- Large screens (1440px+) --- */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }
}
