.product-turntable {
  --board-gutter: max(28px, calc((100% - var(--page)) / 2));
  --board-top-space: clamp(6px, 1.1svh, 14px);
  --board-controls-height: 44px;
  --board-stage: clamp(310px, calc(100svh - var(--header) - var(--board-controls-height) - 16px), 840px);
  --chapter-space: clamp(56px, 8vw, 116px);
  --reading-measure: 54ch;
  display: grid;
  grid-template: "intro board" auto "details board" 1fr /
    minmax(0, 1fr) minmax(0, 1.12fr);
  align-items: start;
  column-gap: clamp(28px, 4vw, 64px);
  padding: clamp(12px, 2svh, 24px) var(--board-gutter) 0;
}

.header-over-photo .product-turntable {
  position: relative;
  isolation: isolate;
  padding-block-start: calc(var(--header) + var(--board-top-space));
}

body:has(.product-turntable)::after {
  opacity: .025;
}

.product-turntable > .product-hero.product-hero-photo {
  grid-area: intro;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: clamp(42px, 15svh, 154px) 0 0;
  overflow: visible;
}

.product-turntable > .product-hero.photo-fade-hero {
  position: static;
  min-height: 0;
  isolation: auto;
  background: transparent;
}

.product-turntable .photo-fade-hero > .product-atmosphere {
  inset: 0 0 auto;
  height: clamp(640px, 96svh, 950px);
  pointer-events: none;
}

