/* BiblespaceDS / Scriptorium tokens (from _ds_bundle.css :root) */
:root {
  --surface-canvas: #fbfaf6;
  --surface-base: #ffffff;
  --surface-muted: #f6f6f5;
  --surface-hover: rgba(28, 25, 23, 0.05);
  --text-primary: #1f1b16;
  --text-secondary: #544e4b;
  --text-tertiary: #6b655c;
  --text-on-accent: #ffffff;
  --border-subtle: #e5e2db;
  --border-default: rgba(28, 25, 23, 0.12);
  --border-strong: rgba(28, 25, 23, 0.2);
  /* Primary CTA = ink (NOT brand scarlet) */
  --primary: #1f1b16;
  --primary-on: #ffffff;
  --primary-hover: #1f1b16;
  --primary-deep: #1f1b16;
  --primary-bg: rgba(31, 27, 22, 0.05);
  --affirm: #00814c;
  --affirm-on: #ffffff;
  --affirm-deep: #006037;
  --affirm-bg: rgba(0, 129, 76, 0.1);
  /* Brand scarlet / save badge */
  --destructive: #c90e1f;
  --destructive-on: #ffffff;
  --brand: #e02a40;
  --font-serif: "Noto Serif TC", "Songti TC", serif;
  --font-sans: "Noto Sans TC", "PingFang TC", sans-serif;
  --radius-page: 22px;
  --radius-card: 12px;
  /* DS radius base (Scriptorium) — buttons use this */
  --radius: 0.375rem;
  --radius-md: var(--radius);
  --button-radius: var(--radius-md);
  --button-height-xs: 28px;
  --button-height-md: 40px;
  --button-height-lg: 48px;
  --button-padding-x-xs: 8px;
  --button-padding-x-md: 16px;
  --button-padding-x-lg: 20px;
  --button-border-width: 1px;
  --duration-fast: 150ms;
  --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.03);
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.04), 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.05), 0 2px 4px -2px rgba(28, 25, 23, 0.05);
  --shadow-page: 0 24px 60px rgba(31, 27, 22, 0.14);
  --shadow-cover: 0 12px 28px rgba(31, 27, 22, 0.16);
  --shadow-cover-lg: 0 18px 42px rgba(31, 27, 22, 0.2);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--surface-muted);
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }

/* —— shell / page frame —— */
.shell {
  padding: 24px 14px 48px;
  display: flex;
  justify-content: center;
}

.page {
  width: 100%;
  max-width: 432px;
  background: var(--surface-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-page);
  overflow: hidden;
  box-shadow: var(--shadow-page);
}

/* —— top bar —— */
.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 0;
}

.topbar-eyebrow {
  display: none;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.lang-switch {
  display: flex;
  gap: 6px;
}

/* DS Button size=xs + ghost / secondary */
.lang-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--button-height-xs);
  padding: 0 var(--button-padding-x-xs);
  border: var(--button-border-width) solid transparent;
  border-radius: var(--button-radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--duration-fast), background-color var(--duration-fast), border-color var(--duration-fast);
}

.lang-switch button:hover {
  background: var(--primary-bg);
  color: var(--text-primary);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--surface-muted);
  color: var(--text-primary);
  border-color: var(--border-default);
  font-weight: 500;
}

.lang-switch button[aria-pressed="true"]:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

/* —— hero (mobile 1a: covers first, centered) —— */
.hero {
  display: flex;
  flex-direction: column;
  padding: 8px 24px 6px;
  text-align: center;
}

.hero-covers {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  order: -1;
}

.hero-covers img {
  width: 88px;
  height: 170px;
  object-fit: contain;
  background: var(--surface-muted);
  border-radius: 9px;
  padding: 5px;
  box-shadow: var(--shadow-cover);
  transition: transform 0.25s ease;
}

.cover-thumb {
  display: block;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  font: inherit;
  cursor: zoom-in;
  text-align: inherit;
}

.hero-covers .cover-thumb {
  flex: 0 0 auto;
}

.hero-covers .cover-thumb img {
  display: block;
}

.hero-covers .cover-thumb:hover img {
  transform: translateY(-4px);
}

