:root {
  --paper: #ffffff;
  --rice: #f0e8d6;
  --rice-soft: #f8f4ea;
  --ink: #141312;
  --muted: #57524a;
  --faint: #8c867b;
  --rule: rgba(20, 19, 18, 0.12);
  --cinnabar: #c40510;
  --cinnabar-soft: rgba(196, 5, 16, 0.08);
  --serif: "EB Garamond", "Iowan Old Style", "Palatino", Georgia, serif;
  --display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --han: "Noto Serif SC", "Songti SC", "STSong", serif;
  --brush: "Ma Shan Zheng", "Kaiti SC", "STKaiti", serif;
  --gutter: clamp(20px, 5vw, 56px);
  --max: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Dappled leaf shadow, the app's signature paper texture */
.dapple {
  position: fixed;
  inset: -10% -10% auto auto;
  width: min(760px, 90vw);
  height: min(760px, 90vw);
  pointer-events: none;
  z-index: 0;
  opacity: 0.1;
  mix-blend-mode: multiply;
  transform-origin: 80% 10%;
  animation: sway 14s ease-in-out infinite alternate;
}
@keyframes sway {
  from { transform: rotate(-1.4deg) translate3d(0, 0, 0); }
  to   { transform: rotate(1.6deg) translate3d(-10px, 8px, 0); }
}
main, header, footer { position: relative; z-index: 1; }

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px var(--rule); }
.brand span { font-family: var(--display); font-size: 24px; font-weight: 500; letter-spacing: 0.01em; }
.top-link {
  font-size: 16px;
  text-decoration: none;
  color: var(--cinnabar);
  padding: 8px 16px;
  border: 1px solid rgba(196, 5, 16, 0.3);
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}
.top-link:hover { background: var(--cinnabar); color: #fff; }
.top-actions { display: flex; align-items: center; gap: 14px; }
/* Language switch: EN · 简 · 繁 */
.lang { display: flex; align-items: center; font-size: 15px; }
.lang a {
  min-width: 34px;
  padding: 6px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--faint);
  border-radius: 999px;
  transition: color 0.2s, background-color 0.2s;
}
.lang a:hover { color: var(--cinnabar); }
.lang a[aria-current="page"] { color: var(--ink); background: var(--cinnabar-soft); }
.lang a[lang^="zh"] { font-family: var(--han); font-size: 14px; }

/* Hero */
.hero { position: relative; padding: 40px 0 72px; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 -120px 0;
  background: url("assets/moon-landscape.jpg") center 30% / cover no-repeat;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%), linear-gradient(to right, transparent 0%, #000 45%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%), linear-gradient(to right, transparent 0%, #000 45%);
  mask-composite: intersect;
  z-index: -1;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.eyebrow {
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cinnabar);
  margin-bottom: 20px;
}
h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 24px;
}
h1 em { font-style: italic; color: var(--muted); }
.lede {
  font-size: clamp(19px, 2vw, 22px);
  color: var(--muted);
  max-width: 30em;
  text-wrap: pretty;
  margin-bottom: 36px;
}
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; }
/* App Store badge, drawn inline so it never depends on a third-party image host */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 0 20px 0 15px;
  border-radius: 11px;
  background: #000;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0 0 1px #a6a6a6;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.badge:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px #a6a6a6, 0 10px 24px -12px rgba(0, 0, 0, 0.6); }
.badge svg { width: 28px; height: 28px; flex: none; margin-top: -3px; }
.badge span { display: flex; flex-direction: column; line-height: 1; }
.badge small { font-size: 11px; letter-spacing: 0.02em; margin-bottom: 3px; }
.badge b { font-size: 23px; font-weight: 500; letter-spacing: -0.02em; }
.cta-note { font-size: 16px; color: var(--faint); }

