/* =========================================================================
   陶澤 TAOTSE · shared styles
   高保真版面 — 根據 TAOTSE Design System v0.1
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@300;400;500;600;700&family=Noto+Sans+TC:wght@300;400;500;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Manrope:wght@400;500;600;700&display=swap");

:root{
  /* tokens — pulled from TAOTSE design system */
  --wood-50:  oklch(0.97 0.012 60);
  --wood-100: oklch(0.93 0.018 58);
  --wood-200: oklch(0.85 0.028 55);
  --wood-300: oklch(0.72 0.038 50);
  --wood-400: oklch(0.58 0.046 45);
  --wood-500: oklch(0.46 0.052 42);
  --wood-600: oklch(0.36 0.054 40);
  --wood-700: oklch(0.28 0.050 38);
  --wood-800: oklch(0.22 0.044 36);
  --wood-900: oklch(0.17 0.034 34);

  --rice-50:  oklch(0.985 0.008 85);
  --rice-100: oklch(0.972 0.012 82);
  --rice-200: oklch(0.955 0.015 80);
  --rice-300: oklch(0.93  0.018 78);

  --ink-green-100: oklch(0.88 0.038 158);
  --ink-green-300: oklch(0.62 0.060 156);
  --ink-green-500: oklch(0.46 0.062 154);
  --ink-green-700: oklch(0.34 0.054 152);
  --ink-green-800: oklch(0.27 0.044 150);

  --stone-300: oklch(0.78 0.008 68);
  --stone-500: oklch(0.58 0.010 66);
  --stone-700: oklch(0.40 0.012 64);

  --clay-100: oklch(0.91 0.024 65);
  --clay-300: oklch(0.80 0.038 62);

  --amber-500: oklch(0.66 0.130 70);

  /* semantic */
  --bg:          var(--rice-100);
  --bg-elevated: var(--rice-50);
  --bg-sunken:   var(--rice-200);
  --bg-dark:     var(--wood-900);

  --fg:          var(--wood-900);
  --fg-muted:    var(--wood-600);
  --fg-quiet:    var(--wood-400);
  --fg-on-dark:  var(--rice-100);
  --fg-on-dark-muted: var(--clay-300);

  --accent:      var(--ink-green-700);
  --accent-soft: var(--ink-green-100);

  --line:        oklch(0.86 0.014 60);
  --line-on-dark: oklch(0.32 0.024 36);

  --shadow-1: 0 1px 2px rgba(46, 35, 23, 0.04), 0 1px 1px rgba(46, 35, 23, 0.04);
  --shadow-2: 0 4px 12px rgba(46, 35, 23, 0.06), 0 2px 4px rgba(46, 35, 23, 0.04);
  --shadow-3: 0 24px 48px rgba(46, 35, 23, 0.08), 0 8px 16px rgba(46, 35, 23, 0.04);

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 20px;

  --font-serif-zh: "Noto Serif TC", "Songti TC", serif;
  --font-sans-zh:  "Noto Sans TC", "PingFang TC", sans-serif;
  --font-serif-en: "Cormorant Garamond", "Noto Serif TC", serif;
  --font-sans-en:  "Manrope", "Helvetica Neue", system-ui, sans-serif;
  --font-numeric:  "Manrope", ui-monospace, monospace;

  --container-max: 1120px;
  --reading-max:   640px;
  --gutter:        24px;

  --ease-settle:   cubic-bezier(0.32, 0.08, 0.24, 1);
  --dur-fast:      180ms;
  --dur-base:      260ms;
  --dur-slow:      340ms;
}

/* -------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------- */

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

html, body { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans-zh), var(--font-sans-en);
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button { font: inherit; cursor: pointer; }

/* hairline-noise overlay for that rice-paper feel */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.13  0 0 0 0 0.09  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .55;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

main, header, footer, section { position: relative; z-index: 2; }

/* -------------------------------------------------------------------------
   Type
   ------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-sans-en);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--accent);
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 14px;
}
.eyebrow.muted { color: var(--fg-muted); }
.eyebrow.on-dark { color: var(--accent-soft); }

.display-zh {
  font-family: var(--font-serif-zh);
  font-weight: 500;
  letter-spacing: .04em;
  line-height: 1.3;
  margin: 0;
}

.display-en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--fg-muted);
}

h1.display-zh { font-size: clamp(34px, 6vw, 56px); line-height: 1.25; }
h2.display-zh { font-size: clamp(26px, 4vw, 38px); }
h3.display-zh { font-size: clamp(20px, 2.6vw, 24px); }

.body-lead {
  font-family: var(--font-sans-zh);
  font-size: 17px;
  line-height: 1.8;
  color: var(--fg-muted);
  max-width: var(--reading-max);
}

.body-base { font-size: 15px; line-height: 1.8; color: var(--fg-muted); }
.body-sm   { font-size: 13px; line-height: 1.7; color: var(--fg-muted); }
.body-xs   { font-size: 12px; line-height: 1.6; color: var(--fg-quiet);  letter-spacing: .02em;}

.num { font-family: var(--font-numeric); font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------------------
   Layout primitives
   ------------------------------------------------------------------------- */

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

