/* 5200 Weeks website.
   Colours, radii and paper follow the app (lib/theme.dart, lib/widgets/paper_background.dart);
   headings use the typefaces of the store art (tool/make_store_screenshots.py).
   Light only, like the app. */

@font-face { font-family: "W5200 Mono"; src: url("fonts/mono.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "W5200 Serif TC"; src: url("fonts/serif-tc.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "W5200 Mincho"; src: url("fonts/mincho-ja.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "W5200 Batang"; src: url("fonts/batang-ko.woff2") format("woff2"); font-display: swap; }

:root {
  --paper: #f7f4ee;
  --panel: #fbf9f4;
  --panel-2: #f2efe7;
  --line: #e2dccb;
  --line-soft: #ece7d9;
  --ink: #3a352c;
  --ink-2: #6b6355;
  --ink-3: #8a8271;
  --accent: #b97a4a;
  --accent-strong: #9a5f33;
  --accent-ink: #94582d;
  --on-accent: #fbf3ea;
  --note: #f6eab8;
  --future: #e6e1d1;
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 22px;
  --shadow-card: 0 1px 2px rgba(58, 53, 44, .05), 0 18px 40px -22px rgba(96, 66, 34, .38);
  --shadow-phone: 0 1px 2px rgba(58, 53, 44, .08), 0 32px 60px -26px rgba(96, 66, 34, .5);
  --header-h: 60px;
  --font-mono: "W5200 Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --font-latin: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --font-sans: var(--font-latin), "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-display: var(--font-mono);
  --lh: 1.6;
  color-scheme: light;
}

/* Each language gets its own body face and the heading face of its store art. */
:lang(zh-Hant) {
  --font-sans: var(--font-latin), "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-display: "W5200 Serif TC", "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --lh: 1.85;
}
:lang(ja) {
  --font-sans: var(--font-latin), "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --font-display: "W5200 Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --lh: 1.85;
}
:lang(ko) {
  --font-sans: var(--font-latin), "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-display: "W5200 Batang", "AppleMyungjo", Batang, serif;
  --lh: 1.8;
}
:lang(en) {
  --font-sans: var(--font-latin), sans-serif;
  --font-display: var(--font-mono);
  --lh: 1.6;
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 12px);
}
html, [lang] { font-family: var(--font-sans); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-size: 1rem;
  line-height: var(--lh);
  /* The app's paper: its fibre texture, toned down by half as on the store art,
     under a soft wash of light at the top. */
  background:
    linear-gradient(180deg, rgba(255, 253, 248, .6) 0, rgba(255, 253, 248, 0) 900px),
    linear-gradient(rgba(247, 244, 238, .55), rgba(247, 244, 238, .55)),
    url("paper.webp") 0 0 / 420px repeat,
    var(--paper);
  overflow-x: hidden;
}
.i18n-pending body { visibility: hidden; }
/* Paper behind the status bar, above the sticky header (phones with viewport-fit=cover). */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: env(safe-area-inset-top, 0px);
  background: var(--paper);
}

img { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2.5px solid var(--accent-strong); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(185, 122, 74, .24); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-small { width: 16px; height: 16px; }

.wrap {
  max-width: 1152px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.skip {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip:focus { top: 12px; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: .02em;
  line-height: 1.35;
  text-wrap: balance;
}
:lang(en) .display, .display:lang(en) { letter-spacing: -.01em; line-height: 1.3; }
.wordmark { font-family: var(--font-mono); letter-spacing: .01em; white-space: nowrap; }

/* -- header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  height: var(--header-h);
  background: rgba(247, 244, 238, .78);
  -webkit-backdrop-filter: saturate(1.3) blur(16px);
  backdrop-filter: saturate(1.3) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background-color .25s;
}
.site-header.is-scrolled { background: rgba(247, 244, 238, .9); border-bottom-color: var(--line); }
.header-row { height: 100%; display: flex; align-items: center; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; }
.brand:hover { color: var(--accent-strong); }
.brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 1px 2px rgba(58, 53, 44, .16); }
.brand .wordmark { font-size: 1.0625rem; }

.header-nav { display: none; gap: 2px; }
.header-nav a {
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .9375rem;
  text-decoration: none;
  white-space: nowrap;
}
.header-nav a:hover { color: var(--ink); background: rgba(185, 122, 74, .1); }

.header-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lang { position: relative; }
.lang-tabs {
  display: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 249, 244, .75);
}
.lang-tabs button, .lang-menu button, .lang-toggle {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.lang-tabs button {
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .8125rem;
  line-height: 1.6;
  white-space: nowrap;
}
.lang-tabs button:hover { color: var(--ink); }
.lang-tabs button[aria-pressed="true"] { background: var(--accent-strong); color: var(--on-accent); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 249, 244, .75);
  color: var(--ink);
  font-size: .875rem;
  white-space: nowrap;
}
.lang-toggle .icon { width: 18px; height: 18px; color: var(--ink-2); }
.lang-toggle .icon-small { width: 14px; height: 14px; transition: transform .2s; }
.lang-toggle[aria-expanded="true"] .icon-small { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 172px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-card);
}
.lang-menu[hidden] { display: none; }
.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink);
  font-size: .9375rem;
  text-align: left;
}
.lang-menu button:hover { background: var(--panel-2); }
.lang-menu button[aria-pressed="true"] { color: var(--accent-ink); font-weight: 600; background: rgba(185, 122, 74, .1); }
.lang-menu button[aria-pressed="true"]::after {
  content: "";
  width: 7px;
  height: 12px;
  margin: -3px 4px 0 12px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s;
}
.btn:hover { background: #87522b; color: var(--on-accent); }

.btn .label-short { display: none; }
@media (max-width: 559px) {
  .btn .label-long { display: none; }
  .btn .label-short { display: inline; }
}
@media (max-width: 379px) {
  .brand .wordmark { display: none; }
}
@media (min-width: 940px) {
  .header-nav { display: flex; }
  .lang-tabs { display: inline-flex; }
  .lang-toggle, .lang-menu { display: none; }
}

/* -- shared section parts ---------------------------------------------------- */

section { padding-block: clamp(64px, 9vw, 120px); }
.section-head { max-width: 40rem; margin: 0 auto; text-align: center; }
.section-head h2 { margin: 0 0 16px; font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.6rem); }
:lang(en) .section-head h2 { font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2.05rem); }
.section-head p { margin: 0; color: var(--ink-2); font-size: 1.0625rem; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-ink);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.phone {
  flex: none;
  width: var(--w, 260px);
  margin: 0;
  padding: calc(var(--w, 260px) * .028);
  border-radius: calc(var(--w, 260px) * .15);
  background: linear-gradient(155deg, #fffdf9 0%, #f4efe6 55%, #ebe4d7 100%);
  box-shadow: inset 0 0 0 1px rgba(58, 53, 44, .07), var(--shadow-phone);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--w, 260px) * .125);
  background: var(--panel-2);
}

.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 186px;
  height: 58px;
  padding: 0 22px 0 16px;
  border-radius: 14px;
  background: var(--accent-strong);
  color: var(--on-accent);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(58, 53, 44, .18), 0 12px 24px -14px rgba(96, 58, 26, .7);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s;
}
.store-btn:hover {
  color: var(--on-accent);
  background: #8d5730;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(58, 53, 44, .18), 0 16px 28px -14px rgba(96, 58, 26, .75);
}
.store-btn .icon { width: 26px; height: 26px; opacity: .9; }
.store-text { display: flex; flex-direction: column; line-height: 1.2; }
.store-text small { font-size: .75rem; opacity: .85; }
.store-name { font-size: 1.1875rem; font-weight: 600; letter-spacing: .01em; }
@media (max-width: 439px) {
  .store-btn { flex: 1 1 0; min-width: 0; height: 54px; padding: 0 12px; gap: 9px; }
  .store-btn .icon { width: 22px; height: 22px; }
  .store-name { font-size: 1.0625rem; }
}

