/* ============================================================
   D_ART — MOBILE RESPONSIVE LAYER
   Loaded LAST in <head> so it overrides everything cleanly.
   Breakpoints: 1024 / 900 / 800 / 600 / 420 / 360
   ============================================================ */

/* ---------- Base mobile hygiene ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow-x: hidden;
  min-width: 0;
}
img, video, canvas, svg {
  max-width: 100%;
}
/* Prevent iOS auto-zoom on input focus (must be >= 16px) */
input, textarea, select {
  font-size: max(16px, 1em);
}
/* Kill the 300ms tap delay and grey tap flash */
a, button, .product-card, .pd-size-chip, .pd-thumb, .install-tabs button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* iPhone notch / home indicator safe areas */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}
/* Respect users who turn off motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   LARGE TABLET / SMALL LAPTOP — 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 24px 0 40px;
  }
  .hero-copy { padding: 60px 0 20px; }
  .hero-art {
    min-height: auto;
    aspect-ratio: 1 / 1;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
  }
  .mascot-stage {
    width: min(280px, 55vw);
    aspect-ratio: .7;
  }
  .story-section {
    grid-template-columns: 1fr;
    gap: 60px;
    padding: 70px 0 100px;
  }
  .story-visual { margin: 0 auto; }
  .contact-section {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .contact-section::before { height: auto; min-height: 100%; }
  .contact-details { padding-top: 0; }
  .pd-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .pd-details { padding-top: 0; }
}

/* ============================================================
   TABLET PORTRAIT / PHONE LANDSCAPE — 900px
   Trim heavy cinematic layers that eat mobile GPU
   ============================================================ */
@media (max-width: 900px) {
  .hero-curtain,
  .hero-split-line,
  .hero-depth-panel,
  .hero-spotlight,
  .runway-floor {
    display: none !important;
  }
  .hero::before,
  .hero::after { display: none; }
  .aurora-mesh { filter: blur(60px); opacity: .28; }
  .page-scanlines { display: none; }
  .particle-canvas { opacity: .55; }
  .contact-glow { width: 240px; height: 240px; filter: blur(50px); }
}

/* ============================================================
   PHONE — 800px
   The big one. Stack everything, compact header, tight spacing.
   ============================================================ */
