:root {
  --preview-pink: var(--pink2, #d35e7e);
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #2f2f2f;
}

.cover-preview-center {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--black);
}

.cover-preview-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--preview-pink) var(--panel);
  overscroll-behavior: contain;
}

.preview-page-content {
  box-sizing: border-box;
  min-height: 100%;
  padding: 38px 32px 100px;
  background: radial-gradient(circle at 52% 14%, rgba(208, 80, 118, .1), transparent 28%), var(--black);
  color: var(--white);
  font-family: var(--mono);
}

.preview-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid #39242d;
}

.preview-back {
  display: inline-block;
  margin-bottom: 22px;
  color: #c8bbc0;
  font-size: 13px;
  transition: color .18s ease;
}

.preview-back:hover, .preview-back:focus-visible {
  color: var(--preview-pink);
  outline: none;
}

.preview-header h1 {
  margin: 0;
  font: 52px/.95 var(--display);
  letter-spacing: .015em;
}

.preview-header p {
  margin: 3px 0 -5px;
  color: var(--preview-pink);
  font: 35px/1 var(--font-authentic-signature);
}

.preview-model {
  padding: 8px 10px;
  border: 1px solid #5a2a3b;
  color: #d6cbd0;
  font-size: 12px;
  letter-spacing: .08em;
  white-space: nowrap;
}

.preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, .72fr);
  align-items: start;
  gap: 24px;
  padding-top: 24px;
}

.preview-workspace {
  min-width: 0;
}

.finish-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.finish-toolbar>div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.finish-toolbar span {
  color: var(--preview-pink);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .11em;
}

.finish-toolbar strong {
  font-size: 15px;
}

.finish-options {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 7px;
}

.finish-button {
  position: relative;
  z-index: 1;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #6d2b43;
  background: var(--surface);
  color: var(--white);
  font: 700 13px var(--mono);
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.finish-button:hover, .finish-button:focus-visible, .finish-button.is-active {
  border-color: var(--preview-pink);
  background: var(--preview-pink);
  color: var(--black);
  outline: none;
}

.finish-button:focus-visible {
  box-shadow: 0 0 0 2px var(--black), 0 0 0 4px var(--preview-pink);
}

.tablet-scene {
  position: relative;
  display: flex;
  min-height: 390px;
  align-items: center;
  justify-content: center;
  padding: 18px 14px 22px;
  border: 1px solid #35272d;
  background: radial-gradient(ellipse at 52% 50%, #141414 0, var(--panel) 55%, #030303 100%);
  overflow: hidden;
  perspective: 1800px;
  isolation: isolate;
}

.tablet-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 62% 58% at 84% 13%, rgba(255, 255, 255, .032), transparent 78%);
  pointer-events: none;
}

.tablet-shadow {
  position: absolute;
  z-index: 0;
  left: 8%;
  right: 8%;
  bottom: 24px;
  height: 14%;
  border-radius: 50%;
  background: rgba(0, 0, 0, .92);
  filter: blur(25px);
  transform: translateY(7px);
  pointer-events: none;
}

/* CTL-472: 210 × 146 mm body ratio, no ExpressKeys, thin fixed-angle shell. */
.ctl472 {
  position: relative;
  z-index: 1;
  width: min(840px, 99%);
  aspect-ratio: 210/146;
  box-sizing: border-box;
  padding: 6.7% 5.1% 7.8%;
  border: 1px solid #3a3a3a;
  border-radius: 4.2%/6%;
  background: linear-gradient(145deg, #303030 0, #1b1b1b 8%, #0d0d0d 72%, var(--surface) 100%);
  box-shadow: 0 24px 38px rgba(0, 0, 0, .72), 0 7px 12px rgba(0, 0, 0, .62), inset 0 1px 1px rgba(255, 255, 255, .18), inset 0 -4px 7px var(--black);
  transform: rotateX(8deg) rotateY(-1deg) rotateZ(-.45deg);
  transform-style: preserve-3d;
}

.ctl472::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 1.5%;
  bottom: -1.8%;
  height: 2.6%;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, #181818, #030303);
  box-shadow: 0 3px 6px var(--black);
  transform-origin: top;
  transform: rotateX(-25deg);
  pointer-events: none;
}

.ctl-surface {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--preview-pink);
  border-radius: 2.1%;
  background: #080808;
  box-shadow: 0 0 0 2px #070707, 0 0 0 3px rgba(208, 80, 118, .22), inset 0 0 0 1px rgba(255, 255, 255, .025);
}

.cover-art {
  position: absolute;
  inset: 0;
  background: var(--surface) url("../assets/tablet-covers/cover-preview-artwork.png") 42% center/cover no-repeat;
  filter: saturate(1.04) contrast(1.035);
  transition: filter .24s ease;
}

.ambient-surface-light, .finish-grain {
  position: absolute;
  inset: -8%;
  pointer-events: none;
  transition: opacity .24s ease, filter .24s ease;
}

