@font-face {
  font-family: "Cinzel";
  src: url("fonts/Cinzel.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English";
  src: url("fonts/IMFellEnglish-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  unicode-range: U+0000-002F, U+003A-FFFF;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English";
  src: url("fonts/IMFellEnglish-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  unicode-range: U+0000-002F, U+003A-FFFF;
  font-display: swap;
}

:root {
  --leather-950: #120806;
  --leather-900: #1b0d08;
  --leather-800: #2a140c;
  --leather-700: #3f1e11;
  --gold: #e8c26a;
  --gold-bright: #ffe7a3;
  --gold-dim: #a9853f;
  --parchment: #eedfbd;
  --parchment-dark: #d9c193;
  --ink: #3a2213;
  --ink-soft: #6a4a30;
  --text: #ecdcbc;
  --text-soft: #c4ad86;
  --radius: 14px;
  --serif-display: "Cinzel", "Trajan Pro", "Songti TC", "Songti SC", "Noto Serif CJK TC", "Noto Serif TC", "PMingLiU", serif;
  --serif-body: "IM Fell English", "Palatino", "Palatino Linotype", "Book Antiqua", "Iowan Old Style", Georgia, "Songti TC", "Songti SC", "Noto Serif CJK TC", "Noto Serif TC", "PMingLiU", serif;
  color-scheme: dark;
}

/* Language switching: html[data-l] decides which [lang] elements are shown. */
html[data-l="en"] body [lang="zh-Hant"],
html[data-l="en"] body [lang="zh-Hans"],
html[data-l="zh-Hant"] body [lang="en"],
html[data-l="zh-Hant"] body [lang="zh-Hans"],
html[data-l="zh-Hans"] body [lang="en"],
html[data-l="zh-Hans"] body [lang="zh-Hant"] {
  display: none !important;
}
html[data-l] body .lang-switch [lang] { display: inline-block !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--serif-body);
  font-size: 1.125rem;
  line-height: 1.65;
  background-color: var(--leather-900);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(232, 194, 106, 0.16), transparent 55%),
    linear-gradient(rgba(18, 8, 6, 0.55), rgba(18, 8, 6, 0.8)),
    url("leather-tile.webp");
  background-size: auto, auto, 480px 480px;
  min-height: 100vh;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-bright); }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--serif-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: var(--gold);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); text-shadow: 0 0 28px rgba(232, 194, 106, 0.35); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); text-align: center; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2.5rem); margin-inline: auto; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--gold); color: var(--leather-900); padding: .5rem 1rem; z-index: 10; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(18, 8, 6, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(232, 194, 106, 0.25);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--gold); font-family: var(--serif-display); font-weight: 600; letter-spacing: .05em; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(232,194,106,.4); }
.nav { display: flex; gap: 1.25rem; margin-left: auto; font-size: 1rem; }
.nav a { text-decoration: none; color: var(--text-soft); }
.nav a:hover { color: var(--gold-bright); }
.lang-switch { display: flex; border: 1px solid var(--gold-dim); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.lang-switch button {
  font: inherit; font-size: .85rem; color: var(--text-soft); background: transparent;
  border: 0; padding: .3rem .7rem; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--gold); color: var(--leather-900); }
@media (max-width: 760px) {
  .nav { display: none; }
  .lang-switch { margin-left: auto; }
  .brand span { font-size: .95rem; }
}