.offer-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--primary-on);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.4;
  white-space: pre-line;
  margin: 0 0 16px;
}

.hero-sub {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 0 auto 22px;
  max-width: 340px;
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cta-row--hero {
  max-width: 100%;
}

.order-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 10px 0 0;
}

/* —— Buttons: match BiblespaceDS Button primitive —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--button-height-md);
  padding: 0 var(--button-padding-x-md);
  border-radius: var(--button-radius);
  border: var(--button-border-width) solid transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition:
    color var(--duration-fast),
    background-color var(--duration-fast),
    border-color var(--duration-fast),
    box-shadow var(--duration-fast);
}

.btn-lg {
  height: var(--button-height-lg);
  padding: 0 var(--button-padding-x-lg);
  font-size: 16px;
}

/* variant=primary */
.btn-primary {
  background: var(--primary);
  color: var(--primary-on);
  border-color: transparent;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  background: var(--primary-deep);
  box-shadow: var(--shadow-xs);
}

/* variant=outline — 1px primary border, transparent fill */
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary-bg);
  color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-outline:active {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* variant=secondary */
.btn-secondary {
  background: var(--surface-muted);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn-secondary:active {
  background: #e1ddda;
}

.btn-block {
  width: 100%;
}

/* —— products (mobile: stack) —— */
.products-section {
  padding: 30px 22px 6px;
  background: var(--surface-canvas);
}

.section-head {
  text-align: center;
  margin-bottom: 20px;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 23px;
  margin: 0 0 4px;
}

.section-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.section-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 0;
}

.products {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product {
  background: var(--surface-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 18px;
}

.product img {
  width: 100%;
  height: 250px;
  object-fit: contain;
  background: var(--surface-muted);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 0;
}

.product .cover-thumb {
  width: 100%;
  margin-bottom: 16px;
}

.product h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  margin: 0 0 4px;
}

.product-meta-line {
  font-size: 12.5px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.product-verse {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-primary);
  opacity: 0.82;
  margin: 0 0 14px;
}

.features {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.features li {
  display: inline-block;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--surface-muted);
  padding: 5px 11px;
  border-radius: 999px;
  margin: 0 6px 6px 0;
}

.product-spec {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  margin-bottom: 16px;
}

.price-list {
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.price-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.price-sale {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 29px;
  color: var(--primary);
  line-height: 1;
}

/* DS Badge tone=destructive fill=filled */
.save-badge {
  margin-left: auto;
  background: var(--destructive);
  color: var(--destructive-on);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

/* —— overprint (mobile: stacked) —— */
.overprint-section {
  padding: 28px 22px 6px;
}

.overprint-card {
  background: var(--surface-muted);
  border-radius: var(--radius-card);
  padding: 22px;
}

.overprint-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge-affirm {
  background: var(--affirm);
  color: var(--affirm-on);
}

/* DS Badge tone=primary fill=outlined */
.badge-outline {
  display: none; /* mobile 1a: only overprint_tag */
  background: var(--primary-bg);
  color: var(--primary-deep);
  border: 1px solid var(--primary);
}

.overprint-copy h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 8px;
  text-align: left;
}

.overprint-copy p {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 0;
}

/* —— scenes —— */
.scenes-section {
  padding: 26px 22px 6px;
  text-align: center;
}

.scenes-section h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 14px;
}

.scenes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.scene-chip {
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: transparent;
}

/* —— contact —— */
.contact-section {
  padding: 26px 22px 32px;
}

.contact-card {
  background: var(--surface-canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 22px 18px;
  box-shadow: 0 12px 32px rgba(31, 27, 22, 0.08);
  text-align: center;
}

.contact-card h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 8px;
}

.contact-card > p {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.contact-box {
  padding: 14px 16px;
  border: 1px dashed var(--border-default);
  border-radius: 12px;
  background: var(--surface-muted);
  margin-bottom: 16px;
  text-align: left;
}

.contact-identity {
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

#contact-org {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.5;
}

#contact-person {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.contact-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.contact-row span {
  flex: 0 0 4.5em;
  color: var(--text-tertiary);
}

.contact-row strong {
  flex: 1;
  font-weight: 600;
  word-break: break-word;
}

.cta-row--contact .btn {
  width: 100%;
}

/* =========================================================
   DESKTOP — prototype #pc · 1180px
   ========================================================= */
@media (min-width: 960px) {
  .shell {
    padding: 44px 30px 64px;
  }

  .page {
    max-width: 1180px;
  }

  .topbar {
    justify-content: space-between;
    padding: 20px 44px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .topbar-eyebrow {
    display: block;
  }

  /* hero: text left | covers right */
  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 52px;
    align-items: center;
    padding: 60px 44px;
    text-align: left;
  }

  .hero-covers {
    order: 0;
    margin-bottom: 0;
    gap: 18px;
  }

  .hero-covers img {
    width: 152px;
    height: 308px;
    object-fit: contain;
    background: var(--surface-muted);
    padding: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow-cover-lg);
  }

  .offer-badge {
    display: none; /* PC prototype has no offer badge in hero */
  }

  .eyebrow {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .hero h1 {
    font-size: 46px;
    line-height: 1.35;
    margin: 0 0 20px;
  }

  .hero-sub {
    font-size: 16px;
    line-height: 1.9;
    margin: 0 0 28px;
    max-width: 480px;
  }

  .cta-row--hero {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .cta-row--hero .btn {
    width: auto;
  }

  .order-note {
    font-size: 12.5px;
    margin-top: 12px;
  }

  /* products on muted band, 3 columns */
  .products-section {
    padding: 44px 44px 8px;
    background: var(--surface-muted);
  }

  .section-head {
    margin-bottom: 32px;
  }

  .section-head h2 {
    font-size: 30px;
    margin-bottom: 6px;
  }

  .section-sub {
    font-size: 14px;
  }

  .products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
  }

  .product {
    box-shadow: 0 10px 28px rgba(31, 27, 22, 0.08);
    border-color: transparent;
  }

  .product img {
    height: 260px;
    object-fit: contain;
    padding: 0;
    background: var(--surface-canvas);
    margin-bottom: 0;
  }

  .product .cover-thumb {
    margin-bottom: 18px;
  }

  /* overprint: badges | copy horizontal */
  .overprint-section {
    padding: 44px 44px 8px;
  }

  .overprint-card {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
    padding: 28px;
  }

  .overprint-badges {
    flex: none;
    margin-bottom: 0;
  }

  .badge-outline {
    display: inline-flex;
  }

  .overprint-copy {
    flex: 1;
    min-width: 320px;
  }

  .overprint-copy h2 {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .overprint-copy p {
    font-size: 14.5px;
    line-height: 1.8;
  }

  .scenes-section {
    padding: 40px 44px 8px;
  }

  .scenes-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .contact-section {
    padding: 44px 44px 60px;
    display: flex;
    justify-content: center;
  }

  .contact-card {
    max-width: 580px;
    width: 100%;
    padding: 28px 24px;
  }

  .contact-card h2 {
    font-size: 26px;
  }

  .contact-card > p {
    font-size: 14.5px;
    margin-bottom: 18px;
  }

  .contact-box {
    padding: 16px 18px;
    margin-bottom: 18px;
  }

  #contact-org { font-size: 15.5px; }
  #contact-person { font-size: 13.5px; }

  .contact-row {
    font-size: 14px;
    gap: 12px;
  }

  .cta-row--contact {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
  }

  .cta-row--contact .btn {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-covers img,
  .hero-covers .cover-thumb img { transition: none; }
  .order-toast { transition: none; }
}

.order-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1000;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--text-primary);
  color: var(--surface-canvas);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
  box-shadow: var(--shadow-md);
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.order-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.cover-lightbox-open {
  overflow: hidden;
}

.cover-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 18, 16, 0.82);
}

.cover-lightbox[hidden] {
  display: none;
}

.cover-lightbox__img {
  max-width: min(92vw, 640px);
  max-height: min(92vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  background: var(--surface-canvas);
}

.cover-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.cover-lightbox__close:hover {
  background: #fff;
}