/* Phone mockup: notched iPhone playing screen recordings of the app */
.demo { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.phone {
  position: relative;
  width: min(300px, 100%);
  padding: 11px;
  border-radius: 50px;
  background: linear-gradient(145deg, #3a3835, #1d1c1a 40%, #2b2927);
  box-shadow:
    0 50px 90px -40px rgba(20, 19, 18, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14);
}
/* Side buttons */
.phone::before, .phone::after {
  content: "";
  position: absolute;
  width: 3px;
  background: #2b2927;
  border-radius: 2px;
}
.phone::before { left: -3px; top: 21%; height: 11%; box-shadow: 0 -52px 0 -1px #2b2927; }
.phone::after { right: -3px; top: 28%; height: 15%; }
.screen {
  position: relative;
  aspect-ratio: 1170 / 2532;
  border-radius: 40px;
  overflow: hidden;
  background: #ece8df url("assets/demo/read.jpg") center / cover;
  container-type: inline-size;
  isolation: isolate;
}
.screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.screen video.on { opacity: 1; }
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  width: 41.5%;
  height: 8.2cqw;
  transform: translateX(-50%);
  background: #000;
  border-radius: 0 0 5.4cqw 5.4cqw;
  z-index: 3;
}
/* The small concave "ears" where the notch meets the top edge */
.notch::before, .notch::after {
  content: "";
  position: absolute;
  top: 0;
  width: 2cqw;
  height: 2cqw;
  background: radial-gradient(circle at 0 100%, transparent 1.95cqw, #000 2cqw);
}
.notch::before { left: -2cqw; }
.notch::after { right: -2cqw; transform: scaleX(-1); }
.statusbar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 12cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6cqw 7.5cqw 0 9.5cqw;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 4.3cqw;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #000;
  z-index: 2;
  pointer-events: none;
}
.statusbar svg { height: 3.1cqw; width: auto; display: block; }
.statusbar .icons { display: flex; align-items: center; gap: 1.4cqw; }

.demo-cap { width: min(340px, 100%); text-align: center; }
.demo-label {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cinnabar);
  margin-bottom: 4px;
}
.demo-text { font-size: 17px; line-height: 1.45; color: var(--muted); min-height: 2.9em; text-wrap: balance; }
.demo-nav { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 10px; }
.dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(20, 19, 18, 0.2);
  transition: background-color 0.2s, width 0.25s;
}
.dot[aria-current="true"]::before { width: 18px; border-radius: 4px; background: var(--cinnabar); }
.dot:hover::before { background: rgba(20, 19, 18, 0.4); }
.dot[aria-current="true"]:hover::before { background: var(--cinnabar); }
.pause {
  width: 28px;
  height: 28px;
  margin-left: 8px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.pause:hover { color: var(--cinnabar); border-color: rgba(196, 5, 16, 0.3); }
.pause svg { width: 10px; height: 10px; }

/* Sections */
section { padding: clamp(64px, 9vw, 120px) 0; }
.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cinnabar);
  margin-bottom: 18px;
}
.kicker::before { content: ""; width: 24px; height: 1px; background: currentColor; }
h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.08;
  text-wrap: balance;
  margin-bottom: 18px;
  max-width: 18em;
}
.section-lede { color: var(--muted); max-width: 34em; text-wrap: pretty; }

