/* Lumo's Support, Privacy and Terms pages (D-155, D-184): the landing page's night at the top, then
   a cream page to read on. site.css holds the fonts, tokens, navigation and footer they share.
   Static and self-contained: no script, nothing from outside. */

@font-face {
  font-family: 'Andika';
  src:
    url('fonts/Andika_400Regular.woff2') format('woff2'),
    url('fonts/Andika_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Andika';
  src:
    url('fonts/Andika_700Bold.woff2') format('woff2'),
    url('fonts/Andika_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

/* The reading surface's own colours, on cream. */
:root {
  --text: #1e2347;
  --text-soft: #4a4f70;
  --link: #3240b8;
  --rule: #ecdfc6;
  --rule-strong: #e2cc9c;
  --note: #fff3d1;
  --shade: rgba(30, 35, 71, 0.16);
  color-scheme: light;
}

html {
  background: var(--deep);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family:
    'Andika',
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* -------------------------------------------------------- the night at the top */
/* The nav sits over the page head, which carries the night: one sky, one star field. */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 16px 12px 0;
}

.page-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
  padding: 140px max(var(--gutter), calc((100% - 1120px) / 2)) 112px;
  background:
    radial-gradient(1.5px 1.5px at 8% 30%, rgba(255, 244, 194, 0.8) 50%, transparent),
    radial-gradient(1px 1px at 21% 62%, rgba(255, 255, 255, 0.6) 50%, transparent),
    radial-gradient(1px 1px at 34% 22%, rgba(255, 255, 255, 0.55) 50%, transparent),
    radial-gradient(1.5px 1.5px at 47% 78%, rgba(255, 244, 194, 0.6) 50%, transparent),
    radial-gradient(1px 1px at 58% 40%, rgba(255, 255, 255, 0.5) 50%, transparent),
    radial-gradient(1px 1px at 69% 70%, rgba(255, 255, 255, 0.45) 50%, transparent),
    radial-gradient(1.5px 1.5px at 81% 26%, rgba(255, 244, 194, 0.7) 50%, transparent),
    radial-gradient(1px 1px at 93% 58%, rgba(255, 255, 255, 0.5) 50%, transparent),
    radial-gradient(ellipse 60% 90% at 50% 120%, rgba(74, 63, 143, 0.55), transparent 70%),
    linear-gradient(180deg, var(--theme) 0%, var(--night-light) 100%);
  color: var(--cream);
}

/* A gold hairline where the night meets the page. */
.page-head::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: min(900px, 90%);
  height: 1px;
  translate: -50% 0;
  background: linear-gradient(90deg, transparent, rgba(255, 200, 61, 0.5), transparent);
}

.page-head-inner {
  position: relative;
  z-index: 1;
  max-width: 44rem;
}

.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--cream);
  text-wrap: balance;
}

/* A short gold stroke under the title. */
.page-head h1::after {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 20px;
  border-radius: var(--pill);
  background: var(--gold);
  box-shadow: 0 0 18px rgba(255, 200, 61, 0.6);
}

.page-head .meta,
.page-lede {
  margin: 18px 0 0;
  color: var(--lavender);
}

.page-head .meta {
  font-size: 1rem;
}

.page-lede {
  max-width: 40rem;
  font-size: 1.125rem;
  line-height: 1.6;
}

.page-head a {
  color: var(--gold);
  text-underline-offset: 0.2em;
}

/* The lantern, lit, at the edge of the night. */
.page-lantern {
  position: relative;
  z-index: 1;
  flex: none;
  width: 92px;
  height: auto;
  margin-bottom: -8px;
  filter: drop-shadow(0 0 30px rgba(255, 200, 61, 0.45))
    drop-shadow(0 20px 26px rgba(6, 8, 30, 0.5));
}

/* ------------------------------------------------------------- the cream page */

.page-body {
  padding: 0 var(--gutter) clamp(64px, 8vw, 112px);
}

.prose {
  position: relative;
  max-width: 48rem;
  margin: -56px auto 0;
  padding: clamp(28px, 5vw, 56px) clamp(22px, 5vw, 56px) clamp(32px, 5vw, 56px);
  border: 1px solid rgba(226, 204, 156, 0.6);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow:
    inset 0 1px 0 #fff,
    0 30px 60px -30px var(--shade);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2,
.prose h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}

.prose h2 {
  margin: 2.6rem 0 0.7rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-size: 1.5rem;
  scroll-margin-top: 24px;
}

