/* ============================================================
   日初 · DAYBREAK ROASTERS — shared design system
   Palette: oat white / light-roast caramel / carbon ink / sand
   ============================================================ */

:root {
  --oat:        #F8F6F0;   /* main background  燕麥白 */
  --caramel:    #D4A373;   /* accent           淺焙焦糖 */
  --caramel-dk: #B6824F;   /* accent pressed */
  --ink:        #333333;   /* text / lines     碳焙深灰 */
  --sand:       #EADDCD;   /* secondary bg     淺灰褐 */

  /* derived */
  --paper:     #FFFFFF;
  --ink-soft:  #6E665B;
  --ink-faint: #A29A8C;
  --line:      #E6DECF;
  --line-soft: #EFE9DD;

  --maxw: 1240px;

  --serif: 'Noto Serif TC', serif;
  --sans:  'Noto Sans TC', sans-serif;
  --latin: 'Spectral', serif;

  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--oat);
  color: var(--ink);
  line-height: 1.65;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* 頁面過場：進場/離場淡入淡出（由 layout.js 控制 .loaded class） */
  opacity: 0;
  transition: opacity 0.2s ease;
}
body.loaded { opacity: 1; }

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

.serif { font-family: var(--serif); }
.latin { font-family: var(--latin); font-style: italic; }