/* -- hero ---------------------------------------------------------------- */

.hero { padding-block: clamp(36px, 6vw, 88px) clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; gap: clamp(40px, 6vw, 56px); align-items: center; }
.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--accent-ink);
  font-size: .9375rem;
}
.kicker .wordmark { color: var(--accent); font-size: 1.125rem; }
.kicker-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); opacity: .6; }

.hero-title {
  margin: 0 0 24px;
  font-size: clamp(2.2rem, 1.25rem + 3.7vw, 3.75rem);
  line-height: 1.32;
}
.hero-title:lang(ja) { font-size: clamp(2rem, 1.2rem + 3.1vw, 3.2rem); }
.hero-title:lang(en) { font-size: clamp(1.7rem, 1.05rem + 2.6vw, 2.75rem); line-height: 1.32; }
.hero-title s {
  position: relative;
  text-decoration: none;
  color: var(--ink-2);
}
/* A hand-drawn strike, as on the first store slide. */
.hero-title s::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 54%;
  height: .07em;
  min-height: 2px;
  border-radius: 1em;
  background: var(--ink);
  transform: rotate(-5deg);
}
.lead { margin: 0 0 30px; max-width: 34rem; color: var(--ink-2); font-size: 1.125rem; }
.hero-note { margin: 16px 0 0; color: var(--ink-2); font-size: .875rem; }

