/* index.html: single-viewport landing page for The Hurma Jeans.
   Desktop never scrolls: html/body are locked to the viewport height and
   the brand story lives inside the #storyOverlay dialog. Mobile scrolls as
   a normal page with the "Sign up for presale" button pinned to the bottom
   of the screen.
   Uses the shared --bg/--text/--muted/--border tokens. White theme only
   (same palette as privacy.html / faq.html); <html> carries
   data-theme="light" for the cookie banner and sign-up popup. */

/* Roboto is loaded by a <link> in index.html (an @import here
   would delay it until this file downloads). */

:root {
  --bg: #ebe8e2;
  --text: #1a1a1a;
  --muted: #666666;
  /* Dimmer secondary text that still meets WCAG AA (4.5:1) on --bg. */
  --faint: #616161;
  --border: #c4c0b7;
  --section-bg: rgba(0, 0, 0, 0.03);
  --input-bg: #f3f1ed;
  --input-border: #ada99f;
  --danger: #c62828;
  /* Main button (and the sign-up popup's accent, see signup.css). */
  --accent: #000000;
  --on-accent: #ffffff;
  /* Fully transparent --bg, for the fade above the pinned button bar. */
  --bg-fade: rgba(235, 232, 226, 0);
  --overlay-bg: #ebe8e2;
  /* Instagram / TikTok icons are white artwork, so they're inverted. */
  --icon-filter: invert(1);
  --font-display: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

/* ---------- Main split ---------- */
.ps-main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 52svh 1fr;
}

@media (min-width: 900px) {
  .ps-main {
    grid-template-columns: 60% 1fr;
    grid-template-rows: 1fr;
  }
}

/* ---------- Hero panel (left) ---------- */
/* Looping video over its poster frame; the poster background shows while it
   loads, if autoplay is blocked (e.g. iOS Low Power Mode) and for reduced motion. */
.ps-hero {
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: #000 url("../branding/hero3-poster.webp") center / cover no-repeat;
}

.ps-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* iOS draws a play button when autoplay is blocked (Low Power Mode); leave
   just the poster instead. */
.ps-hero-video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

@media (prefers-reduced-motion: reduce) {
  .ps-hero-video {
    display: none;
  }
}

/* ---------- Commerce panel ---------- */
.ps-panel {
  grid-row: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 20px calc(16px + var(--safe-bottom)) 20px;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

@media (min-width: 900px) {
  .ps-panel {
    grid-row: 1;
    grid-column: 2;
    border-top: none;
    border-left: 1px solid var(--border);
    /* Top padding clears the fixed header (64px). */
    padding: 84px 32px 20px;
    /* "safe" pins content to the top rather than clipping the story line
       if it is ever taller than the panel. */
    justify-content: safe center;
  }
}

.ps-story-line {
  display: none;
}

@media (min-width: 900px) {
  .ps-story-line {
    display: block;
    font-size: 11px;
    letter-spacing: 0.6px;
    color: var(--muted);
    margin-bottom: 10px;
    min-height: 16px;
    text-align: center;
  }
}

/* "Read the story" sits right after the product name on desktop (mobile has
   its own trigger link). */
#readStoryBtn {
  display: none;
}

@media (min-width: 900px) {
  .ps-title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 14px;
  }

  .ps-title-row .ps-product-price {
    flex-basis: 100%;
  }

  #readStoryBtn {
    display: inline-block;
    background: none;
    border: 0;
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: 0.6px;
    padding: 0;
  }
}

