:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1b19;
  --ink-2: #55524c;
  --ink-3: #8a867e;
  --rule: #e6e2da;
  --accent: #9b2c1f;
  --accent-soft: #f6e9e6;
  --tbc-bg: #fff1a8;
  --tbc-ink: #4a3b00;
  --brand-grey: #7a7c7c;
  --brand-yellow: #eabf56;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 40rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --surface: #1e1d1b;
    --ink: #ece9e3;
    --ink-2: #b4afa6;
    --ink-3: #807b72;
    --rule: #34312d;
    --accent: #f08a78;
    --accent-soft: #3a2420;
    --tbc-bg: #5a4a00;
    --tbc-ink: #fff4c2;
    --brand-grey: #b9b6b0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--serif);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
body > * { width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); background: var(--surface); }
.masthead-in, .footer-in {
  max-width: 72rem; margin: 0 auto; padding: 0.9rem 1rem;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
/* Wordmark after the logo: light MAY, bold DREAM, then the yellow bar. */
.brand { display: inline-flex; align-items: center; font-family: var(--sans); color: var(--ink); text-decoration: none; font-size: 1rem; }
.brand-mark { color: var(--brand-grey); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 1.05rem; padding-right: 0.6rem; border-right: 2px solid var(--brand-yellow); line-height: 1.1; }
.brand-mark .may { font-weight: 300; }
.brand-sub { color: var(--ink-2); padding-left: 0.6rem; }

.draft-bar {
  font-family: var(--sans); font-size: 0.85rem; text-align: center;
  padding: 0.5rem 1rem; background: var(--accent-soft); color: var(--ink);
  border-bottom: 1px solid var(--rule);
}

mark.tbc {
  background: var(--tbc-bg); color: var(--tbc-ink);
  font-family: var(--sans); font-size: 0.85em;
  padding: 0.05em 0.3em; border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Index */
.index { max-width: 52rem; margin: 0 auto; padding: 3rem 1rem 4rem; }
.index h1, .doc-head h1 {
  font-weight: 600; letter-spacing: -0.015em; line-height: 1.15;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem); margin: 0 0 0.75rem;
}
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: var(--measure); margin: 0 0 2.5rem; }
.doc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.doc-list li { border-bottom: 1px solid var(--rule); }
.doc-list a { display: block; padding: 0.85rem 0; color: var(--ink); font-size: 1.15rem; text-decoration: none; }
.doc-list a:hover { color: var(--accent); }

