/* ============================================================
   SOUNDNOTE — Responsive System (production layer)
   Premium luxury breakpoints · typography · touch · a11y
   Load last. Does not change brand colors or content.
   ============================================================ */

:root {
  --max-content: 1400px;
  --section-padding: 120px;
  --header-height: 90px;
  --sn-radius-btn: 12px;
  --sn-radius-input: 12px;
  --sn-touch-min: 48px;
  --sn-btn-min-h: 52px;
  --sn-input-min-h: 54px;
  --sn-container-pct: 100%;
  --fs-hero: clamp(2.125rem, 4.5vw + 1rem, 5.5rem);
  --fs-section: clamp(1.75rem, 2.8vw + 0.75rem, 3rem);
  --fs-subheading: clamp(1.125rem, 1.2vw + 0.85rem, 1.5rem);
  --fs-body: clamp(1rem, 0.25vw + 0.95rem, 1.125rem);
  --fs-btn: clamp(0.9375rem, 0.2vw + 0.9rem, 1rem);
  --lh-body: 1.7;
  --lh-heading: 1.15;
}

/* ── Global foundation ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

h2 {
  font-size: var(--fs-section);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

h3 {
  font-size: var(--fs-subheading);
  line-height: 1.25;
  text-wrap: balance;
}

p,
.sn-lead {
  line-height: var(--lh-body);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

svg {
  flex-shrink: 0;
}

/* Inline UI icons — fixed dimensions */
.sn-tech-phil-card svg,
.sn-tech-svc-card svg,
.sn-tech-measure-card svg,
.sn-tech-trust-list svg,
.sn-contact-card__icon svg,
.sn-contact-feature__icon svg,
[class*="__icon"] svg,
[class*="-icon"] > svg {
  max-width: none;
}

img:not([width]):not(.sn-hero-luxury__img) {
  width: 100%;
}

.sn-img-cover,
.sn-img-editorial,
.sn-product-tile-img img,
.sn-service-img img,
.sn-service-block-img img,
.sn-gallery-link img,
.sn-video-card img,
.sn-brand-wall-cell,
.sn-editorial-service-card {
  object-fit: cover;
}

/* ── Container widths ── */
.container,
.sn-header-inner,
.sn-header.navbar-glass .sn-header-inner {
  width: var(--sn-container-pct);
  max-width: var(--max-content) !important;
  margin-left: auto;
  margin-right: auto;
}

/* ── Sticky header — no jump ── */
.sn-header,
.sn-header.navbar-glass {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  min-height: var(--header-height);
  will-change: background, box-shadow;
  transition:
    background 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

main {
  padding-top: 0;
}

body:not(.page-home) main > .sn-hero:first-child,
body:not(.page-home) main > .sn-page-hero:first-child {
  scroll-margin-top: var(--header-height);
}

/* ── Buttons — premium touch targets ── */
.btn-sn-primary,
.btn-sn-secondary,
.sn-hero-luxury__btn,
.sn-hero-luxury__btn--ghost,
.sn-contact-cta__btn,
.sn-contact-cta__btn--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--sn-btn-min-h);
  padding: 0.875rem 1.75rem;
  font-size: var(--fs-btn);
  line-height: 1.3;
  border-radius: var(--sn-radius-btn) !important;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.btn-sn-primary:active,
.btn-sn-secondary:active,
.sn-hero-luxury__btn:active {
  transform: scale(0.98);
}

.btn-sn-link {
  min-height: var(--sn-touch-min);
  align-items: center;
  padding: 0.5rem 0;
}

