/* 各頁自己的版面。數值照 DESIGN-WEB.md 第 3、5、6 節與 11/15 選定的樣張。 */

/* ================= 首頁 ================= */

/* 首屏：照片佔右邊七成當背景，文字壓在左邊；高度由內容決定 */
.hero {
  position: relative;
  overflow: hidden;
  margin-top: calc(-1 * (var(--nav-h) + 14px));
  padding-top: calc(var(--nav-h) + 14px);
}
.hero-photo { position: absolute; inset: 0 0 0 auto; width: 70%; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 0; }
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 2%, var(--scrim-55) 34%, var(--scrim-0) 62%),
    linear-gradient(var(--scrim-0) 90%, var(--bg));   /* 只在最底下淡出，腹肌和下腹不被蓋到 */
}
.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(14px, 2vw, 24px);
  justify-items: start;
  padding-block: clamp(28px, 5vw, 70px) clamp(28px, 5vw, 64px);
}
.hero-copy > * { max-width: min(56vw, 700px); }
.hero-eyebrow { display: flex; flex-wrap: wrap; gap: 14px; }
.h1 { font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: var(--fs-h1); line-height: 1.12; }
.h1 .ln { display: block; padding-block: .04em; }
.h1 .ln > span { display: inline-block; white-space: nowrap; }
.h1 em { font-style: normal; background: linear-gradient(transparent 82%, var(--mark-line) 82%); }
.motto { font-family: var(--latin); font-weight: 500; color: var(--ink2); font-size: var(--fs-body); letter-spacing: .02em; }
.lede { max-width: 27em; text-wrap: balance; }
.roles { width: 100%; max-width: 31em; padding: 6px 18px; }
.roles li { display: grid; grid-template-columns: 6.2em 1fr; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-btn); }
.roles li:first-child { border-top: 0; }
.roles b { color: var(--ink); font-weight: 700; }
.entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 34em; }
.ent {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: baseline;
  column-gap: 8px;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 18px;
  color: var(--ink);
}
.ent small { grid-column: 1 / -1; font-size: var(--fs-label); letter-spacing: .06em; color: var(--ink2); }
.ent b { font-size: var(--fs-body); }
.ent-main { background: var(--mark); border-color: var(--mark); color: var(--markink); }
.ent-main small { color: var(--markink-soft); }

/* 戰績帶 */
.record { padding-top: 18px; }
.ticker { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tk {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 8px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-edge);
  background: var(--chip-bg);
}
.tk b { color: var(--ink); font-weight: 700; font-size: var(--fs-stat); line-height: 1; }
.tk span { font-size: var(--fs-btn); color: var(--ink2); }
.tk-link { align-items: center; color: var(--ink); font-size: var(--fs-btn); font-weight: 700; border-color: var(--btn-edge); background: transparent; }
.tk-link i { font-style: normal; transition: transform .3s var(--ease); }
.tk-link:hover i { transform: translateX(4px); }

/* 作品 */
.work-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 29%); gap: clamp(18px, 3vw, 40px); align-items: start; }
.work-reels { display: grid; gap: 14px; min-width: 0; }
.help { display: grid; gap: 14px; padding: 22px; }
.link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); font-size: var(--fs-btn); font-weight: 700; border-bottom: 1px solid var(--line); }
.link i { font-style: normal; transition: transform .3s var(--ease); }
.link:hover i { transform: translateX(4px); }
.sec-foot { margin-top: clamp(16px, 2.4vw, 28px); }

/* 事業：私廚、套房兩張大卡 */
.vents { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 44px); align-items: stretch; }
.vent { display: grid; gap: 16px; align-content: start; padding: 12px 12px 22px; min-width: 0; }
.vent-media { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-media); background: var(--media-bg); }
.vent-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.vent:hover .vent-media img { transform: scale(1.05); }
.vent-body { display: grid; gap: 10px; padding: 0 10px; }
.vent-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.vent blockquote { font-family: var(--serif); font-weight: 700; color: var(--ink); }
.vent .btn-row { margin-top: 6px; }

