/*
 * The legal pages (terms, privacy, refunds, contact): the island's look, without the island.
 *
 * The tokens are those of apps/web/src/styles.css; keep them in step. Files in public/ are copied as they
 * are (Vite does not process them), so the @fontsource imports of styles.css cannot be used here: ./fonts
 * holds copies of the same latin woff2 files (SIL Open Font License, see fonts/OFL-*.txt). No scripts and
 * nothing from another server, so the pages pass the site's CSP (style-src 'self', font-src 'self').
 */

@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/alegreya-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/alegreya-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/alegreya-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/im-fell-english-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/im-fell-english-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English SC"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/im-fell-english-sc-latin-400-normal.woff2") format("woff2"); }

:root {
  --night: #0b0f21;
  --night-2: #151a37;
  --glass: rgba(14, 17, 38, 0.82);
  --glass-hi: rgba(28, 32, 64, 0.94);
  --parchment: #f1e7d2;
  --parchment-2: #c8bfd5;
  --parchment-3: #8f89a8;
  --ember: #ffb347;
  --ember-2: #ff7d3b;
  --dream: #93d2ff;
  --moss: #a9d18f;
  --line: rgba(241, 231, 210, 0.12);
  --line-2: rgba(241, 231, 210, 0.24);
  --wash: rgba(241, 231, 210, 0.07);
  --display: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --display-sc: "IM Fell English SC", "IM Fell English", "Palatino Linotype", Georgia, serif;
  --body: "Alegreya Sans", "Gill Sans", "Gill Sans MT", "Trebuchet MS", system-ui, sans-serif;
  color-scheme: dark;
}

html { background: var(--night); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  /* Dusk above, an ember glow below: the island's sky at the hour the candles are lit. */
  background:
    radial-gradient(130% 55% at 50% -12%, rgba(77, 84, 144, 0.42), rgba(77, 84, 144, 0) 62%),
    radial-gradient(90% 40% at 50% 108%, rgba(255, 125, 59, 0.10), rgba(255, 125, 59, 0) 70%),
    var(--night);
  background-repeat: no-repeat;
  color: var(--parchment-2);
  font-family: var(--body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 6px; }

a { color: var(--parchment); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ember); }
strong, b { color: var(--parchment); font-weight: 700; }
em { font-style: italic; }
code { padding: 0 4px; border-radius: 4px; background: var(--wash); color: var(--parchment); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 9; padding: 8px 14px; border-radius: 9px; background: var(--glass-hi); border: 1px solid var(--line-2); }
.skip:focus { top: 12px; }

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

/* Header: the wordmark, as on the island's title plate, and the way back. */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 22px 0 16px; }
.home { display: inline-flex; align-items: center; gap: 12px; color: var(--parchment); text-decoration: none; }
.wordmark { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: 0.005em; white-space: nowrap; }
.wordmark span { font-style: italic; font-size: 0.62em; color: var(--ember); margin-left: 2px; }
.flame {
  width: 14px; height: 20px; flex: none; display: inline-block;
  background: radial-gradient(60% 55% at 50% 72%, #fff6d8, #ffc152 45%, #ff7d3b 75%, transparent 76%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  filter: drop-shadow(0 0 6px rgba(255, 170, 70, 0.8));
  animation: flick 1.6s infinite ease-in-out;
}
@keyframes flick { 0%, 100% { transform: scale(1, 1) rotate(-2deg); } 40% { transform: scale(0.94, 1.07) rotate(3deg); } 70% { transform: scale(1.04, 0.95) rotate(-1deg); } }
.back {
  display: inline-block; padding: 7px 16px; border-radius: 999px; text-decoration: none;
  border: 1px solid rgba(255, 179, 71, 0.55); color: var(--parchment);
  background: radial-gradient(120% 160% at 30% 0%, rgba(255, 196, 110, 0.22), rgba(255, 125, 59, 0.08) 55%, rgba(255, 125, 59, 0) 80%), var(--night-2);
  font-family: var(--display); font-size: 17px;
}
.back:hover { border-color: var(--ember); box-shadow: 0 0 22px rgba(255, 150, 60, 0.22); }

/* The four pages, like the book's tabs. */
.legal-nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.legal-nav ul { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 6px 0; list-style: none; }
.legal-nav a {
  display: block; padding: 6px 12px; border-radius: 8px; text-decoration: none;
  font-family: var(--display-sc); font-size: 15.5px; letter-spacing: 0.04em; color: var(--parchment-3);
}
.legal-nav a:hover { color: var(--parchment-2); background: var(--wash); }
.legal-nav a[aria-current="page"] { color: var(--parchment); background: var(--wash); }

main { padding: 30px 0 40px; }
h1 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 7vw, 46px); line-height: 1.08; color: var(--parchment); text-wrap: balance; }
.lede { margin: 0 0 6px; font-family: var(--display); font-style: italic; font-size: 20px; line-height: 1.4; color: var(--parchment-2); text-wrap: balance; }
.updated { margin: 0 0 26px; font-size: 14px; color: var(--parchment-3); }
h2 { margin: 42px 0 10px; font-family: var(--display); font-weight: 400; font-size: 27px; line-height: 1.2; color: var(--parchment); text-wrap: balance; scroll-margin-top: 16px; }
h3 { margin: 26px 0 6px; font-family: var(--display-sc); font-weight: 400; font-size: 16.5px; letter-spacing: 0.06em; color: var(--parchment-3); }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin: 0 0 7px; }
li::marker { color: var(--ember); }

/* "In short": a glass plate, as on the island. */
.summary { margin: 0 0 8px; padding: 16px 20px 6px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
.summary h2 { margin: 0 0 8px; font-family: var(--display-sc); font-size: 16.5px; letter-spacing: 0.07em; color: var(--parchment-3); }
.summary li { color: var(--parchment); }

/* The sentence that matters most on a page. */
.key {
  margin: 18px 0 20px; padding: 16px 20px; border-left: 3px solid var(--ember); border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, rgba(255, 179, 71, 0.09), rgba(255, 179, 71, 0.02));
  font-family: var(--display); font-size: 20px; line-height: 1.45; color: var(--parchment);
}
.key p:last-child { margin-bottom: 0; }

/* A form or an address to copy. */
.box { margin: 14px 0 18px; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(8, 10, 24, 0.45); }
.box p:last-child { margin-bottom: 0; }
.box .line { display: block; }

dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0 0 16px; }
dl.kv dt { color: var(--parchment-3); }
dl.kv dd { margin: 0; color: var(--parchment); }

.table { overflow-x: auto; margin: 12px 0 18px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.45; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-family: var(--display-sc); font-weight: 400; font-size: 15px; letter-spacing: 0.05em; color: var(--parchment-3); background: var(--wash); }
td:first-child { color: var(--parchment); }

.foot { padding: 18px 0 44px; border-top: 1px solid var(--line); font-size: 14px; color: var(--parchment-3); }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--parchment-2); }

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 16px; }
  .wordmark { font-size: 26px; }
  h2 { font-size: 24px; }
  .key { font-size: 18px; padding: 14px 16px; }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .flame { animation: none; }
}
@media print {
  :root { color-scheme: light; }
  html, body { background: #fff; color: #222; }
  body { font-size: 11pt; }
  .skip, .back, .legal-nav, .flame { display: none; }
  a, strong, b, h1, h2, h3, .lede, .summary li, .key, td:first-child, dl.kv dd { color: #000; }
  .summary, .key, .box, .table { background: none; border-color: #999; }
  th { background: none; color: #444; }
}
