/* ============================================================
   草菴 Herban Studio — 自架官網樣式
   設計系統：鼠尾草綠 × 暖奶油 × 墨綠字
   ============================================================ */

:root {
  --sage:      #93c0a0;   /* 品牌綠（取自 logo） */
  --green:     #6e9277;   /* 中綠 */
  --green-dk:  #415e49;   /* 墨綠（按鈕/標題） */
  --green-ink: #2c3f32;   /* 最深綠 */
  --ink:       #25282a;   /* 內文近黑 */
  --muted:     #6b736e;   /* 次要文字 */
  --line:      #e4e0d6;   /* 分隔線 */
  --cream:     #f6f3ec;   /* 暖奶油底 */
  --cream-2:   #efeadf;   /* 次背景 */
  --paper:     #ffffff;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 8px 30px rgba(40,55,45,.10);
  --shadow-sm: 0 3px 12px rgba(40,55,45,.08);
  --maxw:      1180px;
  --ease:      cubic-bezier(.22,.61,.36,1);
  --serif:     "Noto Serif TC", serif;
  --sans:      "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.75;
  font-size: 16px;
  letter-spacing: .01em;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- 共用排版 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.eyebrow {
  font-size: 13px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--green); font-weight: 700; margin-bottom: 14px;
}
.h-display { font-family: var(--serif); font-weight: 700; line-height: 1.25; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--green-ink); line-height: 1.3; }
.sec-title { font-size: clamp(26px, 4vw, 40px); margin-bottom: 18px; }
.sec-sub { color: var(--muted); max-width: 640px; font-size: 16.5px; }
.center { text-align: center; }
.center .sec-sub { margin-left: auto; margin-right: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-dk); color: #fff;
  padding: 13px 26px; border-radius: 999px;
  font-weight: 700; font-size: 15px;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
  box-shadow: var(--shadow-sm); border: 0; cursor: pointer;
}
.btn:hover { background: var(--green-ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--green-dk); border: 1.5px solid var(--green); box-shadow: none; }
.btn--ghost:hover { background: var(--green); color: #fff; }
.btn--light { background: #fff; color: var(--green-dk); }

/* ============================================================
   頁首 / 導覽
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,243,236,.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 21px; color: var(--green-ink); }
.brand img { height: 38px; width: auto; }
.brand span small { display: block; font-family: var(--sans); font-weight: 500; font-size: 10.5px; letter-spacing: .18em; color: var(--muted); }

.nav-menu { display: flex; align-items: center; gap: 6px; }
.nav-menu > li { position: relative; }
.nav-menu a.nav-link {
  display: block; padding: 10px 15px; font-weight: 600; font-size: 15px; color: var(--ink);
  border-radius: 8px; transition: color .2s, background .2s;
}
.nav-menu a.nav-link:hover, .nav-menu li.has-drop:hover > a.nav-link { color: var(--green-dk); background: rgba(110,146,119,.12); }
.nav-menu .nav-link.is-active { color: var(--green-dk); }
.has-drop > a::after { content: "›"; display: inline-block; transform: rotate(90deg); margin-left: 6px; font-size: 13px; opacity: .6; }

.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 188px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .22s var(--ease);
}
.has-drop:hover > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; padding: 9px 14px; border-radius: 7px; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.dropdown a:hover { background: var(--cream); color: var(--green-dk); }

.nav-cta { display: inline-flex; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--green-ink); margin: 5px 0; transition: .3s; border-radius: 2px; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative; padding: 120px 0 110px;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(147,192,160,.40), transparent 60%),
    radial-gradient(800px 500px at 5% 110%, rgba(110,146,119,.22), transparent 55%),
    var(--cream);
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; }
.hero h1 { font-size: clamp(32px, 5.2vw, 58px); line-height: 1.18; color: var(--green-ink); }
.hero h1 .accent { color: var(--green); }
.hero .lead { margin: 26px 0 34px; font-size: 18px; color: #3c443e; max-width: 540px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art { position: relative; display: grid; place-items: center; }
.hero-badge {
  width: min(420px, 80%); aspect-ratio: 1; border-radius: 30px;
  background: linear-gradient(150deg, #fff, var(--cream-2));
  border: 1px solid var(--line); box-shadow: var(--shadow);
  display: grid; place-items: center; padding: 14%;
}
.hero-badge img { width: 100%; filter: drop-shadow(0 10px 24px rgba(65,94,73,.18)); }
.hero-stats { display: flex; gap: 30px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats .stat strong { font-family: var(--serif); font-size: 30px; color: var(--green-dk); display: block; }
.hero-stats .stat span { font-size: 13.5px; color: var(--muted); }

/* ============================================================
   區塊：關於
   ============================================================ */
.about { background: var(--paper); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.about p + p { margin-top: 16px; }
.about .lead-quote { font-family: var(--serif); font-size: clamp(20px,2.4vw,26px); color: var(--green-ink); line-height: 1.6; }
.about-figure {
  background: linear-gradient(160deg, var(--sage), var(--green));
  border-radius: var(--radius); aspect-ratio: 4/3; display: grid; place-items: center;
  box-shadow: var(--shadow); padding: 12%;
}
.about-figure img { width: 70%; }

/* ============================================================
   優勢卡
   ============================================================ */
.adv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.adv-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.adv-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--sage); }
.adv-num { font-family: var(--serif); font-size: 15px; color: #fff; background: var(--green); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px; font-weight: 700; }
.adv-card h3 { font-size: 19px; margin-bottom: 8px; }
.adv-card p { color: var(--muted); font-size: 15px; }

/* ============================================================
   服務
   ============================================================ */
.services { background: var(--cream); }
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.svc-card {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: 150px 1fr; min-height: 180px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.svc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.svc-card .svc-img { background-size: cover; background-position: center; }
.svc-card .svc-body { padding: 26px 28px; }
.svc-card h3 { font-size: 21px; margin-bottom: 10px; }
.svc-card p { color: var(--muted); font-size: 15px; }
.svc-card .tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.svc-card .tags span { font-size: 12.5px; color: var(--green-dk); background: rgba(147,192,160,.20); padding: 4px 11px; border-radius: 999px; }

/* ============================================================
   作品預覽（首頁）
   ============================================================ */
.works-preview { background: var(--paper); }
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.work-tile {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5;
  box-shadow: var(--shadow-sm); display: block;
}
.work-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--ease); }
.work-tile:hover img { transform: scale(1.06); }
.work-tile .work-cap {
  position: absolute; inset: auto 0 0 0; padding: 22px 20px 18px;
  background: linear-gradient(to top, rgba(28,40,32,.86), transparent);
  color: #fff;
}
.work-tile .work-cap b { font-family: var(--serif); font-size: 19px; display: block; }
.work-tile .work-cap span { font-size: 12.5px; opacity: .85; letter-spacing: .14em; }

/* ============================================================
   客戶
   ============================================================ */
.clients { background: var(--cream); }
.client-wall { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.client-wall .logo {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  aspect-ratio: 3/2; display: grid; place-items: center; padding: 22px;
  filter: grayscale(.2); transition: filter .3s, transform .3s, box-shadow .3s;
}
.client-wall .logo:hover { filter: none; transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.client-wall .logo img { max-height: 64px; width: auto; object-fit: contain; }

/* ============================================================
   作品集頁（gallery）
   ============================================================ */
.page-hero {
  padding: 88px 0 56px; text-align: center;
  background: radial-gradient(900px 420px at 50% -20%, rgba(147,192,160,.35), transparent 60%), var(--cream);
}
.page-hero h1 { font-size: clamp(30px, 5vw, 48px); }
.page-hero p { color: var(--muted); margin-top: 12px; }
.crumb { font-size: 13px; color: var(--green); letter-spacing: .2em; text-transform: uppercase; margin-bottom: 14px; }

.gallery { columns: 3; column-gap: 18px; }
.gallery .item { break-inside: avoid; margin-bottom: 18px; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); cursor: zoom-in; background:#fff; }
.gallery .item img { width: 100%; transition: transform .5s var(--ease), opacity .4s; }
.gallery .item:hover img { transform: scale(1.04); }

.gallery--grid { columns: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gallery--grid .item { aspect-ratio: 1; }
.gallery--grid .item img { height: 100%; object-fit: cover; }
.gallery--portrait { grid-template-columns: repeat(4, 1fr); }
.gallery--portrait .item { aspect-ratio: 9/16; }

/* 社群貼文：圖文卡 */
.case-list { display: grid; gap: 28px; }
.case {
  display: grid; grid-template-columns: 360px 1fr; gap: 30px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.case:nth-child(even) { grid-template-columns: 1fr 360px; }
.case:nth-child(even) .case-img { order: 2; }
.case-img { aspect-ratio: 1; background: var(--cream); }
.case-img img { width: 100%; height: 100%; object-fit: cover; }
.case-body { padding: 30px 34px; }
.case-body .tag { font-size: 12.5px; color: var(--green-dk); background: rgba(147,192,160,.2); padding: 4px 12px; border-radius: 999px; display: inline-block; margin-bottom: 12px; }
.case-body h3 { font-size: 20px; line-height: 1.5; margin-bottom: 10px; }
.case-body p { color: var(--muted); font-size: 15px; }
.case-body .links { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   定價（服務頁）
   ============================================================ */
.pricing { background: var(--paper); }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.price-card {
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 30px; display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s;
}
.price-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.price-card.featured { background: linear-gradient(165deg, var(--green-dk), var(--green-ink)); color: #fff; border: 0; }
.price-card.featured h3, .price-card.featured .price { color: #fff; }
.price-card.featured .price small, .price-card.featured li { color: rgba(255,255,255,.9); }
.price-card .plan-en { font-size: 12px; letter-spacing: .28em; color: var(--green); font-weight: 700; }
.price-card.featured .plan-en { color: var(--sage); }
.price-card h3 { font-size: 23px; margin: 6px 0 4px; }
.price-card .price { font-family: var(--serif); font-size: 34px; color: var(--green-dk); margin: 12px 0 4px; }
.price-card .price small { font-size: 14px; color: var(--muted); font-family: var(--sans); }
.price-card ul { margin: 18px 0 24px; display: grid; gap: 9px; }
.price-card li { font-size: 14.5px; padding-left: 24px; position: relative; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.price-card.featured li::before { color: var(--sage); }
.price-card .btn { margin-top: auto; justify-content: center; }
.badge-pop { position: absolute; top: 18px; right: 18px; background: var(--sage); color: var(--green-ink); font-size: 11.5px; font-weight: 800; padding: 4px 11px; border-radius: 999px; letter-spacing: .1em; }

/* 服務類別清單 */
.svc-cats { display: grid; grid-template-columns: repeat(2,1fr); gap: 22px; }
.svc-cat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.svc-cat .cat-img { aspect-ratio: 16/7; background-size: cover; background-position: center; }
.svc-cat .cat-body { padding: 24px 28px; }
.svc-cat h3 { font-size: 20px; margin-bottom: 12px; }
.svc-cat ul { display: flex; flex-wrap: wrap; gap: 8px; }
.svc-cat li { font-size: 13.5px; color: #44504a; background: var(--cream); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }

/* ============================================================
   聯絡
   ============================================================ */
.contact { background: linear-gradient(165deg, var(--green-ink), #1f2d24); color: #fff; }
.contact h2 { color: #fff; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-info .row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.contact-info .row .ic { font-size: 18px; width: 26px; }
.contact-info .row a, .contact-info .row span { color: rgba(255,255,255,.92); font-size: 15.5px; }
.contact-info .row b { display: block; font-size: 12px; letter-spacing: .15em; color: var(--sage); margin-bottom: 2px; text-transform: uppercase; }
.contact-social { margin-top: 24px; display: flex; gap: 12px; }
.contact-social a { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.10); display: grid; place-items: center; transition: background .25s, transform .25s; }
.contact-social a:hover { background: var(--green); transform: translateY(-3px); }
.contact-social img { width: 22px; height: 22px; }
.form { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 30px; }
.form label { display: block; font-size: 13.5px; margin: 14px 0 6px; color: rgba(255,255,255,.85); }
.form input, .form textarea {
  width: 100%; background: rgba(255,255,255,.94); border: 0; border-radius: 9px;
  padding: 12px 14px; font-family: var(--sans); font-size: 15px; color: var(--ink);
}
.form textarea { min-height: 110px; resize: vertical; }
.form .btn { margin-top: 20px; width: 100%; justify-content: center; }

/* ============================================================
   頁尾
   ============================================================ */
.site-footer { background: #1b271f; color: rgba(255,255,255,.72); padding: 56px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-brand img { height: 40px; margin-bottom: 14px; }
.footer-brand p { font-size: 14px; max-width: 320px; }
.footer-col h4 { color: #fff; font-family: var(--sans); font-size: 14px; letter-spacing: .1em; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14px; padding: 5px 0; color: rgba(255,255,255,.72); transition: color .2s; }
.footer-col a:hover { color: var(--sage); }
.footer-bottom { padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: rgba(255,255,255,.5); }

/* ============================================================
   Lightbox
   ============================================================ */
.lb { position: fixed; inset: 0; background: rgba(20,28,22,.92); z-index: 999; display: none; place-items: center; padding: 30px; }
.lb.open { display: grid; }
.lb img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb .lb-close { position: absolute; top: 22px; right: 28px; color: #fff; font-size: 34px; cursor: pointer; line-height: 1; background:none;border:0; }
.lb .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 44px; cursor: pointer; background: none; border: 0; padding: 0 18px; opacity: .7; transition: opacity .2s; }
.lb .lb-nav:hover { opacity: 1; }
.lb .lb-prev { left: 8px; } .lb .lb-next { right: 8px; }

/* ============================================================
   換頁轉場（原生 View Transitions；不支援的瀏覽器自動退回正常換頁）
   ============================================================ */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: vt-out .26s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .42s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(10px); } }

/* 導覽列與頁尾在換頁時保持穩定，不跟著淡出 */
.site-header { view-transition-name: site-header; }
.site-footer { view-transition-name: site-footer; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ============================================================
   進場動畫（純 CSS、捲動驅動；不支援時內容永遠可見，零隱形風險）
   ============================================================ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: fadeUp .8s var(--ease) both;
      animation-timeline: view();
      animation-range: entry 5% cover 22%;
    }
  }
}

/* ============================================================
   響應式
   ============================================================ */
@media (max-width: 920px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { order: -1; }
  .adv-grid, .work-grid, .price-grid, .client-wall { grid-template-columns: repeat(2, 1fr); }
  .svc-grid, .svc-grid, .svc-cats { grid-template-columns: 1fr; }
  .gallery { columns: 2; }
  .case, .case:nth-child(even) { grid-template-columns: 1fr; }
  .case:nth-child(even) .case-img { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--cream); border-bottom: 1px solid var(--line); padding: 12px 18px 24px;
    gap: 2px; transform: translateY(-130%); transition: transform .35s var(--ease); box-shadow: var(--shadow);
  }
  .nav-menu.open { transform: translateY(0); }
  .nav-menu > li { width: 100%; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 6px 14px; min-width: auto; background: transparent; }
  .has-drop > a::after { display: none; }
  .client-wall { grid-template-columns: repeat(3, 1fr); }
  .gallery--grid, .gallery--portrait { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .adv-grid, .work-grid, .price-grid { grid-template-columns: 1fr; }
  .gallery { columns: 1; }
}