/* Ornaments */
.ornament { display: flex; align-items: center; justify-content: center; gap: .9rem; color: var(--gold); margin: 0 auto 1.6rem; max-width: 360px; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.ornament::after { transform: scaleX(-1); }
.eyebrow { font-family: var(--serif-display); letter-spacing: .2em; text-transform: uppercase; font-size: .8rem; color: var(--gold-dim); text-align: center; margin-bottom: .5rem; }
.lead { font-size: 1.25rem; color: var(--text-soft); }
.center { text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .85rem 1.5rem; border-radius: 12px;
  font-family: var(--serif-display); font-weight: 600; letter-spacing: .05em; text-decoration: none;
  background: linear-gradient(180deg, #f6d98f, #c99a45);
  color: #2a140c; border: 1px solid #ffe7a3;
  box-shadow: 0 0 0 3px rgba(232,194,106,.15), 0 10px 30px rgba(0,0,0,.45), 0 0 30px rgba(232,194,106,.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { color: #1b0d08; transform: translateY(-1px); box-shadow: 0 0 0 3px rgba(232,194,106,.25), 0 14px 34px rgba(0,0,0,.5), 0 0 40px rgba(232,194,106,.35); }
.btn small { display: block; font-size: .68rem; letter-spacing: .08em; opacity: .8; font-weight: 500; }
.btn .glyph { font-size: 1.5rem; line-height: 1; }
.btn.ghost { background: transparent; color: var(--gold); border-color: var(--gold-dim); box-shadow: none; }

/* Sections */
section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
section + section { border-top: 1px solid rgba(232, 194, 106, 0.12); }

/* Hero */
.hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 small { display: block; font-size: .45em; letter-spacing: .12em; color: var(--text-soft); text-shadow: none; margin-top: .4em; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 1.8rem 0 1rem; }
.hero .note { font-size: .95rem; color: var(--text-soft); font-style: italic; }
.hero-art { position: relative; aspect-ratio: 1 / 1; }
.hero-art .glow { position: absolute; inset: 10% 8%; background: radial-gradient(circle, rgba(232,194,106,.35), transparent 65%); filter: blur(20px); }
.hero-art .phone-cover { position: absolute; width: 46%; left: 2%; top: 6%; transform: rotate(-6deg); }
.hero-art .phone-open { position: absolute; width: 74%; right: 0; bottom: 6%; transform: rotate(3deg); }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero .cta { justify-content: center; }
  .hero-art { max-width: 520px; width: 100%; margin-inline: auto; }
}

/* Device frames */
.device {
  border-radius: 28px; padding: 8px;
  background: linear-gradient(145deg, #4b3a30, #15100d 45%, #2b211b);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 25px 60px rgba(0,0,0,.6);
}
.device img { border-radius: 21px; width: 100%; }
.device.wide { border-radius: 24px; padding: 7px; }
.device.wide img { border-radius: 18px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2.5rem; counter-reset: step; }
.step { text-align: center; }
.step .device { margin: 0 auto 1.4rem; }
.step .device.tall { max-width: 230px; }
.step .num { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 1px solid var(--gold-dim); border-radius: 50%; font-family: var(--serif-display); color: var(--gold); margin-bottom: .6rem; }
.step p { color: var(--text-soft); font-size: 1.02rem; }
.step-media { min-height: 330px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } .step-media { min-height: 0; } }
.callout { margin: 2.5rem auto 0; max-width: 720px; text-align: center; padding: 1rem 1.4rem; border: 1px dashed var(--gold-dim); border-radius: var(--radius); color: var(--text-soft); }

/* Feature cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.card {
  position: relative; padding: 1.6rem 1.5rem 1.4rem; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(63, 30, 17, 0.75), rgba(27, 13, 8, 0.85));
  border: 1px solid rgba(232, 194, 106, 0.3);
  box-shadow: inset 0 0 0 4px rgba(18, 8, 6, .5), inset 0 0 0 5px rgba(232, 194, 106, .12);
}
.card .icon { font-size: 1.6rem; color: var(--gold); line-height: 1; margin-bottom: .8rem; }
.card p { color: var(--text-soft); font-size: 1rem; margin: 0; }

/* Parchment */
.parchment {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255,255,255,.35), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(120,80,30,.18), transparent 55%),
    linear-gradient(180deg, var(--parchment), var(--parchment-dark));
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px #b8924a, 0 0 0 5px rgba(42,20,12,.9), 0 0 0 6px rgba(232,194,106,.45), 0 20px 50px rgba(0,0,0,.5);
}
.parchment h2, .parchment h3 { color: #5a3416; text-shadow: none; }
.parchment a { color: #7a4a14; }

/* Chapters */
.chapters-layout { display: grid; grid-template-columns: 300px 1fr; gap: 3rem; align-items: center; margin-top: 2.5rem; }
.chapters-layout .device { max-width: 300px; }
.chapter-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.chapter { padding: 1.2rem 1.3rem; }
.chapter h3 { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .3rem; }
.chapter .price { font-family: var(--serif-display); font-size: 1rem; color: #7a4a14; white-space: nowrap; }
.chapter p { margin: 0; font-size: .98rem; color: var(--ink-soft); }
.chapter.free { grid-column: 1 / -1; }
.chapter.bundle { grid-column: 1 / -1; background: linear-gradient(180deg, #f7e6b8, #e1c27f); }
.chapter.bundle h3 { color: #4a2a0e; }
.fineprint { font-size: .9rem; color: var(--text-soft); margin-top: 1.5rem; text-align: center; }
@media (max-width: 860px) {
  .chapters-layout { grid-template-columns: 1fr; }
  .chapters-layout .device { margin-inline: auto; max-width: 260px; }
}
@media (max-width: 520px) { .chapter-list { grid-template-columns: 1fr; } }

/* Languages */
.langs { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 2rem; padding: 0; list-style: none; }
.langs li { padding: .45rem 1rem; border: 1px solid rgba(232,194,106,.35); border-radius: 999px; background: rgba(18,8,6,.5); }

/* Film */
.film video { width: 100%; border-radius: 18px; background: #000; aspect-ratio: 16 / 9; object-fit: contain; }
.film .device.wide { margin-top: 2rem; }

/* Privacy teaser and final CTA */
.privacy-teaser { padding: 2rem; text-align: center; }
.privacy-teaser ul { list-style: none; padding: 0; margin: 1rem 0 1.4rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.4rem; }
.privacy-teaser li::before { content: "✦ "; color: #a0702a; }
.final { text-align: center; }
.final img.icon { width: 112px; height: 112px; border-radius: 25px; margin: 0 auto 1.5rem; box-shadow: 0 0 0 1px rgba(232,194,106,.5), 0 0 50px rgba(232,194,106,.3); }
.disclaimer { font-style: italic; color: var(--text-soft); }

/* Document pages */
.doc { padding: clamp(2rem, 6vw, 4rem) clamp(1.3rem, 5vw, 3.5rem); margin: clamp(2rem, 5vw, 3.5rem) auto; }
.doc h1 { color: #5a3416; text-shadow: none; font-size: clamp(1.8rem, 4.5vw, 2.6rem); text-align: center; }
.doc h2 { text-align: left; font-size: 1.3rem; margin-top: 2rem; }
.doc .meta { text-align: center; color: var(--ink-soft); font-style: italic; }
.doc ul { padding-left: 1.3rem; }
.doc li { margin-bottom: .4rem; }
.doc details { border-bottom: 1px solid rgba(90, 52, 22, .25); padding: .9rem 0; }
.doc summary { cursor: pointer; font-family: var(--serif-display); font-weight: 600; color: #5a3416; list-style: none; position: relative; padding-right: 1.6rem; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "✦"; position: absolute; right: 0; top: 0; color: #a0702a; transition: transform .2s; }
.doc details[open] summary::after { transform: rotate(45deg); }
.doc details p, .doc details ul { margin: .7rem 0 0; }
.doc .contact-box { margin-top: 2rem; padding: 1.2rem 1.4rem; border: 1px solid rgba(90,52,22,.35); border-radius: 10px; background: rgba(255,255,255,.25); }

/* Footer */
.site-footer { border-top: 1px solid rgba(232, 194, 106, 0.25); padding: 2.5rem 0 3rem; font-size: .95rem; color: var(--text-soft); background: rgba(18, 8, 6, .7); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: flex-start; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; }
.site-footer nav a { color: var(--text-soft); }
.site-footer p { margin: .2rem 0; }

/* 404 */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.notfound img { width: 120px; margin: 0 auto 1.5rem; border-radius: 26px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
.hero-eyebrow { text-align: inherit; }
.final-cta { margin: 1.5rem 0 2rem; }
.nf-cta { margin-top: 2rem; }
#nf-lang { display: inline-flex; margin-top: 2rem; }
