/* Snoozle Sleep website.
   Colours and fonts follow the app's design system: paper #F9F3F7, ink #2D2429, plum #946E83, night #1E171B.
   Most layout is written inline in each page, as designed. This file holds the fonts and the few
   things inline styles can't do: hover and focus states, the FAQ icon, and the legal pages' tables and lists. */

/* ---- Fonts (served from this site, so a visit never contacts another company) ---- */
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-latin.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-italic-latin.woff2') format('woff2');
  font-weight: 400 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-italic-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

/* ---- Base ---- */
:root { color-scheme: light; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body { margin: 0; background: #F9F3F7; }
main { display: block; }
[id] { scroll-margin-top: 16px; }
a:hover { text-decoration-thickness: 2px; }

/* ---- Skip link and keyboard focus ---- */
.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 20;
  padding: 12px 18px; border-radius: 12px;
  background: #2D2429; color: #FFFFFF; text-decoration: none;
  font: 600 15px 'DM Sans', system-ui, sans-serif;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid #946E83; outline-offset: 3px; }
#waitlist :focus-visible { outline-color: #C9A0BA; }
#waitlist-done:focus { outline: none; }

/* ---- Buttons ---- */
.cta { transition: background-color 180ms ease-out, transform 180ms ease-out; }
.cta:active { transform: translateY(1px); }
.cta-ink:hover { background: #3E3237 !important; }
.cta-plum:hover { background: #835F72 !important; }

/* ---- FAQ ---- */
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
details > summary svg { transition: transform 200ms ease-out; }
details[open] > summary svg { transform: rotate(45deg); }

/* ---- Waitlist form ---- */
#waitlist-form input::placeholder { color: #B4A6AB; opacity: 1; }
#waitlist-form input:focus, #waitlist-form select:focus { border-color: #C9A0BA !important; }
#waitlist-form input[aria-invalid="true"] { border-color: #E8A838 !important; }
#waitlist-form button { transition: background-color 180ms ease-out; }
#waitlist-form button:hover:not([disabled]) { background: #A67F94 !important; }
#waitlist-form button[disabled] { opacity: 0.7; cursor: progress !important; }
/* A field only a robot fills in. Kept off screen rather than hidden so simple bots still see it. */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---- Things still to fill in (a launch check looks for these) ---- */
.todo { background: #F0E4EC; color: #624857; border-radius: 6px; padding: 0 6px; }

/* ---- Legal pages ---- */
.wordmark { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 500; letter-spacing: -0.01em; }

.numbered { margin: 0; padding: 0; list-style: none; counter-reset: n; }
.numbered > li {
  counter-increment: n; display: flex; gap: 16px; padding: 14px 0;
  border-top: 1px dashed #F0E4EC;
  font-size: 17px; line-height: 1.65; color: #483F43;
}
.numbered > li:first-child { border-top: 0; padding-top: 4px; }
.numbered > li::before {
  content: counter(n); flex: none; width: 22px;
  font-family: 'Newsreader', Georgia, serif; font-style: italic; font-size: 22px; line-height: 1.35; color: #946E83;
}
.numbered > li > div { min-width: 0; }

.table-wrap {
  margin: 0 0 20px; overflow-x: auto;
  border: 1px solid #F0E4EC; border-radius: 18px; background: #FFFFFF;
}
.legal-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; color: #483F43; }
.legal-table th {
  text-align: left; font-weight: 600; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #615055; padding: 14px 18px; background: #FBF7FA; border-bottom: 1px solid #F0E4EC;
}
.legal-table td { padding: 14px 18px; vertical-align: top; border-top: 1px dashed #F0E4EC; }
.legal-table tbody tr:first-child td { border-top: 0; }
.legal-table td:first-child { font-weight: 600; color: #2D2429; }

@media (max-width: 720px) {
  .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; width: 100%; box-sizing: border-box; }
  .legal-table tr { padding: 12px 0; border-top: 1px dashed #F0E4EC; }
  .legal-table tbody tr:first-child { border-top: 0; }
  .legal-table td { border: 0; padding: 3px 18px; }
  .legal-table td::before {
    content: attr(data-label); display: block; margin-bottom: 1px;
    font-weight: 600; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #615055;
  }
  .legal-table td:first-child { padding-top: 0; }
  .legal-table td:first-child::before { display: none; }
}

.legal-toc summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.legal-toc summary svg { flex: none; }
.legal-toc[open] summary svg { transform: rotate(45deg); }
.legal-toc a:hover { text-decoration: underline; }

/* ---- Legal pages: small extras ---- */
.legal-section > :last-child { margin-bottom: 0; }
/* the "Legal basis" line under each use of your information: a quiet second line */
.basis { display: block; margin-top: 6px; font-size: 15px; line-height: 1.55; color: #615055; }
/* on a wide screen the "On this page" card stays in view while you read */
@media (min-width: 860px) {
  .legal-aside { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
}
/* on a phone the card runs the full width, like the cards below it */
@media (max-width: 859px) {
  .legal-aside { max-width: none !important; flex-basis: 100% !important; }
}

@media print {
  .skip-link, header .cta, #waitlist, .legal-aside { display: none !important; }
}
