/* Tokens mirror MemoryLane/Views/Theme.swift so the site and app read as one product. */
@font-face { font-family: "Lora"; src: url("fonts/Lora.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/Caveat.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #f6f0e4;
  --bg-deep: #efe7d7;
  --paper: #fffdf8;
  --canvas: #fbf6ea;
  --rule: #e3d7c2;
  --tape: rgba(222, 205, 166, 0.8);
  --text: #3d332a;
  --text-caption: #4a3d31;
  --text-secondary: #8a7a68;
  --text-faint: #b3a892;
  --accent: #b3593c;
  --accent-soft: #c98a5e;
  --ink-blue: #43526e;
  --shadow: 0 18px 40px rgba(61, 51, 42, 0.16), 0 2px 6px rgba(61, 51, 42, 0.08);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Bradley Hand", cursive;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1a14;
    --bg-deep: #1a1410;
    --paper: #29241c;
    --canvas: #26211a;
    --rule: #47402f;
    --tape: rgba(115, 102, 77, 0.75);
    --text: #ede6d6;
    --text-caption: #d9ccb8;
    --text-secondary: #a69985;
    --text-faint: #736859;
    --accent: #cc734d;
    --accent-soft: #b8855c;
    --ink-blue: #8c9ec7;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 0 20px; }

/* --- Header / footer --- */
.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 21px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.nav { display: flex; gap: 22px; font-size: 15px; }
.nav a { color: var(--text-secondary); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

.site-footer { border-top: 1px solid var(--rule); margin-top: 40px; padding: 32px 0 48px; color: var(--text-secondary); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--text-secondary); }

/* --- Buttons --- */
.btn-store {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 16px;
  box-shadow: 0 6px 16px rgba(179, 89, 60, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-store:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(179, 89, 60, 0.35); }
.btn-store svg { width: 20px; height: 20px; fill: currentColor; }
.note-small { font-size: 14px; color: var(--text-secondary); margin-top: 12px; }

/* --- Hero --- */
.hero { padding: 40px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.eyebrow { font-family: var(--hand); font-size: 26px; color: var(--accent); margin: 0 0 6px; line-height: 1.1; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.hero h1 { font-size: clamp(38px, 6vw, 60px); }
.hero .lede { font-size: 19px; color: var(--text-caption); margin: 20px 0 28px; max-width: 30em; }

/* --- Flip card (same interaction as the app and Web/album.html) --- */
.scene { perspective: 1600px; width: min(360px, 82vw); margin: 0 auto; }
.card {
  position: relative; width: 100%; aspect-ratio: 0.82;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.34, 1.2, 0.4, 1);
  transform: rotate(-2.5deg);
  cursor: pointer; border: 0; padding: 0; background: none; font: inherit; color: inherit; display: block;
}
.card.flipped { transform: rotate(-2.5deg) rotateY(180deg); }
.face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--paper); box-shadow: var(--shadow); border-radius: 3px;
}
.face.front { padding: 16px 16px 0; display: flex; flex-direction: column; }
.face.front .photo { flex: 1; background-size: cover; background-position: center; border-radius: 1px; }
.face.front .caption { font-family: var(--hand); font-size: 26px; color: var(--text-caption); padding: 10px 4px 14px; text-align: left; }
.face.back {
  transform: rotateY(180deg); background-color: var(--canvas);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 37px, var(--rule) 37px, var(--rule) 38px);
  background-position: 0 58px; padding: 60px 26px 20px; text-align: left;
}
.face.back .handwriting { font-family: var(--hand); color: var(--ink-blue); font-size: 27px; line-height: 38px; margin: 0; }
.stamp {
  position: absolute; top: 16px; right: 18px;
  font-family: var(--hand); font-size: 19px; color: var(--accent);
  border: 2px solid var(--accent); border-radius: 5px; padding: 0 9px; transform: rotate(3deg); opacity: 0.85;
}
.tape {
  position: absolute; top: -12px; left: 50%; width: 92px; height: 26px; transform: translateX(-50%) rotate(-3deg);
  background: var(--tape); box-shadow: 0 1px 2px rgba(0,0,0,0.12); z-index: 2;
}
.flip-hint { text-align: center; font-family: var(--hand); font-size: 22px; color: var(--text-secondary); margin-top: 22px; }

/* --- Sections --- */
section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(30px, 4vw, 40px); }
.section-head p { color: var(--text-secondary); margin: 14px 0 0; font-size: 18px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { background: var(--paper); border-radius: 4px; padding: 26px 24px 28px; box-shadow: 0 1px 3px rgba(61,51,42,0.08); position: relative; }
.step:nth-child(1) { transform: rotate(-0.6deg); }
.step:nth-child(3) { transform: rotate(0.5deg); }
.step .num { font-family: var(--hand); font-size: 36px; color: var(--accent); line-height: 1; }
.step h3 { font-size: 21px; margin: 8px 0 8px; }
.step p { margin: 0; color: var(--text-caption); font-size: 16px; }

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 36px 0; }
.feature + .feature { border-top: 1px dashed var(--rule); }
.feature:nth-of-type(even) .feature-media { order: -1; }
.feature h3 { font-size: clamp(26px, 3.2vw, 34px); }
.feature p { color: var(--text-caption); margin: 14px 0 0; }
.feature ul { padding-left: 0; list-style: none; margin: 18px 0 0; }
.feature li { padding-left: 26px; position: relative; margin-bottom: 8px; color: var(--text-caption); }
.feature li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.phone {
  width: min(290px, 70vw); margin: 0 auto; border-radius: 38px; overflow: hidden;
  border: 9px solid #2a241e; box-shadow: var(--shadow); background: #2a241e;
}
.phone img { width: 100%; height: auto; }