/* Document */
.doc-layout {
  max-width: 72rem; margin: 0 auto; padding: 2.5rem 1rem 4rem;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem;
}
.toc-side { display: none; }
@media (min-width: 64rem) {
  .doc-layout { grid-template-columns: 15rem minmax(0, 1fr); }
  .toc-side { display: block; }
  .toc-side nav { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; padding-right: 0.5rem; }
  .toc-inline { display: none; }
}
.toc-h, .toc-inline summary {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 0.6rem;
}
.toc { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.85rem; line-height: 1.35; }
.toc li { margin: 0; }
.toc a { display: flex; gap: 0.5em; padding: 0.3rem 0; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.toc-n { min-width: 1.4em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toc-inline { margin-top: 1.5rem; border: 1px solid var(--rule); border-radius: 6px; padding: 0.7rem 1rem; background: var(--surface); }
.toc-inline summary { cursor: pointer; margin: 0; }
.toc-inline .toc { margin-top: 0.6rem; }

.doc { max-width: var(--measure); min-width: 0; }
.doc-head { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }
.crumb { font-family: var(--sans); font-size: 0.8rem; margin: 0 0 0.75rem; }
.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.draft-note {
  display: inline-block; margin: 0 0 1rem; font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border-radius: 3px; padding: 0.15rem 0.5rem;
}
.meta { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 1.5rem; font-family: var(--sans); font-size: 0.82rem; }
.meta .wide { grid-column: 1 / -1; }
.meta dt { color: var(--ink-3); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.meta dd { margin: 0.1rem 0 0; color: var(--ink-2); }

/* Prose */
.prose h2 {
  font-size: 1.45rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25;
  margin: 3rem 0 1rem; padding-top: 0.5rem;
}
.prose h3 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote { margin: 0 0 1.1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.35rem 0; }
.prose li > p { margin: 0.35rem 0; }
.prose ul.lettered { list-style: none; padding-left: 0; }
.prose ul.lettered > li { padding-left: 2.1rem; text-indent: -2.1rem; }
.prose strong { font-weight: 650; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; background: var(--surface); border: 1px solid var(--rule); border-radius: 3px; padding: 0.05em 0.3em; }
.prose blockquote { margin-left: 0; padding-left: 1.1rem; border-left: 3px solid var(--rule); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

.prose table {
  display: block; overflow-x: auto; max-width: 100%;
  border-collapse: collapse; font-family: var(--sans); font-size: 0.85rem; line-height: 1.45;
}
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
.prose th { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); border-bottom-color: var(--ink-3); }

/* Clause numbers: self-links, hung in the margin on wide screens */
.sec-n, .clause-n { color: var(--ink-3); text-decoration: none; font-variant-numeric: tabular-nums; }
.sec-n { margin-right: 0.45em; }
.clause-n { font-family: var(--sans); font-size: 0.8em; font-weight: 600; margin-right: 0.6em; }
.sec-n:hover, .clause-n:hover { color: var(--accent); }
@media (min-width: 48rem) {
  .prose p.clause { position: relative; }
  .prose p.clause > .clause-n { position: absolute; right: 100%; top: 0.18em; margin-right: 1rem; text-align: right; white-space: nowrap; }
}
.prose :target { background: var(--accent-soft); box-shadow: 0 0 0 0.4rem var(--accent-soft); border-radius: 2px; }

.doc-foot { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.8rem; color: var(--ink-3); }
.doc-foot a { color: var(--ink-3); }

/* Footer */
.footer { border-top: 1px solid var(--rule); background: var(--surface); font-family: var(--sans); font-size: 0.8rem; color: var(--ink-3); }
.footer { margin-top: auto; }
.footer-in { justify-content: flex-start; gap: 0.4rem 1.5rem; }
.footer a { color: var(--ink-3); text-decoration: none; }
.footer a:hover { color: var(--accent); }

@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --ink-2: #222; --ink-3: #555; --rule: #bbb; --accent: #000; }
  body { font-size: 10.5pt; }
  .masthead, .footer, .toc-side, .toc-inline, .draft-bar, .doc-foot, .crumb { display: none; }
  .doc-layout { display: block; padding: 0; }
  .doc { max-width: none; }
  .prose h2 { break-after: avoid; }
  .prose p.clause > .clause-n { position: static; }
  .prose a[href^="/legal/"]::after { content: " (maydream.com" attr(href) ")"; font-size: 0.85em; color: var(--ink-3); }
}

/* Brand page */
.home-main { flex: 1; width: 100%; max-width: 60rem; margin: 0 auto; padding: clamp(3rem, 14vh, 9rem) 1rem 4rem; }
.hero h1 { margin: 0 0 2.5rem; line-height: 0; }
.hero img { width: min(100%, 26rem); height: auto; }
.hero .lede { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); max-width: 36rem; margin-bottom: 3.5rem; }
.brand-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); border-top: 1px solid var(--rule); }
.brand-list a {
  display: flex; flex-direction: column; gap: 0.4rem; height: 100%;
  padding: 1.5rem 1.5rem 1.5rem 0; color: var(--ink); text-decoration: none;
}
.brand-list a:hover .brand-name { color: var(--accent); }
.brand-name { font-weight: 600; font-size: 1.3rem; transition: color 0.15s; }
.brand-desc { color: var(--ink-2); font-size: 0.98rem; line-height: 1.5; flex: 1; }
.brand-url { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-3); }