@media (max-width: 800px) {

  /* ---------- Global spacing ---------- */
  :root {
    --mobile-gutter: 18px;
  }
  .site-shell { overflow-x: hidden; }
  .site-header,
  .hero,
  .collection-section,
  .story-section,
  .contact-section,
  .exit-section,
  .site-footer {
    width: 100%;
    padding-left: var(--mobile-gutter);
    padding-right: var(--mobile-gutter);
  }
  .site-header { width: 100%; }
  .hero,
  .collection-section,
  .story-section,
  .contact-section,
  .exit-section {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .site-shell {
    padding-left: 0;
    padding-right: 0;
  }
  .hero,
  .collection-section,
  .story-section,
  .contact-section,
  .exit-section,
  .site-footer {
    max-width: 100%;
  }

  /* ---------- Header — fit all 4 controls ---------- */
  .site-header {
    min-height: 62px;
    gap: 10px;
    padding: 10px var(--mobile-gutter);
  }
  .brand-lockup {
    font-size: 12px;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  .brand-lockup img { width: 36px; height: 36px; }
  .brand-lockup span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-actions { gap: 6px; flex: 0 0 auto; }
  .theme-toggle,
  .music-toggle,
  .install-toggle {
    padding: 7px 9px;
    font-size: 9px;
    gap: 5px;
  }
  .theme-toggle-text,
  .music-toggle-text { display: none; }
  .install-toggle-text { display: inline; font-size: 9px; letter-spacing: .06em; }
  .install-toggle span:first-child { font-size: 12px; }
  .nav-toggle { width: 32px; height: 32px; }

  /* ---------- Hero ---------- */
  .hero { padding: 10px 0 30px; }
  .hero-copy { padding: 40px 0 8px; }
  .hero h1 {
    font-size: clamp(46px, 14vw, 84px);
    margin: 20px 0 20px;
    letter-spacing: -.05em;
  }
  .hero-intro {
    font-size: 14px;
    max-width: 100%;
    margin-bottom: 24px;
    line-height: 1.7;
  }
  .button {
    padding: 14px 20px;
    gap: 22px;
    width: 100%;
  }
  .hero-art {
    aspect-ratio: 1 / 1.05;
    border-radius: 24px;
    padding: 16px;
  }
  .art-orbit { transform: scale(.55) rotate(-27deg); }
  .orbit-two { transform: scale(.55) rotate(33deg); }
  .art-note { right: 6%; bottom: 40px; font-size: 10px; }
  .hero-index { display: none; }
  .mascot-stage {
    width: min(240px, 62vw);
    aspect-ratio: .7;
  }
  .archive-mark { bottom: 8%; left: 10%; width: 12px; height: 12px; }

  /* ---------- Ticker ---------- */
  .ticker { padding: 11px 0; }
  .ticker-track { gap: 60px; font-size: 9px; }

  /* ---------- Collection ---------- */
  .collection-section { padding: 70px 0 80px; }
  .section-heading { margin-bottom: 32px; }
  .section-aside {
    text-align: left;
    margin-top: 14px;
    font-size: 11px;
  }
  h2 { font-size: clamp(34px, 9vw, 52px); margin-top: 14px; }
  .empty-collection { min-height: 340px; padding: 40px 20px; }
  .empty-collection h3 { font-size: 26px; }
  .empty-copy { font-size: 12px; }
  .empty-mark { font-size: 34px; }

  /* ---------- Product grid ---------- */
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }
  .product-image-wrap { aspect-ratio: 1 / 1.2; border-radius: 16px 16px 0 0; }
  .product-card { border-radius: 18px; }
  .product-meta { padding: 12px 12px 12px; gap: 10px; }
  .product-meta h3 { font-size: 14px; line-height: 1.15; }
  .product-meta p { font-size: 9px; margin-top: 5px; }
  .product-meta .price-original { font-size: 9px; margin-bottom: 3px; }
  .product-meta strong { font-size: 12px; }
  .product-card .text-link {
    font-size: 8px;
    padding: 0 12px 12px;
    display: block;
    letter-spacing: .06em;
  }
  .product-index { font-size: 8px; padding: 5px 8px; top: 10px; right: 10px; }
  .product-tag { font-size: 8px; padding: 5px 8px; top: 10px; left: 10px; }
  .gallery-nav { display: none !important; }
  .gallery-dots { bottom: 8px; }
  .gallery-dots button { width: 5px; height: 5px; }
  .card-floor { height: 10px; }

  /* ---------- Manifesto ---------- */
  .manifesto-section { padding: 70px 20px; min-height: 0; }
  .manifesto-line { font-size: clamp(24px, 7.4vw, 36px); }

  /* ---------- Story ---------- */
  .story-section { padding: 60px 0 80px; gap: 50px; }
  .story-visual { max-width: 100%; margin-right: 20px; }
  .story-frame { padding: 16px; box-shadow: 12px 12px 0 var(--rust); }
  .beanie-visual .story-frame { box-shadow: 12px 12px 0 var(--gold); }
  .vertical-label { right: -36px; font-size: 8px; }
  .beanie-coming-banner { font-size: 10px; padding: 8px 0 6px; }
  .story-copy > p:not(.eyebrow) { font-size: 14px; margin: 24px 0; }
  .story-signature { font-size: 20px; }
  .story-signature span { font-size: 8px; }

  /* ---------- Contact ---------- */
  .contact-section { padding: 55px 0 60px; gap: 12px; }
  .contact-section::before { display: none; }
  .contact-section { background: var(--ink); color: var(--paper); }
  .contact-section h2 { color: var(--paper); }
  .contact-details > p { font-size: 12px; margin-bottom: 22px; }
  .whatsapp-link { font-size: 12px; }
  .social-row { margin-top: 34px; gap: 18px; font-size: 9px; }

  /* ---------- Exit ---------- */
  .exit-section { padding: 70px 22px 55px; min-height: 0; }
  .exit-line { font-size: 10px; }
  .exit-brand { margin-top: 30px; }
  .exit-brand span { font-size: clamp(24px, 7vw, 34px); }
  .exit-brand p { font-size: 9px; }

  /* ---------- Footer ---------- */
  .site-footer {
    flex-direction: column;
    gap: 6px;
    padding: 14px var(--mobile-gutter);
    font-size: 8px;
    text-align: center;
  }
  .site-footer span:nth-child(2) { display: block; }

  /* ---------- Waitlist bar ---------- */
  .waitlist-bar { font-size: 9px; gap: 8px; padding: 8px 12px; }
  .waitlist-bar span { display: none; }

  /* ---------- Welcome screen ---------- */
  .welcome-screen {
    padding: 18px var(--mobile-gutter) 0;
  }
  .welcome-topline { font-size: 8px; letter-spacing: .14em; }
  .welcome-topline span:first-child { font-size: 11px; }
  .welcome-content {
    padding: 14px 0 20px;
    gap: 4px;
  }
  .welcome-kicker {
    font-size: 9px;
    letter-spacing: .14em;
    margin: 0 0 16px;
    padding: 0 6px;
  }
  .welcome-mascot-wrap {
    width: min(180px, 52vw, 26vh);
  }
  .welcome-wordmark {
    margin-top: 6px;
    line-height: 1;
    flex-direction: column;
    gap: 0;
  }
  .welcome-wordmark .wm-word { font-size: clamp(34px, 11vw, 52px); }
  .welcome-line { font-size: 11px; margin-top: 12px; }
  .welcome-install-guide {
    margin: 18px 0 0;
    padding: 12px 14px;
    width: 100%;
    max-width: 420px;
  }
  .welcome-install-top { gap: 10px; }
  .welcome-install-icon { width: 38px; height: 38px; border-radius: 9px; }
  .welcome-install-kicker { font-size: 9px; margin-bottom: 3px; }
  .welcome-install-copy { font-size: 12px; line-height: 1.5; }
  .welcome-install-cta { font-size: 10px; padding: 11px 16px; margin-top: 10px; }

  .welcome-waitlist { margin-top: 16px; width: 100%; max-width: 420px; }
  .waitlist-title { font-size: 14px; }
  .waitlist-sub { font-size: 10px; margin-bottom: 10px; }
  .waitlist-row { flex-direction: column; }
  .waitlist-row input { padding: 13px 14px; text-align: center; }
  .waitlist-row button { padding: 14px; font-size: 11px; }

  .welcome-bottomline {
    padding: 12px var(--mobile-gutter) calc(16px + env(safe-area-inset-bottom));
    flex-direction: column;
    gap: 10px;
    text-align: center;
    align-items: stretch;
  }
  .welcome-bottomline > span:first-child { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: #7a8782; }
  .welcome-enter-wrap { width: 100%; }
  .welcome-enter {
    width: 100%;
    justify-content: center;
    font-size: 11px;
    letter-spacing: .14em;
    padding: 15px 22px;
  }

  /* ---------- Product detail view ---------- */
  .pd-topbar {
    padding: 12px var(--mobile-gutter);
    gap: 8px;
  }
  .pd-back { font-size: 10px; letter-spacing: .1em; padding: 6px 2px; gap: 6px; }
  .pd-back span:first-child { font-size: 16px; }
  .pd-topbar-brand { display: none; }
  .pd-share-top {
    font-size: 9px;
    padding: 7px 11px;
    letter-spacing: .08em;
  }

  .pd-grid {
    padding: 18px var(--mobile-gutter) 40px;
    gap: 26px;
  }
  .pd-main-wrap { aspect-ratio: 3 / 4; border-radius: 16px; }
  .pd-nav {
    opacity: 1;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .pd-nav-prev { left: 10px; }
  .pd-nav-next { right: 10px; }
  .pd-count { bottom: 10px; right: 12px; font-size: 9px; padding: 5px 9px; }
  .pd-badge { top: 10px; left: 10px; font-size: 8px; padding: 6px 10px; }
  .pd-thumb { width: 58px; height: 72px; border-radius: 10px; }
  .pd-thumbs { gap: 8px; padding-bottom: 2px; }

  .pd-details { gap: 16px; }
  .pd-eyebrow { font-size: 9px; letter-spacing: .14em; }
  .pd-title { font-size: clamp(28px, 9vw, 42px); line-height: 1.02; }
  .pd-subtitle { font-size: 10px; letter-spacing: .12em; }
  .pd-price { gap: 10px; padding-bottom: 16px; }
  .pd-price strong { font-size: 24px; }
  .pd-price .price-original { font-size: 11px; }
  .pd-price .pd-save { font-size: 9px; padding: 3px 7px; }
  .pd-description { font-size: 14px; line-height: 1.7; }
  .pd-specs { gap: 16px; }
  .pd-spec-label { font-size: 9px; letter-spacing: .14em; }
  .pd-size-chip { padding: 11px 16px; font-size: 11px; min-width: 52px; text-align: center; }
  .pd-measurements { font-size: 11px; padding: 12px 14px; }
  .pd-actions { flex-direction: column; gap: 10px; }
  .pd-order,
  .pd-share { width: 100%; min-width: 0; justify-content: center; padding: 15px 18px; font-size: 11px; }
  .pd-note { padding: 12px 14px; gap: 10px; }
  .pd-note p { font-size: 11px; line-height: 1.55; }

  /* ---------- Related pieces ---------- */
  .pd-related { padding: 50px var(--mobile-gutter) 70px; }
  .pd-related-head { margin-bottom: 22px; }
  .pd-related-head h2 { font-size: clamp(26px, 8vw, 38px); margin-top: 10px; }
  .pd-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }
  .pd-related-image { aspect-ratio: 1 / 1.2; border-radius: 14px; }
  .pd-related-name { font-size: 13px; }
  .pd-related-price { font-size: 9px; }

  /* ---------- Modals: full-width, mobile-first ---------- */
  .waitlist-modal,
  .archive-overlay {
    padding: 16px;
    align-items: flex-end;
  }
  .waitlist-card {
    width: 100%;
    max-width: 100%;
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    text-align: left;
  }
  .waitlist-card h2 { font-size: 30px; margin: 8px 0 14px; }
  .waitlist-card .waitlist-form { margin: 0; }
  .waitlist-card .waitlist-row { flex-direction: column; }
  .waitlist-close { top: 8px; right: 12px; }

  .archive-frame {
    padding: 34px 22px;
    width: 100%;
    max-width: 100%;
    border-radius: 22px 22px 0 0;
  }
  .archive-title { font-size: 28px; }
  .archive-copy { font-size: 12px; line-height: 1.7; }
  .archive-tags { flex-wrap: wrap; gap: 8px; }
  .archive-tags span { font-size: 8px; padding: 5px 10px; }

  .install-modal { align-items: flex-end; padding: 0; }
  .install-sheet {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
  }
  .install-sheet h2 { font-size: 26px; }
  .install-copy { font-size: 13px; }
  .install-step { padding: 12px; gap: 12px; }
  .install-step-icon { width: 38px; height: 38px; }
  .install-step-icon svg { width: 20px; height: 20px; }
  .install-step-body strong { font-size: 13px; }
  .install-step-body > span { font-size: 12px; }
  .install-tabs button { padding: 10px 8px; font-size: 10px; }

  /* ---------- Lightbox ---------- */
  .product-lightbox { padding: 40px 14px 26px; }
  .lightbox-figure { max-width: 100%; max-height: 60vh; }
  .lightbox-figure img {
    max-width: 100%;
    max-height: 52vh;
    border-radius: 14px;
  }
  .lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 24px; }
  .lightbox-arrow { width: 38px; height: 38px; font-size: 22px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-details { width: 100%; padding: 0 4px; }
  .lightbox-details h2 { font-size: 20px; }
  .lightbox-details p { font-size: 12px; }
  .lightbox-specs { gap: 14px 22px; }

  /* ---------- Toast ---------- */
  .pd-toast { bottom: 20px; font-size: 10px; padding: 10px 16px; max-width: calc(100% - 32px); }
}

/* ============================================================
   SMALL PHONES — 600px
   ============================================================ */
@media (max-width: 600px) {
  .hero h1 { font-size: clamp(40px, 13vw, 68px); }
  .mascot-stage { width: min(210px, 60vw); }
  .welcome-mascot-wrap { width: min(160px, 48vw, 24vh); }
  .welcome-wordmark .wm-word { font-size: clamp(30px, 10vw, 44px); }
  .pd-related-grid { grid-template-columns: 1fr 1fr; }
  .pd-main-wrap { aspect-ratio: 1 / 1.25; }
  .header-actions { gap: 4px; }
  .theme-toggle, .music-toggle, .install-toggle { padding: 6px 8px; }
}

/* ============================================================
   SMALL PHONES — 420px
   ============================================================ */
@media (max-width: 420px) {
  :root { --mobile-gutter: 14px; }
  .site-header { min-height: 58px; }
  .brand-lockup img { width: 32px; height: 32px; }
  .brand-lockup span { font-size: 11px; }

  /* Header: hide install label on very tight screens */
  .install-toggle-text { display: none; }
  .install-toggle span:first-child { font-size: 14px; }

  .hero h1 { font-size: clamp(36px, 12vw, 54px); letter-spacing: -.05em; }
  .hero-intro { font-size: 13px; }
  h2 { font-size: clamp(30px, 8.5vw, 42px); }

  .product-grid { gap: 12px 8px; }
  .product-meta { padding: 10px 10px 10px; }
  .product-meta h3 { font-size: 13px; }
  .product-meta strong { font-size: 11px; }

  .manifesto-line { font-size: clamp(22px, 7vw, 30px); }
  .story-frame { padding: 12px; box-shadow: 10px 10px 0 var(--rust); }
  .beanie-visual .story-frame { box-shadow: 10px 10px 0 var(--gold); }

  .pd-title { font-size: clamp(26px, 8vw, 36px); }
  .pd-price strong { font-size: 22px; }

  .welcome-mascot-wrap { width: min(150px, 45vw, 22vh); }
  .welcome-wordmark .wm-word { font-size: clamp(28px, 10vw, 38px); }
  .welcome-line { font-size: 10px; }
  .welcome-install-copy { font-size: 11px; }
}

/* ============================================================
   VERY SMALL PHONES — 360px
   ============================================================ */
@media (max-width: 360px) {
  :root { --mobile-gutter: 12px; }
  .header-actions { gap: 3px; }
  .theme-toggle, .music-toggle, .install-toggle { padding: 5px 6px; font-size: 8px; }
  .nav-toggle { width: 28px; height: 28px; gap: 4px; }
  .nav-toggle span { height: 1.2px; }

  .hero h1 { font-size: clamp(32px, 12vw, 48px); }

  .welcome-wordmark .wm-word { font-size: clamp(26px, 10vw, 34px); }
  .welcome-mascot-wrap { width: min(130px, 42vw, 20vh); }
  .welcome-install-cta { font-size: 9px; padding: 10px 14px; }
  .welcome-enter { font-size: 10px; padding: 14px 16px; }

  .pd-title { font-size: 24px; }
  .pd-price strong { font-size: 20px; }
  .pd-size-chip { padding: 10px 12px; font-size: 10px; min-width: 44px; }
}

/* ============================================================
   TOUCH-ONLY TRIMS
   Disable things that only make sense on hover
   ============================================================ */
@media (hover: none), (pointer: coarse) {
  .hero-spotlight,
  .runway-floor,
  .welcome-mascot-shine,
  .card-shine,
  .page-grain {
    animation: none !important;
  }
  .card-shine { display: none; }
  .product-card:hover { transform: none; }
  .product-card:hover .product-image-wrap img { transform: none; }
  .magnetic { transform: none !important; }
  .gallery-nav { display: flex !important; } /* keep arrows visible on touch */
  .pd-nav { opacity: 1 !important; }
  .archive-mark { opacity: .55; }
  body.is-returning .archive-mark { opacity: .75; }
  /* Restore tap states */
  .product-card:active { transform: scale(.99); }
  .button:active,
  .welcome-enter:active,
  .pd-order:active,
  .pd-share:active { transform: scale(.98); }
}

/* ============================================================
   LANDSCAPE PHONE — short viewport
   ============================================================ */
@media (max-width: 900px) and (orientation: landscape) {
  .welcome-screen { padding-top: 12px; }
  .welcome-mascot-wrap { width: min(140px, 22vh, 30vw); }
  .welcome-wordmark .wm-word { font-size: clamp(24px, 6vw, 34px); }
  .hero { padding: 10px 0; }
  .hero h1 { font-size: clamp(36px, 8vw, 56px); }
  .mascot-stage { width: min(180px, 38vh); }
  .manifesto-section { padding: 50px 20px; }
  .exit-section { padding: 50px 22px; }
}