.hero-art {
  --w: clamp(164px, 41vw, 272px);
  position: relative;
  display: flex;
  justify-content: center;
  padding: 8px 0 40px;
}
.hero-art .phone-a { position: relative; z-index: 2; transform: rotate(-3deg); }
.hero-art .phone-b { margin: calc(var(--w) * .2) 0 0 calc(var(--w) * -.24); transform: rotate(4deg); }
.hero-sticky {
  position: absolute;
  z-index: 3;
  left: calc(50% - var(--w) * .98);
  bottom: 8px;
  width: calc(var(--w) * .66);
  margin: 0;
  padding: 18px 14px 20px;
  background: linear-gradient(180deg, #f8edc1, var(--note));
  box-shadow: 0 1px 1px rgba(58, 53, 44, .06), 0 14px 26px -14px rgba(110, 82, 28, .55);
  color: var(--ink);
  font-size: clamp(.8125rem, .7rem + .45vw, .9375rem);
  line-height: 1.6;
  transform: rotate(-6deg);
}
.hero-sticky::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 46%;
  height: 20px;
  margin-left: -23%;
  background: rgba(255, 253, 246, .66);
  box-shadow: 0 1px 2px rgba(58, 53, 44, .08);
  transform: rotate(3deg);
}

@media (max-width: 519px) {
  .hero-sticky { display: none; }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .hero-art { --w: clamp(220px, 21vw, 272px); padding: 24px 0 48px; }
}

/* -- 5,200 weeks --------------------------------------------------------- */

.weeks { padding-top: clamp(40px, 6vw, 72px); }
.weeks-card {
  margin-top: clamp(28px, 4vw, 44px);
  padding: clamp(18px, 3.6vw, 40px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  background: rgba(251, 249, 244, .92);
  box-shadow: var(--shadow-card);
}
.weeks-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px 40px;
  margin-bottom: clamp(22px, 3vw, 32px);
}
.weeks-field label { display: block; margin-bottom: 8px; font-weight: 600; font-size: .9375rem; }
.weeks-field input {
  width: min(100%, 240px);
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}
.weeks-field input:hover { border-color: #d3cab4; }
.weeks-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(185, 122, 74, .22); }
.weeks-result { min-width: 0; flex: 1 1 260px; }
.weeks-big {
  margin: 0;
  font-size: clamp(2.1rem, 1.6rem + 2vw, 3rem);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.weeks-line { margin: 6px 0 0; color: var(--ink-2); }
.weeks-line + .weeks-line { margin-top: 0; }
#life { display: block; width: 100%; height: 520px; }
.weeks-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: .8125rem;
}
.weeks-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.weeks-legend li { display: inline-flex; align-items: center; gap: 7px; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.dot-lived { background: var(--accent); }
.dot-now { background: var(--ink); }
.dot-future { background: var(--future); }
.weeks-private { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.weeks-private .icon { width: 18px; height: 18px; color: var(--accent-strong); }
.weeks-app { max-width: 40rem; margin: 22px auto 0; color: var(--ink-2); text-align: center; font-size: .9375rem; }

/* -- features ------------------------------------------------------------ */

.features { padding-top: clamp(40px, 6vw, 72px); overflow-x: clip; }
.feature {
  display: grid;
  gap: 36px;
  align-items: center;
  align-content: center;
  padding-block: clamp(48px, 8vw, 96px);
}
.feature-copy { max-width: 31rem; }
.feature-no { margin: 0 0 12px; color: var(--accent-ink); font-family: var(--font-mono); font-size: .875rem; letter-spacing: .08em; }
.feature h3 { margin: 0 0 18px; font-size: clamp(1.5rem, 1.15rem + 1.25vw, 2.05rem); }
.feature h3:lang(en) { font-size: clamp(1.25rem, 1.02rem + .85vw, 1.6rem); }
.feature-copy p:last-child { margin: 0; color: var(--ink-2); font-size: 1.0625rem; }
.feature-art { --w: clamp(210px, 60vw, 280px); display: flex; justify-content: center; }
.feature-art.pair { --w: clamp(150px, 42vw, 250px); padding-bottom: calc(var(--w) * .16); }
.feature-art.pair .phone:first-child { position: relative; z-index: 1; transform: rotate(-2.5deg); }
.feature-art.pair .phone + .phone { margin: calc(var(--w) * .2) 0 0 calc(var(--w) * -.18); transform: rotate(3deg); }

@media (min-width: 880px) {
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); }
  .feature.is-flipped .feature-copy { order: 2; }
  .feature-copy { justify-self: center; }
}