/* ---------- Model set switcher: [ Name | Name ] ---------- */
.ps-set-switch {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Three-column grid keeps the "|" dead centre (under the gap between the two
   photos); no brackets. */
.ps-set-switch {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.ps-set-switch button:first-of-type {
  justify-self: end;
}

.ps-set-switch button:last-of-type {
  justify-self: start;
}

.ps-set-switch-sep {
  opacity: 0.6;
}

.ps-set-switch button {
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--muted);
  padding: 6px 4px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ps-set-switch button:hover,
.ps-set-switch button:focus-visible {
  color: var(--text);
}

.ps-set-switch button[aria-pressed="true"] {
  color: var(--text);
  font-weight: 700;
}

.ps-set-switch button:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 2px;
}

/* ---------- Model tiles ---------- */
.ps-model-tiles {
  display: flex;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.25s ease;
}

.ps-model-tiles.is-fading {
  opacity: 0;
}

.ps-model-tile {
  aspect-ratio: 4 / 5;
  position: relative;
  min-width: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}

.ps-model-tile:hover,
.ps-model-tile:focus-visible {
  border-color: var(--muted);
}

.ps-model-tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ps-model-tile-placeholder {
  padding: 8px;
  text-align: center;
}

/* Mobile: tiles sit below the name/price inside the scrolling panel, so
   those stay first and the pinned button bar is unaffected. */
@media (max-width: 899px) {
  .ps-set-switch,
  .ps-model-tiles,
  .ps-story-trigger-mobile {
    order: 1;
  }

  .ps-buy-bar {
    order: 2;
  }

  .ps-set-switch {
    margin-top: 2px;
  }

  .ps-model-tiles {
    margin-bottom: 10px;
  }

  .ps-model-tile {
    flex: 0 1 calc((100% - 8px) / 2);
    max-width: 200px;
  }

  .ps-story-trigger-mobile {
    align-self: center;
  }
}

@media (min-width: 900px) {
  /* The tiles show the photos uncropped at their native 4:5 ratio and are
     the only flexible item in the panel. max-height is the full-width
     size (two tiles across the panel's content box); on a viewport too
     short for that, the row gets shorter and each tile's width follows
     its height via aspect-ratio, so the photos scale down (centred).
     min-height keeps them visible on short windowed laptop screens. */
  .ps-model-tiles {
    flex: 1 1 0;
    min-height: 140px;
    max-height: calc((40vw - 64px - 8px) / 2 * 5 / 4);
    margin-bottom: 14px;
  }

  .ps-model-tile {
    flex: 0 1 auto;
    height: 100%;
  }
}

.ps-product-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
  margin-bottom: 6px;
}

/* The name is the Hurma Jeans lettering image; its height follows the old
   text size (1em of the clamp above, a touch smaller per breakpoint below). */
.ps-product-name img {
  display: block;
  height: 0.9em;
  width: auto;
  max-width: 100%;
}

