/* starrybedtime.com: one stylesheet for every page (WEB-R3-1).
   System fonts only (no web-font request). The app's night palette by default, a light one when the
   reader's system asks for it. Sizes in rem, so the page reflows at 200 % zoom without a sideways scroll. */

:root {
  color-scheme: dark light;
  --bg: #111730;          /* DSColor.bgHome */
  --surface: #182142;     /* DSColor.card */
  --text: #F3E9D8;        /* DSColor.textPrimary */
  --text-strong: #CFC6BA; /* textPrimary at 0.82 over bgHome, solid */
  --rule: #2A3150;
  --link: #E8B54B;        /* DSColor.accent, 9.4 : 1 on --bg */
  --mark-bg: #3A3220;
  --mark-text: #F6D28A;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #FBF7F0;
    --surface: #F2EADC;
    --text: #161B2E;        /* DSColor.onAccent */
    --text-strong: #3A3F52;
    --rule: #DDD3C2;
    --link: #8A5600;        /* 5.9 : 1 on --bg */
    --mark-bg: #FCE8B8;
    --mark-text: #5A3A00;
  }
}

*, *::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: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.site-header, main, .site-footer {
  max-width: 44rem;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

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

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a {
  display: inline-block;
  padding: 0.5rem 0;   /* 44 px tall at default size */
  font-weight: 700;
}

.site-header nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

main { padding-top: 2rem; padding-bottom: 3rem; }

h1, h2, h3 { line-height: 1.25; font-weight: 800; }
h1 { font-size: 2rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.375rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.0625rem; margin: 1.75rem 0 0.5rem; }

p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
li { margin: 0.35rem 0; }
li > ul { margin: 0.35rem 0 0; }

strong { font-weight: 700; }

a { color: var(--link); text-underline-offset: 0.15em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 4px; }

.version, .lead { color: var(--text-strong); }
.lead { font-size: 1.1875rem; }

mark.placeholder {
  background: var(--mark-bg);
  color: var(--mark-text);
  outline: 1px dashed currentColor;
  padding: 0 0.2em;
  border-radius: 3px;
}

table {
  width: 100%;
  margin: 0 0 1.5rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th, td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
  hyphens: auto;
}

@media (max-width: 30rem) {
  th, td { padding: 0.5rem 0.4rem; }
  table { font-size: 0.875rem; }
}

thead th { background: var(--surface); font-weight: 800; }
tbody th { font-weight: 400; }

.links { padding-left: 1.25rem; }
.links li { margin: 0.5rem 0; }

.site-footer {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--text-strong);
  font-size: 0.9375rem;
}
.site-footer p { margin: 0; }