/* 關於我（首頁那一段） */
.about-home { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(20px, 4vw, 60px); align-items: center; }
.about-home.no-photo { grid-template-columns: 1fr; }
.about-photo { aspect-ratio: 4 / 5; max-height: 560px; overflow: hidden; border-radius: var(--r-card); background: var(--media-bg); justify-self: end; width: 100%; max-width: 440px; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-text { display: grid; gap: 14px; justify-items: start; }

/* 結尾三條路 */
.ends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.end { display: grid; align-content: space-between; gap: 6px; min-height: 150px; padding: 20px; color: var(--ink); }
.end b { font-family: var(--serif); font-weight: 700; font-size: var(--fs-h3); line-height: 1.2; }
.end span { font-size: var(--fs-btn); color: var(--ink2); }
.end i { justify-self: end; font-size: var(--fs-h3); line-height: 1; }
.end:hover i { transform: translateX(6px); }

/* ================= 合作寶庫 ================= */
.page-top { padding-top: clamp(28px, 5vw, 64px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chips button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--body);
  font-size: var(--fs-btn);
  transition: border-color .3s var(--ease);
}
.chips button:hover { border-color: var(--ink2); }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--markink); border-color: var(--ink); font-weight: 700; }
.v-list-page .v-item > summary { cursor: pointer; list-style: none; }
.v-list-page .v-item > summary::-webkit-details-marker { display: none; }
/* 展開的那一筆佔滿整列：左邊是卡片正面，右邊是影片、折扣 */
.v-list-page .v-item[open] { grid-column: 1 / -1; max-width: none; display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(14px, 2.4vw, 30px); align-items: start; }
.v-body { display: grid; gap: 16px; padding: 8px 8px 4px 0; min-width: 0; }
.v-note { color: var(--body); max-width: 30em; }
.reels-sm { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.v-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--ink); }
.code { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 16px; border: 1px dashed var(--btn-edge); border-radius: var(--r-pill); }
.code-val { font-family: var(--latin); font-weight: 700; font-size: var(--fs-body); letter-spacing: .06em; color: var(--ink); user-select: all; }
.copy { min-height: 36px; min-width: 4.4em; padding: 0 14px; border-radius: var(--r-pill); background: var(--chip-bg); border: 1px solid var(--glass-edge); color: var(--ink); font-size: var(--fs-btn); font-weight: 700; }
.email-row .copy, .code .copy { min-height: 44px; }
.tbl-wrap { overflow-x: auto; }
.rank { width: 100%; max-width: 34em; font-size: var(--fs-btn); }
.rank caption { caption-side: bottom; text-align: left; padding-top: 10px; font-size: var(--fs-label); color: var(--ink2); }
.rank th, .rank td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.rank th { color: var(--ink2); font-weight: 500; white-space: nowrap; }
.rank td { color: var(--body); }
.rank td:first-child { color: var(--ink); }
.rank th:nth-child(n+2), .rank td:nth-child(n+2) { text-align: right; font-family: var(--latin); font-variant-numeric: tabular-nums; }
.rank th button { min-height: 44px; font-family: var(--sans); color: var(--ink2); border-bottom: 1px solid var(--line); }
.rank th button[aria-pressed="true"] { color: var(--ink); font-weight: 700; border-color: var(--mark); }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding: clamp(18px, 3vw, 30px); }
.cta > div { display: grid; gap: 6px; }

/* ================= 作品與戰績 ================= */
.work-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 29%); gap: clamp(32px, 5vw, 64px) clamp(18px, 3vw, 40px); align-items: start; }
.work-page > .series { grid-column: 1; min-width: 0; }
.series { display: grid; gap: 14px; }
.series-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.series-head p { font-size: var(--fs-btn); color: var(--ink2); }
.series-head .lab { margin-left: 8px; vertical-align: middle; }
.reels-work { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.help-sticky { grid-column: 2; grid-row: 1 / span var(--n, 7); position: sticky; top: calc(var(--nav-h) + 30px); }
.ticker-left { justify-content: flex-start; margin-bottom: clamp(18px, 3vw, 32px); }
.events { display: grid; border-top: 1px solid var(--line); }
.ev { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 8px 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.ev-year { color: var(--ink2); font-size: var(--fs-stat); font-weight: 500; line-height: 1.1; }
.ev-name { font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: var(--fs-body); line-height: 1.5; margin-bottom: 4px; }
.ev-res { display: grid; gap: 2px; font-size: var(--fs-btn); color: var(--body); max-width: 46em; }

/* ================= 關於與聯絡 ================= */
.about-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(20px, 4vw, 60px); align-items: start; }
.about-page.no-photo { grid-template-columns: 1fr; }
.about-page .about-text { gap: 16px; }
.about-lead { position: sticky; top: calc(var(--nav-h) + 30px); justify-self: end; }
.facts { margin-top: 10px; max-width: 36em; }
.family { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 22px); }
.fam { display: grid; gap: 8px; align-content: start; }   /* 說明文字貼著照片，旁邊那張字比較多也不會被往下推 */
.fam-pic { aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r-card); background: var(--media-bg); }
.fam-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.fam figcaption { font-size: var(--fs-btn); color: var(--ink2); }
.contact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(18px, 4vw, 48px); align-items: center; padding: clamp(20px, 4vw, 44px); }
.contact-head { display: grid; gap: 10px; }
.contact-head p { max-width: 28em; }
.contact-ways { display: grid; gap: 16px; justify-items: start; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.email-row .code-val { font-size: var(--fs-body); letter-spacing: 0; overflow-wrap: anywhere; }
.ends-2 { grid-template-columns: repeat(2, 1fr); }

/* ================= 寫真 ================= */
.g-sets { display: grid; gap: clamp(36px, 6vw, 80px); }
.g-set { display: grid; gap: 16px; }
.g-grid { columns: 3; column-gap: clamp(8px, 1.4vw, 18px); }
.g-photo { display: block; break-inside: avoid; margin-bottom: clamp(8px, 1.4vw, 18px); overflow: hidden; border-radius: var(--r-media); background: var(--media-bg); }
.g-photo img { width: 100%; height: auto; transition: transform 1s var(--ease); }
.g-photo:hover img { transform: scale(1.03); }
#lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--scrim-92); color: var(--ink); overscroll-behavior: contain; }
#lightbox::backdrop { background: var(--scrim-80); }
.lb-fig { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 10px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.lb-img { min-height: 0; display: grid; place-items: center; }
.lb-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--r-media); }
.lb-cap { font-size: var(--fs-btn); color: var(--ink2); text-align: center; min-height: 1.6em; }
.lb-btn { position: absolute; width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--glass-solid); border: 1px solid var(--glass-edge); color: var(--ink); font-size: var(--fs-body); }
.lb-prev { left: 12px; top: 50%; margin-top: -24px; }
.lb-next { right: 12px; top: 50%; margin-top: -24px; }
.lb-close { right: 12px; top: 12px; }

