/* ============================================================
   T.T Do Something — shared styles
   Variant A: Modern Editorial Warm  (default)
   Variant B: Sunbaked Boutique      (data-variant="b")
   Light/dark via data-theme on :root
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Noto+Sans+TC:wght@400;500;700&family=Noto+Serif+TC:wght@500;600;700&display=swap');

/* ---------- Variant A: Modern Editorial Warm ---------- */
:root,
:root[data-variant="a"] {
  --bg:           oklch(0.97 0.012 75);     /* warm cream */
  --bg-elev:      oklch(0.985 0.008 75);    /* card cream */
  --bg-deep:      oklch(0.93 0.018 70);     /* contrast band */
  --ink:          oklch(0.27 0.035 45);     /* deep coffee */
  --ink-soft:     oklch(0.45 0.032 50);     /* muted text */
  --ink-faint:    oklch(0.62 0.025 60);     /* hint text */
  --line:         oklch(0.86 0.018 70);     /* hairline */
  --accent:       oklch(0.72 0.13 45);      /* clay/terracotta */
  --accent-deep:  oklch(0.58 0.135 40);
  --accent-soft:  oklch(0.88 0.06 55);

  --font-display: 'Noto Serif TC', serif;
  --font-body:    'Noto Sans TC', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 6px;
  --radius:    14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px oklch(0.4 0.04 50 / 0.06);
  --shadow:    0 12px 32px -16px oklch(0.4 0.04 50 / 0.18);
  --shadow-lg: 0 30px 60px -28px oklch(0.4 0.04 50 / 0.28);

  --container: 1240px;
  --gutter:    clamp(1.5rem, 5vw, 2.25rem);
}

/* ---------- Variant B: Sunbaked Boutique ---------- */
:root[data-variant="b"] {
  --bg:           oklch(0.94 0.04 65);
  --bg-elev:      oklch(0.97 0.025 70);
  --bg-deep:      oklch(0.42 0.085 40);
  --ink:          oklch(0.22 0.04 40);
  --ink-soft:     oklch(0.4 0.04 45);
  --ink-faint:    oklch(0.55 0.04 50);
  --line:         oklch(0.82 0.04 60);
  --accent:       oklch(0.55 0.16 35);
  --accent-deep:  oklch(0.4 0.14 35);
  --accent-soft:  oklch(0.85 0.08 60);
}

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  --bg:           oklch(0.18 0.014 50);
  --bg-elev:      oklch(0.22 0.018 50);
  --bg-deep:      oklch(0.14 0.014 50);
  --ink:          oklch(0.94 0.012 75);
  --ink-soft:     oklch(0.78 0.018 70);
  --ink-faint:    oklch(0.6 0.018 65);
  --line:         oklch(0.32 0.02 55);
  --accent:       oklch(0.78 0.12 50);
  --accent-deep:  oklch(0.85 0.12 55);
  --accent-soft:  oklch(0.32 0.05 50);
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
  --shadow:    0 14px 36px -16px oklch(0 0 0 / 0.6);
  --shadow-lg: 0 32px 64px -28px oklch(0 0 0 / 0.7);
}

/* ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}

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

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background: var(--ink-faint);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.4vw, 2.75rem);
  font-variation-settings: "opsz" 144;
  margin: .25rem 0 0;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.section-head h2 em {
  font-style: normal;
  color: var(--accent-deep);
  font-weight: 600;
}
.section-head .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  letter-spacing: 0.1em;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
}
.site-header .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { white-space: nowrap; }
.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  text-transform: uppercase;
  display: block;
  font-weight: 400;
  margin-top: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  position: relative;
  padding: 8px 0;
  transition: color .2s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: transform .2s ease, background-color .2s ease;
}
.nav-cta:hover { transform: translateY(-1px); background: var(--accent-deep); }
.nav-cta svg { width: 14px; height: 14px; }

.nav-icon {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  transition: color .2s ease;
}
.nav-icon:hover { color: var(--accent-deep); }

/* mobile hamburger */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.nav-toggle svg { width: 18px; height: 18px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-top: 6rem;
  padding: 4rem 0 2rem;
  background: var(--bg-deep);
  color: var(--ink);
  border-top: 1px solid var(--line);
}
:root[data-variant="b"] .site-footer { color: var(--bg); }
:root[data-variant="b"] .site-footer .ink-soft { color: oklch(0.85 0.04 65); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
  opacity: .7;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; font-size: 14px; }
.footer-grid a { opacity: .85; transition: opacity .2s; }
.footer-grid a:hover { opacity: 1; }
.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.3;
  max-width: 32ch;
  margin: 0 0 1.5rem;
  font-weight: 400;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid color-mix(in oklab, var(--line) 50%, transparent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: .7;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================================
   BUTTONS / SHARED
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s, background-color .2s, color .2s, border-color .2s;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { transform: translateY(-1px); background: var(--accent-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn .arrow { transition: transform .25s; }
.btn:hover .arrow { transform: translateX(3px); }

/* placeholder image art */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in oklab, var(--accent) 35%, transparent) 0 12px,
      color-mix(in oklab, var(--accent) 22%, transparent) 12px 24px
    ),
    var(--accent-soft);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
  border-radius: var(--radius);
  isolation: isolate;
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  inset: auto auto 12px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 999px;
  opacity: .85;
}
.ph[data-tone="dark"] {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in oklab, var(--ink) 30%, transparent) 0 14px,
      color-mix(in oklab, var(--ink) 18%, transparent) 14px 28px
    ),
    color-mix(in oklab, var(--ink) 70%, var(--accent));
}