.ps-product-price {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Price parts (styled by currency.js with opacity, which drops below AA):
   dim with --faint instead. The header region buttons do the same in
   site-header.css. */
.ps-product-price .price-was,
.ps-product-price .price-note {
  opacity: 1;
  color: var(--faint);
}

.ps-presale-line {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.ps-presale-line strong {
  color: var(--text);
  font-weight: 600;
}

.ps-terms-link {
  font-size: 10px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-block;
  margin-bottom: 16px;
}

.ps-terms-link:hover,
.ps-terms-link:focus-visible {
  color: var(--text);
}

.soldout-badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 2px;
  margin-bottom: 12px;
}

/* ---------- Colour swatches + size selector ---------- */
.ps-option-label {
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}

.ps-option-label span {
  color: var(--text);
  font-weight: 600;
}

.ps-colour-block {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 10px;
}

.ps-colour-block[hidden],
.ps-swatches[hidden] {
  display: none;
}

.ps-swatches {
  display: flex;
  gap: 8px;
}

/* Swatches are tiny product shots, so the black denim reads as black. */
.ps-swatch {
  position: relative;
  width: 40px;
  height: 52px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.ps-swatch img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ps-swatch:hover {
  border-color: var(--muted);
}

.ps-swatch[aria-checked="true"] {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.ps-swatch:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ~44px tap target. */
.ps-swatch::before {
  content: "";
  position: absolute;
  inset: -4px;
}

.size-block {
  margin-bottom: 10px;
}

.size-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.size-guide-link {
  font-size: 10px;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-underline-offset: 2px;
}

.size-guide-link:hover,
.size-guide-link:focus-visible {
  color: var(--text);
}

.size-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 6px;
}

.size-options.shake {
  animation: size-shake 0.4s ease;
}

@keyframes size-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .size-options.shake {
    animation: none;
  }
}

.size-btn {
  min-height: 40px;
  padding: 8px 4px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.size-btn:hover:not(:disabled) {
  border-color: var(--text);
}

.size-btn[aria-checked="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* Sold out: struck through but still selectable ("Notify me"). */
.size-btn.is-soldout {
  color: var(--faint);
  text-decoration: line-through;
  border-style: dashed;
}

.size-btn.is-soldout[aria-checked="true"] {
  background: var(--input-bg);
  color: var(--text);
  border-style: solid;
  border-color: var(--text);
}

/* Sold out, sold as made to order instead (buy-box.js, mtoTarget). */
.size-btn.is-mto,
.size-btn.is-mto:hover:not(:disabled) {
  border-color: var(--danger);
}

.size-btn.is-mto[aria-checked="true"] {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.size-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.size-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* The presale note under the price opens the sign-up. */
.ps-product-price .price-note-btn {
  color: var(--faint);
}

.ps-product-price .price-note-btn:hover,
.ps-product-price .price-note-btn:focus-visible {
  color: var(--text);
}

/* Product shots (cut-outs and close-ups) are shown whole, not cropped. */
.ps-model-tile-img.is-product {
  object-fit: contain;
  padding: 6px;
}

/* ---------- Buttons ---------- */
/* Buy now and Add to bag side by side; Add to bag is hidden for a sold-out
   size (Buy now becomes "Notify me" and takes the full width). */
.ps-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.ps-actions .btn[hidden] {
  display: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
}

.btn-outline:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
}

.btn {
  width: 100%;
  min-height: 46px;
  padding: 13px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status-line {
  min-height: 16px;
  font-size: 11px;
  color: var(--muted);
}

.status-line.status-alert {
  color: var(--danger);
}

/* Only used for a load error; no empty gap under the button otherwise. */
.status-line:empty {
  display: none;
}

/* Mobile: the whole page scrolls normally, while the button + status line
   stay pinned to the bottom of the screen (sticky inside the panel, which
   runs to the end of the page) so the Buy now button is always
   reachable. */
@media (max-width: 899px) {
  html,
  body {
    height: auto;
    min-height: 100svh;
    /* clip, not hidden: hidden would make body a scroll container and the
       sticky button bar would stick to it instead of the screen. */
    overflow: visible;
    overflow-x: clip;
  }

  html.ps-overlay-open,
  html.ps-overlay-open body {
    overflow: hidden;
  }

  .ps-main {
    grid-template-rows: 52svh auto;
  }

  .ps-panel {
    overflow: visible;
    padding-bottom: 0;
  }

  .ps-buy-bar {
    position: sticky;
    /* Lift above the cookie banner while it's showing (set by consent.js). */
    bottom: var(--ba-cookie-h, 0px);
    z-index: 1;
    margin-top: auto;
    padding-top: 4px;
    padding-bottom: calc(12px + var(--safe-bottom));
    background: var(--bg);
  }

  /* Fade above the bar hints that details scroll behind it. */
  .ps-buy-bar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 16px;
    background: linear-gradient(to bottom, var(--bg-fade), var(--bg));
    pointer-events: none;
  }
}

/* Phones in landscape: side-by-side split like desktop, otherwise the panel
   under the photo is shorter than the pinned button. */
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
  .ps-main {
    grid-template-columns: 50% 1fr;
    grid-template-rows: auto;
  }

  .ps-hero {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100svh;
  }

  /* Top padding clears the fixed header (56px). */
  .ps-panel {
    grid-row: 1;
    grid-column: 2;
    border-top: none;
    border-left: 1px solid var(--border);
    padding-top: 72px;
  }
}

/* Mobile: privacy/terms sit just above the company line at the end of the
   panel (the legal-entity footer is order 99). */
.ps-footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  order: 98;
  margin-top: 16px;
}

.ps-footer-links a {
  font-size: 9px;
  letter-spacing: 0.6px;
  color: var(--muted);
  text-decoration: none;
}

@media (min-width: 900px) {
  .ps-footer-links {
    justify-content: flex-start;
    order: 0;
    gap: 14px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .ps-footer-links a {
    font-size: 9px;
    letter-spacing: 0.6px;
    color: var(--muted);
    text-decoration: none;
  }

  .ps-footer-links a:hover,
  .ps-footer-links a:focus-visible {
    color: var(--text);
  }
}

/* Desktop compaction: tighter commerce block so the 4:5 model tiles fit
   at full size in a windowed browser (taskbar + browser chrome). */
@media (min-width: 900px) {
  .ps-product-name {
    font-size: clamp(28px, 3vw, 40px);
    margin-bottom: 4px;
  }

  .ps-product-price {
    margin-bottom: 6px;
  }

  .ps-presale-line {
    margin-bottom: 2px;
  }

  .ps-terms-link {
    margin-bottom: 12px;
  }

  .ps-actions {
    gap: 6px;
    margin-bottom: 6px;
  }

  .btn {
    min-height: 42px;
    padding: 11px;
  }

  .ps-footer-links {
    margin-top: 8px;
    padding-top: 8px;
  }

  /* Room to spare under the buttons (set by presale.js): stack them, larger. */
  .ps-panel.is-roomy .ps-actions {
    grid-auto-flow: row;
    gap: 10px;
    margin-bottom: 10px;
  }

  .ps-panel.is-roomy .btn {
    min-height: 52px;
    padding: 15px;
    font-size: 13px;
  }
}

/* Short desktop windows (laptops with browser chrome + taskbar): reflow the
   commerce block into fewer rows so the model tiles keep most of the height.
   Name + price share a row and the availability line sits on its own. */
@media (min-width: 900px) and (max-height: 800px) {
  .ps-panel {
    padding-top: calc(64px + 14px);
    padding-bottom: 14px;
    overflow-y: auto;
  }

  .ps-story-line {
    margin-bottom: 8px;
  }

  .ps-model-tiles {
    margin-bottom: 10px;
  }

  .ps-title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 14px;
    margin-bottom: 4px;
  }

  .ps-product-name {
    font-size: clamp(26px, 2.4vw, 34px);
    margin-bottom: 0;
  }

  .ps-product-price {
    margin-bottom: 0;
  }

  .ps-meta-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 10px;
    margin-bottom: 10px;
  }

  .ps-presale-line,
  .ps-terms-link {
    margin-bottom: 0;
  }

  .btn {
    min-height: 40px;
    padding: 10px;
  }
}

