/* Warmtide — shared styles for the legal pages.
   Tokens are the app's default "Lemonade" light theme (frontend/src/theme/themes.ts):
   pink primary, yellow accent, warm blush background. Headings use Instrument Serif with
   an italic pink accent word, body uses Figtree — the same pairing as the app. */

:root {
  --bg: #fff6f9;
  --surface: #ffffff;
  --muted: #ffe3ec;
  --text: #2b1220;
  --text-2: #7a5466;
  --border: #f6d3df;
  --primary: #d6336c;
  --primary-ink: #ffffff;
  --accent: #ffd23f;
  --ok: #2ba88a;
  --r-card: 24px;
  --r-btn: 100px;
  --doc: 780px;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Figtree", -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 246, 249, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 22px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--serif); font-size: 26px; line-height: 1; margin-right: auto; }
.brand img { width: 34px; height: 34px; display: block; }
.nav a.link { text-decoration: none; color: var(--text-2); font-size: 15px; font-weight: 500; white-space: nowrap; }
.nav a.link:hover, .nav a.link[aria-current="page"] { color: var(--primary); }
/* ---------- document ---------- */
.doc { max-width: var(--doc); padding-top: 44px; padding-bottom: 28px; }
.doc h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 8vw, 56px); line-height: 1.05; letter-spacing: -0.5px; margin: 0 0 12px; }
.doc h1 em, .hero h1 em { font-style: italic; color: var(--primary); }
.meta { color: var(--text-2); font-size: 15px; margin: 0 0 26px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.doc h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.15; margin: 44px 0 10px; scroll-margin-top: 84px; }
.doc h3 { font-size: 17px; font-weight: 700; margin: 24px 0 6px; }
.doc p, .doc li { color: var(--text-2); }
.doc p, .doc li, .doc td, .doc code { overflow-wrap: break-word; }
.doc li { margin-bottom: 7px; }
.doc strong { color: var(--text); font-weight: 700; }
.doc ul, .doc ol { padding-left: 22px; }
.doc code { background: var(--muted); border-radius: 6px; padding: 1px 6px; font-size: 0.9em; color: var(--text); }

.platform {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent);
  border-radius: var(--r-card); padding: 18px 22px; margin: 0 0 28px;
}
.platform .ico { flex-shrink: 0; width: 26px; padding-top: 3px; }
.platform .ico svg { width: 26px; height: 26px; display: block; }
.platform p { margin: 0; }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 24px; margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; }
.toc li { margin: 0 0 4px; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (max-width: 600px) { .toc ol { columns: 1; } }

.callout { background: var(--muted); border-radius: var(--r-card); padding: 20px 24px; margin: 24px 0; border-left: 5px solid var(--primary); }
.callout p { margin: 0 0 10px; }
.callout p:last-child { margin-bottom: 0; }
.callout .tag { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }
.callout.warm { background: #fff4c9; border-left-color: #e0a800; }
.callout.warm .tag { color: #8a6500; }

.table-scroll { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { text-align: left; background: var(--muted); color: var(--text); font-weight: 700; }
th, td { padding: 11px 14px; vertical-align: top; border-bottom: 1px solid var(--border); }
td { color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; left: -9999px; }
  tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  tr:last-child { border-bottom: 0; }
  td { border: 0; padding: 4px 14px; }
  td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text); }
}

.btn { display: inline-flex; align-items: center; min-height: 46px; padding: 10px 24px; border-radius: var(--r-btn); background: var(--primary); color: var(--primary-ink); font-weight: 700; text-decoration: none; }
.btn:hover { filter: brightness(0.93); }

/* ---------- landing ---------- */
.hero { text-align: center; padding: 72px 0 56px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 10vw, 76px); line-height: 1; letter-spacing: -1px; margin: 22px 0 16px; }
.hero p.lead { max-width: 46ch; margin: 0 auto 26px; color: var(--text-2); font-size: 19px; }
.hero .mark { width: 96px; height: 96px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 56px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 22px; text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--primary); }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0 0 4px; }
.card p { margin: 0; color: var(--text-2); font-size: 15.5px; }

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

/* ---------- nav: links on desktop, hamburger on phones ---------- */
.links { display: flex; align-items: center; gap: 22px; }
.menu { display: none; position: static; }
.menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.menu summary::-webkit-details-marker { display: none; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); content: ""; transition: transform 0.2s ease, opacity 0.2s ease; }
.bars { position: relative; }
.bars::before { position: absolute; top: -6px; }
.bars::after { position: absolute; top: 6px; }
.menu[open] .bars { background: transparent; }
.menu[open] .bars::before { top: 0; transform: rotate(45deg); }
.menu[open] .bars::after { top: 0; transform: rotate(-45deg); }
.panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: 0 14px 24px rgba(43, 18, 32, 0.08); padding: 8px 20px 20px; display: flex; flex-direction: column; }
.panel a.link { font-size: 17px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.panel .store { align-self: flex-start; margin-top: 16px; }
@media (max-width: 720px) {
  .links { display: none; }
  .menu { display: block; }
  .nav-inner { min-height: 66px; }
}

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 32px 0 28px; background: var(--surface); }
.footer-in { max-width: 1080px; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: flex-start; justify-content: space-between; }
.footer p { margin: 0 0 4px; color: var(--text-2); font-size: 15px; }
.footer .made { font-family: var(--serif); font-size: 22px; color: var(--text); margin-bottom: 6px; }
.footer .made strong { font-weight: 400; color: var(--primary); }
.footer a { overflow-wrap: anywhere; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer nav a { font-size: 15px; font-weight: 500; text-decoration: none; }
.footer nav a:hover { text-decoration: underline; }
.footer-in.copy { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.footer-in.copy p { font-size: 14px; margin: 0; }
@media (max-width: 560px) { .footer-in { flex-direction: column; gap: 16px; } }

/* ---------- small-phone safety ---------- */
html { -webkit-text-size-adjust: 100%; }
.wrap, .doc { padding-left: 20px; padding-right: 20px; }
@media (max-width: 380px) {
  body { font-size: 16px; }
  .doc { padding-top: 32px; }
  .doc h2 { font-size: 26px; }
  .platform { padding: 14px 16px; gap: 10px; }
  .toc { padding: 14px 16px; }
  .callout { padding: 16px 18px; }
  .hero { padding: 48px 0 40px; }
  .hero p.lead { font-size: 17px; }
}

/* ---------- Google Play badge ---------- */
a.store { cursor: pointer; text-decoration: none; transition: border-color 0.15s ease, background 0.15s ease; }
a.store:hover { border-color: var(--primary); background: var(--muted); }
a.store:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.store { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 7px 16px 7px 12px; border-radius: var(--r-btn); line-height: 1.1; white-space: nowrap; font-size: 15px; font-weight: 600; }
.store svg { width: 18px; height: 18px; flex-shrink: 0; }
.store small { display: none; }
.store b { font-weight: 600; font-size: 15px; }
.store.big { padding: 13px 22px 13px 18px; gap: 10px; }
.store.big svg { width: 24px; height: 24px; }
.store.big b { font-size: 17px; }
.panel .store { padding: 11px 20px 11px 16px; }