/* Collections band */
.band {
  background: var(--rice-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.stat { border-top: 1px solid var(--rule); padding-top: 20px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(44px, 5vw, 60px); line-height: 1; margin-bottom: 10px; font-variant-numeric: lining-nums; }
.stat span { color: var(--muted); font-size: 17px; }

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px clamp(32px, 6vw, 80px);
  margin-top: 56px;
}
.feature { display: grid; grid-template-columns: 44px 1fr; gap: 18px; }
.feature .mark {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
  display: grid;
  place-items: center;
  font-family: var(--brush);
  font-size: 24px;
  line-height: 1;
}
h3 { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 18px; text-wrap: pretty; }
.extras {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 56px;
  list-style: none;
}
.extras li {
  font-size: 16px;
  color: var(--muted);
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
}

/* Personal seal */
.seal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(40px, 7vw, 96px);
  align-items: center;
}
.seal-points { list-style: none; margin-top: 28px; display: grid; gap: 12px; max-width: 34em; }
.seal-points li { position: relative; padding-left: 22px; color: var(--muted); font-size: 18px; text-wrap: pretty; }
.seal-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: var(--cinnabar);
}
.seal-stage { display: grid; justify-items: center; gap: 18px; }
.seal-imgs { display: grid; width: min(260px, 64vw); aspect-ratio: 1; }
.seal-imgs img {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(84, 8, 12, 0.14));
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2), visibility 0.4s;
}
.seal-imgs img.off { opacity: 0; visibility: hidden; transform: scale(1.12); }
.seal-caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 12px; font-size: 20px; }
.seal-en { font-style: italic; }
.seal-arrow { color: var(--faint); }
.seal-zh { font-family: var(--han); letter-spacing: 0.08em; }
.seal-py { color: var(--faint); font-size: 16px; }
.seal-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 340px; }
.seal-chip {
  font: inherit;
  font-size: 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.seal-chip:hover { color: var(--cinnabar); border-color: rgba(196, 5, 16, 0.3); }
.seal-chip[aria-pressed="true"] { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff; }

/* Poem of the day */
.daily { position: relative; overflow: hidden; }
.daily::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/bamboo-landscape.jpg") center / cover no-repeat;
  opacity: 0.35;
  z-index: -1;
}
.daily-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  margin-top: 44px;
  padding: clamp(28px, 5vw, 56px);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.d-han { text-align: center; }
.d-title { font-family: var(--brush); font-size: clamp(38px, 4.4vw, 52px); line-height: 1.1; margin-bottom: 6px; }
.d-author { font-family: var(--han); font-size: 16px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 22px; }
.d-lines { font-family: var(--han); font-size: clamp(19px, 2vw, 22px); line-height: 2.1; letter-spacing: 0.12em; }
.d-en h3 { font-size: clamp(28px, 3vw, 34px); font-style: italic; font-weight: 400; margin-bottom: 4px; }
.d-en .by { color: var(--faint); font-size: 16px; margin-bottom: 20px; }
.d-en .trans { font-size: 20px; line-height: 1.6; margin-bottom: 20px; text-wrap: pretty; }
.d-en .note { color: var(--muted); font-size: 17px; border-left: 2px solid var(--cinnabar); padding-left: 16px; text-wrap: pretty; }
/* Carousel controls, spanning both columns under the poem */
.d-nav {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.d-nav small { color: var(--faint); font-size: 15px; }
.d-controls { display: flex; align-items: center; gap: 4px; }
.d-dots { display: flex; align-items: center; }
.arrow {
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.arrow:hover { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff; }
.arrow svg { width: 14px; height: 14px; }
.d-controls .pause { margin-left: 6px; }
/* Every poem is stacked in the same grid cell, so the card is always as tall
   as the longest poem and never jumps when the poem changes. */
.d-stack { display: grid; }
.d-stack > * { grid-area: 1 / 1; transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s; }
.d-stack > .off { opacity: 0; visibility: hidden; }
.d-han .d-stack > * { align-self: center; }
.daily-card { touch-action: pan-y; }

/* Poets */
.poets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px 32px;
  margin-top: 56px;
  list-style: none;
}
.poet { display: grid; grid-template-columns: 88px 1fr; gap: 18px; align-items: start; }
.poet img {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--rule);
  background: var(--rice);
}
.poet h3 { font-size: 23px; margin-bottom: 0; }
.poet .han { font-family: var(--han); font-size: 15px; color: var(--faint); margin-left: 6px; letter-spacing: 0.08em; }
.poet .dates { font-size: 15px; color: var(--faint); margin-bottom: 6px; font-variant-numeric: lining-nums; }
.poet p { font-size: 17px; color: var(--muted); line-height: 1.5; text-wrap: pretty; }