/* Very short desktop windows (e.g. a 1366x768 laptop, ~600px of viewport):
   trim the rows around the photos so the tiles get the height back. The
   caption and story link shrink a touch so they stay on one line. */
@media (min-width: 900px) and (max-height: 680px) {
  .ps-panel {
    padding-top: 66px;
    padding-bottom: 12px;
  }

  .ps-set-switch {
    margin-bottom: 4px;
  }

  .ps-set-switch button {
    padding: 3px 4px;
  }

  .ps-story-line,
  #readStoryBtn {
    font-size: 10px;
    letter-spacing: 0.4px;
  }

  .ps-story-line {
    margin-bottom: 6px;
  }

  .ps-swatch {
    width: 36px;
    height: 46px;
  }

  .ps-colour-block {
    margin-bottom: 8px;
  }

  .size-head {
    margin-bottom: 4px;
  }

  .size-btn {
    min-height: 36px;
    padding: 6px 4px;
  }

  .size-block,
  .ps-meta-row {
    margin-bottom: 8px;
  }

  .btn {
    min-height: 38px;
    padding: 9px;
  }
}

/* Mobile: a full-width outlined button above the photos opens the Story
   overlay (desktop uses "Read the story" on the caption row instead). */
.ps-story-trigger-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 408px;
  gap: 12px;
  min-height: 44px;
  padding: 8px 16px;
  margin-bottom: 10px;
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-align: left;
  text-transform: uppercase;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--text);
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ps-story-trigger-mobile span[aria-hidden] {
  font-size: 14px;
  transition: transform 0.2s ease;
}

.ps-story-trigger-mobile:active span[aria-hidden] {
  transform: translateX(3px);
}

.ps-story-trigger-mobile:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

@media (min-width: 900px) {
  .ps-story-trigger-mobile {
    display: none;
  }
}

/* ---------- Story overlay ---------- */
.ps-overlay {
  position: fixed;
  inset: 0;
  height: 100svh;
  /* Follow Safari's toolbar as it collapses, or the page shows underneath. */
  height: 100dvh;
  z-index: 100;
  display: none;
  background: var(--overlay-bg);
  color: var(--text);
  padding: max(16px, var(--safe-top)) max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
  flex-direction: column;
}

.ps-overlay.open {
  display: flex;
}

/* Colour swatches left, model switch truly centred, close pinned top right. */
.ps-overlay-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 14px;
}

.ps-overlay-header .ps-set-switch {
  margin: 0;
  order: 0; /* the mobile page layout gives .ps-set-switch order: 1 */
  justify-self: center;
}

.ps-overlay-swatches {
  grid-column: 1;
  justify-self: start;
}

