:root {
  --paper: #f6f1e7;
  --paper-2: #efe8da;
  --ink: #1f1b16;
  --ink-soft: #5b534a;
  --line: #d9cfbd;
  --cinnabar: #b3261e;
  --cinnabar-dark: #8e1d17;
  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", system-ui, sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--cinnabar); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.08em; margin: 0; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background .3s, box-shadow .3s;
}
.site-header.scrolled {
  background: rgba(246, 241, 231, .92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-seal { width: 34px; height: 34px; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: 0.2em; }
.site-nav { display: flex; gap: clamp(14px, 2.4vw, 32px); }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 15px; position: relative; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--cinnabar); transform: scaleX(0); transition: transform .25s;
}
.site-nav a:hover::after { transform: scaleX(1); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 96px 16px 64px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.7), transparent 60%),
    var(--paper);
}
.hero-seal { width: clamp(110px, 18vw, 150px); height: clamp(110px, 18vw, 150px); margin-bottom: 48px; }
.hero-title {
  font-size: clamp(28px, 5vw, 52px); font-weight: 600; line-height: 1.6; letter-spacing: 0.18em;
}
.hero-title span { display: block; }
.hero-sub { color: var(--ink-soft); margin: 28px 0 40px; letter-spacing: 0.2em; font-size: 15px; }
.hero-cta {
  display: inline-block; padding: 12px 40px;
  border: 1px solid var(--ink); color: var(--ink); text-decoration: none; letter-spacing: 0.3em;
  transition: background .25s, color .25s;
}
.hero-cta:hover { background: var(--ink); color: var(--paper); }

/* ---------- Sections ---------- */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(72px, 10vw, 120px) clamp(16px, 4vw, 40px);
  opacity: 0; transform: translateY(24px); transition: opacity .8s, transform .8s;
}
.section.in { opacity: 1; transform: none; }
.section-head { text-align: center; margin-bottom: 48px; }
.eyebrow { margin: 0 0 6px; color: var(--cinnabar); font-size: 13px; letter-spacing: 0.35em; text-transform: uppercase; }
.section-head h2 { font-size: clamp(24px, 3.2vw, 32px); }
.section-head h2::after {
  content: ""; display: block; width: 28px; height: 2px; margin: 18px auto 0; background: var(--cinnabar);
}
.section-lead { color: var(--ink-soft); margin: 18px 0 0; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.about-photo { margin: 0; }
.about-photo img {
  width: 100%; height: auto;
  border: 1px solid var(--line);
}
.photo-placeholder {
  aspect-ratio: 4 / 5; background: var(--paper-2); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink-soft); font-size: 14px; letter-spacing: 0.2em;
}
.about-name { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: 0.2em; margin: 0 0 20px; }
.about-name span { font-family: var(--sans); font-size: 14px; font-weight: 400; color: var(--ink-soft); margin-left: 14px; letter-spacing: 0.1em; }
.about-text p { margin: 0 0 14px; }
.timeline { list-style: none; padding: 0; margin: 32px 0 0; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 22px; color: var(--ink-soft); font-size: 15px; }
.timeline li::before {
  content: ""; position: absolute; left: -4px; top: 11px; width: 7px; height: 7px; background: var(--cinnabar);
}
.timeline b { color: var(--ink); font-weight: 500; display: inline-block; min-width: 4.5em; }

