/* Renty 介紹頁：大字排版 + 角色插畫 + 捲動動畫 */
@font-face { font-family: "Anton"; src: url("fonts/anton.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "RentyScript"; src: url("fonts/script.woff2") format("woff2"); font-display: swap; }

:root {
  --ink: #141113;
  --ink-soft: rgba(20, 17, 19, 0.7);
  --ink-line: rgba(20, 17, 19, 0.16);
  --paper: #fffdfd;
  --pink: #ff9dbb;
  --pink-deep: #ff5c8d;
  /* 文字、圖示與滑過底色用的深粉紅：白底對比 5.5:1，粉紅漸層上 3.6:1 以上。--pink-deep 只留給裝飾。 */
  --pink-ink: #c81e5f;
  --pink-wash: #ffd9e5;
  --white-soft: rgba(255, 255, 255, 0.66);
  --white-line: rgba(255, 255, 255, 0.16);
  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --script: "RentyScript", "Segoe Script", "Brush Script MT", cursive;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --p: 0;
  --nav-h: 60px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 底色：取自插畫的白、粉紅，隨捲動慢慢移動 */
body::before {
  content: ""; position: fixed; inset: -20vh 0; z-index: -1;
  background:
    radial-gradient(60vw 60vh at 85% 30%, rgba(255, 157, 187, 0.55), transparent 65%),
    radial-gradient(50vw 50vh at 10% 85%, rgba(255, 196, 214, 0.6), transparent 70%),
    linear-gradient(160deg, #ffffff 0%, #fff6f9 35%, var(--pink-wash) 70%, #ffc2d5 100%);
  transform: translateY(calc(var(--p) * -14vh));
}

a { color: inherit; }
code {
  font-family: var(--mono); font-size: 0.9em; font-weight: 700;
  background: var(--ink); color: #fff; padding: 0.1em 0.45em; border-radius: 4px; white-space: nowrap;
}
.section-ink code { background: var(--pink); color: var(--ink); }
.script { font-family: var(--script); font-weight: 400; line-height: 1; }

/* 只給輔助工具看的文字；跳過連結取得焦點時才顯示 */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important; clip-path: inset(50%) !important; overflow: hidden !important;
  width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; white-space: nowrap !important;
}
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 30; background: var(--ink); color: #fff; font-weight: 800; padding: 10px 16px; border-radius: 999px; text-decoration: none; transform: translateY(-200%); }
.skip-link:focus-visible { transform: none; }
main:focus { outline: none; }

/* 導覽列 */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: rgba(255, 253, 253, 0.72); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ink-line); }
.nav-inner { display: flex; align-items: center; min-height: 60px; gap: 24px; padding: 0 28px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 1.5rem; letter-spacing: 0.04em; text-decoration: none; margin-right: auto; }
.brand-mark { width: 14px; height: 14px; border-radius: 50%; background: var(--pink-deep); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { text-decoration: none; font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.nav-links a:hover { color: var(--pink-ink); }
.nav-cta { background: var(--ink); color: #fff; text-decoration: none; font-weight: 800; font-size: 0.9rem; padding: 8px 18px; border-radius: 999px; white-space: nowrap; }
.nav-cta:hover { background: var(--pink-ink); }
.nav-cta.is-disabled { background: var(--ink-line); color: var(--ink-soft); }

/* 版面：左內容、右插畫 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 42vw; }
.content { grid-column: 1; grid-row: 1; min-width: 0; position: relative; z-index: 2; }
.stage { grid-column: 2; grid-row: 1; position: relative; z-index: 3; pointer-events: none; }
.stage-inner { position: sticky; top: 0; height: 100vh; overflow: visible; }
.stage-art {
  position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(90% 60% at 70% 20%, rgba(255, 157, 187, 0.5), transparent 70%),
    linear-gradient(200deg, #fff 0%, var(--pink-wash) 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 26%);
  mask-image: linear-gradient(to right, transparent 0, #000 26%);
}
.stage-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% calc(var(--p) * 42%);
  mix-blend-mode: multiply;
  transform: scale(calc(1.08 - var(--p) * 0.08)); transform-origin: 50% 30%;
}

/* 粉紅筆刷 */
.brush { position: absolute; width: 70%; fill: none; stroke: var(--pink); stroke-width: 22; stroke-linecap: round; opacity: 0.55; mix-blend-mode: multiply; pointer-events: none; }
.brush path { stroke-dasharray: 520; }
/* 筆刷只伸進內容欄右側的留白，不壓到文字與價格表 */
.brush-a { left: -14%; top: 70%; width: 60%; transform: rotate(-18deg); }
.brush-a path { stroke-dashoffset: calc(520px * (1 - min(1, var(--p) * 3 + 0.35))); }
.brush-b { left: -12%; top: 12%; width: 46%; transform: rotate(14deg); stroke: var(--pink-deep); stroke-width: 10; opacity: 0.45; }
.brush-b path { stroke-dashoffset: calc(520px * (1 - var(--p))); }

/* 隨區塊切換的手寫字 */
.doodle {
  position: absolute; left: 9%; top: 62%; z-index: 3;
  display: flex; align-items: flex-start; gap: 6px;
  opacity: 0; transform: rotate(-10deg) translateY(24px) scale(0.9);
  transition: opacity 0.5s, transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: none;
}
/* 淺色光暈：壓在插畫深色處時字仍看得清楚 */
.doodle .script { font-size: clamp(2.6rem, 5vw, 4.6rem); white-space: nowrap; text-shadow: 0 0 2px var(--paper), 0 0 8px var(--paper), 0 0 18px var(--paper); }
.doodle i { font-style: normal; font-size: 1.8rem; line-height: 1; }
.heart::before { content: "♥"; color: var(--pink-deep); }
.star::before { content: "☆"; color: var(--ink); }
.doodle:nth-of-type(even) { top: 74%; left: 13%; }
.stage[data-scene="hero"] .on-hero,
.stage[data-scene="how"] .on-how,
.stage[data-scene="pricing"] .on-pricing,
.stage[data-scene="payment"] .on-payment,
.stage[data-scene="rules"] .on-rules,
.stage[data-scene="commands"] .on-commands,
.stage[data-scene="faq"] .on-faq { opacity: 1; transform: rotate(-10deg) translateY(0) scale(1); }

/* 首屏 */
.hero { min-height: 100vh; padding: 96px 0 56px 5vw; display: flex; flex-direction: column; justify-content: center; }
.hero-script { font-size: clamp(2.4rem, 4.6vw, 4.4rem); color: var(--pink-ink); margin: 0 0 -0.2em 0.1em; transform: rotate(-4deg); transform-origin: left; }
h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(6.5rem, 23vw, 26rem); line-height: 0.86; letter-spacing: -0.01em;
  margin: 0 -12vw 0 -0.04em; white-space: nowrap;
  transform: translateX(calc(var(--p) * -6vw));
}
.tagline { font-size: clamp(1.5rem, 2.8vw, 2.5rem); font-weight: 900; line-height: 1.25; margin: 28px 0 10px; }
.tagline em { font-style: normal; background: linear-gradient(transparent 58%, var(--pink) 58%); }
.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 30em; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 30px; border-radius: 999px; font-weight: 800; text-decoration: none; border: 2px solid var(--ink); transition: transform 0.15s, background 0.15s, color 0.15s; }
.btn:hover { transform: translateY(-2px) rotate(-1deg); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--pink-ink); border-color: var(--pink-ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn.is-disabled { background: transparent; color: var(--ink-soft); border-color: var(--ink-line); cursor: default; transform: none; }
.highlights { list-style: none; padding: 0; margin: 44px 0 0; display: flex; flex-wrap: wrap; gap: 14px 40px; }
.highlights strong { display: block; font-family: var(--display); font-weight: 400; font-size: 2.3rem; line-height: 1.1; }
.highlights span { color: var(--ink-soft); font-size: 0.9rem; }

/* 區塊 */
.wrap { padding: 0 7vw 0 5vw; }
.section { padding: 96px 0; }
.kicker { font-family: var(--display); font-size: clamp(3.6rem, 9vw, 9rem); line-height: 0.9; margin: 0 0 14px; text-transform: uppercase; }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); font-weight: 900; margin: 0 0 32px; display: inline-block; background: linear-gradient(transparent 58%, var(--pink) 58%); }
h3 { font-size: 1.1rem; font-weight: 800; margin: 0 0 4px; }
.muted { color: var(--white-soft); margin: -14px 0 28px; }

/* 步驟 */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 84px 1fr; column-gap: 12px; padding: 22px 0; border-bottom: 1px solid var(--ink-line); }
.steps li::before { content: "0" counter(step); grid-row: span 2; font-family: var(--display); font-size: 3.2rem; line-height: 1; color: var(--pink-ink); }
.steps p { margin: 0; color: var(--ink-soft); }