/* fade-up reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

/* ============================================================
   PRODUCT CARD (style 1: rounded card, image on top)
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.product-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 18px;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .35s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in oklab, var(--accent) 50%, var(--line));
}
.product-card .pc-img {
  aspect-ratio: 4/3;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.product-card .pc-img .ph { border-radius: 10px; height: 100%; }
.product-card .pc-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.product-card:hover .pc-img img { transform: scale(1.05); }

.pc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.pc-meta .dot {
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.product-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  line-height: 1.25;
}
.pc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.pc-price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}
.pc-arrow {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s;
}
.pc-arrow svg { width: 12px; height: 12px; }
.product-card:hover .pc-arrow {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  transform: rotate(-45deg);
}

/* row variant */
.product-grid.is-row { grid-template-columns: 1fr; gap: 0; }
.product-grid.is-row .product-card {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 2rem;
  align-items: center;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0;
}
.product-grid.is-row .product-card:last-child { border-bottom: 1px solid var(--line); }
.product-grid.is-row .product-card:hover {
  transform: none;
  box-shadow: none;
  background: color-mix(in oklab, var(--accent-soft) 30%, transparent);
}
.product-grid.is-row .pc-img { aspect-ratio: 4/3; margin-bottom: 0; }
.product-grid.is-row .pc-bottom { border-top: none; padding-top: 0; margin-top: 0; flex-direction: column; align-items: flex-end; gap: 8px; }

/* ============================================================
   MODAL (re-engineered)
   ============================================================ */
.modal {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  inset: 0;
  background: oklch(0.15 0.012 50 / 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 1000;
  transition: opacity .35s ease, visibility 0s linear .35s;
  padding: 1.5rem;
}
.modal:target { visibility: visible; opacity: 1; transition: opacity .35s ease; }
.modal-bg { position: absolute; inset: 0; }
.modal-card {
  position: relative;
  z-index: 2;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
  transform: translateY(24px) scale(.97);
  transition: transform .45s cubic-bezier(.2,.7,.2,1);
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 3rem);
}
.modal:target .modal-card { transform: none; }
.modal-img {
  aspect-ratio: 4/5;
  background: var(--accent-soft);
  position: relative;
}
.modal-img .ph { position: absolute; inset: 0; border-radius: 0; }
.modal-img img { width: 100%; height: 100%; object-fit: cover; }
.modal-body {
  padding: 2.25rem 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}
.modal-body h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: .25rem 0 0;
}
.modal-desc { color: var(--ink-soft); font-size: 14.5px; line-height: 1.7; margin: 0; }
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.modal-grid dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}
.modal-grid dd {
  margin: 0 0 4px;
  font-weight: 500;
}
.sweetness {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.sweetness .pip {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line);
}
.sweetness .pip.on { background: var(--accent); }

.modal-footer-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
}
.modal-price {
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  z-index: 3;
  color: var(--ink);
  font-size: 18px;
  border: 1px solid var(--line);
  transition: background-color .2s, color .2s;
}
.modal-close:hover { background: var(--ink); color: var(--bg); }

/* scroll-to-top button */
.scroll-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  z-index: 90;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .25s, transform .25s, background-color .25s;
}
.scroll-top.show { opacity: 1; transform: none; pointer-events: auto; }
.scroll-top:hover { background: var(--accent-deep); }
.scroll-top svg { width: 16px; height: 16px; }

/* ============================================================
   RWD
   ============================================================ */
@media (max-width: 980px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .modal-card { grid-template-columns: 1fr; max-height: 90vh; }
  .modal-img { aspect-ratio: 5/3; }
  .modal-body { padding: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .product-grid.is-row .product-card { grid-template-columns: 140px 1fr; }
  .product-grid.is-row .pc-bottom { grid-column: 1 / -1; flex-direction: row; align-items: center; padding-top: 12px; border-top: 1px dashed var(--line); }
}
@media (max-width: 640px) {
  :root, :root[data-variant="a"], :root[data-variant="b"] {
    --gutter: 1.75rem; /* 28px breathing room on phones */
  }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav-mobile-open .nav-links {
    display: flex;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem var(--gutter);
    gap: 1.25rem;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 1rem; padding-bottom: 1.25rem; margin-bottom: 1.5rem; }
  .section-head h2 { font-size: clamp(1.9rem, 8.5vw, 2.6rem); line-height: 1.15; }
  .section-head .meta { font-size: 11px; }
  /* Header brand spacing */
  .brand-name { font-size: 1rem; }
  .brand-tag { font-size: 11px; }
  /* Modal — fit phone width with margins */
  .modal-card { margin: 1rem; max-width: calc(100vw - 2rem); }
  .modal-body { padding: 1.25rem; }
  .modal-body h3 { font-size: 1.5rem; }
  /* Product cards — bottom row breathing */
  .product-card { padding: 14px; }
  .pc-meta h3 { font-size: 1.05rem; }
}