.ambient-surface-light {
  background: radial-gradient(ellipse 88% 84% at 94% 1%, rgba(255, 255, 255, .3) 0, rgba(255, 255, 255, .15) 31%, rgba(255, 255, 255, .045) 57%, transparent 81%), radial-gradient(ellipse 62% 48% at 68% 23%, rgba(255, 255, 255, .085), transparent 78%);
  filter: blur(19px);
  mix-blend-mode: screen;
}

.finish-grain {
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19' height='19' viewBox='0 0 19 19'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' seed='17'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.46'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

[data-finish-preview="glossy"] .cover-art {
  filter: saturate(1.13) contrast(1.085);
}

[data-finish-preview="glossy"] .ambient-surface-light {
  opacity: .76;
  filter: blur(18px);
}

[data-finish-preview="matte"] .cover-art {
  filter: saturate(1) contrast(1.015);
}

[data-finish-preview="matte"] .ambient-surface-light {
  opacity: .16;
  filter: blur(24px);
}

[data-finish-preview="matte"] .finish-grain {
  opacity: .07;
}

[data-finish-preview="textured"] .cover-art {
  filter: saturate(1.01) contrast(1.015);
}

[data-finish-preview="textured"] .ambient-surface-light {
  opacity: .24;
  filter: blur(23px);
}

[data-finish-preview="textured"] .finish-grain {
  opacity: .72;
  background-size: 19px 19px;
  filter: contrast(1.18);
  mask-image: radial-gradient(ellipse 94% 92% at 82% 12%, var(--black) 0, rgba(0, 0, 0, .82) 58%, rgba(0, 0, 0, .4) 82%, transparent 100%);
}

.ctl-mark {
  position: absolute;
  left: 50%;
  bottom: 2.7%;
  color: #777;
  font: 700 7px var(--mono);
  letter-spacing: .18em;
  transform: translateX(-50%);
}

.finish-closeups {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.finish-closeup {
  display: grid;
  width: 100%;
  padding: 11px;
  border: 1px solid #382a30;
  background: var(--surface);
  color: var(--white);
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.finish-closeup:hover, .finish-closeup:focus-visible, .finish-closeup.is-active {
  border-color: var(--preview-pink);
  background: #0a0708;
  outline: none;
}

.finish-closeup:hover {
  transform: translateY(-2px);
}

.finish-closeup:focus-visible {
  box-shadow: 0 0 0 2px var(--black), 0 0 0 4px var(--preview-pink);
}

.closeup-art {
  position: relative;
  display: block;
  height: 105px;
  overflow: hidden;
  background: var(--surface) url("../assets/tablet-covers/cover-preview-artwork.png") center/cover no-repeat;
  isolation: isolate;
}

.closeup-art::after, .closeup-art::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.finish-closeup.glossy .closeup-art {
  filter: saturate(1.13) contrast(1.085);
}

.finish-closeup.glossy .closeup-art::after {
  inset: -14%;
  background: radial-gradient(ellipse 90% 88% at 94% 2%, rgba(255, 255, 255, .39), rgba(255, 255, 255, .14) 40%, transparent 80%), radial-gradient(ellipse 60% 48% at 65% 27%, rgba(255, 255, 255, .1), transparent 78%);
  filter: blur(14px);
  mix-blend-mode: screen;
}

.finish-closeup.matte .closeup-art {
  filter: saturate(1) contrast(1.015);
}

.finish-closeup.matte .closeup-art::after {
  inset: -12%;
  background: radial-gradient(ellipse 78% 70% at 88% 7%, rgba(255, 255, 255, .1), transparent 78%);
  filter: blur(18px);
}

.finish-closeup.textured .closeup-art::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19' height='19'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' seed='17'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.48'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.finish-closeup strong {
  margin: 10px 0 5px;
  font: 700 20px var(--display);
  text-transform: uppercase;
}

.finish-closeup>span:last-child {
  color: #b8acb0;
  font: 13px/1.45 var(--mono);
}

.finish-closeup.is-active>strong {
  color: var(--preview-pink);
}

.preview-summary {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.price-card {
  position: relative;
  padding: 25px 22px;
  border: 1px solid #713047;
  background: linear-gradient(150deg, #0d0b0c, #030303);
  overflow: hidden;
}

.price-card::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  right: -54px;
  top: -54px;
  border: 1px solid var(--preview-pink);
  transform: rotate(45deg);
}

.card-number {
  color: var(--preview-pink);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.price-card h2 {
  max-width: 230px;
  margin: 14px 0 8px;
  font: 29px/.98 var(--display);
}

.price-role {
  margin: 0 0 17px !important;
  color: #e0d5d9 !important;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.45;
}

.preview-price {
  padding: 12px 0;
  border-block: 1px solid #35252b;
  color: var(--preview-pink);
  font: 700 27px var(--mono);
}

.price-card>p:not(.price-role) {
  margin: 16px 0;
  color: #bcb0b4;
  font-size: 13px;
  line-height: 1.6;
}

.brief-button {
  display: block;
  margin-top: 18px;
  padding: 13px;
  border: 1px solid var(--preview-pink);
  background: var(--preview-pink);
  color: var(--black);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  transition: background .18s ease, color .18s ease;
}

.brief-button:hover, .brief-button:focus-visible {
  background: var(--black);
  color: var(--preview-pink);
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.production-card {
  min-width: 0;
  border: 1px solid #423139;
  background: #060606;
}

.production-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 0;
  background: transparent;
  color: var(--white);
  text-align: left;
  cursor: pointer;
}

.production-toggle:hover {
  background: #0b0809;
}

.production-toggle span {
  display: grid;
  gap: 4px;
}

.production-toggle b {
  font: 18px var(--display);
}

.production-toggle small {
  color: #b9adb1;
  font: 12px var(--mono);
}

.production-toggle i {
  flex: none;
  color: var(--preview-pink);
  font: 700 20px/1 var(--mono);
  transition: transform .2s ease;
}

.production-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.production-toggle:focus-visible {
  outline: 2px solid var(--preview-pink);
  outline-offset: -3px;
}

.production-details {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .26s ease, opacity .2s ease;
}

.production-details.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.production-details[hidden] {
  display: none;
}

.production-details-inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 15px;
}

.production-details.is-open .production-details-inner {
  padding-bottom: 15px;
}

.production-details-inner>p {
  margin: 2px 0 13px;
  color: #bdb1b5;
  font-size: 13px;
  line-height: 1.55;
}

.production-details dl {
  margin: 0 0 13px;
  border-block: 1px solid #392a30;
}

.production-details dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #292126;
}

.production-details dl div:last-child {
  border: 0;
}

.production-details dt, .production-details dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.production-details dt {
  overflow-wrap: anywhere;
}

.production-details dd {
  flex: none;
  color: var(--preview-pink);
  font-weight: 700;
  white-space: nowrap;
}

.coming-soon {
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
  border: 1px dashed #5b4d52;
  color: #a99ca1;
  font-size: 12px;
}

.acrid-link {
  display: grid;
  gap: 4px;
  border-style: solid;
  background: #080808;
  color: #aaa;
  font-weight: 400;
  text-decoration: none;
}

.acrid-link strong {
  color: var(--preview-pink);
  font-weight: 700;
}

.acrid-link:hover, .acrid-link:focus-visible {
  background: var(--preview-pink);
  color: var(--surface);
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.acrid-link:hover strong, .acrid-link:focus-visible strong {
  color: var(--surface);
}

.cover-preview-stage>.footer {
  grid-column: 1/4;
  grid-row: 2;
}

@media (max-width:900px) {
  html, body {
    height: auto;
    overflow: auto;
    background: var(--black);
  }

  .cover-preview-page #viewport {
    height: auto !important;
    overflow: visible;
  }

  #site-stage.cover-preview-stage {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    transform: none !important;
    margin: 0 !important;
  }

  .cover-preview-stage>.left-rail, .cover-preview-stage>.right-rail, .cover-preview-stage>.footer {
    display: none !important;
  }

  .cover-preview-center {
    width: 100%;
    overflow: visible;
  }

  .cover-preview-scroll {
    height: auto;
    overflow: visible;
  }

  .preview-page-content {
    padding: 24px 16px 70px;
  }

  .preview-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-header h1 {
    font-size: clamp(39px, 12vw, 52px);
  }

  .preview-header p {
    font-size: 31px;
  }

  .preview-layout {
    grid-template-columns: 1fr;
  }

  .finish-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .finish-options {
    width: 100%;
  }

  .finish-button {
    flex: 1;
    padding-inline: 5px;
  }

  .tablet-scene {
    min-height: 300px;
    padding: 18px 7px 23px;
  }

  .ctl472 {
    width: 98%;
    transform: rotateX(10deg) rotateY(-1deg) rotateZ(-.7deg);
  }

  .finish-closeups {
    grid-template-columns: 1fr;
  }

  .closeup-art {
    height: 130px;
  }

  .preview-summary {
    margin-top: 12px;
  }

  .preview-model {
    white-space: normal;
  }
}

@media (max-width:520px) {
  .finish-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .finish-button {
    font-size: 12px;
  }

  .tablet-scene {
    min-height: 245px;
  }

  .ctl472 {
    width: 100%;
    transform: rotateX(8deg) rotateZ(-.5deg);
  }
}

@media (prefers-reduced-motion:reduce) {
  .finish-button, .finish-closeup, .cover-art, .ambient-surface-light, .finish-grain, .brief-button, .production-toggle i, .production-details {
    transition: none !important;
  }
}
