/*
 * 醒來再說 TAKE A NAP — 品牌設計規範（brand tokens + 共用元件）
 * takeanap.tw 與 card.takeanap.tw 共用同一份；改這裡，兩站一起更新。
 *
 * 色彩用途：
 *   --sun        品牌橘：大面積、圖形、3D、底色塊（不當小字用）
 *   --sun-strong 大標題的橘字、圖示（對暖白 3.4:1，符合大字 AA）
 *   --sun-text   小字的橘字、連結（對暖白 4.8:1，符合 AA）
 *   --line-green 只用在 LINE 按鈕
 */
:root {
  --bg: #FBF9F7;
  --paper: #FFFFFF;
  --cream: #F4EFEA;
  --cream-2: #EDE6DE;
  --ink: #1A1A1A;
  --ink2: #4C4944;
  --muted: #6F6A64;
  --line: rgba(26, 26, 26, .10);
  --line-strong: rgba(26, 26, 26, .18);

  --sun: #FA7A35;
  --sun2: #EE9936;
  --sun-strong: #E0601C;
  --sun-text: #B8501A;
  --sun-soft: rgba(250, 122, 53, .12);
  --sun-softer: rgba(250, 122, 53, .07);
  --line-green: #06C755;

  --dark: #1A1A1A;
  --dark-2: #252321;
  --on-dark: #F4EFEA;
  --on-dark-muted: #B5AEA6;
  --dark-line: rgba(244, 239, 234, .14);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-latin: "Sora", -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;

  --r-sm: 12px;
  --r: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(40, 30, 20, .05), 0 2px 8px rgba(40, 30, 20, .05);
  --shadow: 0 18px 40px -18px rgba(40, 30, 20, .22), 0 2px 6px rgba(40, 30, 20, .05);
  --shadow-lg: 0 30px 60px -20px rgba(40, 30, 20, .28);

  --wrap: 1160px;
  --nav-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@font-face { font-family: "Sora"; font-weight: 400; font-display: swap; src: url("/assets/fonts/sora-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2010-2027, U+2190-21FF; }
@font-face { font-family: "Sora"; font-weight: 600; font-display: swap; src: url("/assets/fonts/sora-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2010-2027, U+2190-21FF; }
@font-face { font-family: "Sora"; font-weight: 700; font-display: swap; src: url("/assets/fonts/sora-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2010-2027, U+2190-21FF; }

/* ---------- 基礎 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.nw { white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--pill); text-decoration: none; font-weight: 700; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--sun-strong); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(250, 122, 53, .22); }

/* ---------- 字級 ---------- */
h1 { font-size: clamp(34px, 5.4vw, 58px); line-height: 1.2; letter-spacing: .02em; font-weight: 800; }
h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.32; letter-spacing: .02em; font-weight: 700; }
h3 { font-size: 18px; line-height: 1.45; font-weight: 700; letter-spacing: .01em; }
h1 em, h2 em { font-style: normal; color: var(--sun-strong); }
.lead { font-size: clamp(16px, 1.4vw, 18px); color: var(--ink2); max-width: 34em; }
.sub { color: var(--ink2); max-width: 36em; }
.small { font-size: 14px; color: var(--muted); }
.latin { font-family: var(--font-latin); }

/* 小標：英文大寫、加寬字距、橘色 */
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-latin); font-size: 12.5px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--sun-text);
}
.kicker b { font-weight: 700; color: var(--ink); letter-spacing: .08em; }
.kicker b::after { content: ""; display: inline-block; width: 22px; height: 1px; background: var(--line-strong); margin-left: 10px; vertical-align: middle; }

/* 膠囊標籤 */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--sun-text);
  background: var(--sun-soft); padding: 6px 14px; border-radius: var(--pill); letter-spacing: .06em;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: var(--pill);
  font-weight: 700; font-size: 15px; letter-spacing: .02em; text-decoration: none;
  border: 0; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.btn svg { width: 19px; height: 19px; flex: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-line { background: var(--line-green); color: #fff; box-shadow: 0 8px 20px rgba(6, 199, 85, .25); }
.btn-line:hover { box-shadow: 0 12px 26px rgba(6, 199, 85, .32); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; box-shadow: var(--shadow); }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-light { background: var(--on-dark); color: var(--ink); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--sun-text); text-decoration: none; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- 導覽列 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 249, 247, .86);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 16px; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .04em; font-size: 17px; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand small { font-family: var(--font-latin); font-weight: 600; font-size: 10.5px; letter-spacing: .2em; color: var(--muted); display: block; line-height: 1; margin-top: 3px; }
.brand span { display: block; line-height: 1.1; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 14.5px; list-style: none; }
.nav-links a { display: block; padding: 8px 12px; border-radius: var(--pill); text-decoration: none; color: var(--ink2); transition: background-color .2s, color .2s; }
.nav-links a:hover { color: var(--ink); background: rgba(26, 26, 26, .05); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav-links .tag { font-family: var(--font-latin); font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--sun-text); background: var(--sun-soft); padding: 1px 6px; border-radius: var(--pill); margin-left: 4px; vertical-align: 2px; }
.nav .btn { margin-left: 8px; }
.menu-btn { display: none; margin-left: 4px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); cursor: pointer; place-items: center; }
.menu-btn svg { width: 20px; height: 20px; }
@media (max-width: 960px) {
  .nav-links { display: none; }
  .menu-btn { display: grid; }
  .nav .btn { margin-left: auto; }
}
.drawer { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 49; background: var(--bg); padding: 16px 20px 40px; overflow-y: auto; display: none; }
.drawer.open { display: block; animation: drawer-in .28s var(--ease); }
@keyframes drawer-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.drawer ul { list-style: none; display: grid; }
.drawer a { display: flex; justify-content: space-between; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 18px; font-weight: 700; }
.drawer a small { font-family: var(--font-latin); font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--muted); }
.drawer .cta { margin-top: 24px; flex-direction: column; }
.drawer .cta .btn { width: 100%; }
body.menu-open { overflow: hidden; }

/* ---------- 區塊 ---------- */
.section { padding: 104px 0; position: relative; }
@media (max-width: 720px) { .section { padding: 68px 0; } }
.section--cream { background: var(--cream); }
.section--paper { background: var(--paper); }
.section--fade { background: linear-gradient(180deg, var(--bg), var(--cream)); }
.section--dark { background: var(--dark); color: var(--on-dark); }
.section--dark .sub, .section--dark .lead, .section--dark p { color: var(--on-dark-muted); }
.section--dark h2 em, .section--dark h1 em { color: var(--sun); }
.section--dark .kicker { color: var(--sun); }
.section--dark .kicker b { color: var(--on-dark); }
.section--dark .kicker b::after { background: var(--dark-line); }

.head { display: grid; gap: 20px; margin-bottom: 48px; }
.head h2 { margin-top: 12px; }
@media (min-width: 900px) {
  .head.split { grid-template-columns: 1.15fr .85fr; align-items: end; gap: 48px; }
  .head.split .sub { justify-self: end; }
}
.head.center { text-align: center; justify-items: center; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.grid > * { min-width: 0; }

/* ---------- 卡片 ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 26px; position: relative; }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--ink2); font-size: 15px; }
.section--cream .card { border-color: rgba(26, 26, 26, .07); }
.section--dark .card { background: var(--dark-2); border-color: var(--dark-line); }
.section--dark .card p { color: var(--on-dark-muted); }
.ic { width: 46px; height: 46px; border-radius: 14px; background: var(--sun-soft); color: var(--sun-strong); display: grid; place-items: center; margin-bottom: 18px; flex: none; }
.ic svg { width: 24px; height: 24px; stroke-width: 1.8; }
.section--dark .ic { background: rgba(250, 122, 53, .16); color: var(--sun); }

/* 勾勾清單 */
.checks { list-style: none; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; font-size: 15px; color: var(--ink2); }
.checks li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: var(--sun-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E0601C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat; }
.section--dark .checks li { color: var(--on-dark-muted); }

/* 標籤列 */
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tags li { font-size: 13px; padding: 5px 12px; border-radius: var(--pill); border: 1px solid var(--line-strong); color: var(--ink2); background: var(--paper); }

/* 承諾小字列 */
.assure { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; font-size: 14px; color: var(--muted); }
.assure li { display: inline-flex; align-items: center; gap: 6px; }
.assure svg { width: 16px; height: 16px; color: var(--sun-strong); }

/* ---------- 步驟 ---------- */
.steps { counter-reset: s; }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 24px; position: relative; }
.step::before {
  counter-increment: s; content: "0" counter(s);
  position: absolute; top: 18px; right: 22px;
  font-family: var(--font-latin); font-size: 38px; font-weight: 700; line-height: 1;
  color: var(--sun-softer); -webkit-text-stroke: 1px rgba(224, 96, 28, .38);
}
.step h3 { margin-bottom: 6px; padding-right: 48px; }
.step p { color: var(--ink2); font-size: 15px; }
.step .meta { margin-top: 14px; font-size: 12.5px; font-weight: 700; color: var(--sun-text); background: var(--sun-soft); display: inline-block; padding: 2px 10px; border-radius: var(--pill); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 22px; transition: border-color .2s; }
.faq details[open] { border-color: var(--line-strong); }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--sun-strong); font-size: 22px; line-height: 1; font-weight: 400; flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 10px; color: var(--ink2); font-size: 15px; }
.faq details p a { color: var(--sun-text); }

/* ---------- 頁尾 ---------- */
.footer { background: var(--dark); color: var(--on-dark-muted); padding: 72px 0 32px; font-size: 14px; }
.footer a { color: var(--on-dark-muted); text-decoration: none; }
.footer a:hover { color: var(--on-dark); }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; padding-bottom: 48px; border-bottom: 1px solid var(--dark-line); }
@media (max-width: 880px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-top { grid-template-columns: 1fr; } }
.footer .brand { color: var(--on-dark); }
.footer .brand small { color: var(--on-dark-muted); }
.footer-brand p { margin-top: 16px; max-width: 22em; line-height: 1.8; }
.footer h4 { font-size: 13px; font-weight: 700; color: var(--on-dark); letter-spacing: .08em; margin-bottom: 14px; }
.footer ul { list-style: none; display: grid; gap: 10px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 24px; font-size: 13px; }
.footer-bottom nav { display: flex; gap: 18px; }

/* ---------- 進場動畫 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .btn, .link-arrow svg { transition: none; }
}
