/*
 * Local comparison motion layer.
 * One transform owner remains in carousel-motion.js; this file only gives the
 * three directions a more deliberate reading-room material language.
 */

.prototype-page {
  background: #f4eee3;
}

.prototype-header {
  background: rgba(249, 246, 239, .96);
  border-bottom-color: rgba(67, 21, 29, .2);
  box-shadow: 0 6px 20px rgba(46, 13, 19, .06);
}

.prototype-header__inner {
  min-height: 70px;
}

.prototype-nav a {
  color: var(--burgundy);
}

.prototype-hero {
  background:
    linear-gradient(112deg, rgba(46, 13, 19, .98), rgba(67, 21, 29, .88) 58%, rgba(82, 43, 31, .92)),
    url('/assets/hero-botanical.webp') center / cover no-repeat;
}

.prototype-hero::before {
  opacity: .14;
  mix-blend-mode: screen;
}

.prototype-hero__inner {
  min-height: 330px;
  padding-block: clamp(3.5rem, 7vw, 5.8rem) clamp(3rem, 6vw, 4.5rem);
}

.prototype-hero h1 {
  max-width: 14ch;
  margin-bottom: 1rem;
  font-size: clamp(3.2rem, 6.6vw, 5.8rem);
  letter-spacing: -.045em;
}

.prototype-hero__note {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .65rem;
  border: 1px solid rgba(230, 193, 126, .35);
  color: #f3dfc5;
  font-size: .7rem;
  letter-spacing: .03em;
}

.prototype-hero__note::before {
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: var(--gold-pale);
  box-shadow: 0 0 0 .2rem rgba(230, 193, 126, .12);
  content: '';
}

.prototype-hero__mark {
  align-self: end;
  padding-bottom: .25rem;
  color: rgba(230, 193, 126, .86);
  font-size: 3.25rem;
}

.prototype-option {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3.8rem, 6.2vw, 5.8rem);
  scroll-margin-top: 96px;
}

.prototype-option::before {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 152, 85, .56) 22%, rgba(196, 152, 85, .16) 78%, transparent);
  content: '';
}