/* 01 to 06 are a deck. Its stage stays pinned under the header while the
   page scrolls on, and at each step the next card runs in from the right in
   one go and lands on top, the ones below sinking back a little with their
   edges showing, like a pile of polaroids; scrolling back sends it off to
   the right again. site.js adds .deck-live and sets the sizes (--stage-top,
   --stage-h, --card-h, --fit, --track) and each card's place (--depth).
   Without it (no scripts, or reduced motion) the cards follow one another. */
.feature-deck { position: relative; }
.deck-card { padding-block: clamp(28px, 4.5vw, 56px); }
.deck-card + .deck-card { margin-top: clamp(20px, 3vw, 32px); }
.feature-deck .feature-art { --w: clamp(200px, 52vw, 250px); }
.feature-deck .feature-art.pair { --w: clamp(150px, 40vw, 225px); }
/* On a phone each card should still fit on the screen under the header. */
@media (max-width: 879px) {
  .deck-card { gap: 22px; padding-block: 24px; }
  .feature-deck .feature-art { --w: clamp(160px, 44vw, 210px); }
  .feature-deck .feature-art.pair { --w: clamp(130px, 36vw, 190px); }
  .feature-deck .pile-unit { --pw: min(250px, 62vw); gap: 8px; }
  .feature-deck .feature-art.pile-spot { gap: 12px; }
  .feature-deck .feature h3 { margin-bottom: 12px; }
  .feature-deck .feature-copy p:last-child { font-size: 1rem; }
}
.deck-dots { display: none; }

.deck-live { height: var(--track); }
.deck-live .deck-stage {
  position: sticky;
  top: var(--stage-top);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  height: var(--stage-h);
  overflow-x: clip;
}
.deck-live .deck-pile {
  position: relative;
  height: var(--card-h);
  transform: scale(var(--fit, 1));
}
.deck-live .deck-pile > .deck-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--card-h);
  margin: 0;
  transform: translateX(160%) rotate(7deg);
  transform-origin: 50% 0;
  transition: transform .72s cubic-bezier(.17, 1.12, .32, 1);
  pointer-events: none;
}
.deck-live .deck-pile > .deck-card.is-laid {
  transform: translateY(calc(var(--depth, 0) * -12px)) rotate(var(--lean, 0deg)) scale(calc(1 - var(--depth, 0) * .035));
}
.deck-live .deck-pile > .deck-card.is-top { pointer-events: auto; }
.deck-live.is-instant .deck-pile > .deck-card { transition: none; }
.deck-live .deck-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom, 0px));
}
.deck-dots button {
  appearance: none;
  -webkit-appearance: none;
  min-width: 40px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 249, 244, .75);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.deck-dots button:hover { color: var(--ink); border-color: #d3cab4; }
/* Clear of the back-to-top button in the corner. */
@media (max-width: 559px) {
  .deck-live .deck-dots { gap: 5px; padding-inline: 0 54px; }
  .deck-dots button { min-width: 34px; padding: 4px 6px; }
}
.deck-dots button[aria-current="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }

/* 02 to 06: sheets of paper laid down by hand. */
.feature.feature-card {
  position: relative;
  isolation: isolate;
  padding-inline: clamp(20px, 4.5vw, 56px);
}
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf9, #fbf8f2);
  box-shadow: inset 0 0 0 1px rgba(58, 53, 44, .05), 0 1px 2px rgba(58, 53, 44, .06), 0 24px 48px -28px rgba(96, 66, 34, .5);
  transform: rotate(.5deg);
}
.feature-card.is-flipped::before { transform: rotate(-.6deg); }
/* The shade on a card as the next one covers it. */
.feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 8px;
  background: rgba(58, 53, 44, .14);
  opacity: var(--covered, 0);
  pointer-events: none;
}