/* selection */
::selection { background: var(--caramel); color: #fff; }

/* ---- utility labels ---- */
.eyebrow {
  font-family: var(--latin);
  font-style: italic;
  font-size: 17px;
  letter-spacing: .04em;
  color: var(--caramel-dk);
}
.kicker {
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
}

/* ============================================================
   TOP MARQUEE
   ============================================================ */
.topbar {
  background: var(--ink);
  color: var(--oat);
  font-size: 11.5px;
  letter-spacing: .26em;
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 9px 24px;
  flex-wrap: wrap;
}
.topbar span { opacity: .85; }
.topbar .dot { opacity: .4; }

/* ============================================================
   NAV
   ============================================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,246,240,.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: grid; place-items: center;
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--caramel);
}
.brand-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1;
}
.brand-sub {
  display: block;
  font-family: var(--latin);
  font-style: italic;
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--caramel-dk);
  margin-top: 3px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-links a {
  text-decoration: none;
  font-size: 13.5px;
  letter-spacing: .08em;
  color: var(--ink-soft);
  font-weight: 400;
  transition: color .2s;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -7px;
  height: 1.5px;
  background: var(--caramel);
}
.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 8px 18px 8px 16px;
  font-size: 13px;
  letter-spacing: .1em;
  text-decoration: none;
  color: var(--ink);
  transition: background .2s, color .2s;
}
.cart-link:hover { background: var(--ink); color: var(--oat); }
.cart-link .bag {
  width: 16px; height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 3px 3px 4px 4px;
  position: relative;
}
.cart-link .bag::before {
  content: '';
  position: absolute;
  top: -5px; left: 50%; transform: translateX(-50%);
  width: 9px; height: 7px;
  border: 1.5px solid currentColor;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.cart-count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  min-width: 14px;
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
section { padding: 110px 0; }

.section-head { margin-bottom: 56px; }
.section-head.center { text-align: center; }
.section-head .eyebrow { display: block; margin-bottom: 14px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.2;
}
.section-head.center p {
  max-width: 540px;
  margin: 20px auto 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: .14em;
  font-weight: 400;
  padding: 15px 30px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--oat);
  text-decoration: none;
  cursor: pointer;
  transition: background .22s var(--ease), color .22s var(--ease), border-color .22s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn.accent { background: var(--caramel); border-color: var(--caramel); color: #fff; }
.btn.accent:hover { background: var(--caramel-dk); border-color: var(--caramel-dk); color:#fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--oat); }
.btn.block { width: 100%; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   IMAGE PLACEHOLDER (self-complete, no upload needed)
   ============================================================ */
.ph {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      rgba(212,163,115,.10) 0 2px,
      transparent 2px 13px),
    linear-gradient(160deg, var(--sand), #f1e9dc);
  display: grid;
  place-items: center;
  color: var(--caramel-dk);
}
.ph .ph-glyph {
  width: 52px; height: 52px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  display: grid; place-items: center;
  opacity: .55;
}
.ph .ph-glyph::after {
  content: '';
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.ph .ph-cap {
  position: absolute;
  bottom: 14px; left: 0; right: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--caramel-dk);
  opacity: .75;
}
.ph.dark {
  background:
    repeating-linear-gradient(135deg,
      rgba(248,246,240,.07) 0 2px,
      transparent 2px 13px),
    linear-gradient(160deg, #4a4036, #2c2620);
  color: var(--sand);
}
.ph.dark .ph-cap { color: var(--sand); opacity:.7; }

/* ============================================================
   PRODUCT CARD (with hover product<->beans swap)
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 30px;
}
.card {
  display: flex;
  flex-direction: column;
  background: transparent;
  text-decoration: none;
  color: var(--ink);
}
.card-media {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--sand);
}
.card-img,
.card-bean-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-img {
  z-index: 1;
  transition: transform .6s var(--ease);
}
.card-bean-img {
  z-index: 2;
  opacity: 0;
  transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.card-media .ph { position: absolute; inset: 0; }
.card:hover .card-bean-img { opacity: 1; }
.card-media .ph.bean { transition: transform .6s var(--ease); }
.card:hover .card-img,
.card:hover .card-bean-img,
.card:hover .card-media .ph.bean { transform: scale(1.04); }
.card-tag {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 3;
  background: var(--oat);
  color: var(--ink);
  font-size: 10.5px;
  letter-spacing: .2em;
  padding: 6px 12px;
  text-transform: uppercase;
}
.card-tag.accent { background: var(--caramel); color: #fff; }
.card-swap-hint {
  position: absolute;
  bottom: 14px; right: 14px;
  z-index: 3;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--ink-soft);
  background: rgba(248,246,240,.82);
  padding: 5px 10px;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s, transform .3s;
}
.card:hover .card-swap-hint { opacity: 1; transform: translateY(0); }
.card-body { padding: 20px 2px 0; }
.card-origin {
  font-family: var(--latin);
  font-style: italic;
  font-size: 14px;
  color: var(--caramel-dk);
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.card-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: 10px;
}
.card-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}
.tasting-chip {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}
.card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.price { font-family: var(--serif); }
.price .cur { font-size: 13px; color: var(--ink-soft); margin-right: 1px; }
.price .amt { font-size: 23px; font-weight: 600; }
.price .unit { font-size: 12px; color: var(--ink-faint); margin-left: 4px; }
.roast-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--ink-soft);
}
.roast-dot i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--caramel);
  display: inline-block;
}
.roast-dot.light i  { background: #E3BE92; }
.roast-dot.medium i { background: #B6824F; }
.roast-dot.dark i   { background: #6B4A33; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--ink);
  color: var(--oat);
  padding: 72px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 48px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(248,246,240,.16);
}
.footer-brand .brand-name { color: var(--oat); }
.footer-brand p {
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(248,246,240,.6);
  max-width: 300px;
}
.footer-col h5 {
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--caramel);
  margin-bottom: 18px;
  font-weight: 400;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 11px; }
.footer-col a {
  text-decoration: none;
  font-size: 13px;
  color: rgba(248,246,240,.78);
  transition: color .2s;
}
.footer-col a:hover { color: var(--caramel); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  font-size: 11px;
  letter-spacing: .2em;
  color: rgba(248,246,240,.4);
  text-transform: uppercase;
}

/* ============================================================
   TOAST (add-to-cart feedback)
   ============================================================ */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translate(-50%, 130%);
  z-index: 2000;
  background: var(--ink);
  color: var(--oat);
  padding: 15px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13.5px;
  letter-spacing: .04em;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.5);
  transition: transform .4s var(--ease);
}
.toast.show { transform: translate(-50%, 0); }
.toast a {
  color: var(--caramel);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .nav-links a:not(.cart-link) { display: none; }
  section { padding: 80px 0; }
  .section-head h2 { font-size: 33px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 20px; }
  .nav-inner { padding: 14px 20px; }
  .product-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