.ps-overlay-header .ps-set-switch {
  grid-column: 2;
}

.ps-overlay-close {
  grid-column: 3;
  justify-self: end;
}

.ps-overlay-photos {
  transition: opacity 0.25s ease;
}

.ps-overlay-photos.is-fading {
  opacity: 0;
}

.ps-overlay-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

.ps-overlay-close:hover,
.ps-overlay-close:focus-visible {
  border-color: var(--text);
}

.ps-overlay-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  gap: 16px;
}

@media (min-width: 700px) {
  /* Photos get most of the width; the story is a narrow column. */
  .ps-overlay-body {
    grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
}

.ps-overlay-photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  min-height: 0;
}

.ps-overlay-photos img,
.ps-overlay-photos .ps-overlay-photo-placeholder {
  flex: 0 0 78%;
  scroll-snap-align: start;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--section-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.ps-overlay-photos img:nth-child(1) {
  object-position: 53% top;
}

.ps-overlay-photos img:nth-child(2) {
  object-position: 47% top;
}

/* Desktop: the first two photos side by side, uncropped at their native 4:5,
   no scrolling. With width/height auto, max-width + max-height scale each
   image down to whichever limit it hits first while keeping its ratio. Extra
   photos live in the album thumbnails beside the story instead. */
@media (min-width: 700px) {
  .ps-overlay-photos {
    overflow: hidden;
    scroll-snap-type: none;
    justify-content: center;
    align-items: flex-start;
  }

  .ps-overlay-photos img {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    max-width: calc(50% - 4px);
    max-height: 100%;
    object-fit: contain;
  }

  .ps-overlay-photos img:nth-child(n + 3) {
    display: none;
  }

  .ps-overlay-photos .ps-overlay-photo-placeholder {
    flex: 0 0 calc(50% - 4px);
  }

  .ps-overlay-story {
    font-size: 13px;
    line-height: 1.7;
  }

  .ps-overlay-story p:first-child {
    font-size: 18px;
  }
}

.ps-overlay-side {
  min-height: 0;
  overflow-y: auto;
}

.ps-overlay-story {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.ps-overlay-story p {
  margin-bottom: 14px;
}

.ps-overlay-story p:first-child {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.4;
}

.ps-specs-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  margin: 22px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.ps-specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.ps-specs dt {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding-top: 2px;
}

.ps-specs dd {
  color: var(--text);
}

.ps-overlay-footer {
  margin-top: 14px;
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ps-overlay-back {
  background: none;
  border: 1px solid var(--text);
  color: var(--text);
  padding: 10px 18px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.ps-loading,
.ps-error {
  padding: 14px 20px;
  font-size: 12px;
  color: var(--muted);
}

.ps-error a {
  color: var(--text);
  text-decoration: underline;
}

/* Footer: desktop gets a full-width bar under the split; mobile keeps the
   links, socials and company line at the end of the panel. */
.ps-site-footer {
  display: none;
}

.ps-panel > .ps-social--footer {
  order: 98;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}

.ps-social--footer img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.75;
  filter: var(--icon-filter);
}

.ps-social--footer a:hover img,
.ps-social--footer a:focus-visible img {
  opacity: 1;
}

@media (min-width: 900px) {
  .ps-panel > .ps-footer-links,
  .ps-panel > .ps-social--footer,
  .ps-panel > .legal-entity--presale {
    display: none;
  }

  .ps-site-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 32px calc(10px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    background: var(--bg);
    font-size: 10px;
    letter-spacing: 0.4px;
    color: var(--muted);
  }

  .ps-site-footer .ps-footer-links {
    margin: 0;
    padding: 0;
    border: 0;
    order: 0;
    flex: 0 0 auto;
  }

  .ps-site-footer-entity {
    margin: 0;
    flex: 1 1 auto;
    text-align: center;
  }

  .ps-site-footer-entity a {
    color: inherit;
    text-decoration: underline;
  }

  .ps-site-footer .ps-social--footer {
    flex: 0 0 auto;
    gap: 14px;
  }
}

@media (min-width: 900px) {
  #readStoryBtn {
    white-space: nowrap;
  }
}

/* Desktop: the hero column widens to the artwork's 3:2 shape (height of the
   screen x 1.5, the header sits over it) so it fills the column with little or no cropping and no bars,
   never below 60% and never leaving the product panel under 520px. */
@media (min-width: 900px) {
  .ps-main {
    grid-template-columns: clamp(60%, calc(100svh * 1.5), calc(100% - 520px)) 1fr;
  }
}

/* Desktop: the split fills the first screen and the footer sits below the
   fold; the page scrolls to reach it. */
@media (min-width: 900px) {
  html,
  body {
    height: auto;
    min-height: 100svh;
    overflow: visible;
    overflow-x: clip;
  }

  html.ps-overlay-open,
  html.ps-overlay-open body {
    overflow: hidden;
  }

  .ps-main {
    flex: 0 0 auto;
    height: 100svh;
  }

  .ps-site-footer {
    padding-top: 8px;
    padding-bottom: calc(8px + var(--safe-bottom));
    font-size: 9px;
  }

  .ps-site-footer .ps-social--footer img {
    width: 16px;
    height: 16px;
  }
}

/* Mobile: the story link sits above the photos and the JBIZ / SYLVIE switch
   below them (order only; DOM order is unchanged for desktop). */
@media (max-width: 899px) {
  .ps-panel > .ps-story-trigger-mobile {
    order: 1;
  }

  .ps-panel > .ps-model-tiles {
    order: 2;
  }

  .ps-panel > .ps-set-switch {
    order: 3;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .ps-panel > .ps-buy-bar {
    order: 4;
  }
}

/* Album thumbnails (desktop only): extra photos under the story; click opens
   the lightbox. */
.ps-overlay-album {
  display: none;
}

@media (min-width: 700px) {
  .ps-overlay-album {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 22px;
    padding-bottom: 4px;
  }

  .ps-overlay-album:empty {
    display: none;
  }

  .ps-album-thumb {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--section-bg);
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 4 / 5;
  }

  .ps-album-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.9;
    transition: opacity 0.2s ease;
  }

  .ps-album-thumb:hover img,
  .ps-album-thumb:focus-visible img {
    opacity: 1;
  }

  .ps-album-thumb:focus-visible {
    outline: 1px solid var(--text);
    outline-offset: 2px;
  }
}

.ps-overlay-photo-zoom {
  cursor: zoom-in;
}

/* "Questions? Read the FAQ" link at the end of the story overlay */
.ps-overlay-footer {
  align-items: center;
}

.ps-overlay-size-guide--mobile,
.ps-overlay-faq-link--mobile {
  display: none;
}

.ps-overlay-faq-link {
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: auto;
}

.ps-overlay-faq-link:hover,
.ps-overlay-faq-link:focus-visible {
  color: var(--text);
}

/* Phones: the story overlay scrolls as one page (full, uncropped photos, then
   the story underneath), while the header and the "Back to the jeans" footer
   stay pinned on screen. */
@media (max-width: 699px) {
  .ps-overlay-body {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .ps-overlay-photos {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .ps-overlay-photos img,
  .ps-overlay-photos .ps-overlay-photo-placeholder {
    flex: 0 0 auto;
    width: 86%;
    min-width: 0;
    height: auto;
    object-fit: contain;
  }

  .ps-overlay-photos .ps-overlay-photo-placeholder {
    aspect-ratio: 4 / 5;
  }

  .ps-overlay-side {
    overflow: visible;
  }

  .ps-overlay-size-guide--mobile {
    display: inline-block;
    margin-bottom: 16px;
  }

  .ps-overlay-size-guide--desktop,
  .ps-overlay-faq-link--desktop {
    display: none;
  }

  /* The FAQ link ends the scrolling story instead, so the pinned footer is
     a single row of buttons. */
  .ps-overlay-faq-link--mobile {
    display: inline-flex;
    margin-left: 0;
  }

  .ps-overlay-footer {
    flex: 0 0 auto;
    align-self: stretch;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 0;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  .ps-overlay-footer .ps-overlay-back {
    padding: 10px 12px;
    white-space: nowrap;
  }
}

/* The model photos are shot on pure white; multiply blends that white into
   the off-white page so they don't glare. */
.ps-model-tile-img,
.ps-overlay-photos img,
.ps-album-thumb img {
  mix-blend-mode: multiply;
}

/* Gallery photos with real backgrounds stay as shot. */
.ps-overlay-photos img.is-scene,
.ps-album-thumb img.is-scene {
  mix-blend-mode: normal;
}

