/* Dreamy Room — legal & support site.
   Mobile-first, system fonts only, no external resources, light/dark via prefers-color-scheme.
   Served as /assets/site.css (CSP: style-src 'self' — no inline styles anywhere). */

:root {
  color-scheme: light dark;
  --bg: #fbf7f2;
  --surface: #ffffff;
  --text: #2a2433;
  --muted: #5d566a;
  --border: #e4dcd2;
  --accent: #7a3fb8;
  --accent-text: #ffffff;
  --link: #6331a0;
  --link-visited: #7d3f86;
  --focus: #1a73e8;
  --banner-bg: #fff4d6;
  --banner-text: #5a4300;
  --banner-border: #e8c766;
  --mark-bg: #ffe08a;
  --mark-text: #3b2e00;
  --quote-bg: #f4eefb;
  --radius: 12px;
  --measure: 72ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151c;
    --surface: #211e28;
    --text: #ece8f2;
    --muted: #b7afc4;
    --border: #3a3545;
    --accent: #c9a5f2;
    --accent-text: #1b1423;
    --link: #d2b4f7;
    --link-visited: #e2b8e8;
    --focus: #8ab4f8;
    --banner-bg: #3a2f10;
    --banner-text: #ffe7a3;
    --banner-border: #7a6420;
    --mark-bg: #6b5410;
    --mark-text: #fff3cc;
    --quote-bg: #2a2434;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------- accessibility ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.5rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

main:focus {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* ---------- header & footer ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 3.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
}

.lang-switch a {
  display: inline-block;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--link);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: inline-block;
  padding: 0.35rem 0;
}

.copyright {
  margin: 0.5rem 0 0;
}

/* ---------- content ---------- */

main {
  padding-top: 1.5rem;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  scroll-margin-top: 1rem;
}

h1 {
  font-size: 1.85rem;
  margin: 0.5rem 0 0.5rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2.25rem 0 0.75rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
}

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

li + li {
  margin-top: 0.3rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:visited {
  color: var(--link-visited);
}

strong {
  font-weight: 700;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: var(--quote-bg);
}

hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.muted,
.doc-meta {
  color: var(--muted);
}

.doc-meta {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--banner-border);
  background: var(--banner-bg);
  color: var(--banner-text);
  font-weight: 600;
}

mark.placeholder {
  padding: 0 0.2em;
  border-radius: 4px;
  background: var(--mark-bg);
  color: var(--mark-text);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.toc {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

blockquote {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--quote-bg);
}

blockquote > :last-child {
  margin-bottom: 0;
}

.cta {
  margin: 0 0 1.5rem;
}

.button,
.button:visited {
  display: inline-block;
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.05);
}

/* Tables scroll inside their own container, never the page. */
.table-wrap {
  max-width: 100%;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  min-width: 9rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--quote-bg);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

/* ---------- home / lists ---------- */

.hero h1 {
  font-size: 2.25rem;
  margin-top: 1rem;
}

.pitch {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.home-section {
  margin: 0 0 2.5rem;
}

.home-section h2 {
  margin-top: 1.25rem;
  font-size: 1.1rem;
}

.link-list {
  padding-left: 1.25rem;
}

.link-list a {
  display: inline-block;
  padding: 0.3rem 0;
}

.jump-links {
  font-weight: 600;
}

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  main {
    padding-top: 2.5rem;
  }
}

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

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }
}