.product-turntable .photo-fade-hero > .product-atmosphere::after {
  background:
    var(--photo-header-scrim),
    radial-gradient(ellipse 45% 52% at 18% 51%, #f8f6effc 16%, #f8f6efe8 41%, #f8f6ef7a 70%, transparent 100%),
    radial-gradient(ellipse 33% 55% at 72% 58%, var(--product-stage-light, #f8f6efb8) 11%, var(--product-stage-haze, #f8f6ef61) 60%, transparent 100%);
}

.product-hero-crest { --photo-hero-focus: center 72%; }
.product-hero-dark-key { --product-stage-light: #f8f6efdd; --product-stage-haze: #f8f6ef92; }
.product-hero-payday { --photo-hero-focus: 61% 55%; }
.product-hero-smooth { --photo-hero-focus: center 61%; }
.product-hero-thrive { --photo-hero-focus: 57% center; }

.product-turntable .product-copy {
  max-width: none;
}

.product-turntable .product-copy h1 {
  margin-block: 10px 19px;
  font-size: clamp(3.55rem, 8.1vw, 8rem);
  font-weight: 400;
  line-height: .93;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.product-turntable .product-lede {
  max-width: 29ch;
  margin-bottom: 0;
  font-size: clamp(1.12rem, 1.65vw, 1.55rem);
  line-height: 1.38;
  text-wrap: pretty;
}

.product-detail-flow {
  --story-image-height: clamp(21rem, 77cqw, 33rem);
  grid-area: details;
  min-width: 0;
  container-type: inline-size;
  isolation: isolate;
}

.product-summary {
  display: grid;
  align-content: start;
  gap: clamp(28px, 4.2svh, 46px);
  min-height: clamp(280px, 40svh, 380px);
  padding-block: clamp(21px, 3.2svh, 38px) 56px;
}

.product-summary > :is(.product-primary-action, .product-specs) {
  grid-area: auto;
}

.product-turntable .product-primary-action {
  gap: 14px;
}

.product-turntable .product-starting-price {
  gap: 3px;
}

.product-turntable .product-starting-price > span {
  color: var(--rust);
  font-weight: 650;
}

.product-turntable .product-starting-price strong {
  font-size: clamp(2.35rem, 3.85vw, 3.45rem);
  line-height: 1;
  font-weight: 650;
}

.product-turntable .product-specs {
  grid-template-columns: minmax(0, 1.22fr) minmax(0, .82fr) minmax(0, 1fr);
  gap: 0 clamp(12px, 1.6vw, 24px);
  align-self: start;
  padding-block-start: 14px;
  border: 0;
  border-top: 1px solid var(--line);
}

.product-turntable .product-specs > div,
.product-turntable .product-specs > div + div {
  padding: 0;
  border: 0;
}

.product-turntable .product-specs strong {
  overflow-wrap: anywhere;
}

.product-turntable > .product-board-slider {
  grid-area: board;
  align-self: start;
  min-width: 0;
  gap: 0;
  position: sticky;
  top: clamp(12px, 2.8svh, 32px);
  z-index: 2;
}

.product-turntable .product-board-stage {
  height: var(--board-stage);
  min-height: 0;
  isolation: isolate;
  background: transparent;
}

.product-turntable .product-board-stage::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 53% 49%, rgb(255 255 255 / .64), transparent 66%);
  content: "";
  pointer-events: none;
}

.board-narrative-light {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  visibility: hidden;
  background: radial-gradient(ellipse at 51% 51%, rgb(129 171 178 / .4), rgb(167 199 202 / .18) 43%, transparent 71%);
  pointer-events: none;
}

.product-turntable[data-board-mode="scroll"] .board-narrative-light {
  visibility: visible;
}

.product-turntable .product-board-slide img {
  padding: 10px;
  filter: saturate(1.1) drop-shadow(9px 13px 13px #34291b40);
}

.product-turntable .product-board-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  min-height: var(--board-controls-height);
  border: 0;
}

.product-turntable .product-board-switch button {
  position: relative;
  width: 44px;
  height: var(--board-controls-height);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.product-turntable .product-board-switch button:not([hidden]) {
  display: grid;
  place-items: center;
}

.product-turntable .product-board-switch button[aria-pressed="true"] {
  background: transparent;
  color: var(--paper-light);
}

.product-board-switch button::before {
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  content: "";
}

.product-board-switch button[aria-pressed="true"]::before { background: var(--ink); }

.product-turntable .product-board-switch button:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: -2px;
}

.product-turntable .product-board-switch svg {
  position: relative;
  width: 20px;
  height: 20px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
  pointer-events: none;
}

@media (hover: hover) {
  .product-turntable .product-board-switch button[aria-pressed="false"]:hover { background: transparent; }
  .product-board-switch button[aria-pressed="false"]:hover::before { background: var(--accent); }
}

.product-board-interaction {
  position: absolute;
  z-index: 3;
  inset: 8% 10%;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}

.product-board-interaction.is-grabbing { cursor: grabbing; }

.product-board-interaction:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 5px;
}

.product-turntable .product-board-render {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(9px 13px 13px #34291b42);
}

.product-board-render canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.product-turntable.is-shape-ready .product-board-render {
  opacity: 1;
}

.product-turntable.is-shape-ready .product-board-slide.is-active {
  opacity: 0;
}

.product-detail-flow > :is(.product-story, .product-photo-statement, .product-gallery-shell, .product-sizing, .shop-stock-section) {
  width: 100%;
  padding-inline: 0;
}

.product-detail-flow :is(.product-story, .product-sizing, .shop-stock-section) {
  border-top: 1px solid var(--line);
}

.product-detail-flow .product-story {
  grid-template: "words" auto "closeup" auto / minmax(0, 1fr);
  gap: clamp(34px, 6cqw, 62px);
  padding-block: var(--chapter-space);
}

.product-detail-flow .product-story > div:last-child {
  grid-area: words;
  min-width: 0;
}

.product-detail-flow .product-story h2 {
  max-width: 20ch;
  margin: 0 0 clamp(20px, 4.5cqw, 36px);
  font-size: clamp(2rem, 7.35cqw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.026em;
  text-wrap: balance;
}

.product-detail-flow .product-story > div:last-child > p {
  max-width: var(--reading-measure);
  margin-block: 16px 0;
  line-height: 1.62;
  text-wrap: pretty;
}

.product-detail-flow .product-story .product-deep-copy {
  padding-inline: 0;
  border: 0;
}

.product-detail-flow .product-story aside {
  max-width: var(--reading-measure);
  margin-top: 32px;
  padding-inline: 0;
  background: none;
}

.product-detail-flow .product-story .section-rail-board {
  grid-area: closeup;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  justify-self: stretch;
  align-self: start;
}

.product-detail-flow .product-story-image {
  block-size: var(--story-image-height);
  aspect-ratio: auto;
}

.product-detail-flow .product-tech-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(16px, 4cqw, 36px);
  margin-top: clamp(27px, 5cqw, 42px);
  border: 0;
}

.product-detail-flow .product-tech-grid > div {
  min-height: 0;
  padding: 11px 0 15px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.product-detail-flow .product-tech-grid dd {
  margin-top: 5px;
  font: 500 .91rem/1.4 var(--font-body);
}

.product-detail-flow .product-photo-statement {
  position: relative;
  isolation: isolate;
  min-height: 0;
  margin-block: 0;
  background: var(--forest);
  grid-template: "image" minmax(var(--story-image-height), auto) / minmax(0, 1fr);
  align-items: end;
  gap: 0;
}

.product-detail-flow .product-photo-statement figure {
  position: absolute;
  inset: 0;
  min-height: 0;
  aspect-ratio: auto;
  margin: 0;
  z-index: -1;
}

.product-detail-flow .product-photo-statement figure::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(0deg, rgb(13 24 23 / .92), rgb(13 24 23 / .73) 35%, rgb(13 24 23 / .55) 68%, rgb(13 24 23 / .1)),
    linear-gradient(90deg, rgb(13 24 23 / .18), transparent 90%);
  content: "";
  pointer-events: none;
}

.product-detail-flow .product-photo-statement .photo-story-copy {
  grid-area: image;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: clamp(24px, 7cqw, 56px);
  align-self: end;
  justify-self: start;
  color: #fff;
}

.product-detail-flow .product-photo-statement .photo-story-copy h2 {
  max-width: 17ch;
  margin-block: 0 10px;
  color: inherit;
  font-size: clamp(2.05rem, 6.75cqw, 4rem);
  line-height: 1.025;
  letter-spacing: -.026em;
  text-wrap: balance;
}

.product-detail-flow .product-photo-statement .photo-story-copy p {
  max-width: 41ch;
  color: inherit;
  line-height: 1.48;
  text-wrap: pretty;
}

@container (max-width: 19rem) {
  .product-detail-flow .product-photo-statement .photo-story-copy {
    padding: 20px 18px;
  }

  .product-detail-flow .product-photo-statement .photo-story-copy h2 {
    font-size: 1.8rem;
  }

  .product-detail-flow .product-photo-statement .photo-story-copy p {
    font-size: 1rem;
  }
}

.product-detail-flow .product-shape-plan {
  padding-block-start: var(--chapter-space);
}

.product-shape-plan h2 + p {
  margin-block-start: 8px;
  color: var(--muted);
  text-wrap: pretty;
}

.product-shape-plan figure {
  margin: clamp(8px, 2cqw, 16px) 0 0;
}

.product-shape-plan img {
  display: block;
  width: 100%;
  height: auto;
}

.product-shape-plan figcaption {
  color: var(--ink-soft);
  font: .85rem/1.45 var(--font-body);
}

.product-shape-plan-measurements {
  display: block;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.product-detail-flow .product-gallery-shell,
.product-detail-flow .product-gallery,
.product-detail-flow .product-sizing,
.product-detail-flow .shop-stock-section {
  background: transparent;
}

.product-detail-flow .product-gallery-shell {
  padding-block-start: var(--chapter-space);
}

.product-detail-flow .product-gallery,
.product-detail-flow .product-gallery-heading {
  width: 100%;
  padding-inline: 0;
}

.product-detail-flow .product-gallery {
  --masonry-gap: clamp(5px, 1.15cqw, 9px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-block-end: var(--chapter-space);
}

.product-detail-flow .product-gallery figure:not(.is-featured, .is-landscape) figcaption {
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  font-size: .68rem;
}

.product-detail-flow .product-gallery-heading {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding-block-end: clamp(18px, 4cqw, 32px);
}

.product-detail-flow :is(.product-shape-plan, .product-gallery-heading, .size-chart-intro, .shop-stock-heading) h2 {
  max-width: 18ch;
  font-size: clamp(2.05rem, 6.05cqw, 3.8rem);
  line-height: 1;
  letter-spacing: -.026em;
  text-wrap: balance;
}

.product-detail-flow .product-sizing {
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-block: var(--chapter-space);
}

.product-detail-flow .size-chart-intro {
  position: static;
}

.product-detail-flow .size-chart-intro h2 {
  margin-block-end: 12px;
}

.product-detail-flow .size-table {
  min-width: 0;
  table-layout: fixed;
}

.product-detail-flow .size-table thead th {
  padding-inline: 0 6px;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.product-detail-flow .size-table tbody :is(th, td),
.product-detail-flow .size-table tbody tr:hover > * {
  padding-inline: 0 6px;
}

.product-detail-flow .size-table tbody td {
  font-family: var(--font-body);
  font-size: .81rem;
  letter-spacing: 0;
}

.product-detail-flow .size-table :is(thead th:last-child, .size-cart-cell) {
  width: 49px;
  padding-inline-end: 0;
}

.product-detail-flow .size-cart-link:focus-visible {
  outline-offset: -4px;
}

.product-detail-flow .shop-stock-section {
  margin-inline: 0;
  padding-block: clamp(36px, 8cqw, 70px);
  color: var(--ink);
}

@media (min-width: 45.01rem) and (min-height: 34rem) {
  .product-detail-flow .shop-stock-section {
    min-block-size: calc(var(--board-stage) + 116px);
  }
}

.product-detail-flow .shop-stock-heading {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.product-detail-flow .shop-stock-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row;
  margin: 0;
  padding-inline: 0;
}

.product-detail-flow .shop-stock-card {
  color: var(--paper-light);
}

.product-detail-flow :is(.shop-stock-heading > p, .shop-stock-footer > p, .shop-stock-unavailable) {
  color: var(--muted);
}

.product-detail-flow :is(.shop-stock-heading, .shop-stock-footer) {
  border-color: var(--line);
}

@media (prefers-reduced-motion: no-preference) {
  .product-turntable .product-board-render,
  .product-turntable .product-board-slide {
    transition: opacity 230ms var(--ease);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .product-turntable .product-board-slide img {
    transition: transform 260ms var(--motion-out);
  }

  .product-turntable:not(.is-shape-ready) .product-board-stage:hover .product-board-slide.is-active img {
    transform: translateY(-3px) scale(1.02);
  }
}

@media (min-width: 80rem) and (min-height: 61rem) {
  .product-turntable > .product-board-slider {
    container-type: inline-size;
  }

  .product-turntable .product-board-stage {
    /* Match the renderer's minimum aspect ratio so a taller frame still enlarges the board. */
    height: min(
      calc(100svh - var(--header) - var(--board-top-space) - var(--board-controls-height) - 8px),
      calc(100cqw / .47)
    );
  }
}

@media (max-width: 63.99rem) {
  .product-turntable {
    --board-gutter: max(24px, calc((100% - var(--page)) / 2));
    --board-stage: clamp(310px, calc(100svh - var(--header) - var(--board-controls-height) - 32px), 722px);
    grid-template-columns: minmax(0, 1fr) minmax(0, .98fr);
  }

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

@media (max-width: 45rem) {
  .product-turntable {
    --board-gutter: 20px;
    --board-stage: var(--product-mobile-stage);
    --chapter-space: clamp(43px, 12vw, 60px);
    display: block;
    padding-block-start: 14px;
  }

  .product-turntable > .product-hero.product-hero-photo {
    padding-block-start: 7px;
  }

  .header-over-photo .product-turntable {
    padding-block-start: var(--header);
  }

  .product-turntable > .product-hero.photo-fade-hero {
    position: relative;
    padding-block-start: clamp(22px, 4.5svh, 42px);
  }

  .product-turntable .photo-fade-hero > .product-atmosphere {
    inset: calc(-1 * var(--header)) calc(-1 * var(--board-gutter)) -10px;
    height: auto;
  }

  .product-turntable .photo-fade-hero > .product-atmosphere::after {
    background:
      linear-gradient(180deg, transparent calc(var(--header) - 10px), #f8f6efe6 calc(var(--header) + 22px), #f8f6eff2 calc(var(--header) + 60px), var(--paper) 93%),
      var(--photo-header-scrim);
  }

  .product-turntable .product-hero-crest > .product-atmosphere img {
    position: absolute;
    inset-block-end: 0;
    height: 145%;
  }

  .product-turntable .product-copy h1 {
    margin-block: 5px 7px;
    font-size: clamp(3rem, 12vw, 5.4rem);
  }

  .product-turntable > .product-board-slider {
    top: 0;
    width: calc(100% + 2 * var(--board-gutter));
    justify-self: stretch;
    margin: 4px calc(-1 * var(--board-gutter)) 0;
    background: var(--paper-grain) var(--paper);
    box-shadow: 0 10px 20px -17px rgb(24 42 43 / .48);
  }

  .product-turntable .product-board-slide img {
    padding: 7px;
  }

  .product-summary {
    min-height: 0;
    padding-block: 14px 39px;
  }

  .product-turntable .product-starting-price {
    display: grid;
    grid-template-columns: max-content max-content;
    align-items: baseline;
    gap: 3px 9px;
  }

  .product-turntable .product-starting-price small {
    grid-column: 1 / -1;
  }

  .product-detail-flow .size-table tbody th {
    font-size: clamp(1.3rem, 6vw, 1.68rem);
    white-space: normal;
  }

  .product-detail-flow .size-table tbody td {
    font-size: .73rem;
    white-space: normal;
  }
}

@media (max-width: 22rem) {
  .product-turntable {
    --board-gutter: 16px;
  }

  .product-turntable[data-shape-scene="double-trouble"] .product-copy h1 {
    font-size: max(2.35rem, 12vw);
  }
}

@media (max-width: 45rem) {
  html:has(.product-turntable) {
    --product-mobile-stage: clamp(215px, 41svh, 378px);
  }
}

@media (max-width: 45rem) and (min-height: 34rem) and (prefers-reduced-motion: no-preference) {
  html:has(.product-turntable) {
    scroll-padding-top: calc(var(--product-dock-height, var(--product-mobile-stage) + 44px) + 12px);
  }
}

@media (max-width: 45rem) and (prefers-reduced-motion: reduce) {
  html:has(.product-turntable) {
    --product-mobile-stage: clamp(215px, 43svh, 394px);
  }

  .product-turntable > .product-board-slider {
    position: static;
    box-shadow: none;
  }
}

@media (max-height: 33.99rem), print {
  .product-turntable > .product-board-slider {
    position: static;
  }
}