/* FAQ */
.faq { max-width: 780px; margin-top: 40px; }
details { border-top: 1px solid var(--rule); }
details:last-child { border-bottom: 1px solid var(--rule); }
summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--serif); color: var(--cinnabar); font-size: 26px; line-height: 1; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); padding: 0 0 24px; max-width: 38em; }
.faq-contact { max-width: 780px; margin-top: 32px; color: var(--muted); text-wrap: pretty; }
.faq-contact a { color: var(--cinnabar); text-underline-offset: 3px; overflow-wrap: anywhere; }

/* Closing CTA */
.closing {
  position: relative;
  text-align: center;
  padding: clamp(80px, 12vw, 150px) 0;
  overflow: hidden;
}
.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/snow-landscape.jpg") center bottom / cover no-repeat;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%);
  mask-image: linear-gradient(to bottom, transparent, #000 40%);
  z-index: -1;
}
.closing blockquote { font-family: var(--han); font-size: clamp(22px, 2.6vw, 28px); letter-spacing: 0.14em; margin-bottom: 10px; }
.closing cite { display: block; font-style: italic; color: var(--muted); margin-bottom: 40px; }
.closing h2 { margin-left: auto; margin-right: auto; }
.closing .cta { justify-content: center; margin-top: 28px; }

/* Footer */
footer { border-top: 1px solid var(--rule); padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); font-size: 16px; color: var(--faint); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { text-decoration: none; color: var(--muted); }
.foot a:hover { color: var(--cinnabar); }

/* Chinese pages: CJK serif for running text, Latin figures stay in Garamond */
html:lang(zh) {
  --serif: "EB Garamond", "Noto Serif SC", "Songti SC", "STSong", serif;
  --display: "Cormorant Garamond", "Noto Serif SC", "Songti SC", "STSong", serif;
}
html:lang(zh-Hant) {
  --serif: "EB Garamond", "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --display: "Cormorant Garamond", "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --han: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --brush: "Kaiti TC", "BiauKai", "Ma Shan Zheng", serif;
}
html:lang(zh) body { line-height: 1.8; }
html:lang(zh) h1 { line-height: 1.3; letter-spacing: 0.02em; }
html:lang(zh) h1 em { font-style: normal; }
html:lang(zh) h2 { line-height: 1.35; letter-spacing: 0.02em; }
html:lang(zh) h3 { letter-spacing: 0.04em; }
html:lang(zh) .eyebrow,
html:lang(zh) .kicker,
html:lang(zh) .demo-label { letter-spacing: 0.24em; }
html:lang(zh) .lede,
html:lang(zh) .section-lede { max-width: 28em; }
html:lang(zh) .d-en .trans { line-height: 1.85; }
html:lang(zh) .d-en .by { margin-bottom: 14px; }
html:lang(zh) .poet .dates { margin-top: 2px; }
.seal-en:empty, .seal-en:empty + .seal-arrow { display: none; }

@media (max-width: 880px) {
  .hero-grid, .daily-card, .seal-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 16px; }
  .hero::before { -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%); mask-image: linear-gradient(to bottom, #000 0%, transparent 70%); opacity: 0.35; }
  .phone { width: min(280px, 76vw); }
  .features { grid-template-columns: 1fr; gap: 40px; }
  .poets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  body { font-size: 18px; }
  .eyebrow { font-size: 13px; letter-spacing: 0.1em; }
  .stats { grid-template-columns: 1fr; gap: 20px; margin-top: 36px; }
  .poets { grid-template-columns: 1fr; gap: 32px; }
  .top-link { display: none; }
  summary { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dapple { animation: none; }
  .d-stack > * { transition: none; }
  .seal-imgs img { transition: none; }
}
@media (max-width: 560px) {
  .d-nav { flex-direction: column-reverse; gap: 12px; }
}
