/* Dawnstep draft site. One stylesheet, no build step, no external fonts, scripts or trackers: both typefaces are self-hosted (fonts/).
   Colours are defined once as tokens that mirror the app's palettes (apps/mobile/lib/design/tokens.ts); tests/unit/website-brand.test.ts
   keeps them in step and checks contrast. Dark mode follows the visitor's system setting. */

@font-face { font-family: "Fraunces Soft Bold"; src: url("fonts/fraunces-softbold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --display: "Fraunces Soft Bold", Georgia, "Times New Roman", serif;
  --bg: #FFF8EF;
  --surface: #FFFFFF;
  --tint: #E3F1EE;
  --text: #25283D;
  --muted: #5B5870;
  --border: #E6DAC8;
  --link: #0F6B6B;
  --link-hover: #0B4F55;
  --button-bg: #0F6B6B;
  --button-text: #FFFFFF;
  --warn-bg: #FDE9C9;
  --warn-text: #3A2900;
  --warn-border: #8A5A00;
  --sample-bg: #E3F1EE;
  --sample-border: #0F6B6B;
  --placeholder-bg: #FFE08A;
  --placeholder-text: #2B1F00;
  --focus: #A63D00;
  --mark-walls: #0F6B6B;
  --mark-sun: #F4A62A;
  --mark-step-1: #0F6B6B;
  --mark-step-2: #8CC3BE;
  --mark-step-3: #8CC3BE;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1A20;
    --surface: #15262E;
    --tint: #1B3340;
    --text: #F5EDE0;
    --muted: #B7C4C6;
    --border: #2A4350;
    --link: #5CC8BE;
    --link-hover: #7ED8CF;
    --button-bg: #5CC8BE;
    --button-text: #06302E;
    --warn-bg: #3A2B14;
    --warn-text: #FFE9AE;
    --warn-border: #D9A441;
    --sample-bg: #143A3E;
    --sample-border: #5CC8BE;
    --placeholder-bg: #5C4500;
    --placeholder-text: #FFF1C2;
    --focus: #FFB36B;
    --mark-walls: #FFF8EF;
    --mark-step-1: #FFF8EF;
    --mark-step-2: #D9ECE9;
    --mark-step-3: #BFDDD9;
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.prose { max-width: 44rem; }
main :is(p, ul, ol):not(.steps) { max-width: 44rem; }

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

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

/* Skip link: visible only when focused */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
  border-radius: 0.375rem;
}
.skip-link:focus { top: 0.5rem; }

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; padding-block: 0.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); text-decoration: none; padding-block: 0.5rem; }
.brand-mark { flex: none; display: block; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.01em; }
.mk-walls { fill: var(--mark-walls); }
.mk-sun { fill: var(--mark-sun); }
.mk-s1 { fill: var(--mark-step-1); }
.mk-s2 { fill: var(--mark-step-2); }
.mk-s3 { fill: var(--mark-step-3); }
.brand .working { font-weight: 400; font-size: 0.8125rem; color: var(--muted); margin-inline-start: 0.25rem; }
.site-header nav ul { display: flex; flex-wrap: wrap; gap: 0 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  display: inline-block;
  min-height: 2.75rem;
  padding: 0.6rem 0.6rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 0.375rem;
}
.site-header nav a:hover { text-decoration: underline; }
.site-header nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; }

/* Main content */
main { padding-block: 1.5rem 3rem; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.5rem; line-height: 1.25; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.1875rem; line-height: 1.3; margin: 1.5rem 0 0.5rem; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
p, ul, ol, dl { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--tint); padding: 0.1em 0.3em; border-radius: 0.25rem; overflow-wrap: anywhere; }
pre { overflow-x: auto; background: var(--tint); padding: 0.75rem; border-radius: 0.375rem; }

.lede { font-size: 1.25rem; color: var(--muted); max-width: 40rem; }
.muted { color: var(--muted); }

/* Draft banner: prominent on every legal page */
.draft-banner {
  margin: 0 0 1.5rem;
  padding: 1rem 1.125rem;
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 3px solid var(--warn-border);
  border-radius: 0.5rem;
}
.draft-banner strong { display: block; font-size: 1.25rem; line-height: 1.3; }
.draft-banner p { margin: 0.5rem 0 0; }

/* Smaller notice for non-legal pages */
.notice {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-inline-start: 4px solid var(--warn-border);
  border-radius: 0.25rem;
}
.notice p { margin: 0; }

/* Placeholders the owner must replace */
mark.ph {
  background: var(--placeholder-bg);
  color: var(--placeholder-text);
  padding: 0.05em 0.3em;
  border-radius: 0.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* Cards and the sample block */
.cards { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .cards.two { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem 1.125rem; }
.card h2, .card h3 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 1rem; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem 1.125rem; margin: 0; }
.steps li::before { content: "Step " counter(step); display: block; font-size: 0.875rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.steps h3 { margin: 0.25rem 0 0.5rem; }
.steps p { margin: 0; }

.sample {
  background: var(--sample-bg);
  border: 2px dashed var(--sample-border);
  border-radius: 0.5rem;
  padding: 1rem 1.125rem;
}
.sample .sample-label {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  border-radius: 0.25rem;
}
.sample h3 { margin: 1rem 0 0.35rem; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.sample blockquote { margin: 0 0 0.75rem; padding-inline-start: 0.875rem; border-inline-start: 4px solid var(--sample-border); }
.sample blockquote p { margin: 0; }
.sample ul { padding-inline-start: 1.25rem; }

/* Tables: scroll sideways on small screens rather than breaking the layout */
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; border: 1px solid var(--border); border-radius: 0.375rem; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.9375rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); }
th { background: var(--tint); }
tr:last-child td { border-bottom: 0; }

blockquote { margin: 0 0 1rem; }

/* Drafting notes at the end of legal pages: visually set apart */
.drafting-notes { margin-top: 3rem; padding: 1rem 1.125rem; border: 2px dashed var(--warn-border); border-radius: 0.5rem; }
.drafting-notes h2 { margin-top: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: 1.5rem; font-size: 0.9375rem; color: var(--muted); }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0 1rem; list-style: none; margin: 0 0 0.75rem; padding: 0; }
.site-footer a { display: inline-block; padding-block: 0.4rem; }
.site-footer p { margin: 0 0 0.5rem; }

@media (max-width: 30rem) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .lede { font-size: 1.125rem; }
}

@media (forced-colors: active) {
  .draft-banner, .sample, .card, .steps li { border-color: CanvasText; }
  mark.ph { forced-color-adjust: none; }
}

@media print {
  .skip-link, .site-header nav { display: none; }
  body { font-size: 11pt; }
}