/* 價格：黑底 */
.section-ink { background: var(--ink); color: #fff; margin-right: -3vw; padding-right: 3vw; border-radius: 0 28px 28px 0; }
.section-ink .kicker { color: #fff; }
.section-ink h2 { background: linear-gradient(transparent 58%, var(--pink-ink) 58%); }
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--white-line); border: 1px solid var(--white-line); }
.price { background: var(--ink); padding: 22px 18px 18px; position: relative; display: flex; flex-direction: column; transition: background 0.2s; }
.price:hover { background: #231c20; }
.price::before { content: ""; position: absolute; left: 18px; top: 0; width: 34px; height: 4px; background: var(--rank, var(--pink)); }
.price span { color: var(--white-soft); }
.price strong { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 3.6vw, 3.4rem); line-height: 1.15; white-space: nowrap; }
.price strong small { font-family: system-ui, sans-serif; font-size: 0.8rem; color: var(--white-soft); }
.rank-iron { --rank: #8a8f96; } .rank-bronze { --rank: #c98446; } .rank-silver { --rank: #cfd8dd; } .rank-gold { --rank: #f2c14e; }
.rank-plat { --rank: #35c9c1; } .rank-diamond { --rank: #d68cff; } .rank-ascendant { --rank: #3fe09a; } .rank-immortal { --rank: #ff4d6d; }

/* 儲值 */
.two-col { display: grid; gap: 28px; }
.two-col > div > p { color: var(--ink-soft); margin-top: 0; }
.checks { list-style: none; padding: 0; margin: 20px 0 0; border-top: 2px solid var(--ink); }
.checks li { padding: 12px 0 12px 30px; position: relative; border-bottom: 1px solid var(--ink-line); }
.checks li::before { content: "♥"; content: "♥" / ""; position: absolute; left: 2px; color: var(--pink-deep); }
.two-col .note { background: #fff; border: 2px solid var(--ink); border-radius: 18px; padding: 24px; box-shadow: 6px 6px 0 var(--pink); transform: rotate(-0.6deg); }
.two-col .note p { color: var(--ink-soft); margin: 8px 0 0; }

/* 規則 */
.rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.rules article { background: rgba(255, 255, 255, 0.7); border: 2px solid var(--ink); border-radius: 18px; padding: 22px; }
.rules p { margin: 0; color: var(--ink-soft); }

/* 指令 */
.table-wrap { overflow-x: auto; border-top: 2px solid var(--ink); }
.commands { width: 100%; border-collapse: collapse; }
.commands th, .commands td { text-align: left; padding: 15px 16px 15px 0; border-bottom: 1px solid var(--ink-line); }
.commands th { font-size: 0.82rem; color: var(--ink-soft); }
.commands td:first-child { width: 130px; }

/* 常見問題 */
details { border-bottom: 1px solid var(--ink-line); }
details:first-of-type { border-top: 2px solid var(--ink); }
summary { cursor: pointer; padding: 18px 40px 18px 0; font-weight: 800; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; content: "+" / ""; position: absolute; right: 4px; top: 10px; font-size: 1.7rem; font-weight: 400; color: var(--pink-ink); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 18px; color: var(--ink-soft); }

/* 結尾：黑底大字 */
.final { position: relative; z-index: 5; background: var(--ink); color: #fff; text-align: center; padding: 120px 24px; overflow: hidden; }
.final-script { font-size: clamp(4rem, 10vw, 9rem); color: var(--pink); margin: 0 0 -0.15em; transform: rotate(-5deg); }
.final h2 { font-size: clamp(2.6rem, 8vw, 7rem); line-height: 1.1; background: none; margin: 0 0 12px; display: block; }
.final .lead { margin: 0 auto 32px; color: var(--white-soft); }
.final .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.final .btn-primary:hover { background: var(--pink); border-color: var(--pink); }
.final .btn.is-disabled { color: var(--white-soft); border-color: var(--white-line); background: transparent; }
.footer { position: relative; z-index: 5; background: var(--ink); color: var(--white-soft); border-top: 1px solid var(--white-line); padding: 26px 0; font-size: 0.88rem; }
.footer p { margin: 0; }
.footer .contact { margin-bottom: 8px; }
.footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* 捲動連動：瀏覽器支援時用 CSS 捲動時間軸直接算，不經過 JavaScript；
   不支援時由 site.js 寫入 --p，沿用上面各規則裡的 var(--p)。兩邊的數值要一致。 */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: scroll()) and (animation-range: entry)) {
    @keyframes bg-drift { to { transform: translateY(-14vh); } }
    @keyframes title-drift { to { transform: translateX(-6vw); } }
    @keyframes art-pan { from { object-position: 50% 0%; transform: scale(1.08); } to { object-position: 50% 42%; transform: scale(1); } }
    @keyframes brush-a-draw { from { stroke-dashoffset: 338px; } 21.67%, to { stroke-dashoffset: 0; } }
    @keyframes brush-b-draw { from { stroke-dashoffset: 520px; } to { stroke-dashoffset: 0; } }
    body::before { animation: bg-drift linear both; animation-timeline: scroll(root); }
    h1 { animation: title-drift linear both; animation-timeline: scroll(root); }
    .stage-img { animation: art-pan linear both; animation-timeline: scroll(root); }
    .brush-a path { animation: brush-a-draw linear both; animation-timeline: scroll(root); }
    .brush-b path { animation: brush-b-draw linear both; animation-timeline: scroll(root); }
  }
}

/* 進場動畫（有 JS 才啟用） */
/* 位移用 translate 而不是 transform，才不會蓋掉元素自己的旋轉與 hover 效果 */
.js .reveal { opacity: 0; translate: 0 28px; transition: opacity 0.6s, translate 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.js .reveal.in { opacity: 1; translate: none; }
.js .kicker.reveal { translate: -40px 0; }
.js .kicker.reveal.in { translate: none; }
/* 表格列只淡入不位移，否則會撐出表格外框的垂直捲動 */
.js .commands tr.reveal { translate: none; }

/* 內容欄變窄時價格表改兩欄，「/時」才不會被擠到下一行 */
@media (max-width: 1100px) {
  .price-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  /* 手機：導覽連結移到第二列，放不下時可橫向滑動 */
  :root { --nav-h: 88px; }
  .nav-inner { padding: 0 16px; flex-wrap: wrap; row-gap: 0; }
  .nav-links { order: 3; flex: 0 0 100%; gap: 20px; overflow-x: auto; border-top: 1px solid var(--ink-line); }
  .nav-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .layout { display: block; }
  .stage-inner { position: relative; height: 128vw; margin-top: var(--nav-h); overflow: hidden; }
  .stage-img { object-position: 50% 6%; transform: none; animation: none; }
  .stage-art { -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); }
  .doodle { display: none; }
  .brush-a { left: -10%; }
  .hero { min-height: 0; padding: 0 20px 40px; margin-top: -14vw; position: relative; z-index: 4; }
  .hero-script { display: none; }
  h1 { font-size: 31vw; margin-right: 0; transform: none; animation: none; mix-blend-mode: multiply; }
  .wrap { padding: 0 20px; }
  .section { padding: 64px 0; }
  .section-ink { margin-right: 0; padding-right: 0; border-radius: 0; }
  .price-grid, .rules { grid-template-columns: repeat(2, 1fr); }
  .rules { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 64px 1fr; }
  .steps li::before { font-size: 2.4rem; }
  .btn { flex: 1 1 auto; }
}

/* 螢幕偏寬（平板、橫向）時插畫只佔半個螢幕多一點，標題與按鈕才會留在首屏；臉維持在畫面中間。
   直向手機（寬高比小於 1:2）不套用，維持上面的版面。 */
@media (max-width: 860px) and (min-aspect-ratio: 1/2) {
  .stage-inner { height: 55vh; }
  .stage-img { object-position: 50% min(0px, calc(30vh - 88vw)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; translate: none; transition: none; }
  .doodle, .btn { transition: none; }
}