.reading {
  max-width: var(--reading-max);
  margin: 0 auto;
}

.section {
  padding: clamp(64px, 9vw, 144px) 0;
}
.section.compact { padding: clamp(48px, 6vw, 96px) 0; }
.section.dark {
  background: var(--bg-dark);
  color: var(--fg-on-dark);
}
.section.dark .display-en { color: var(--fg-on-dark-muted); }
.section.dark .body-lead,
.section.dark .body-base,
.section.dark .body-sm { color: var(--fg-on-dark-muted); }
.section.sunken { background: var(--bg-sunken); }
.section.elevated { background: var(--bg-elevated); }

/* a single 1px line that doesn't go full-width */
.rule {
  display: block;
  width: 64px;
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0 0 28px;
}
.rule.center { margin-left: auto; margin-right: auto; }
.rule.on-dark { background: var(--line-on-dark); }

/* -------------------------------------------------------------------------
   Nav — Medium-style scroll-up-reveal sticky
   ------------------------------------------------------------------------- */

.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 24px 0;
}
.nav.on-dark-hero { color: var(--fg-on-dark); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-serif-zh);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: .14em;
}
.logo .en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .22em;
  opacity: .7;
}

.nav-links {
  display: none;
  list-style: none;
  margin: 0; padding: 0;
  gap: 32px;
}
.nav-links a {
  font-size: 14px;
  letter-spacing: .04em;
  color: inherit;
  position: relative;
  padding: 4px 0;
  transition: color var(--dur-base) var(--ease-settle);
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--dur-base) var(--ease-settle);
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.is-active { color: var(--accent); }
.nav-links a.is-active::after { width: 100%; }

.nav-cta {
  display: none;
  font-size: 13px;
  letter-spacing: .04em;
}

.nav-hamburger {
  appearance: none;
  border: 0;
  background: transparent;
  width: 32px; height: 32px;
  display: inline-flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 6px;
  color: inherit;
}
.nav-hamburger span {
  display: block; width: 22px; height: 1.5px; background: currentColor;
}

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-hamburger { display: none; }
}

/* Floating sticky bar — appears on scroll-up */
.nav-sticky {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  padding: 12px 0;
  background: color-mix(in oklch, var(--rice-100) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform var(--dur-slow) var(--ease-settle);
}
.nav-sticky.is-visible { transform: translateY(0); }
.nav-sticky .nav-inner .logo { font-size: 16px; }
.nav-sticky .nav-inner .logo .en { font-size: 12px; }

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans-zh);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-settle),
    color var(--dur-fast) var(--ease-settle),
    transform var(--dur-fast) var(--ease-settle),
    box-shadow var(--dur-fast) var(--ease-settle);
}
.btn:hover { background: var(--wood-800); border-color: var(--wood-800); color: var(--fg-on-dark); }
.btn:active { transform: scale(.98); background: var(--wood-900); }

.btn.solid {
  background: var(--fg);
  color: var(--fg-on-dark);
}
.btn.solid:hover { background: var(--wood-800); }

.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--fg-on-dark);
}
.btn.accent:hover { background: var(--ink-green-800); border-color: var(--ink-green-800); }

.btn.ghost {
  border-color: var(--line);
  color: var(--fg);
}
.btn.ghost:hover {
  border-color: var(--fg);
  background: transparent;
  color: var(--fg);
}

.btn.on-dark {
  border-color: var(--fg-on-dark);
  color: var(--fg-on-dark);
}
.btn.on-dark:hover { background: var(--fg-on-dark); color: var(--fg); }
.btn.on-dark.solid { background: var(--fg-on-dark); color: var(--fg); }
.btn.on-dark.solid:hover { background: var(--clay-100); }

.btn .icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.btn.lg { padding: 18px 30px; font-size: 15px; }
.btn.sm { padding: 10px 16px; font-size: 13px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--accent);
  position: relative;
  padding: 4px 0;
  transition: color var(--dur-base) var(--ease-settle), gap var(--dur-base) var(--ease-settle);
}
.link-arrow::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width var(--dur-base) var(--ease-settle);
}
.link-arrow:hover { gap: 12px; }
.link-arrow:hover::after { width: 100%; }

/* -------------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------------- */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-1);
  transition:
    transform var(--dur-base) var(--ease-settle),
    box-shadow var(--dur-base) var(--ease-settle);
}
.card.hoverable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.card.flat { box-shadow: none; }
@media (max-width: 700px) {
  .card { padding: 20px; }
}

/* -------------------------------------------------------------------------
   Image media — until real photography, use warm CSS placeholders
   ------------------------------------------------------------------------- */