/* ---------- Tabs & Gallery ---------- */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 36px; }
.tabs button {
  font: inherit; font-size: 15px; letter-spacing: 0.15em; cursor: pointer;
  padding: 6px 18px; background: none; border: 1px solid transparent; color: var(--ink-soft);
}
.tabs button[aria-selected="true"] { border-color: var(--ink); color: var(--ink); }
.tabs button:hover { color: var(--cinnabar); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
/* button 預設會把內容垂直置中，改成由上往下排，圖片才會對齊 */
.work {
  font: inherit; color: inherit; text-align: left; cursor: zoom-in;
  background: none; border: 0; padding: 0;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.work img, .seal-imprint {
  aspect-ratio: 1; width: 100%; object-fit: cover;
  background: #fbf8f2; border: 1px solid var(--line);
  transition: transform .35s, box-shadow .35s;
}
.seal-imprint { display: grid; place-items: center; }
.seal-imprint svg { width: 58%; height: 58%; }
.work:hover img, .work:hover .seal-imprint { transform: translateY(-4px); box-shadow: 0 12px 28px -14px rgba(31, 27, 22, .35); }
.work-meta { display: block; padding: 12px 2px 0; }
.work-meta b, .work-meta small {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.work-meta b { font-family: var(--serif); font-weight: 600; letter-spacing: 0.12em; }
.work-meta small { color: var(--ink-soft); font-size: 13px; }

/* ---------- Articles ---------- */
.articles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.article {
  display: flex; flex-direction: column; padding: 28px; color: var(--ink); text-decoration: none;
  background: #fbf8f2; border: 1px solid var(--line); transition: border-color .25s;
}
.article:hover { border-color: var(--cinnabar); }
.article time { color: var(--cinnabar); font-size: 13px; letter-spacing: 0.15em; }
.article h3 { font-size: 19px; line-height: 1.6; margin: 10px 0 12px; }
.article p { color: var(--ink-soft); font-size: 15px; margin: 0 0 20px; flex: 1; }
.read-more { font-size: 14px; color: var(--cinnabar); }

/* ---------- Pricing ---------- */
.formula { font-family: var(--serif); font-size: 18px; margin: 22px 0 0; letter-spacing: 0.12em; }
.formula b { color: var(--cinnabar); font-weight: 600; }
.pricing-step { margin-bottom: 64px; }
.pricing-step h3, .pricing-step-title {
  display: flex; align-items: center; gap: 12px; font-size: 22px; margin-bottom: 8px;
}
.pricing-step-title { margin-bottom: 24px; }
.step-no {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  background: var(--cinnabar); color: #fff; font-size: 15px; font-family: var(--sans);
}
.stones { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-top: 24px; }
.stone {
  font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 0;
  background: #fbf8f2; border: 1px solid var(--line); transition: border-color .25s, box-shadow .25s;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.stone:hover:not(:disabled) { border-color: var(--ink-soft); }
.stone[aria-pressed="true"] { border-color: var(--cinnabar); box-shadow: 0 0 0 1px var(--cinnabar); }
.stone:disabled { cursor: not-allowed; opacity: .55; }
.stone-photo { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--paper-2); }
.stone-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.stone:hover:not(:disabled) .stone-photo img { transform: scale(1.04); }
.stone-ph {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-family: var(--serif); font-size: 44px; color: rgba(31, 27, 22, .18);
  background: linear-gradient(135deg, #e9e0cf, #d8ccb6);
}
.sold-tag {
  position: absolute; top: 10px; left: 10px; padding: 2px 10px;
  background: var(--ink); color: var(--paper); font-size: 12px; letter-spacing: 0.15em;
}
.stone-info { display: block; padding: 14px 16px 16px; }
.stone-info b { display: block; font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: 0.12em; }
.stone-info small { display: block; color: var(--ink-soft); font-size: 13px; margin: 2px 0 8px; }
.stone-info em { font-style: normal; font-family: var(--serif); font-size: 18px; color: var(--cinnabar); }
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; align-items: stretch; }
.calc-breakdown { margin: 8px 0 0; border-top: 1px solid var(--line); }
.calc-breakdown div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.calc-breakdown dt { color: var(--ink-soft); }
.calc-breakdown dd { margin: 0; font-family: var(--serif); }
.price-card { background: #fbf8f2; border: 1px solid var(--line); padding: 32px 28px; }
.price-card h3 { font-size: 20px; margin-bottom: 6px; }
.price-note { color: var(--ink-soft); font-size: 14px; margin: 0 0 16px; }
.price-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.price-table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--ink-soft); border-bottom: 1px solid var(--ink); padding: 6px 0; }
.price-table th:last-child, .price-table td:last-child { text-align: right; }
.price-table td { padding: 12px 0; border-bottom: 1px solid var(--line); font-family: var(--serif); }
.price-table td:first-child { display: flex; align-items: center; gap: 10px; }
.mini-seal { width: 16px; height: 16px; display: inline-block; }
.mini-seal.white { background: var(--cinnabar); }
.mini-seal.full-white { background: var(--cinnabar-dark); }
.mini-seal.red { border: 2px solid var(--cinnabar); }
.mini-seal.fine-red { border: 1px solid var(--cinnabar); }
.calc label { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.calc select, .calc input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 0;
}
.calc select:focus, .calc input:focus { outline: 2px solid var(--cinnabar); outline-offset: -1px; }
.calc-result { margin: 22px 0 10px; font-size: 14px; color: var(--ink-soft); }
.calc-result strong { font-family: var(--serif); font-size: 34px; color: var(--cinnabar); letter-spacing: 0.04em; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-seal { width: 84px; height: 84px; margin: 0 auto 28px; }
.contact h2 { font-size: clamp(24px, 3.2vw, 32px); margin-bottom: 18px; }
.contact p { color: var(--ink-soft); }
.contact-mail {
  display: inline-block; margin-top: 18px; padding: 14px 32px;
  background: var(--cinnabar); color: #fff; text-decoration: none; letter-spacing: 0.08em;
  transition: background .25s;
}
.contact-mail:hover { background: var(--cinnabar-dark); }

.site-footer { text-align: center; padding: 40px 16px; color: var(--ink-soft); font-size: 13px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; letter-spacing: 0.15em; }

/* ---------- Article page ---------- */
.article-cover { display: block; aspect-ratio: 16 / 9; object-fit: cover; margin: -28px -28px 20px; width: calc(100% + 56px); max-width: none; }
.back-link { color: var(--ink); text-decoration: none; font-size: 15px; }
.back-link:hover { color: var(--cinnabar); }
.post { max-width: 720px; margin: 0 auto; padding: 120px 16px 96px; min-height: 70vh; }
.post-loading { color: var(--ink-soft); text-align: center; }
.post-date { color: var(--cinnabar); font-size: 14px; letter-spacing: 0.15em; }
.post-title { font-size: clamp(26px, 4vw, 38px); line-height: 1.5; margin: 10px 0 32px; }
.post-cover { width: 100%; margin-bottom: 36px; border: 1px solid var(--line); }
.prose { font-size: 17px; line-height: 2; }
.prose h2, .prose h3 { margin: 2em 0 .6em; font-size: 22px; }
.prose p { margin: 0 0 1.4em; }
/* 文章內的照片：縮小置中、限制高度，點一下可放大 */
.prose figure { margin: 2em 0; text-align: center; }
.prose figure img {
  display: block; margin: 0 auto; width: auto; max-width: min(100%, 440px); max-height: 60vh;
  object-fit: contain; border: 1px solid var(--line); cursor: zoom-in;
}
.prose figcaption { margin-top: 10px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.img-zoom {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(31, 27, 22, .88); cursor: zoom-out;
}
.img-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--cinnabar); color: var(--ink-soft); }
.prose blockquote p { margin: 0; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.prose a { color: var(--cinnabar); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 1.6em; font-size: 15px; line-height: 1.7; }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; min-width: 5em; }
.prose th { white-space: nowrap; }
.prose th { border-bottom: 1px solid var(--ink); font-weight: 600; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(31, 27, 22, .82);
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(560px, 100%); text-align: center; color: #f6f1e7; }
.lightbox-media img, .lightbox-media .seal-imprint { width: 100%; max-height: 72vh; object-fit: contain; }
.lightbox figcaption { margin-top: 14px; font-size: 14px; }
.lightbox figcaption b { display: block; font-family: var(--serif); font-size: 18px; letter-spacing: 0.15em; }
.lightbox-close {
  position: absolute; top: 12px; right: 16px; font-size: 36px; line-height: 1;
  background: none; border: 0; color: #f6f1e7; cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .articles, .pricing-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 7px;
    width: 40px; height: 40px; background: none; border: 0; cursor: pointer; padding: 8px;
  }
  .nav-toggle span { height: 1.5px; background: var(--ink); transition: transform .25s; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }
  .site-nav {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px; display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .about-grid { grid-template-columns: 1fr; }
  .gallery, .stones { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section { opacity: 1; transform: none; transition: none; }
}