/* ── Forms ── */
.sn-form-label,
.page-contact .sn-form-label {
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.sn-form-control,
.page-contact .sn-form-control,
.sn-footer-newsletter-form input,
.sn-home-contact-form input,
.sn-home-contact-form textarea,
.sn-home-contact-form select {
  min-height: var(--sn-input-min-h);
  padding: 0.875rem 1.125rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--sn-radius-input) !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

textarea.sn-form-control,
.page-contact .sn-form-group textarea.sn-form-control,
.sn-home-contact-form textarea {
  min-height: 140px;
  padding-top: 1rem;
}

.sn-form-control:invalid:not(:placeholder-shown),
.page-contact .sn-form-control:invalid:not(:placeholder-shown) {
  border-color: #c45c5c;
}

.sn-form-control:valid:not(:placeholder-shown),
.page-contact .sn-form-control:valid:not(:placeholder-shown) {
  border-color: rgba(200, 154, 61, 0.55);
}

/* ── Footer social — 48px targets ── */
.sn-footer-social a {
  width: var(--sn-touch-min);
  height: var(--sn-touch-min);
  min-width: var(--sn-touch-min);
  min-height: var(--sn-touch-min);
}

/* ── Footer layout grid ── */
.sn-footer .row.g-5 {
  --bs-gutter-y: 2.5rem;
}

/* ── Equal-height card grids ── */
.sn-services-row,
.sn-editorial-services,
.sn-product-grid,
.sn-brand-grid,
.sn-brand-wall-grid,
.sn-process {
  align-items: stretch;
}

.sn-service-item,
.sn-product-tile,
.sn-brand-card,
.sn-editorial-service-card,
.sn-process-step,
.sn-review-card,
.sn-testimonial-card {
  height: 100%;
}

/* ── Hero heights ── */
.sn-hero-luxury {
  min-height: 100vh;
  min-height: 100svh;
}

.sn-hero-luxury__title {
  font-size: var(--fs-hero);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.sn-hero-luxury__desc {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* ── Product grid progression 4 → 3 → 2 → 1 ── */
@media (min-width: 1600px) {
  .sn-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) and (max-width: 1599.98px) {
  .sn-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Services grid 3 → 2 → 1 ── */
@media (min-width: 992px) {
  .sn-services-row,
  .sn-editorial-services {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Statistics 4 → 2 → 1 ── */
@media (min-width: 992px) {
  .sn-stat-grid,
  .sn-stat-inline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── Accessibility — focus visible ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-gold, #C89A3D);
  outline-offset: 3px;
}

.sn-nav-link:focus-visible,
.sn-dropdown-trigger:focus-visible {
  outline-offset: 2px;
}

/* ── Touch devices — disable hover lift ── */
@media (hover: none) and (pointer: coarse) {
  .sn-product-tile:hover,
  .sn-brand-card:hover,
  .sn-editorial-service-card:hover,
  .sn-home-product-card:hover,
  .sn-gallery-link:hover img,
  .sn-product-tile:hover .sn-product-tile-img img,
  .sn-service-item:hover .sn-service-img img,
  .sn-image-reveal:hover img,
  .sn-home-editorial-media:hover img,
  .sn-brand-wall-cell:hover {
    transform: none !important;
    box-shadow: none;
  }

  .sn-hero-luxury__img {
    animation: none !important;
    transform: none !important;
  }
}

/* ── 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;
  }

  .sn-hero-luxury__img {
    animation: none !important;
  }
}

/* ============================================================
   LAPTOP / DESKTOP REFINEMENTS
   ============================================================ */

@media (max-width: 1599.98px) {
  :root { --max-content: 1320px; }
}

@media (max-width: 1439.98px) {
  :root { --max-content: 1240px; }
}

@media (max-width: 1365.98px) {
  :root { --max-content: 1180px; }
}

@media (max-width: 1279.98px) {
  :root {
    --max-content: 1120px;
    --section-padding: 100px;
  }
}

/* ============================================================
   TABLET — 992px / 820px / 768px
   ============================================================ */

@media (max-width: 1199.98px) {
  :root {
    --section-padding: 90px;
    --fs-hero: clamp(2.375rem, 5vw + 0.5rem, 3.5rem);
    --fs-section: clamp(1.875rem, 3vw + 0.5rem, 2.375rem);
    --fs-body: 1.0625rem;
    --sn-container-pct: 90%;
  }

  .sn-hero-luxury {
    min-height: 70vh;
    min-height: 70svh;
  }

  .sn-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sn-services-row,
  .sn-editorial-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sn-stat-grid,
  .sn-stat-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sn-brand-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Footer: 2 columns */
  .sn-footer .row > .col-lg-4:first-child {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .sn-footer .row > .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .sn-footer .row > .col-lg-4:last-child {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 991.98px) {
  :root {
    --section-padding: 90px;
    --header-height: 80px;
    --sn-container-pct: 90%;
  }

  .sn-section,
  .sn-section-alt,
  .page-contact .sn-section-contact {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
  }

  .sn-hero-luxury {
    min-height: 70vh;
    min-height: 70svh;
  }

  /* Premium mobile menu — slide + blur */
  .sn-header.navbar-glass .sn-nav,
  .sn-nav {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: calc(var(--header-height) + 1.5rem) 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition:
      transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.35s ease,
      visibility 0.35s ease;
  }

  .sn-header.navbar-glass .sn-nav.open,
  .sn-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }

  body.sn-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .sn-nav-link,
  .sn-dropdown-trigger,
  .sn-header.navbar-glass .sn-nav-link,
  .sn-header.navbar-glass .sn-dropdown-trigger {
    min-height: var(--sn-touch-min);
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    width: 100%;
  }

  .sn-mega-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .sn-nav-toggle {
    min-width: var(--sn-touch-min);
    min-height: var(--sn-touch-min);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .sn-editorial,
  .sn-home-editorial,
  .sn-service-block,
  .sn-home-contact {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .sn-home-editorial-media,
  .sn-editorial-image {
    order: -1;
  }

  .sn-brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sn-brand-wall-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sn-gallery {
    grid-template-columns: 1fr !important;
    grid-auto-rows: minmax(240px, auto) !important;
  }

  .sn-gallery-item,
  .sn-gallery-item--tall,
  .sn-gallery-item--wide,
  #residential .sn-gallery > *,
  #commercial .sn-gallery > *,
  #multiplex .sn-gallery > *,
  #studios .sn-gallery > *,
  #home-cinemas .sn-gallery > *,
  #before-after .sn-gallery > * {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

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

  .sn-contact-form-panel,
  .sn-form-panel,
  .sn-home-contact-form {
    width: 100%;
  }
}

@media (max-width: 819.98px) {
  .sn-process {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================
   MOBILE — 480px and below common phones
   ============================================================ */

@media (max-width: 767.98px) {
  :root {
    --section-padding: 64px;
    --header-height: 72px;
    --sn-container-pct: 92%;
    --fs-hero: clamp(2.125rem, 8vw, 2.5rem);
    --fs-section: clamp(1.75rem, 5.5vw, 1.75rem);
    --fs-body: 1rem;
    --fs-btn: 1rem;
  }

  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .sn-hero-luxury {
    min-height: 55vh;
    min-height: 55svh;
  }

  .sn-hero-luxury__inner {
    width: 92%;
    padding: calc(var(--header-height) + 1.25rem) 0 2rem;
  }

  .sn-hero-luxury__actions,
  .sn-hero-actions,
  .sn-cta-actions,
  .sn-contact-cta__actions {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    gap: 0.875rem;
  }

  .sn-hero-luxury__btn,
  .sn-hero-luxury__btn--ghost,
  .btn-sn-primary,
  .btn-sn-secondary,
  .sn-hero-actions .btn-sn-primary,
  .sn-hero-actions .btn-sn-secondary,
  .sn-cta-actions .btn-sn-primary,
  .sn-cta-actions .btn-sn-secondary {
    width: 100%;
    max-width: 100%;
  }

  .sn-services-row,
  .sn-editorial-services,
  .sn-product-grid,
  .sn-brand-grid,
  .sn-process {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }

  .sn-stat-grid,
  .sn-stat-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .sn-editorial-service-card {
    min-height: 200px !important;
    max-height: none;
  }

  .sn-brand-wall-grid {
    grid-template-columns: 1fr;
  }

  .sn-brand-wall-cell {
    min-height: 80px;
  }

  .sn-gallery {
    grid-template-columns: 1fr !important;
    grid-auto-rows: minmax(220px, auto);
  }

  .sn-cta-cinematic {
    min-height: auto;
  }

  .sn-cta-cinematic-content,
  .sn-cta-banner {
    padding: var(--section-padding) 0;
  }

  .sn-footer {
    text-align: center;
  }

  .sn-footer .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .sn-footer-social {
    justify-content: center;
  }

  .sn-footer-links {
    text-align: center;
  }

  .sn-footer-map iframe,
  .sn-contact-map-wrap iframe {
    height: clamp(220px, 45vw, 320px) !important;
    border-radius: var(--sn-radius-btn);
  }

  .sn-footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .sn-footer-legal {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .sn-footer-newsletter-form {
    flex-direction: column;
    max-width: 100%;
  }

  .sn-footer-newsletter-form input,
  .sn-footer-newsletter-form button {
    width: 100%;
    min-height: var(--sn-btn-min-h);
  }

  .sn-cert-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
  }

  .sn-cert-list::-webkit-scrollbar {
    display: none;
  }

  body:not(.page-home) main > .sn-hero:first-child,
  body:not(.page-home) main > .sn-page-hero:first-child {
    padding-left: 4%;
    padding-right: 4%;
  }

  body:not(.page-home) main > .sn-hero:first-child .sn-hero-content,
  body:not(.page-home) main > .sn-page-hero:first-child .sn-hero-content {
    padding: 1.5rem 1.25rem;
  }

  body:not(.page-home) main > .sn-hero:first-child .sn-hero-actions,
  body:not(.page-home) main > .sn-page-hero:first-child .sn-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sn-timeline {
    padding-left: 1.5rem;
  }

  .sn-timeline-item::before {
    left: -1.5rem;
  }

  .sn-contact-card {
    flex-direction: column;
    gap: 1rem;
  }

  .sn-contact-hero {
    min-height: 50svh;
  }

  .sn-contact-hero__title {
    font-size: var(--fs-hero);
  }

  /* Click-to-call emphasis */
  .sn-footer-links a[href^="tel:"],
  .sn-home-contact-detail a[href^="tel:"],
  .sn-contact-card__body a[href^="tel:"] {
    font-size: 1.125rem;
    font-weight: 600;
  }
}

/* ============================================================
   SMALL PHONES — 480 / 430 / 414 / 390 / 375 / 360 / 320
   ============================================================ */

@media (max-width: 575.98px) {
  .sn-stat-grid,
  .sn-stat-inline {
    grid-template-columns: 1fr;
  }

  .sn-home-section-intro {
    margin-bottom: 2rem;
  }

  .sn-form-panel,
  .sn-contact-form-panel {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 479.98px) {
  :root {
    --header-height: 68px;
    --fs-hero: 2.125rem;
    --fs-section: 1.75rem;
  }

  .sn-hero-luxury__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
  }

  .sn-brands-track {
    gap: 2.5rem;
  }

  .sn-brand-name {
    font-size: 0.75rem;
  }
}

@media (max-width: 389.98px) {
  :root {
    --fs-hero: 2rem;
    --fs-section: 1.625rem;
    --sn-container-pct: 94%;
  }
}

@media (max-width: 359.98px) {
  :root {
    --fs-hero: 1.875rem;
    --section-padding: 56px;
  }

  .btn-sn-primary,
  .btn-sn-secondary {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    letter-spacing: 0.08em;
  }
}

/* Prevent horizontal overflow */
@media (max-width: 991.98px) {
  .sn-brands-wrap,
  .sn-brands-track,
  .sn-mega-menu-panel,
  .sn-header-inner {
    max-width: 100%;
  }

  .row {
    margin-left: 0;
    margin-right: 0;
  }
}

/* ============================================================
   FINAL POLISH — performance, mobile stability, animations
   ============================================================ */

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html.is-mobile [data-aos] {
  will-change: auto;
}

body.sn-nav-open {
  overflow: hidden;
  touch-action: none;
}

.js-ready .sn-brand-cards,
.js-ready .pj-grid,
.js-ready .sn-stagger {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

@media (max-width: 575.98px) {
  .sn-brand-cards {
    grid-template-columns: 1fr !important;
  }

  .sn-brand-card {
    min-height: 240px;
  }

  .sn-home-hero--cinematic,
  .sn-hero-luxury {
    min-height: 62svh;
  }

  .sn-mega-menu-panel img {
    max-height: 160px;
    object-fit: cover;
  }
}
