:root {
  --bg: #f5efe1;
  --bg-alt: #ece0c6;
  --panel: #fffdf6;
  --ink: #1c1710;
  --ink-soft: #6b6151;
  --ink-faint: #96897212;
  --line: rgba(28, 23, 16, 0.14);
  --brand: #203e8a;
  --brand-ink: #ffffff;
  --red: #c21f42;
  --red-ink: #ffffff;
  --blue: #146b63;
  --blue-ink: #ffffff;
  --gold: #d99a2b;
  --gold-ink: #241c0c;
  --plastic: #b9c2c9;
  --plastic-dark: #7c8891;
  --shadow: 0 18px 40px -18px rgba(28, 20, 8, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16130e;
    --bg-alt: #1e1a12;
    --panel: #241f16;
    --ink: #f3ecdc;
    --ink-soft: #b6ab93;
    --ink-faint: #96897220;
    --line: rgba(243, 236, 220, 0.14);
    --brand: #7ea0f5;
    --brand-ink: #10182c;
    --red: #ff6f89;
    --red-ink: #2b0f16;
    --blue: #4fd6c8;
    --blue-ink: #062420;
    --gold: #f0bc5c;
    --gold-ink: #241c0c;
    --plastic: #4a5157;
    --plastic-dark: #2c3236;
    --shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --bg: #16130e;
  --bg-alt: #1e1a12;
  --panel: #241f16;
  --ink: #f3ecdc;
  --ink-soft: #b6ab93;
  --ink-faint: #96897220;
  --line: rgba(243, 236, 220, 0.14);
  --brand: #7ea0f5;
  --brand-ink: #10182c;
  --red: #ff6f89;
  --red-ink: #2b0f16;
  --blue: #4fd6c8;
  --blue-ink: #062420;
  --gold: #f0bc5c;
  --gold-ink: #241c0c;
  --plastic: #4a5157;
  --plastic-dark: #2c3236;
  --shadow: 0 18px 44px -16px rgba(0, 0, 0, 0.55);
}

:root[data-theme="light"] {
  --bg: #f5efe1;
  --bg-alt: #ece0c6;
  --panel: #fffdf6;
  --ink: #1c1710;
  --ink-soft: #6b6151;
  --ink-faint: #96897212;
  --line: rgba(28, 23, 16, 0.14);
  --brand: #203e8a;
  --brand-ink: #ffffff;
  --red: #c21f42;
  --red-ink: #ffffff;
  --blue: #146b63;
  --blue-ink: #ffffff;
  --gold: #d99a2b;
  --gold-ink: #241c0c;
  --plastic: #b9c2c9;
  --plastic-dark: #7c8891;
  --shadow: 0 18px 40px -18px rgba(28, 20, 8, 0.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang TC", "Hiragino Sans", "Noto Sans TC", "Microsoft JhengHei",
    system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3 { text-wrap: balance; margin: 0; }

a { color: inherit; }

img, svg { display: block; max-width: 100%; }

.label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

/* ---------- background texture ---------- */
.halftone {
  background-image: radial-gradient(var(--ink-faint) 1.1px, transparent 1.1px);
  background-size: 13px 13px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.brand-mark {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 6px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: var(--brand-ink);
  font-weight: 900;
  font-size: 0.95rem;
  flex: none;
}
.brand-mark svg { width: 66%; height: 66%; }
.brand small {
  display: block;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.68rem;
  color: var(--ink-soft);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--ink); }
.cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.cart-toggle:hover { border-color: var(--ink-soft); transform: translateY(-1px); }
.cart-toggle:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.cart-toggle svg { width: 1.3rem; height: 1.3rem; }
.cart-count {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cart-count[hidden] { display: none; }

.cart-toggle.bump { animation: cart-bump 0.4s ease; }
@keyframes cart-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .cart-toggle.bump { animation: none; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}
.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--brand) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.82rem; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(3.5rem, 9vw, 7rem);
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--brand);
}
.eyebrow::before {
  content: "";
  width: 1.4rem;
  height: 2px;
  background: var(--brand);
}

.hero h1 {
  margin-top: 1rem;
  font-size: clamp(2.3rem, 5.4vw, 3.8rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.01em;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand);
}
.hero p.lede {
  margin-top: 1.25rem;
  max-width: 34rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.6rem;
}
.sticker {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  transform: rotate(-3deg);
  box-shadow: var(--shadow);
}
.sticker.red { background: var(--red); color: var(--red-ink); }
.sticker.blue { background: var(--blue); color: var(--blue-ink); transform: rotate(2deg); }
.sticker.gold { background: var(--gold); color: var(--gold-ink); transform: rotate(-1.5deg); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}
.trust-line {
  margin-top: 1.4rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.trust-line .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--gold);
}

/* ---------- hero art: product photo cluster ---------- */
.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}
.photo-cluster {
  position: relative;
  width: 100%;
  max-width: 26rem;
  aspect-ratio: 1 / 1;
}
.ph-tile {
  position: absolute;
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 9%;
  display: grid;
  place-items: center;
}
.ph-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(20, 15, 8, 0.22));
}
.pt1 { width: 56%; left: 0;   top: 4%;  transform: rotate(-6deg); z-index: 2; }
.pt2 { width: 60%; left: 26%; top: 40%; transform: rotate(5deg);  z-index: 3; }
.pt3 { width: 42%; left: 56%; top: 0;   transform: rotate(9deg);  z-index: 1; }
.pc-badge { position: absolute; left: -0.6rem; bottom: 1rem; z-index: 4; }

