/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink: #FF90E8;
  --black: #000;
  --white: #fff;
  --border: 1px solid #000;
  --shadow: 3px 3px 0 0 #000;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* === PRICE TAG (arrow shape) === */
.price-tag {
  display: inline-flex;
  align-items: center;
  color: #000;
  font-weight: 800;
  font-size: 14px;
  padding: 6px 18px 6px 14px;
  white-space: nowrap;
  line-height: 1.3;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'><path d='M3 3 H97 L85 20 L97 37 H3 Z' fill='%23FF90E8' stroke='black' stroke-width='3' vector-effect='non-scaling-stroke' stroke-linejoin='round'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.price-tag--lg {
  font-size: 16px;
  padding: 7px 20px 7px 16px;
}

/* === BUTTONS === */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: var(--border);
  border-radius: 2px;
  padding: 10px 22px;
  text-decoration: none;
  text-align: center;
  line-height: 1.3;
  transition: transform 0.05s, box-shadow 0.05s;
  -webkit-user-select: none;
  user-select: none;
}

.btn-pink {
  background: var(--pink);
  color: var(--black);
  box-shadow: var(--shadow);
}

.btn-pink:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 #000;
}

.btn-pink:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 #000;
}

.btn-outline {
  background: var(--white);
  color: var(--black);
  box-shadow: var(--shadow);
}

.btn-outline:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 #000;
}

.btn-full {
  width: 100%;
}

.btn-lg {
  font-size: 17px;
  padding: 15px 20px;
}

/* === SITE HEADER === */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  border-bottom: var(--border);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.header-product-name {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === COVER SECTION === */
.cover-section {
  border-bottom: var(--border);
}

.cover-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 28px;
  display: flex;
  justify-content: center;
}

.cover-frame {
  border: var(--border);
  overflow: hidden;
  max-width: 480px;
  width: 100%;
  position: relative;
  background: #eee;
}

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

/* shown when img fails to load */
.cover-frame.has-placeholder .cover-img {
  display: none;
}

.cover-placeholder-text {
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 28px;
  color: #888;
  font-size: 14px;
  line-height: 1.6;
  min-height: 320px;
}

.cover-frame.has-placeholder .cover-placeholder-text {
  display: flex;
}

/* === PRODUCT SECTION === */
.product-section {
  border-bottom: var(--border);
}

.product-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 310px;
  border-left: var(--border);
  border-right: var(--border);
}

/* --- Left column --- */
.product-body {
  border-right: var(--border);
  display: flex;
  flex-direction: column;
}

.product-title-row {
  padding: 32px 40px 24px;
  border-bottom: var(--border);
}

.product-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.product-meta-row {
  display: flex;
  align-items: stretch;
  border-bottom: var(--border);
}

.product-meta-price {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  border-right: var(--border);
}

.product-meta-creator {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  font-weight: 600;
  font-size: 15px;
}

.product-description {
  padding: 28px 40px 40px;
  flex: 1;
}

.product-description p {
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 18px;
}

.product-description p:last-child {
  margin-bottom: 0;
}

/* --- Right column: purchase panel --- */
.purchase-panel {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-self: start;
  position: sticky;
  top: 56px;
}

.purchase-panel .btn-full {
  margin-bottom: 16px;
}

.purchase-details {
  border: var(--border);
}

.purchase-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border-bottom: var(--border);
  font-size: 13px;
}

.purchase-row:last-child {
  border-bottom: none;
}

.purchase-label {
  color: #555;
}

.purchase-value {
  font-weight: 700;
  text-align: right;
}

/* === MOBILE STICKY BAR === */
.mobile-sticky {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  padding: 10px 16px;
  background: var(--pink);
  border-top: 2px solid #000;
  box-shadow: 0 -2px 0 0 #000;
}

.mobile-sticky-btn {
  width: 100%;
  font-family: var(--font);
  font-weight: 800;
  font-size: 17px;
  background: transparent;
  border: none;
  color: var(--black);
  cursor: pointer;
  padding: 6px 0;
  text-align: center;
  letter-spacing: -0.2px;
}