.prose h3 {
  margin: 1.8rem 0 0.4rem;
  font-size: 1.1875rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose li::marker {
  color: #c9a54f;
}

.prose a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose a:focus-visible,
.toc a:focus-visible,
.page-head a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* The note: a warm card with a gold light at its edge. */
.note {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.15rem 1.35rem 1.15rem 3.1rem;
  border: 1px solid #f0d58f;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff6dc, var(--note));
}

.note::before {
  content: '';
  position: absolute;
  top: 1.45rem;
  left: 1.35rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow:
    0 0 0 4px rgba(255, 200, 61, 0.22),
    0 0 14px rgba(255, 170, 0, 0.6);
}

.note p:last-child,
.note ul:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------- Support's FAQ */

.prose .faq-group {
  margin: 2rem 0 0.8rem;
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 600;
}

details {
  margin: 0 0 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
  transition:
    border-color 0.2s,
    box-shadow 0.3s var(--ease);
}

details:hover {
  border-color: var(--rule-strong);
}

details[open] {
  border-color: var(--rule-strong);
  box-shadow: 0 16px 34px -22px var(--shade);
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 1rem 1.35rem;
  border-radius: var(--radius);
  font-weight: 700;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

/* The chevron turns over as the answer opens. */
summary::after {
  content: '';
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin: -0.2rem 0.2rem 0 0;
  border-right: 2px solid #b8913a;
  border-bottom: 2px solid #b8913a;
  rotate: 45deg;
  transition: rotate 0.3s var(--ease);
}

details[open] > summary::after {
  margin-top: 0.25rem;
  rotate: 225deg;
}

details > :not(summary) {
  margin-right: 1.35rem;
  margin-left: 1.35rem;
}

details > :last-child {
  margin-bottom: 1.2rem;
}

/* Where the browser can, the answer slides open rather than appearing at once. */
@supports (interpolate-size: allow-keywords) {
  :root {
    interpolate-size: allow-keywords;
  }

  details::details-content {
    block-size: 0;
    overflow: clip;
    transition:
      block-size 0.35s var(--ease),
      content-visibility 0.35s allow-discrete;
  }

  details[open]::details-content {
    block-size: auto;
  }
}

/* ---------------------------------------------------------- On this page */
/* Privacy and Terms: the contents beside the page on wide screens, still while it scrolls. */

.toc {
  display: none;
}

@media (min-width: 1100px) {
  .page-body.has-toc {
    display: grid;
    grid-template-columns: 15rem minmax(0, 48rem);
    gap: clamp(32px, 4vw, 64px);
    justify-content: center;
    align-items: start;
  }

  .has-toc .prose {
    margin: -56px 0 0;
  }

  .toc {
    position: sticky;
    top: 24px;
    display: block;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 28px 0 8px;
    font-family: var(--display);
    font-size: 0.9375rem;
    line-height: 1.35;
  }

  .toc-title {
    margin: 0 0 12px;
    color: var(--text-soft);
    font-weight: 600;
  }

  .toc ol {
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--rule-strong);
    list-style: none;
  }

  .toc a {
    position: relative;
    display: block;
    padding: 6px 0 6px 16px;
    color: var(--text-soft);
    text-decoration: none;
    transition: color 0.2s;
  }

  .toc a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -1px;
    width: 2px;
    height: 0;
    translate: 0 -50%;
    background: var(--gold);
    transition: height 0.25s var(--ease);
  }

  .toc a:hover {
    color: var(--text);
  }

  .toc a:hover::before {
    height: 70%;
  }
}

/* ------------------------------------------------------------ narrower screens */

@media (max-width: 820px) {
  .page-head {
    padding-top: 124px;
    padding-bottom: 96px;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: 10px 10px 0;
  }

  /* The lantern stands beside the title only, so the text under it has the full width. */
  .page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0 16px;
    padding-top: 108px;
    padding-bottom: 88px;
  }

  .page-head-inner {
    display: contents;
  }

  .page-head h1 {
    grid-area: 1 / 1;
  }

  .page-head .meta,
  .page-lede {
    grid-column: 1 / -1;
  }

  .page-lantern {
    grid-area: 1 / 2;
    width: 52px;
    margin: 0;
  }

  .prose {
    margin-top: -48px;
  }

  .note {
    padding-left: 2.6rem;
  }

  .note::before {
    left: 1.05rem;
  }

  summary {
    padding: 0.95rem 1.1rem;
  }

  details > :not(summary) {
    margin-right: 1.1rem;
    margin-left: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  details,
  summary::after,
  .toc a,
  .toc a::before {
    transition: none;
  }

  details::details-content {
    transition: none;
  }
}

@media print {
  .site-header,
  .toc,
  .site-footer,
  .page-lantern {
    display: none;
  }

  .page-head {
    padding: 0;
    background: none;
    color: #000;
  }

  .page-head h1,
  .page-head .meta {
    color: #000;
  }

  .prose {
    margin: 0;
    border: 0;
    box-shadow: none;
  }
}
