/*
 * Privacy, Terms and Support (/<lang>/privacy, /terms, /support).
 *
 * The same look as the Secret Santa pages (santa.css) and the app's
 * KeepTheme: paper-notebook cream, forest ink, a New York serif for headings
 * and the hand-drawn art on a peach-to-sage panel. On a phone it's one column
 * with tabs; from 900px wide it becomes the desktop layout with a top bar.
 * Built with logical properties, so Arabic mirrors itself. The header,
 * footer and language sheet are shared with other pages: site.css.
 */

:root {
  --ink: #0E2923;
  --text-3: #4A5148;
  --muted: #5C6359;
  --cream: #F7F2E7;
  --paper: #FEFCF7;
  --raised: #FBF8F0;
  --hair: rgba(199, 189, 166, 0.36);
  --forest: #133B34;
  --green: #296147;
  --mint: #D6E3D1;
  --mint-soft: #E4ECDF;
  --gold-soft: #F3E8D6;
  --gold-ink: #6E4A17;
  --peach-soft: #F5E2D3;
  --peach-ink: #6B3E22;
  --panel: linear-gradient(180deg, #F2DBCA 0%, #EED8C6 50%, #D3D9CF 100%);
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --latin-serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --shadow-card: 0 14px 32px rgba(14, 41, 35, 0.06), 0 1px 3px rgba(14, 41, 35, 0.04);
  color-scheme: light;
}

/* Fonts follow the script. */
:lang(ja) { --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; --sans: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif; }
:lang(ko) { --serif: "AppleMyungjo", "Noto Serif KR", serif; --sans: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; }
:lang(zh-Hans) { --serif: "Songti SC", "Noto Serif SC", serif; --sans: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; }
:lang(ar) { --serif: "Geeza Pro", "Noto Naskh Arabic", serif; --sans: "SF Arabic", "Geeza Pro", -apple-system, "Segoe UI", "Noto Sans Arabic", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(520px 380px at 100% 0%, rgba(214, 227, 209, 0.75), rgba(214, 227, 209, 0) 70%) no-repeat, var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[dir="rtl"] body { background: radial-gradient(520px 380px at 0% 0%, rgba(214, 227, 209, 0.75), rgba(214, 227, 209, 0) 70%) no-repeat, var(--cream); }
:lang(ja) body, :lang(zh-Hans) body, :lang(ko) body { line-height: 1.65; line-break: strict; }
:lang(ar) body { line-height: 1.7; }
:lang(de) body { hyphens: auto; }
::selection { background: #DCEADA; color: var(--ink); }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--forest); }
:focus-visible { outline: 3px solid rgba(41, 97, 71, 0.4); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i.s16 { width: 16px; height: 16px; }
.grow { flex: 1; min-width: 0; }

/* MARK: Frame (phone) */

.page { max-width: 600px; margin: 0 auto; }
.wordmark { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-family: var(--latin-serif); font-weight: 600; font-size: 21px; letter-spacing: -0.5px; text-decoration: none; }
.leaf { width: 22px; height: 22px; color: #99AA98; }
.side { display: none; }

.tabs { display: flex; gap: 4px; padding: 4px; margin: 2px 16px 0; border-radius: 16px; background: rgba(19, 59, 52, 0.06); }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 4px; border-radius: 12px; color: var(--text-3); font-size: 14px; font-weight: 600; line-height: 1.15; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 41, 35, 0.1); }

.stage { margin: 14px 16px 0; border-radius: 28px; background: var(--panel); overflow: hidden; }
.art { display: block; width: 100%; height: auto; }
[dir="rtl"] .art { transform: scaleX(-1); }
.art .ground { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; opacity: 0.35; }
.art .ink { stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; fill: none; }
.art .paper { fill: var(--paper); }
.art .raised { fill: var(--raised); }
.art .mint { fill: var(--mint); }
.art .gold { fill: var(--gold-soft); }
.art .peach { fill: var(--peach-soft); }
.art .lines { opacity: 0.45; }
.art .dot { fill: var(--ink); opacity: 0.55; }
.art .cross { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; opacity: 0.45; }

/* MARK: Motion in the drawings (same vocabulary as santa.css) */

.art .fb { transform-box: fill-box; transform-origin: center; }
:root { --pop: cubic-bezier(0.3, 1.4, 0.5, 1); }

/* Sparkles twinkle out of step. */
.art .tw { animation: tw 3s ease-in-out infinite; }
.art .tw2 { animation: tw 3s ease-in-out -1s infinite; }
.art .tw3 { animation: tw 3s ease-in-out -2s infinite; }
@keyframes tw { 0%, 100% { opacity: 0.25; scale: 0.7; } 50% { opacity: 0.7; scale: 1.1; } }

/* Lines that write themselves in when the page opens. */
/* Hidden until they start, so the round line ends don't show as dots. */
.art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; animation: draw 1.3s cubic-bezier(0.45, 0, 0.3, 1) 350ms forwards; }
.art .draw.late { animation-delay: 750ms; }
@keyframes draw { 0% { opacity: 0; stroke-dashoffset: 1; } 4% { opacity: 0.45; } 100% { opacity: 0.45; stroke-dashoffset: 0; } }

/* Privacy: the sprout sways, the lock clicks shut. */
.art .sway { transform-origin: 35% 100%; animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { rotate: -3deg; } 50% { rotate: 4deg; } }
.art .shackle { animation: shackle 6s var(--pop) 400ms infinite backwards; }
@keyframes shackle { 0%, 6% { translate: 0 -8px; } 16%, 90% { translate: 0 0; } 100% { translate: 0 -8px; } }
.art .lock { transform-origin: 50% 100%; animation: click 6s ease-in-out 400ms infinite; }
@keyframes click { 0%, 14%, 30%, 100% { rotate: 0deg; } 18% { rotate: -4deg; } 22% { rotate: 3deg; } 26% { rotate: -1deg; } }

/* Terms: the pen signs, the signature fades, and again. */
.art .sign { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; animation: sign 5.5s ease-in-out 1.2s infinite; }
@keyframes sign { 0%, 6% { stroke-dashoffset: 1; opacity: 0; } 7% { stroke-dashoffset: 0.97; opacity: 1; } 36%, 82% { stroke-dashoffset: 0; opacity: 1; } 92%, 100% { stroke-dashoffset: 0; opacity: 0; } }
.art .pen { transform-origin: 0% 100%; animation: pen 5.5s ease-in-out 1.2s infinite; }
@keyframes pen {
  0%, 6%, 40%, 100% { translate: 0 0; rotate: 0deg; }
  11% { translate: -3px 3px; rotate: -6deg; }
  16% { translate: 1px 0; rotate: 4deg; }
  21% { translate: -2px 3px; rotate: -5deg; }
  26% { translate: 2px 1px; rotate: 3deg; }
  31% { translate: -1px 2px; rotate: -3deg; }
  36% { translate: 0 0; rotate: 0deg; }
}

/* Support: the question pops up, then the reply; the heart beats; both drift. */
.art .ask { transform-origin: 20% 100%; animation: pop-in 650ms var(--pop) 150ms backwards, drift 6.4s ease-in-out 1s infinite; }
.art .reply { transform-origin: 55% 100%; animation: pop-in 650ms var(--pop) 1.5s backwards, drift 7.2s ease-in-out -2.5s infinite; }
@keyframes pop-in { from { scale: 0.4; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.art .beat { animation: beat 2.6s ease-in-out 2.2s infinite; }
@keyframes beat { 0%, 56%, 100% { scale: 1; } 64% { scale: 1.22; } 72% { scale: 1; } 80% { scale: 1.14; } 88% { scale: 1; } }

@media (prefers-reduced-motion: reduce) {
  .art * { animation: none !important; }
  .art .draw { stroke-dashoffset: 0; opacity: 0.45; }
  .art .sign { stroke-dashoffset: 0; opacity: 1; }
}

.hero-text, .body { padding: 0 20px; }
h1 { margin: 22px 0 0; font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.12; letter-spacing: -0.4px; text-wrap: balance; overflow-wrap: anywhere; }
:lang(ja) h1, :lang(zh-Hans) h1, :lang(ko) h1, :lang(ar) h1 { font-weight: 600; letter-spacing: 0; line-height: 1.3; }
.lede { margin: 10px 0 0; font-size: 16px; line-height: 1.5; color: var(--text-3); text-wrap: pretty; }
.meta { margin: 12px 0 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tr { margin: 12px 0 0; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: rgba(19, 59, 52, 0.05); font-size: 13px; color: var(--text-3); }
.tr a { font-weight: 600; white-space: nowrap; }

h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 23px; line-height: 1.2; letter-spacing: -0.2px; overflow-wrap: anywhere; }
:lang(ja) h2, :lang(zh-Hans) h2, :lang(ko) h2, :lang(ar) h2 { font-weight: 600; letter-spacing: 0; line-height: 1.4; }
.h2 { margin-top: 30px; }
.support .h2 { margin-top: 32px; }
h3 { margin: 18px 0 0; font-size: 16px; font-weight: 600; }
.anchor { scroll-margin-top: 16px; }

/* MARK: Cards */

.list { margin: 12px 0 0; padding: 0; list-style: none; border-radius: 24px; background: var(--paper); border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-card); overflow: hidden; }
.row { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-top: 1px solid var(--hair); }
.row:first-child { border-top: 0; }
.tile { flex: none; width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.t0 { background: var(--mint); color: var(--forest); }
.t1 { background: var(--peach-soft); color: var(--peach-ink); }
.t2 { background: var(--gold-soft); color: var(--gold-ink); }
.rt { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.rs { display: block; margin-top: 3px; font-size: 14px; color: var(--muted); line-height: 1.4; }

/* "On this page", opened in place on a phone. */
.toc { margin-top: 22px; border-radius: 18px; border: 1px solid rgba(19, 59, 52, 0.18); background: rgba(254, 252, 247, 0.6); }
.toc summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; color: var(--forest); font: 600 15px var(--sans); cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc[open] .chev { transform: rotate(180deg); }
.toc ol { margin: 0; padding: 4px 16px 12px; list-style: none; border-top: 1px solid var(--hair); }
.toc li a { display: block; padding: 9px 0; color: var(--text-3); font-size: 15px; text-decoration: none; }
.toc li a:hover { color: var(--ink); }

/* MARK: Text */

.sec { margin-top: 34px; scroll-margin-top: 16px; }
.sec p, .sec li { color: var(--text-3); }
.sec p { margin: 10px 0 0; }
.sec ul { margin: 10px 0 0; padding-inline-start: 20px; }
.sec li { margin-top: 6px; }
.callout { display: flex; gap: 10px; margin-top: 14px; padding: 14px 16px; border-radius: 18px; background: var(--mint-soft); color: #1F4A36; font-size: 14px; line-height: 1.45; }

/* MARK: Accordions (Terms and Support) */

.acc { border-top: 1px solid var(--hair); }
.acc:first-child { border-top: 0; }
.q { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; color: var(--ink); font: 600 16px var(--sans); line-height: 1.35; cursor: pointer; list-style: none; }
.support .q { padding-inline: 16px 14px; }
.q::-webkit-details-marker { display: none; }
.q:hover { background: rgba(19, 59, 52, 0.025); }
.chev { color: #7A8076; transition: transform 160ms ease; }
.acc[open] > .q .chev { transform: rotate(180deg); }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--mint-soft); color: #1F4A36; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ans { padding: 0 16px 16px; padding-inline-start: 54px; color: var(--text-3); font-size: 15px; line-height: 1.5; }
.support .ans { padding-inline-start: 16px; }
.ans p { margin: 0 0 10px; }
.ans p:last-child { margin-bottom: 0; }
.ans ol, .ans ul { margin: 0 0 10px; padding-inline-start: 20px; }
.ans ol:last-child, .ans ul:last-child { margin-bottom: 0; }
.ans li { margin-top: 4px; }
.where { display: inline-block; padding: 1px 7px; border-radius: 7px; background: var(--mint-soft); color: #1F4A36; font-size: 14px; font-weight: 600; }
.eula { margin-top: 18px; display: block; }

/* MARK: Support */

.search { display: flex; align-items: center; gap: 10px; margin-top: 18px; min-height: 52px; padding: 0 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--hair); box-shadow: 0 1px 3px rgba(14, 41, 35, 0.05); color: var(--muted); cursor: text; }
.search:focus-within { border-color: rgba(41, 97, 71, 0.45); }
.search input { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; font: 16px var(--sans); color: var(--ink); outline: none; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(19, 59, 52, 0.2); background: transparent; color: var(--forest); font: 600 14px var(--sans); cursor: pointer; }
.pill:hover { background: rgba(19, 59, 52, 0.05); }
.pill[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--paper); }
.empty { margin: 14px 4px 0; font-size: 14px; color: var(--muted); }
.contact { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 16px; border-radius: 24px; background: var(--paper); border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-card); }

/* The one main action, where a thumb reaches it. */
.bar {
  position: sticky; bottom: 0; z-index: 2;
  margin: 8px -20px 0;
  padding: 22px 20px calc(30px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, rgba(247, 242, 231, 0), var(--cream) 30%);
}
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 0 20px;
  border-radius: 18px; border: 0; background: var(--forest); color: var(--paper); font: 600 17px var(--sans);
  text-decoration: none; box-shadow: 0 10px 24px rgba(19, 59, 52, 0.22); cursor: pointer;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:hover { color: var(--paper); }
.btn:active { transform: scale(0.98); }
.small { margin: 0; text-align: center; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.small a { color: inherit; }

/* The header, footer and language sheet are in site.css. */
.support .foot { margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
  .chev, .btn { transition: none; }
}

/* MARK: Desktop (from 900px) */

@media (min-width: 900px) {
  body { background: radial-gradient(900px 560px at 100% 0%, rgba(214, 227, 209, 0.75), rgba(214, 227, 209, 0) 70%) no-repeat, var(--cream); }
  [dir="rtl"] body { background: radial-gradient(900px 560px at 0% 0%, rgba(214, 227, 209, 0.75), rgba(214, 227, 209, 0) 70%) no-repeat, var(--cream); }
  body { font-size: 16px; line-height: 1.55; }
  .page { max-width: 1184px; padding: 0 32px; }

  .tabs { display: none; }

  .hero { display: flex; align-items: center; gap: 32px; padding: 40px 0 8px; }
  .hero-text { order: -1; flex: 1 1 420px; min-width: 0; padding: 0; }
  .stage { flex: 1 1 380px; min-width: 0; max-width: 480px; margin: 0; border-radius: 32px; }
  h1 { margin: 0; font-size: 52px; line-height: 1.08; letter-spacing: -0.8px; }
  .lede { margin-top: 16px; max-width: 560px; font-size: 19px; }
  .meta { margin-top: 16px; font-size: 14px; }
  .tr { max-width: 560px; }

  .body { display: flex; gap: 48px; align-items: flex-start; padding: 48px 0 0; }
  .main { flex: 1 1 auto; min-width: 0; max-width: 700px; }
  /* Terms and Support line up with the Privacy text column, so switching tabs doesn't move the reading line. */
  .terms .main, .support .main { margin-inline-start: 268px; }
  .side { display: block; position: sticky; top: 24px; flex: 0 0 220px; }
  .side h2 { margin: 0 0 10px; font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
  .side ol { margin: 0; padding: 0; list-style: none; border-inline-start: 2px solid var(--hair); }
  .side a { display: block; padding-block: 7px; padding-inline: 14px 0; margin-inline-start: -2px; border-inline-start: 2px solid transparent; color: var(--text-3); font-size: 15px; line-height: 1.4; text-decoration: none; }
  .side a:hover { color: var(--ink); }
  .side a[aria-current="true"] { border-color: var(--green); color: var(--ink); font-weight: 600; }
  .toc { display: none; }

  .summary { display: grid; gap: 12px; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .summary.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary .row { padding: 18px; border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow-card); }
  .summary .tile { width: 38px; height: 38px; }
  .summary .rs { margin-top: 4px; line-height: 1.45; }

  .sec { margin-top: 44px; }
  .sec h2, .h2 { font-size: 29px; letter-spacing: -0.3px; }
  .sec h3 { margin-top: 20px; font-size: 17px; }
  .sec p, .sec li { font-size: 17px; }
  .sec p { margin-top: 12px; }
  .sec ul { margin-top: 12px; padding-inline-start: 22px; }
  .callout { margin-top: 16px; padding: 16px 18px; font-size: 15px; }
  .h2 { margin-top: 44px; }
  .support .h2 { margin-top: 44px; }
  .ans { font-size: 16px; }

  .bar { position: static; margin: 16px 0 0; padding: 0; background: none; flex-direction: row; align-items: center; gap: 18px; }
  .bar .btn { width: auto; min-width: 240px; }
  .bar .small { text-align: start; }

  .support .foot { margin-top: 72px; }
}