/* -- the pile of polaroids (feature 02, assets/pile.js) ---------------------
   Laid out like the app's (lib/widgets/moment_layout.dart): square instant
   film, 88 units wide, with thin borders, the date in the top one and a deep
   margin below for the words. */

.feature-art.pile-spot { flex-direction: column; align-items: center; gap: 18px; }
.pile-unit {
  --pw: min(300px, 72vw);
  --u: calc(var(--pw) / 88);
  display: grid;
  justify-items: center;
  gap: 14px;
}
.pile {
  position: relative;
  width: var(--pw);
  height: calc(var(--u) * 107);
  cursor: pointer;
  outline: none;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s ease;
}
.pile-spot .pile:hover { transform: translateY(-5px); }
.pola {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: calc(var(--u) * 6) calc(var(--u) * 79) 1fr;
  padding: 0 calc(var(--u) * 4.5);
  border-radius: calc(var(--u) * .8);
  background: #fffdf9;
  box-shadow: 0 2px 6px rgba(58, 53, 44, .18);
  transform-origin: 50% 100%;
}
.pile:focus-visible .pola.is-top { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5.5px var(--accent-strong); }
.pola-date {
  align-self: center;
  margin: 0;
  color: var(--ink-3);
  font-size: calc(var(--u) * 2.6);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  line-height: 1;
}
.pola-photo { position: relative; }
.pola-window { position: absolute; inset: 0; overflow: hidden; background: #e6e0d3; }
.pola-window img, .pola-reach img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
}
.pola-shadow { opacity: 0; filter: brightness(0) blur(calc(var(--u) * 1.1)); }
.pola-reach { position: absolute; inset: 0; clip-path: inset(0); pointer-events: none; }
.pola-words {
  margin: 0;
  padding: calc(var(--u) * 3) calc(var(--u) * .4) 0;
  overflow: hidden;
  color: var(--ink);
  font-size: calc(var(--u) * 3.6);
  line-height: 1.55;
  text-align: left;
}
.pola-words .tag { color: var(--accent-ink); white-space: nowrap; }
/* Below the cards that peek out from under the pile: the arrows (the photo
   before, the next one) with the dots between them. */
