/* AniLife 官方網站 —— 共用視覺系統
   色彩全部集中在下方 :root，深色版只換值、不另寫版面。 */

:root {
  /* 取自 App icon 與 DSTokens.swift */
  --paper: #faf7f3;
  --surface: #ffffff;
  --ink: #23303f;
  --ink-soft: #5c6b7d;
  --line: #e6dfd7;
  --perf: #ddd4c9;
  --accent: #e39a2c;
  /* 需要被看清楚的琥珀（連結底線、展開標記）：淺色底上要有足夠對比 */
  --accent-strong: #b4720e;
  --sakura: #f2a5ae;
  --shadow: 0 1px 2px rgba(35, 48, 63, 0.04), 0 8px 24px rgba(35, 48, 63, 0.06);

  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
    "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Noto Sans TC", "Microsoft JhengHei", sans-serif;

  --page: 1080px;
  --gutter: clamp(20px, 5vw, 48px);
  --rhythm: clamp(56px, 9vw, 104px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141210;
    --surface: #221e1b;
    --ink: #efe9e2;
    --ink-soft: #a89e92;
    --line: #3a342e;
    --perf: #4a423a;
    --accent: #f1b452;
    --accent-strong: #f1b452;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 {
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 2.85rem);
  line-height: 1.35;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.55rem);
  line-height: 1.5;
}

h3 {
  font-size: 1.1875rem;
  line-height: 1.6;
}

p {
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration-color: var(--accent-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.66;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- 版面容器 ------------------------------------------------------- */

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 20px;
  z-index: 10;
  border-radius: 0 0 10px 0;
}

.skip:focus {
  left: 0;
}

/* --- 導覽列 --------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.site-nav {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
  font-size: 0.9375rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: 6px;
}

.site-nav a:hover {
  color: var(--ink);
  opacity: 1;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent-strong);
}

/* --- 首頁 hero ------------------------------------------------------ */

.hero {
  padding-block: clamp(48px, 9vw, 96px) clamp(40px, 7vw, 72px);
  text-align: center;
}

.hero-icon {
  width: clamp(88px, 14vw, 116px);
  height: auto;
  border-radius: 24%;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin-top: 28px;
  max-width: 15em;
  margin-inline: auto;
  text-wrap: initial;
}

/* 讓換行優先落在句讀之間，而不是把詞拆開 */
.hero h1 span {
  display: inline-block;
}

.lede {
  margin: 20px auto 0;
  max-width: 30em;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.cta {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--ink);
}

.btn:hover {
  opacity: 0.85;
}

/* App Store 連結還沒有時的狀態，不產生死連結 */
.btn--pending {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-weight: 500;
  cursor: default;
}

.cta small {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* --- 段落骨架：左標題、右內容 --------------------------------------- */

.section {
  padding-block: var(--rhythm);
  border-top: 1px solid var(--line);
}

.section > .wrap {
  display: grid;
  gap: clamp(24px, 4vw, 56px);
}

@media (min-width: 900px) {
  .section > .wrap {
    grid-template-columns: minmax(160px, 220px) 1fr;
    gap: 64px;
  }

  .section-head {
    position: sticky;
    top: 92px;
    align-self: start;
  }
}

.section-head h2 {
  color: var(--ink);
}

.section-head p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* --- 功能列表 ------------------------------------------------------- */

.feature + .feature {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.feature p {
  margin-top: 8px;
  color: var(--ink-soft);
  max-width: 34em;
  text-wrap: pretty;
}

/* --- 截圖 ----------------------------------------------------------- */

.shots {
  padding-block: var(--rhythm);
  border-top: 1px solid var(--line);
}

.shots-head {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shots-head p {
  margin-top: 10px;
  color: var(--ink-soft);
  max-width: 40em;
}

/* 底片齒孔：取自 App icon 的底片格，全站只出現在截圖區上下緣 */
.filmstrip {
  height: 15px;
  margin-block: clamp(28px, 4vw, 44px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    90deg,
    var(--perf) 0 13px,
    transparent 13px 30px
  );
  background-size: 100% 5px;
  background-position: center;
  background-repeat: repeat-x;
}

.filmstrip--end {
  margin-block: 0 0;
}

.rail {
  display: flex;
  gap: clamp(20px, 3vw, 36px);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: clamp(28px, 4vw, 44px) var(--gutter);
  margin: 0;
  list-style: none;
  scrollbar-width: thin;
}

.rail li {
  flex: 0 0 auto;
  width: clamp(190px, 46vw, 240px);
  scroll-snap-align: center;
}

.rail figure {
  margin: 0;
}

.rail img {
  width: 100%;
  height: auto;
  display: block;
}

.rail figcaption {
  margin-top: 14px;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--ink-soft);
  text-align: center;
}

/* --- 一般內文頁（支援 / 隱私 / 條款） ------------------------------- */

.page-head {
  padding-block: clamp(44px, 7vw, 80px) clamp(20px, 3vw, 32px);
  max-width: 42em;
  margin-inline: auto;
}

.page-head h1 {
  max-width: 16em;
}

.page-head p {
  margin-top: 16px;
  color: var(--ink-soft);
  max-width: 40em;
}

.prose {
  padding-bottom: var(--rhythm);
  max-width: 42em;
  margin-inline: auto;
}

.prose h2 {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.prose h2:first-child {
  margin-top: 24px;
}

.prose h3 {
  margin-top: 32px;
}

.prose p,
.prose ul {
  margin-top: 14px;
  color: var(--ink-soft);
}

.prose h2 + p,
.prose h3 + p {
  margin-top: 10px;
}

.prose ul {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 8px;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.meta {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* --- 常見問題 ------------------------------------------------------- */

.faq {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  padding-block: 18px;
  font-weight: 600;
  font-family: var(--font-display);
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "＋";
  margin-left: auto;
  color: var(--accent-strong);
  font-weight: 700;
}

.faq details[open] summary::after {
  content: "－";
}

.faq details > *:not(summary) {
  color: var(--ink-soft);
  margin-top: 0;
  margin-bottom: 20px;
}

.faq details ul {
  padding-left: 1.25em;
}

/* --- 聯絡區塊 ------------------------------------------------------- */

.contact {
  margin-top: 20px;
  padding: clamp(20px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.contact p + p {
  margin-top: 8px;
}

.contact a {
  font-weight: 600;
  word-break: break-word;
}

/* --- 頁尾 ----------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding-block: 40px 56px;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 20px;
}

.foot-nav a {
  text-decoration: none;
}

.foot-nav a:hover {
  text-decoration: underline;
}

.site-foot p + p {
  margin-top: 10px;
}

.site-foot .credits {
  max-width: 46em;
}

/* --- 404 ------------------------------------------------------------ */

.notfound {
  padding-block: clamp(72px, 14vw, 140px);
  text-align: center;
}

.notfound p {
  margin-top: 16px;
  color: var(--ink-soft);
}

.notfound .btn {
  margin-top: 32px;
}

/* --- 動態 ----------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(8px);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
