/* Phase one: hero and Momento only. Desktop saved geometry stays authoritative. */
.memento-items {
  display: contents;
}
.compact-card-caption {
  display: none;
}
.compact-feature-nav {
  display: none;
}
.compact-momento-title {
  display: none;
}
@media (max-width: 1199px) {
  .intro-hero .hero-films {
    max-height: none;
    max-width: 540px !important;
    aspect-ratio: 1.13;
  }
  .intro-hero .hero-title {
    padding: 0;
  }
  .intro-hero .calendar-sheet {
    left: 0;
    right: auto;
    top: 12%;
  }
  .intro-hero .time-sheet {
    left: auto;
    right: 0;
    top: 0;
  }
  .intro-hero .film-sheet {
    max-width: none;
  }
}
@media (max-width: 767px) {
  #product > .polaroid-chapter,
  #product > .polaroid-chapter.sip-story-ready {
    margin-block-start: 40px;
    display: block;
  }
  .polaroid-chapter .memento-scroll-track {
    height: auto !important;
    position: relative;
  }
  .polaroid-chapter .memento-stage {
    position: relative;
    top: 0;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 0 32px;
  }
  .polaroid-chapter .memory-bridge-header,
  .polaroid-chapter .memento-opening {
    display: contents;
    translate: none;
    transform: none !important;
  }
  .polaroid-chapter .sip-entry-anchor {
    position: absolute;
    top: 0;
    height: 500px;
    width: 100%;
    scroll-margin-top: 108px;
  }
  .polaroid-chapter .sip-cue-motion {
    order: 0;
    position: relative;
    top: auto;
    left: auto;
    width: calc(100% - 48px);
    max-width: 640px;
    margin: 0 auto 40px;
    z-index: 10;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: none;
  }
  .polaroid-chapter .memory-bridge-cue {
    max-width: 100%;
    width: 100% !important;
    padding: 0;
    font-size: 28px !important;
    line-height: 1.25 !important;
    transform: rotate(2deg) !important;
  }
  .polaroid-chapter .hero-log-link {
    pointer-events: auto;
  }
  .polaroid-chapter .compact-momento-title {
    display: block;
    order: 3;
    width: calc(100% - 48px);
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    font:
      700 28px/35px "Courier Prime",
      monospace;
    letter-spacing: 0.6px;
    color: var(--gold);
    transform: rotate(-2deg);
  }
  .polaroid-chapter .sip-sticker-window {
    order: 1;
    position: relative;
    inset: auto;
    display: grid;
    place-items: center;
    height: 320px;
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }
  .polaroid-chapter .memory-sticker-motion {
    position: relative;
    left: auto;
    top: auto;
    transform-origin: center;
  }
  .polaroid-chapter .memory-sticker {
    width: 176px !important;
    transform: rotate(-9deg) !important;
  }
  .polaroid-chapter .memory-bridge {
    order: 2;
    position: relative;
    inset: auto;
    display: block;
    width: calc(100% - 56px);
    max-width: 560px;
    min-height: 0;
    height: auto;
    padding: 0;
    margin: 16px auto 110px;
  }
  .polaroid-chapter .memory-bridge-copy {
    position: static;
    width: 100%;
    opacity: 1 !important;
    transform: none !important;
    transition: none;
    animation: none;
  }
  .polaroid-chapter .memory-bridge-title {
    font-size: 20px !important;
    line-height: 28px !important;
    width: 100% !important;
    transform: rotate(-2deg) !important;
  }
  .polaroid-chapter :is(.memento-pocket-back, .memento-pocket-front) {
    display: none;
  }
  .polaroid-chapter .memento-items {
    order: 4;
    display: flex;
    position: relative;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
    padding: 64px
      calc((100% - var(--compact-paper-width, min(240px, 48vw))) / 2) 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: calc(
      (100% - var(--compact-paper-width, min(240px, 48vw))) / 2
    );
    overscroll-behavior-x: contain;
    isolation: isolate;
    scrollbar-width: none;
  }
  .polaroid-chapter .memento-items::-webkit-scrollbar {
    display: none;
  }
  .polaroid-chapter .memento-card {
    --card-width: var(--compact-paper-width, min(240px, 48vw));
    position: relative;
    left: auto;
    top: auto;
    flex: 0 0 var(--card-width);
    width: var(--card-width) !important;
    aspect-ratio: auto;
    opacity: 1 !important;
    transform: rotate(-3deg) !important;
    scroll-snap-align: center;
    will-change: auto;
  }
  .polaroid-chapter .diary-card {
    order: 2;
    transform: rotate(3deg) !important;
  }
  .polaroid-chapter .keepsake-card {
    order: 1;
    transform: rotate(-1deg) !important;
    pointer-events: auto;
    margin-top: 24px;
  }
  .polaroid-chapter .memento-face {
    aspect-ratio: 318/424;
    height: auto;
  }
  .polaroid-chapter .memento-photo {
    flex: none;
    aspect-ratio: 270/320;
  }
  .polaroid-chapter .memento-meta {
    height: auto;
  }
  .polaroid-chapter .compact-card-caption {
    display: block;
    order: 4;
    margin: 16px auto 24px;
    min-height: 44px;
    text-align: center;
    font:
      400 16px/22px "Courier Prime",
      monospace;
    color: #8a7c78;
  }
  .polaroid-chapter .memento-palette {
    top: calc(var(--card-width) * 424 / 318 - 12px);
    gap: 0;
    justify-content: space-between;
  }
  .polaroid-chapter .memento-palette button {
    width: calc(var(--card-width) / 6);
    height: 44px;
  }
  /* Cream inherits the desktop silhouette and soft shadow without a gray rim. */
  .polaroid-chapter .memento-palette button:not([data-color="#FDFBF7"]) {
    filter: none;
  }
  .polaroid-chapter .memento-palette button span {
    inset: 6px 3px;
  }
  .polaroid-chapter .color-face {
    touch-action: auto;
    transform: translateY(var(--card-lift, -24px));
    transition:
      transform 0.3s,
      background-color 0.2s;
  }
  .polaroid-chapter :is(.memento-caption, .memento-scroll-hint) {
    display: none;
  }
  .polaroid-chapter .memento-live-badge {
    width: 30px;
    height: 30px;
    padding: 5px;
  }
  .polaroid-chapter .memento-demo-note {
    font-size: 16px;
    line-height: 22px;
  }
  .polaroid-chapter .compact-feature-nav {
    order: 5;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    gap: 0;
  }
  .compact-feature-nav button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 44px;
    border: 0;
    background: none;
    padding: 0;
  }
  .compact-feature-nav button span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c4bcb8;
    transition:
      width 0.2s,
      background 0.2s;
  }
  .compact-feature-nav button[aria-pressed="true"] span {
    width: 22px;
    border-radius: 6px;
    background: var(--gold);
  }
}
@media (max-width: 767px) {
  .intro-hero {
    padding-bottom: 48px !important;
  }
  .intro-hero .hero-title h1 {
    -webkit-text-stroke: 2px #fff;
  }
  .intro-hero .hero-films {
    width: 100%;
    max-width: 430px !important;
    margin: 0;
  }
  #product > .polaroid-chapter {
    margin-block-start: 48px;
  }
  .polaroid-chapter .sip-cue-motion {
    max-width: 340px;
    margin-bottom: 24px;
  }
  .polaroid-chapter .memory-bridge-cue,
  .polaroid-chapter .compact-momento-title {
    font-size: 24px !important;
    line-height: 30px !important;
    letter-spacing: 0 !important;
  }
  .polaroid-chapter .sip-sticker-window {
    height: 280px;
  }
  .polaroid-chapter .memory-sticker {
    width: 160px !important;
    /* The SVG owns the phone shadow with an explicitly expanded filter area. */
    filter: none;
  }
  .polaroid-chapter .memory-sticker-art {
    overflow: visible;
  }
  .polaroid-chapter .memory-sticker-shadow {
    filter: var(--cup-shadow-filter);
  }
  .polaroid-chapter .memory-sticker-art > img {
    /* Static fallback before the SVG animation takes over. */
    filter: drop-shadow(0 8px 10px #3e27231a);
  }
  .polaroid-chapter .memory-bridge {
    margin: 24px auto 88px;
    max-width: 350px;
  }
  .polaroid-chapter .memory-bridge-title {
    font-size: 18px !important;
    line-height: 25px !important;
    letter-spacing: 0 !important;
  }
  .polaroid-chapter .memento-items {
    gap: 24px;
  }
  .polaroid-chapter .memento-face {
    /* One soft paper shadow at phone scale, without a second offset contour. */
    box-shadow: 0 8px 20px #3e27231a;
  }
  .navigation-bar {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }
  .navigation nav {
    gap: 12px;
  }
  .navigation-bar button {
    min-width: 44px;
    min-height: 44px;
  }
  #product > .polaroid-chapter {
    margin-bottom: 96px;
  }
}