.pile-nav { display: flex; align-items: center; gap: 10px; margin-top: calc(var(--u) * 4.5); }
.pile-step {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fffdf9;
  box-shadow: 0 2px 6px -2px rgba(58, 53, 44, .22);
  color: var(--ink-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.pile-step:hover { border-color: #d3c6ad; color: var(--accent-strong); }
.pile-step:active { transform: scale(.92); }
.pile-step .icon { width: 20px; height: 20px; stroke-width: 2; }
.pile-dots { display: flex; }
.pile-dots button {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 3px;
  border: 0;
  background: none;
  cursor: pointer;
}
.pile-dots button::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #c9c0a9;
  transition: width .2s ease, background-color .2s ease;
}
.pile-dots button[aria-current="true"]::before { width: 14px; background: var(--accent); }
.pile-dots button:focus-visible { outline-offset: 0; }
.pile-hint { margin: 0; color: var(--ink-2); font-size: .875rem; text-align: center; }

/* Picked up: the page blurs and dims behind the pile, as in the app
   (lib/widgets/card_inspector.dart). */
.lift {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px))
           max(20px, env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px));
  overscroll-behavior: contain;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.lift-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 40, 30, .35);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity .32s ease-out;
}
.lift-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 20px;
  opacity: 0;
  transform: scale(.86);
  transition: opacity .32s ease-out, transform .32s cubic-bezier(.34, 1.56, .64, 1);
}
.lift.is-open .lift-backdrop, .lift.is-open .lift-stage { opacity: 1; }
.lift.is-open .lift-stage { transform: none; }
.lift.is-closing .lift-backdrop { opacity: 0; transition-duration: .24s; }
.lift.is-closing .lift-stage {
  opacity: 0;
  transform: scale(.92);
  transition: opacity .24s ease-in, transform .24s cubic-bezier(.55, .06, .68, .19);
}
.lift .pile-unit { --pw: min(440px, calc(100vw - 44px), calc((100vh - 210px) * .8)); }
@supports (height: 100dvh) {
  .lift .pile-unit { --pw: min(440px, calc(100vw - 44px), calc((100dvh - 210px) * .8)); }
}
.lift .pile-step { border-color: rgba(255, 255, 255, .55); background: rgba(251, 249, 244, .9); color: var(--ink); }
.lift .pile { cursor: grab; touch-action: none; transition: none; }
.lift .pile:active { cursor: grabbing; }
.lift .pola.is-top { box-shadow: 0 20px 30px rgba(58, 53, 44, .25); }
.lift-hint {
  max-width: min(92vw, 460px);
  margin: 0;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(251, 249, 244, .82);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 8px 24px -12px rgba(45, 40, 30, .45);
  color: var(--ink);
  font-size: .8125rem;
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}
.lift-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  background: rgba(251, 249, 244, .82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
}
.lift-close .icon { width: 20px; height: 20px; stroke-width: 2; }

.more-title {
  margin: clamp(40px, 6vw, 72px) 0 22px;
  font-size: 1.25rem;
  text-align: center;
}
.more {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.more li {
  padding: 22px 22px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-m);
  background: rgba(251, 249, 244, .9);
  box-shadow: 0 1px 2px rgba(58, 53, 44, .04);
}
.more .icon { width: 26px; height: 26px; color: var(--accent); }
.more h4 { margin: 12px 0 6px; font-size: 1.0625rem; line-height: 1.4; }
.more p { margin: 0; color: var(--ink-2); font-size: .9375rem; }

/* -- privacy: a sticky note, tape and all -------------------------------- */

.privacy-card {
  position: relative;
  isolation: isolate;
  max-width: 900px;
  margin-inline: auto;
  padding: clamp(40px, 6vw, 68px) clamp(22px, 6vw, 76px) clamp(36px, 5vw, 60px);
}
.privacy-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 3px;
  background: linear-gradient(180deg, #f9eec4 0%, var(--note) 55%, #f3e4ac 100%);
  box-shadow: 0 1px 1px rgba(58, 53, 44, .06), 0 26px 48px -26px rgba(120, 88, 30, .55);
  transform: rotate(-.7deg);
}
.privacy-card::after {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 136px;
  height: 30px;
  margin-left: -68px;
  background: rgba(255, 253, 246, .66);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 1px 3px rgba(58, 53, 44, .08);
  transform: rotate(2.5deg);
}
.privacy-card h2 { margin: 0 0 18px; font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.6rem); }
.privacy-card h2:lang(en) { font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2.05rem); }
.privacy-text { margin: 0; font-size: 1.0625rem; }
.promises {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px 24px;
  margin: 26px 0;
  padding: 18px 0;
  border-block: 1px dashed rgba(58, 53, 44, .2);
  list-style: none;
}
.promises li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.promises .icon { width: 22px; height: 22px; color: var(--accent-strong); stroke-width: 2; }
.privacy-small { margin: 0 0 10px; color: #5a5347; font-size: .9375rem; }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.text-link .icon { width: 20px; height: 20px; transition: transform .2s; }
.text-link:hover { color: var(--accent-strong); }
.text-link:hover .icon { transform: translateX(3px); }

/* -- FAQ ----------------------------------------------------------------- */

.faq { padding-top: clamp(48px, 7vw, 88px); }
.faq-list { max-width: 760px; margin: clamp(28px, 4vw, 40px) auto 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  padding: 20px 44px 20px 2px;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: var(--accent-strong);
  transition: transform .25s ease;
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0); }
.faq summary:hover { color: var(--accent-ink); }
.faq details p { margin: 0; padding: 0 44px 22px 2px; color: var(--ink-2); }

