/* 官網：白底黑字，紅色只用在按鈕和一整塊色面。 */
:root {
  --bg: #ffffff;
  --surface: #f2f2f2;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --accent: #d92b21;
  --accent-ink: #ffffff;
  --field-1: #000000;
  --field-1-ink: #ffffff;
  --font: "Archivo", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --margin: clamp(16px, 2.2vw, 32px);
  --frame-w: min(48vw, 820px);
  --gap: 24px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.5; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10; height: 64px; padding: 0 var(--margin);
  display: flex; align-items: center; justify-content: space-between; background: var(--bg);
}
.wordmark { font-weight: 600; font-size: 15px; text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px; text-decoration: none;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.btn:hover { background: #b8231b; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn.small { min-height: 36px; padding: 0 16px; font-size: 15px; }
.btn.big { min-height: 64px; padding: 0 36px; font-size: var(--step-lead); }

/* ── 第一屏：一句話被畫面切成兩半，中間是一條往下走的畫面帶 ── */
.hero { position: relative; }
.stage {
  min-height: 100svh; padding: 96px var(--margin) 40px;
  display: grid; grid-template-columns: 1fr var(--frame-w) 1fr; grid-template-rows: auto 1fr auto; column-gap: var(--gap);
}
.split { grid-column: 1 / -1; grid-row: 2; align-self: center; display: grid; grid-template-columns: subgrid; font-weight: 400; position: relative; z-index: 2; }
.half {
  font-size: clamp(34px, 2.9vw, 50px); line-height: 1; letter-spacing: -0.02em; white-space: nowrap;
}
.half.left { grid-column: 1; justify-self: start; }
.half.right { grid-column: 3; justify-self: end; }
.motion .half { animation: arrive 700ms var(--ease) both; }
.motion .half.right { animation-delay: 90ms; }
@keyframes arrive { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.reel-window { grid-column: 2; grid-row: 1 / span 3; }
.reel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gap); }
.frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: left top; border-radius: 4px; background: var(--surface); }
.caption { margin-top: 10px; font-size: var(--step-small); color: var(--muted); }
.frame.on .caption { color: var(--ink); }
.lede { grid-column: 1; grid-row: 3; align-self: end; max-width: 30ch; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.lede p { font-size: 18px; }

/* 有動畫時：舞台固定，畫面帶往上走，兩半句子不動。 */
.motion .hero { height: calc(100svh + 3 * 45svh); }
.motion .stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.motion .reel-window { position: relative; align-self: center; height: calc(var(--frame-w) * 9 / 16 + 34px); }
.motion .reel-window::before, .motion .reel-window::after { content: none; }
.motion .reel { position: absolute; inset: 0 0 auto 0; will-change: transform; }
.motion .frame { transition: opacity 400ms var(--ease); opacity: 0.35; }
.motion .frame.on { opacity: 1; }
.motion .frame.on img { animation: drift 9s var(--ease) both; }
@keyframes drift { from { transform: scale(1.025); } to { transform: scale(1); } }

/* ── 選開發的 AI：一個放大的切換鈕，色面跟著換 ── */
.choose {
  position: relative; overflow: hidden; min-height: 92svh; margin-top: 160px; padding: 72px var(--margin);
  background: var(--accent); color: var(--accent-ink); transition: background-color 500ms var(--ease), color 500ms var(--ease);
}
.choose[data-field="ink"] { background: var(--field-1); color: var(--field-1-ink); }
.choose-text { max-width: 34ch; display: flex; flex-direction: column; gap: 16px; position: relative; z-index: 1; }
.choose h2 { font-size: clamp(28px, 2.6vw, 40px); font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; }
.choose p { font-size: 17px; }
.control {
  position: absolute; right: -7vw; bottom: 12vh; font-size: clamp(40px, 11vh, 128px);
  display: flex; flex-direction: column; gap: 0.35em; color: inherit;
}
.control-label { font-size: 0.5em; font-weight: 600; }
.segments { display: inline-flex; padding: 0.12em; background: rgba(255, 255, 255, 0.16); border-radius: 0.28em; }
.segment {
  font: inherit; font-weight: 600; color: inherit; background: transparent; border: 0; border-radius: 0.2em;
  padding: 0.38em 0.9em; cursor: pointer; transition: background-color 300ms var(--ease), color 300ms var(--ease), transform 160ms var(--ease);
}
.segment:active { transform: scale(0.97); }
.segment[aria-checked="true"] { background: var(--bg); color: var(--ink); }
.segment:focus-visible { outline: 0.08em solid currentColor; outline-offset: 0.08em; }

/* ── 下載 ── */
.download { padding: 200px var(--margin) 0; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); row-gap: 48px; align-items: end; }
.download h2 { grid-column: 1 / span 8; font-size: clamp(36px, 5vw, 76px); font-weight: 400; line-height: 1.02; letter-spacing: -0.03em; }
.get { grid-column: 9 / span 4; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.meta { font-size: 16px; }

.foot {
  margin-top: 200px; padding: 0 var(--margin) 30px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; font-size: 15px;
}
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.end { justify-self: end; }

/* 進場：標題、文字、畫面依序浮上來（沒有 script 時本來就看得到）。 */
.motion .rise { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.motion .rise.in { opacity: 1; transform: none; }

/* ── 平板和手機：句子在上，畫面一張接一張橫著滑 ── */
@media (max-width: 1100px) {
  .motion .hero { height: auto; }
  .stage, .motion .stage { position: static; height: auto; min-height: 0; overflow: visible; display: flex; flex-direction: column; gap: 28px; padding-top: 104px; }
  .split { align-self: stretch; display: flex; flex-direction: column; gap: 8px; }
  .half { font-size: clamp(36px, 7vw, 56px); white-space: normal; }
  .half.right { align-self: flex-end; }
  .reel-window, .motion .reel-window { height: auto; margin: 0 calc(-1 * var(--margin)); }
  .reel, .motion .reel {
    position: static; transform: none !important; flex-direction: row; gap: 16px; overflow-x: auto;
    scroll-snap-type: x mandatory; padding: 0 var(--margin); scroll-padding: 0 var(--margin); scrollbar-width: none;
  }
  .reel::-webkit-scrollbar { display: none; }
  .frame, .motion .frame { flex: 0 0 min(78%, 640px); scroll-snap-align: start; opacity: 1; }
  .js .frame:not(.on) .caption { visibility: hidden; }
  .lede { max-width: 44ch; align-self: flex-start; }
  .download h2 { grid-column: 1 / -1; }
  .get { grid-column: 1 / -1; }
  .choose { min-height: 0; padding-bottom: 0; }
  .control { position: relative; right: auto; bottom: auto; margin: 96px 0 -0.6em auto; width: max-content; transform: translateX(12%); }
}

/* ── 手機 ── */
@media (max-width: 760px) {
  .stage, .motion .stage { gap: 20px; padding-top: 88px; }
  .half { font-size: 9vw; }
  .frame, .motion .frame { flex-basis: 86%; }
  .frame img { aspect-ratio: 4 / 3; }
  .lede p { font-size: 16px; }
  .choose { margin-top: 112px; padding: 48px var(--margin) 0; }
  .choose h2 { font-size: 26px; }
  .choose p { font-size: 16px; }
  .control { font-size: 11vw; margin: 72px 0 -0.6em 0; transform: translateX(18%); }
  .download { padding-top: 112px; row-gap: 32px; }
  .download h2 { font-size: 10vw; }
  .foot { margin-top: 120px; padding-bottom: 24px; grid-template-columns: 1fr; gap: 8px; font-size: 14px; }
  .end { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
}