.privacy-band { background: var(--bg-deep); }
.privacy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.privacy-item { background: var(--paper); border-radius: 4px; padding: 22px 20px; }
.privacy-item .icon { font-size: 26px; line-height: 1; }
.privacy-item h3 { font-size: 18px; margin: 12px 0 6px; }
.privacy-item p { margin: 0; font-size: 15px; color: var(--text-caption); }
.privacy-band .more { text-align: center; margin-top: 28px; font-size: 15px; }

/* --- Pricing --- */
.pricing-band .section-head .eyebrow { margin-bottom: 8px; }
.plans { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 24px; align-items: start; }
.plan { background: var(--paper); border-radius: 6px; padding: 30px 28px; box-shadow: 0 1px 3px rgba(61,51,42,0.08); }
.plan h3 { font-size: 24px; }
.plan-price { font-family: var(--hand); font-size: 26px; color: var(--accent); margin: 4px 0 0; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 0; }
.plan li { padding-left: 26px; position: relative; margin-bottom: 8px; color: var(--text-caption); font-size: 16px; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.plan-pro { border-top: 3px solid var(--accent); }
.tiers { display: grid; gap: 10px; margin-top: 22px; }
.tier { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--canvas); }
.tier.best { border: 2px solid var(--accent); padding: 13px 15px; }
.tier-name { display: block; font-weight: 600; color: var(--text); }
.tier-tag { display: block; font-size: 14px; color: var(--accent); }
.tier-price { font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--text); white-space: nowrap; text-align: right; }
.tier-price small { font-family: var(--sans); font-weight: 400; font-size: 14px; color: var(--text-secondary); }
.pricing-note { text-align: center; color: var(--text-secondary); font-size: 14px; max-width: 46em; margin: 24px auto 0; }

/* --- Language menu --- */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); }
.lang-menu svg { width: 17px; height: 17px; }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 10px); z-index: 10; list-style: none; margin: 0; padding: 6px; min-width: 150px; background: var(--paper); border-radius: 10px; box-shadow: var(--shadow); }
.lang-menu li a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text); text-decoration: none; }
.lang-menu li a:hover { background: var(--bg-deep); }
.lang-menu li a[aria-current] { color: var(--accent); font-weight: 600; }
.footer-note { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--text-faint); }

/* Caveat and Lora are Latin-only. CJK pages fall back to the handwriting
   and serif faces their own systems ship, not a generic sans. */
:lang(zh) { --hand: "Caveat", "Kaiti SC", "STKaiti", "KaiTi", cursive; --serif: "Lora", "Songti SC", "STSong", "SimSun", serif; }
:lang(ja) { --hand: "Caveat", "Klee", "Klee One", "YuKyokasho", cursive; --serif: "Lora", "Hiragino Mincho ProN", "Yu Mincho", serif; }
:lang(ko) { --hand: "Caveat", "Nanum Pen Script", "NanumPen", cursive; --serif: "Lora", "AppleMyungjo", "Nanum Myeongjo", serif; }
:lang(ko) { word-break: keep-all; }

.cta { text-align: center; }
.cta h2 { font-size: clamp(30px, 4.5vw, 44px); }
.cta p { color: var(--text-secondary); margin: 14px auto 28px; max-width: 32em; }

/* --- Document pages (privacy, support, terms) --- */
.doc { max-width: 720px; margin: 0 auto; padding: 24px 20px 40px; }
.doc h1 { font-size: clamp(34px, 5vw, 44px); }
.doc .updated { color: var(--text-secondary); font-size: 15px; margin: 8px 0 32px; }
.doc h2 { font-size: 22px; margin: 40px 0 10px; }
.doc p, .doc li { color: var(--text-caption); }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc .callout { background: var(--paper); border-left: 3px solid var(--accent); padding: 18px 22px; border-radius: 3px; margin: 24px 0; }
.doc .callout p { margin: 0; }
.faq details { background: var(--paper); border-radius: 4px; padding: 16px 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text); list-style-position: outside; }
.faq details p { margin: 10px 0 0; }

@media (max-width: 860px) {
  .hero .wrap, .feature, .plans { grid-template-columns: 1fr; gap: 36px; }
  .plans { gap: 20px; }
  .hero { padding-top: 16px; text-align: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .feature:nth-of-type(even) .feature-media { order: 0; }
  .feature { text-align: center; }
  .feature ul { display: inline-block; text-align: left; }
  .steps { grid-template-columns: 1fr; }
  .step { transform: none !important; }
  .privacy-grid { grid-template-columns: 1fr 1fr; }
  .nav { gap: 16px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .privacy-grid { grid-template-columns: 1fr; }
  .nav a.hide-sm { display: none; }
  section { padding: 48px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