.float-capsule {
  position: absolute;
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--shadow);
  top: -1.2rem;
  right: -1rem;
  animation: bob 5s ease-in-out infinite;
}
.float-capsule .top { height: 45%; background: var(--red); }
.float-capsule .bottom { height: 55%; background: var(--panel); border: 1px solid var(--line); border-top: none; }

.float-tag {
  position: absolute;
  bottom: -0.8rem;
  left: -1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.65rem 0.9rem;
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: bob 6s ease-in-out infinite 0.4s;
}
.float-tag strong { color: var(--red); font-size: 0.95rem; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .float-capsule, .float-tag, .reveal { animation: none !important; transition: none !important; }
}

/* ---------- section shell ---------- */
section { padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  flex-wrap: wrap;
}
.section-head h2 {
  margin-top: 0.5rem;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 900;
}
.section-head p { color: var(--ink-soft); max-width: 30rem; margin: 0; }

/* ---------- categories ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cat-grid { grid-template-columns: 1fr; } }

.cat-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.6rem 1.4rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.cat-icon {
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 1rem;
}
.cat-card .en {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--brand);
}
.cat-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 0.3rem;
}
.cat-card p {
  margin: 0.5rem 0 0;
  font-size: 0.87rem;
  color: var(--ink-soft);
}

/* ---------- products ---------- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}
@media (max-width: 900px) { .prod-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .prod-grid { grid-template-columns: 1fr; } }

.prod-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.prod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.prod-window {
  position: relative;
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(120% 90% at 50% 15%, color-mix(in srgb, var(--ink) 7%, transparent), transparent 60%),
    var(--bg-alt);
  display: grid;
  place-items: center;
  padding: 0.9rem;
}
.prod-window img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(20, 15, 8, 0.22));
}
.prod-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.28rem 0.6rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.prod-badge.red { background: var(--red); color: var(--red-ink); }
.prod-badge.blue { background: var(--blue); color: var(--blue-ink); }
.prod-badge.gold { background: var(--gold); color: var(--gold-ink); }

.prod-body { padding: 1.1rem 1.2rem 0.4rem; }
.prod-cat { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; color: var(--ink-soft); text-transform: uppercase; }
.prod-name { margin-top: 0.35rem; font-size: 1.02rem; font-weight: 800; }
.prod-foot {
  padding: 0.8rem 1.2rem 0.2rem;
}
.prod-price { font-weight: 900; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.prod-price small { font-weight: 600; font-size: 0.72rem; color: var(--ink-soft); }
.prod-link {
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--blue);
  border-bottom: 1px solid currentColor;
}
.prod-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 1.2rem 1.3rem;
}
.btn-add {
  border: none;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.btn-add:hover { transform: translateY(-2px); }
.btn-add:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* ---------- process ---------- */
.process-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  position: relative;
}
@media (max-width: 760px) { .process-strip { grid-template-columns: 1fr; gap: 2.4rem; } }
.process-strip::before {
  content: "";
  position: absolute;
  top: 1.4rem;
  left: 8%;
  right: 8%;
  border-top: 2px dashed var(--line);
}
@media (max-width: 760px) { .process-strip::before { display: none; } }
.step { position: relative; }
.step-num {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1rem;
  position: relative;
  z-index: 1;
}
.step h3 { margin-top: 1rem; font-size: 1.1rem; font-weight: 800; }
.step p { margin-top: 0.4rem; color: var(--ink-soft); font-size: 0.92rem; max-width: 20rem; }

/* ---------- trust stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.5rem;
}
.stat-num {
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 900;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.stat-card p { margin: 0.4rem 0 0; font-size: 0.86rem; color: var(--ink-soft); }

/* ---------- footer ---------- */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding-block: 3rem 2rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 760px) { .foot-grid { grid-template-columns: repeat(2, 1fr); } }
.foot-grid h4 { color: var(--ink); font-size: 0.85rem; margin-bottom: 0.8rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.foot-grid a { text-decoration: none; }
.foot-grid a:hover { color: var(--ink); }
.foot-bottom {
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.disclaimer {
  max-width: 46rem;
  line-height: 1.6;
  font-size: 0.76rem;
  opacity: 0.8;
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- cart drawer ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 4, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 60;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(24rem, 100%);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 61;
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.cart-drawer-head h2 { font-size: 1.1rem; font-weight: 900; }
.cart-close {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.cart-close:hover { border-color: var(--ink-soft); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.4rem;
  display: grid;
  gap: 1.1rem;
  align-content: start;
}
.cart-empty {
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding-top: 2.5rem;
  text-align: center;
}

.cart-item {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 0.8rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.cart-item-swatch {
  width: 3rem;
  height: 3rem;
  border-radius: 0.6rem;
  background: linear-gradient(160deg, var(--plastic), var(--plastic-dark));
}
.cart-item-cat { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; color: var(--ink-soft); text-transform: uppercase; }
.cart-item-name { margin-top: 0.15rem; font-weight: 800; font-size: 0.9rem; }
.cart-item-price { margin-top: 0.35rem; font-size: 0.82rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cart-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.55rem;
}
.qty-btn {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
}
.qty-btn:hover { border-color: var(--ink-soft); }
.cart-item-qty span {
  min-width: 1.2rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.cart-item-remove {
  justify-self: end;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-decoration: underline;
  padding: 0;
}
.cart-item-remove:hover { color: var(--red); }

.cart-summary {
  padding: 1.2rem 1.4rem 1.5rem;
  border-top: 1px solid var(--line);
}
.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  margin-bottom: 1rem;
  font-variant-numeric: tabular-nums;
}
.cart-checkout { width: 100%; }