/* 開場：橫光掃過 → 標題兩行 → 身分清單 → 三個入口。只有腳本跑起來、而且沒開「減少動態」才播 */
@media (prefers-reduced-motion: no-preference) {
  .js .lightbar { animation: sweep 1.3s var(--ease) both; }
  .js .h1 .ln > span { animation: up .8s .2s var(--ease) both; }
  .js .h1 .ln:nth-child(2) > span { animation-delay: .32s; }
  .js .roles { animation: up .8s .55s var(--ease) both; }
  .js .ent { animation: up .7s var(--ease) both; }
  .js .ent:nth-child(1) { animation-delay: .7s; }
  .js .ent:nth-child(2) { animation-delay: .8s; }
  .js .ent:nth-child(3) { animation-delay: .9s; }
}

@media (max-width: 760px) {
  /* 手機：照片移到最上面、4:3；其餘全部單欄 */
  .hero { margin-top: 0; padding-top: 0; display: grid; }
  .hero-photo { position: relative; inset: auto; width: auto; aspect-ratio: 4 / 3; margin-top: 12px; }
  /* 手機：照片放大一點、以底邊為準，頭頂上方的空白少掉大約一半（頭髮上面還留一點呼吸空間） */
  .hero-photo img { object-position: 50% 0; transform: scale(1.14); transform-origin: 50% 100%; }
  .hero-photo::after { background: linear-gradient(var(--scrim-0) 90%, var(--bg)); }
  .lightbar { bottom: 0; }
  .hero-copy { padding-block: 22px 30px; }
  .hero-copy > * { max-width: none; }
  .roles li { grid-template-columns: 5.4em 1fr; }
  .entries { max-width: none; }
  .ent { padding: 10px 12px; }
  .ticker { justify-content: flex-start; }
  .tk { white-space: normal; padding: 8px 16px; }
  .work-grid, .vents, .about-home, .ends { grid-template-columns: 1fr; }
  .about-photo { justify-self: start; max-height: none; aspect-ratio: 4 / 3; max-width: none; }
  .end { min-height: 0; }
  .v-list-page .v-item[open] { grid-template-columns: 1fr; }
  .work-page { grid-template-columns: 1fr; }
  .g-grid { columns: 2; }
  .lb-prev, .lb-next { top: auto; bottom: calc(52px + env(safe-area-inset-bottom, 0px)); margin-top: 0; }
  .about-page, .contact, .ends-2 { grid-template-columns: 1fr; }
  .about-lead { position: static; justify-self: start; grid-row: 1; }
  .family { grid-template-columns: 1fr 1fr; }
  .work-page > .series, .help-sticky { grid-column: auto; grid-row: auto; }
  .help-sticky { position: static; }
  .reels-work { grid-template-columns: repeat(2, 1fr); }
  .ev { grid-template-columns: 1fr; gap: 2px; }
  .v-body { padding: 0 6px 4px; }
}
@media (max-width: 420px) {
  .entries { grid-template-columns: 1fr; }
  .ent { grid-template-columns: auto 1fr auto; }
  .ent small { grid-column: auto; }
  .ent i { justify-self: end; }
}