/* -- download ------------------------------------------------------------ */

.download { text-align: center; padding-bottom: clamp(72px, 10vw, 128px); }
.polaroid {
  position: relative;
  display: inline-block;
  margin: 0 0 30px;
  padding: 12px 12px 48px;
  background: #fffdf8;
  box-shadow: inset 0 0 0 1px rgba(58, 53, 44, .05), var(--shadow-card);
  transform: rotate(-4deg);
}
.polaroid img { display: block; width: 148px; height: 148px; }
.polaroid figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: .8125rem;
}
.download h2 { margin: 0 0 12px; font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.6rem); }
.download h2:lang(en) { font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2.05rem); }
.download p { margin: 0 0 28px; color: var(--ink-2); font-size: 1.0625rem; }
.download .stores { justify-content: center; }

/* -- footer -------------------------------------------------------------- */

.site-footer {
  padding: 34px 0 calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: .875rem;
}
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; }
.footer-brand { display: inline-flex; align-items: center; gap: 9px; }
.footer-brand img { width: 24px; height: 24px; border-radius: 6px; }
.footer-brand .wordmark { color: var(--accent-ink); }
.footer-copy { color: var(--ink-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent-ink); text-decoration: underline; }
.footer-note { flex-basis: 100%; margin: 0; font-size: .8125rem; }

.to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(251, 249, 244, .92);
  color: var(--accent-strong);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top .icon { width: 22px; height: 22px; stroke-width: 2; }

/* -- privacy policy page ------------------------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: .875rem;
  text-decoration: none;
  white-space: nowrap;
}
.back-link .icon { width: 16px; height: 16px; transform: scaleX(-1); }
.back-link:hover { color: var(--accent-ink); border-color: #d3cab4; }

.policy-tabs {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  z-index: 45;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 244, 238, .92);
  -webkit-backdrop-filter: saturate(1.3) blur(16px);
  backdrop-filter: saturate(1.3) blur(16px);
}
.tabs-row {
  display: flex;
  gap: 2px;
  max-width: 720px;
  margin-inline: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-row::-webkit-scrollbar { display: none; }
.tabs-row [role="tab"] {
  position: relative;
  flex: none;
  padding: 15px 14px 13px;
  color: var(--ink-2);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.tabs-row [role="tab"]:first-child { margin-left: -14px; }
.tabs-row [role="tab"]:hover { color: var(--ink); }
.tabs-row [role="tab"][aria-selected="true"] { color: var(--ink); }
.tabs-row [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
}
.tabs-row [role="tab"]:focus-visible { outline-offset: -4px; }

.policy-body { padding-block: clamp(32px, 6vw, 60px) clamp(64px, 9vw, 112px); }
.policy-body section { max-width: 720px; margin-inline: auto; padding: 0; scroll-margin-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 56px); }
.policy-body section:focus-visible { outline: none; }
.policy-body h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.4rem);
  line-height: 1.3;
  text-wrap: balance;
}
.policy-body h1:lang(en) { font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2rem); }
.policy-body .date { margin: 0 0 28px; color: var(--ink-2); font-size: .875rem; }
.policy-body h2 { margin: 38px 0 8px; font-size: 1.125rem; line-height: 1.5; }
.policy-body p, .policy-body li { margin: 8px 0; }
.policy-body ul { padding-left: 1.3em; }
.policy-body li::marker { color: var(--accent); }
.policy-body strong { font-weight: 600; background: linear-gradient(transparent 58%, rgba(246, 234, 184, .95) 58%); }

/* With scripts on, one language at a time (the tabs); without, all four in a row. */
.js .policy-body section { display: none; }
.js[data-lang="zh"] #policy-zh,
.js[data-lang="en"] #policy-en,
.js[data-lang="ja"] #policy-ja,
.js[data-lang="ko"] #policy-ko { display: block; }
html:not(.js) .policy-body section + section { margin-top: 56px; padding-top: 44px; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