.prototype-option--shelf { background: #f4eee3; }
.prototype-option--folio { background: #fbf8f1; }
.prototype-option--table { background: #e6d5c0; }

.prototype-option__heading {
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 24rem);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-bottom: clamp(1.45rem, 3vw, 2.25rem);
}

.prototype-option__heading h2 {
  max-width: 14ch;
  font-size: clamp(2.65rem, 5vw, 4.8rem);
  letter-spacing: -.045em;
}

.prototype-option__summary {
  max-width: 24rem;
  margin: 0 0 .2rem;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
}

.prototype-carousel { min-width: 0; }

.motion-carousel .prototype-carousel__stage {
  position: relative;
  height: clamp(460px, 43vw, 560px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(128, 91, 52, .5);
  border-radius: 2px;
  box-shadow: 0 22px 52px rgba(46, 13, 19, .14);
  perspective: 1200px;
}

.motion-carousel .prototype-carousel__stage::before {
  position: absolute;
  z-index: 3;
  inset: 14px;
  border: 1px solid rgba(230, 193, 126, .34);
  content: '';
  pointer-events: none;
}

.motion-carousel .prototype-carousel__stage::after {
  position: absolute;
  z-index: 0;
  right: 10%;
  bottom: 12%;
  left: 10%;
  height: 1.2rem;
  border-radius: 50%;
  background: rgba(20, 7, 9, .22);
  filter: blur(12px);
  content: '';
  pointer-events: none;
}

.motion-carousel[data-carousel-mode='shelf'] .prototype-carousel__stage {
  background:
    repeating-linear-gradient(90deg, rgba(255, 245, 225, .025) 0 1px, transparent 1px 8px),
    radial-gradient(ellipse at 50% 46%, rgba(128, 76, 48, .35), transparent 62%),
    linear-gradient(135deg, #3a1219, #210a0e 78%);
}

.motion-carousel[data-carousel-mode='shelf'] .prototype-carousel__stage::after {
  right: 7%;
  bottom: 13%;
  left: 7%;
  height: .55rem;
  border-radius: 0;
  background: linear-gradient(180deg, #b28650, #6c442e 48%, #321613 49%, #16070b 100%);
  box-shadow: 0 9px 14px rgba(8, 1, 3, .45);
  filter: none;
}

.motion-carousel[data-carousel-mode='folio'] .prototype-carousel__stage {
  height: clamp(480px, 45vw, 575px);
  background:
    repeating-linear-gradient(0deg, rgba(83, 55, 40, .025) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 50% 32%, rgba(255, 255, 252, .96), rgba(236, 222, 204, .82) 70%);
}

.motion-carousel[data-carousel-mode='folio'] .prototype-carousel__stage::before {
  inset: 18px;
  border-color: rgba(67, 21, 29, .22);
}

.motion-carousel[data-carousel-mode='folio'] .prototype-carousel__stage::after {
  right: 15%;
  bottom: 12%;
  left: 15%;
  background: rgba(67, 21, 29, .16);
}

.motion-carousel[data-carousel-mode='table'] .prototype-carousel__stage {
  background:
    repeating-linear-gradient(0deg, rgba(255, 228, 179, .06) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 50% 18%, rgba(195, 141, 83, .32), transparent 55%),
    linear-gradient(145deg, #765139, #4b2927 56%, #2d161a);
}

.motion-carousel[data-carousel-mode='table'] .prototype-carousel__stage::before { border-color: rgba(230, 193, 126, .42); }

.motion-carousel[data-carousel-mode='table'] .prototype-carousel__stage::after {
  right: 8%;
  bottom: 14%;
  left: 8%;
  height: .7rem;
  border-radius: 0;
  background: linear-gradient(180deg, #b4844f, #5f3828 47%, #291417 48%, #16080a 100%);
  box-shadow: 0 10px 16px rgba(9, 2, 3, .44);
  filter: none;
}

.motion-track {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.motion-track:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: -6px; }
.motion-track.is-dragging, .motion-track.is-dragging button { cursor: grabbing; }

.motion-slide {
  position: absolute;
  top: 49%;
  left: 50%;
  width: var(--book-width);
  transform-origin: center bottom;
  will-change: transform;
  transition: none !important;
}

.motion-slide[hidden] { display: none; }

.motion-book {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 1px 3px 3px 1px;
  aspect-ratio: 2 / 3;
  background: transparent;
  cursor: grab;
  box-shadow: 5px 10px 14px rgba(20, 7, 9, .3), 1px 2px 2px rgba(20, 7, 9, .28);
  transition: box-shadow .25s ease, filter .25s ease;
}

.motion-book::before {
  position: absolute;
  z-index: -1;
  inset: 3px -4px 3px auto;
  width: 4px;
  border-radius: 0 2px 2px 0;
  background: repeating-linear-gradient(0deg, #e5dfd3 0 1px, #fdfbf7 1px 3px);
  content: '';
}

.motion-book::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 250, 240, .24);
  background: linear-gradient(90deg, rgba(0, 0, 0, .08), transparent 3%, rgba(255, 255, 255, .12) 5%, transparent 10%);
  content: '';
  pointer-events: none;
}

.motion-book img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 1px 2px 2px 1px; pointer-events: none; }
.motion-slide.is-active .motion-book { box-shadow: 10px 19px 27px rgba(20, 7, 9, .4), 0 0 0 1px rgba(230, 193, 126, .38); filter: saturate(1.04); }
.motion-book:hover { box-shadow: 8px 17px 25px rgba(20, 7, 9, .4); }
.motion-book:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 5px; }

.motion-book__label {
  position: absolute;
  z-index: 2;
  bottom: .65rem;
  left: 50%;
  width: max-content;
  max-width: min(16rem, calc(100vw - 2rem));
  padding: .45rem .65rem;
  border: 1px solid rgba(255, 250, 240, .28);
  background: rgba(48, 32, 30, .91);
  color: #fffaf0;
  font-family: var(--sans);
  font-size: .67rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, .35rem);
  transition: opacity .18s ease, transform .18s ease;
}

.motion-book:hover .motion-book__label,
.motion-book:focus-visible .motion-book__label { opacity: 1; transform: translate(-50%, 0); }

.motion-carousel .prototype-carousel__shelf-line,
.motion-carousel .prototype-carousel__table-inlay,
.motion-carousel .prototype-carousel__table-edge,
.motion-carousel .prototype-carousel__deck-shadow { display: block; pointer-events: none; }

.motion-carousel .prototype-carousel__shelf-line {
  z-index: 0;
  right: 7%;
  bottom: 13%;
  left: 7%;
  height: .58rem;
  border-top: 1px solid rgba(230, 193, 126, .82);
  border-bottom: 2px solid rgba(83, 42, 30, .9);
  background: linear-gradient(180deg, #a2764a, #4b281f);
  box-shadow: 0 8px 12px rgba(10, 2, 5, .4);
}

.motion-carousel .prototype-carousel__table-inlay {
  z-index: 0;
  right: 8%;
  bottom: 13%;
  left: 8%;
  height: .72rem;
  border-top: 1px solid rgba(230, 193, 126, .76);
  border-bottom: 1px solid rgba(25, 9, 10, .68);
  background: linear-gradient(180deg, rgba(180, 126, 74, .72), rgba(64, 30, 23, .94));
  box-shadow: 0 9px 13px rgba(10, 2, 5, .4);
}

.motion-carousel .prototype-carousel__table-edge {
  z-index: 0;
  right: 8%;
  bottom: 9.5%;
  left: 8%;
  height: .34rem;
  border-top: 1px solid rgba(230, 193, 126, .5);
  background: rgba(29, 10, 12, .68);
  box-shadow: 0 7px 9px rgba(10, 2, 5, .3);
}

.motion-carousel .prototype-carousel__deck-shadow {
  z-index: 0;
  right: 14%;
  bottom: 12%;
  left: 14%;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(67, 21, 29, .18);
  filter: blur(12px);
}

.prototype-carousel__details {
  position: relative;
  max-width: none;
  margin: 1.35rem 0 0;
  padding: 1.05rem 1.15rem 0;
  border-top: 1px solid rgba(83, 55, 40, .25);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
}

.prototype-carousel__details > div:first-child { position: relative; padding-left: .9rem; }
.prototype-carousel__details > div:first-child::before { position: absolute; top: .15rem; bottom: .15rem; left: 0; width: 2px; background: var(--gold); content: ''; }
.prototype-carousel__eyebrow { margin-bottom: .45rem; color: #875f32; font-size: .65rem; letter-spacing: .14em; }
.prototype-carousel__details h3 { max-width: 30ch; margin-bottom: 0; color: var(--burgundy); font-size: clamp(1.6rem, 2.6vw, 2.35rem); line-height: 1.07; }
.prototype-carousel__translation { margin-top: .4rem; color: var(--muted); font-family: var(--serif); font-size: 1rem; }
.prototype-carousel__meta { margin-top: .45rem; color: var(--muted); font-size: .72rem; }
.prototype-carousel__actions { display: flex; flex-direction: column; align-items: flex-end; gap: .65rem; }
.prototype-carousel__status { min-width: 10ch; margin: 0; padding: .32rem .48rem; border: 1px solid rgba(128, 91, 52, .28); color: var(--muted); font-size: .64rem; letter-spacing: .14em; line-height: 1.2; text-align: center; }
.prototype-carousel__buttons { display: flex; align-items: center; gap: .45rem; }
.prototype-carousel__button { width: 2.65rem; height: 2.65rem; border-color: rgba(67, 21, 29, .36); }
.prototype-carousel__pause { min-height: 2.65rem; padding: .55rem .8rem; border: 1px solid rgba(67, 21, 29, .3); background: transparent; color: var(--burgundy); cursor: pointer; font-size: .64rem; font-weight: 700; letter-spacing: .04em; }
.prototype-carousel__pause:hover, .prototype-carousel__pause[aria-pressed='true'] { background: var(--burgundy); color: var(--ivory); }
.prototype-carousel__pause:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (max-width: 1024px) and (min-width: 761px) {
  .motion-carousel .prototype-carousel__stage { height: 430px; }
  .motion-carousel[data-carousel-mode='folio'] .prototype-carousel__stage { height: 470px; }
  .prototype-option__heading { grid-template-columns: minmax(0, 1fr) minmax(13rem, 20rem); }
}

@media (hover: none), (max-width: 760px) { .motion-book__label { display: none; } }

@media (max-width: 760px) {
  .prototype-header__inner { min-height: 64px; padding-block: .48rem; }
  .prototype-nav { display: flex; gap: .25rem; margin-top: .3rem; padding-top: .3rem; justify-content: space-between; }
  .prototype-nav a { min-height: 44px; padding: .35rem .5rem; border: 0; font-size: .63rem; letter-spacing: 0; }
  .prototype-hero__inner { grid-template-columns: 1fr; gap: 1.2rem; min-height: 0; padding-block: 2.35rem 2.1rem; }
  .prototype-hero h1 { max-width: 14ch; margin-bottom: .8rem; font-size: clamp(2.55rem, 12vw, 4rem); }
  .prototype-hero__mark { display: none; }
  .prototype-hero__note { font-size: .65rem; }
  .prototype-option { padding-block: 2.7rem 3.2rem; scroll-margin-top: 108px; }
  .prototype-option__heading { display: block; margin-bottom: 1.1rem; }
  .prototype-option__heading h2 { max-width: 12ch; font-size: clamp(2.35rem, 11vw, 3.5rem); }
  .prototype-option__summary { max-width: 32rem; margin-top: .65rem; font-size: .78rem; }
  .motion-carousel .prototype-carousel__stage { height: 310px; }
  .motion-carousel[data-carousel-mode='folio'] .prototype-carousel__stage { height: 350px; }
  .motion-carousel[data-carousel-mode='table'] .prototype-carousel__stage { height: 315px; }
  .motion-carousel .prototype-carousel__stage::before { inset: 9px; }
  .motion-carousel .prototype-carousel__shelf-line { bottom: 11.5%; }
  .motion-carousel .prototype-carousel__table-inlay { bottom: 12%; }
  .motion-carousel .prototype-carousel__table-edge { bottom: 8.6%; }
  .motion-carousel .prototype-carousel__deck-shadow { bottom: 10%; }
  .prototype-carousel__details { display: flex; flex-direction: column; align-items: stretch; gap: .85rem; margin-top: 1rem; padding: .9rem .85rem 0; }
  .prototype-carousel__details h3 { max-width: none; font-size: 1.45rem; line-height: 1.08; }
  .prototype-carousel__translation { font-size: .88rem; }
  .prototype-carousel__meta { font-size: .7rem; }
  .prototype-carousel__actions { flex-direction: row; align-items: center; justify-content: space-between; gap: .7rem; }
  .prototype-carousel__buttons { flex-wrap: nowrap; }
  .prototype-carousel__pause { min-height: 2.55rem; padding-inline: .65rem; font-size: .61rem; }
}

@media (max-width: 360px) {
  .prototype-nav a { padding-inline: .3rem; font-size: .59rem; }
  .motion-carousel .prototype-carousel__stage { height: 255px; }
  .motion-carousel[data-carousel-mode='folio'] .prototype-carousel__stage { height: 295px; }
  .motion-carousel[data-carousel-mode='table'] .prototype-carousel__stage { height: 270px; }
  .prototype-carousel__details { padding-inline: .7rem; }
  .prototype-carousel__actions { align-items: flex-start; flex-direction: column; }
  .prototype-carousel__buttons { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .prototype-header, .motion-book, .motion-book__label, .prototype-carousel__button { transition: none; }
}