/* === FOOTER === */
.site-footer {
  border-top: var(--border);
  padding: 32px 28px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-bottom: 20px;
  list-style: none;
}

.footer-nav a {
  font-size: 14px;
  text-decoration: underline;
}

.footer-nav a:hover {
  text-decoration: none;
}

.footer-company {
  font-size: 13px;
  color: #555;
  margin-bottom: 16px;
  min-height: 18px;
  line-height: 1.5;
  /* HK company legal information will be placed here */
}

.footer-disclaimer {
  font-size: 12px;
  color: #777;
  line-height: 1.55;
  max-width: 680px;
}

/* === CENTERED PAGES (success / failed) === */
.centered-section {
  min-height: calc(100vh - 57px - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}

.message-card {
  border: var(--border);
  max-width: 480px;
  width: 100%;
  padding: 48px 40px;
  text-align: center;
}

.message-card h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 32px;
}

.download-note {
  font-size: 13px;
  color: #888;
  margin-top: 14px;
}

/* === LEGAL PAGES === */
.legal-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 28px 64px;
}

.legal-page h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: var(--border);
}

.legal-page h2 {
  font-size: 17px;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 10px;
  letter-spacing: -0.1px;
}

.legal-page p {
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 14px;
  color: #1a1a1a;
}

.legal-page ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.legal-page li {
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.legal-page a {
  text-decoration: underline;
}

.legal-block {
  border: var(--border);
  padding: 20px 24px;
  margin-top: 16px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: #222;
}

.legal-block strong {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .product-inner {
    grid-template-columns: 1fr 270px;
  }

  .product-title {
    font-size: 34px;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: 10px 16px;
    gap: 12px;
  }

  .header-product-name {
    font-size: 14px;
  }

  .cover-inner {
    padding: 24px 16px;
  }

  /* Stack two columns */
  .product-inner {
    grid-template-columns: 1fr;
    border-left: none;
    border-right: none;
  }

  .product-body {
    border-right: none;
    border-bottom: var(--border);
  }

  .product-title-row {
    padding: 24px 16px 18px;
  }

  .product-title {
    font-size: 28px;
  }

  .product-meta-price {
    padding: 12px 16px;
  }

  .product-meta-creator {
    padding: 12px 16px;
  }

  .product-description {
    padding: 22px 16px 32px;
  }

  .purchase-panel {
    position: static;
    padding: 20px 16px 100px; /* space for sticky bar */
  }

  .mobile-sticky {
    display: block;
  }

  .site-footer {
    padding: 24px 16px 96px; /* space for sticky bar */
  }

  .message-card {
    padding: 36px 24px;
  }

  .message-card h1 {
    font-size: 22px;
  }
}

/* === HERO NOTE (non-clickable pink hint beside cover) === */
.cover-inner {
  position: relative;
  padding: 36px 28px;
}

.cover-frame {
  max-width: 400px; /* slightly smaller so the content below peeks up */
}

.hero-note {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 270px;
  background: #EEFF00; /* neon yellow, doesn't clash with the pink CTAs; no shadow = not a button */
  border: var(--border);
  border-radius: 2px;
  color: #000; /* black text, readable on neon yellow */
  font-weight: 700;
  font-size: 15px;
  line-height: 1.45;
  padding: 18px 20px;
}

@media (max-width: 1040px) {
  .cover-inner {
    flex-direction: column;
  }
  .hero-note {
    position: static;
    transform: none;
    width: 100%;
    max-width: 400px;
    margin: 0 0 20px;
  }
}

/* === CONTENTS PREVIEW (table of contents) === */
.contents-preview {
  border: var(--border);
  padding: 18px 22px;
  margin: 10px 0 22px;
}

.toc-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  padding: 3px 0;
}

.toc-row .toc-title {
  flex: 1;
  min-width: 0;
}

.toc-pg {
  flex: none;
  color: #888;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.toc-chapter {
  font-weight: 700;
}

.toc-sub .toc-title {
  padding-left: 16px;
  color: #555;
  font-size: 13px;
}