.media {
  position: relative;
  width: 100%;
  background: var(--wood-700);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.media.square { aspect-ratio: 1 / 1; }
.media.portrait { aspect-ratio: 3 / 4; }
.media.landscape { aspect-ratio: 4 / 3; }
.media.wide { aspect-ratio: 16 / 9; }
.media.tall { aspect-ratio: 2 / 3; }
.media.cinema { aspect-ratio: 21 / 9; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media.no-radius { border-radius: 0; }

/* protection gradient at bottom for hero text */
.media .protect {
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  background: linear-gradient(to top,
    color-mix(in oklch, var(--wood-900) 80%, transparent),
    transparent);
  pointer-events: none;
}

/* sticker overlay flag for placeholders */
.media .placeholder-tag {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--font-sans-en);
  font-size: 10px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--fg-on-dark);
  background: rgba(0,0,0,.4);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  backdrop-filter: blur(4px);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

footer.footer {
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  padding: 80px 0 32px;
}
.footer .footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 56px;
}
@media (min-width: 800px) {
  .footer .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.footer h4 {
  font-family: var(--font-serif-zh);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--fg-on-dark);
  margin: 0 0 16px;
}
.footer h4.footer-sub-h4 {
  margin: 32px 0 16px;
  font-size: 13px;
  opacity: .85;
}
.footer ul.footer-social {
  list-style: none; padding: 0;
  margin: 20px 0 0;
  display: flex;
  gap: 12px;
}
.footer ul.footer-social li { margin: 0; }
.footer ul.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #D9D2C5;
  color: var(--fg-on-dark-muted);
  transition: color var(--dur-fast) var(--ease-settle),
              border-color var(--dur-fast) var(--ease-settle),
              background-color var(--dur-fast) var(--ease-settle);
}
.footer ul.footer-social a:hover {
  color: var(--fg-on-dark);
  border-color: var(--fg-on-dark);
}
.footer ul.footer-social svg { width: 18px; height: 18px; }
@media (max-width: 800px) {
  .footer ul.footer-social { justify-content: center; }
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin: 8px 0; }
.footer a, .footer p {
  color: var(--fg-on-dark-muted);
  font-size: 13px;
  line-height: 1.8;
  transition: color var(--dur-fast) var(--ease-settle);
}
.footer a:hover { color: var(--fg-on-dark); }
.footer .footer-meta {
  border-top: 1px solid var(--line-on-dark);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--fg-on-dark-muted);
  letter-spacing: .04em;
}
.footer-disclosure {
  font-size: 11px;
  line-height: 1.7;
  color: var(--fg-on-dark-muted);
  opacity: .7;
  max-width: 480px;
}

/* -------------------------------------------------------------------------
   Page hero (smaller, for inner pages)
   ------------------------------------------------------------------------- */

.page-hero {
  padding: clamp(140px, 18vw, 200px) 0 clamp(56px, 7vw, 96px);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { margin-top: 6px; }
.page-hero .display-en { margin-top: 14px; display: block; font-size: 22px; }

/* -------------------------------------------------------------------------
   Tiny components
   ------------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-family: var(--font-sans-zh);
  color: var(--fg-muted);
  background: var(--bg-elevated);
  letter-spacing: .04em;
}

.tag-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  font-family: var(--font-sans-en);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--accent);
  text-transform: uppercase;
}

.kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 600px) {
  .kv { grid-template-columns: 140px 1fr auto; align-items: baseline; gap: 24px; }
}
.kv .k {
  font-family: var(--font-serif-zh);
  font-size: 15px;
  font-weight: 500;
}
.kv .v { font-size: 13px; color: var(--fg-muted); }
.kv .price {
  font-family: var(--font-numeric);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}

/* numbered step */
.step-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.step-row:last-child { border-bottom: 0; }
.step-row .n {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 36px;
  line-height: 1;
  color: var(--accent);
  font-weight: 400;
}
.step-row h3 { margin: 0 0 6px; }

/* utility */
.center-text { text-align: center; }
.gap-sm { display: flex; gap: 12px; flex-wrap: wrap; }
.gap-md { display: flex; gap: 16px; flex-wrap: wrap; }

/* fade-in-on-load — minimal motion, design system says ≤ 8px translate + fade */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 340ms var(--ease-settle), transform 340ms var(--ease-settle);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* selection */
::selection { background: var(--accent); color: var(--fg-on-dark); }

/* -------------------------------------------------------------------------
   Mobile menu drawer
   ------------------------------------------------------------------------- */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  padding: 24px var(--gutter);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-settle);
  display: flex;
  flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 40px;
}
.drawer-close {
  appearance: none; border: 0; background: transparent;
  width: 32px; height: 32px;
  font-size: 28px; line-height: 1; color: var(--fg);
}
.drawer ul {
  list-style: none; padding: 0; margin: 0;
}
.drawer li {
  border-bottom: 1px solid var(--line);
}
.drawer li a {
  display: block;
  padding: 18px 0;
  font-family: var(--font-serif-zh);
  font-size: 22px;
  letter-spacing: .04em;
}
.drawer li a .en {
  display: block;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 4px;
  letter-spacing: .08em;
}
.drawer-cta {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  gap: 12px;
}
.drawer-cta .btn { flex: 1; }
