/* SleepFeed site: Paper Sleep Diary, Colored Pencils palette.
   Tokens mirror mobile/lib/theme.ts and mobile/lib/activityTokens.ts (pencils). */

:root {
  color-scheme: light dark;
  --paper: #F3EEE3;
  --sheet: #F8F5EE;
  --strip: #E9E3D5;
  --ink: #262421;
  --ink-dim: #4A4640;
  --pencil: #645F56;
  --red: #A8382C;
  --rule: #D9D1C1;
  --rule-strong: #BDB3A1;
  --sleep: #2F55AF;
  --nursing: #9D2A73;
  --bottle: #894D24;
  --diaper: #6F5F1D;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171210;
    --sheet: #1E1814;
    --strip: #221C18;
    --ink: #F3EADF;
    --ink-dim: #D9CCC0;
    --pencil: #A89A8C;
    --red: #E07058;
    --rule: #332C26;
    --rule-strong: #463E36;
    --sleep: #738ECB;
    --nursing: #CB72AA;
    --bottle: #C2845B;
    --diaper: #AB963F;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--serif);
  font-kerning: normal;
}

p, li { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }

a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--sheet); color: var(--ink); padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule-strong); font: 0.875rem var(--mono);
}
.skip:focus { top: 1rem; }

/* Header and footer */

.bar {
  max-width: 52rem; margin: 0 auto; padding: 1.25rem 1.25rem 0;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem;
}
.wordmark {
  font: 600 1.25rem/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.wordmark svg { width: 1.25rem; height: 1.25rem; flex: none; }
.nav { display: flex; gap: 1rem; margin: 0; padding: 0; list-style: none; font: 0.875rem/1.4 var(--mono); }
.nav a { color: var(--pencil); text-decoration: none; padding: 0.25rem 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); }

.foot {
  max-width: 52rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem;
  color: var(--pencil); font: 0.875rem/1.7 var(--mono);
}
.foot .nav { flex-wrap: wrap; margin-bottom: 0.5rem; }
.foot p { margin: 0; }
.foot a { color: var(--pencil); }

/* The diary sheet */

.sheet {
  max-width: 52rem; margin: 1.25rem auto 0;
  background: var(--sheet);
  border-block: 1px solid var(--rule);
  padding: 2.25rem 1.25rem 2.5rem 2rem;
  position: relative;
}
.sheet::before {
  /* the red margin line of a notebook page */
  content: ""; position: absolute; top: 0; bottom: 0; left: 1rem;
  border-left: 1px solid var(--red); opacity: 0.45;
}
@media (min-width: 52rem) {
  .sheet { border: 1px solid var(--rule); border-radius: 3px; padding: 3.5rem 4rem 3.5rem 5rem; }
  .sheet::before { left: 3rem; }
}

.eyebrow { font: 0.8125rem/1.4 var(--mono); color: var(--pencil); letter-spacing: 0.04em; margin: 0 0 0.75rem; }

/* Home */

.hero h1 { font-size: clamp(1.875rem, 7.4vw, 3.5rem); margin: 0 0 1rem; letter-spacing: -0.02em; }
.hero .lede { font-size: clamp(1.125rem, 2.6vw, 1.3125rem); color: var(--ink-dim); margin: 0 0 1.75rem; max-width: 34rem; }
.soon {
  display: inline-block; margin: 0;
  font: 0.9375rem/1.4 var(--mono); color: var(--red);
  border-bottom: 2px solid var(--red); padding-bottom: 0.2rem;
}

.ruled {
  margin: 2.5rem 0; border: 0; height: 2.5rem;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(0.625rem - 1px), var(--rule) calc(0.625rem - 1px) 0.625rem);
}

.benefits { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; }
.benefits li { padding-left: 1.25rem; position: relative; }
.benefits li::before {
  content: ""; position: absolute; left: 0; top: 0.35rem; bottom: 0.35rem;
  width: 3px; border-radius: 2px; background: var(--mark);
}
.benefits strong { display: block; font-size: 1.1875rem; }
.benefits span { color: var(--ink-dim); }
.benefits .sleep { --mark: var(--sleep); }
.benefits .feed { --mark: var(--bottle); }
.benefits .share { --mark: var(--nursing); }
@media (min-width: 46rem) {
  .benefits { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

section h2 { font-size: 1.5rem; margin: 0 0 0.75rem; }

.plans { display: grid; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 46rem) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { border: 1px solid var(--rule-strong); border-radius: 3px; padding: 1.25rem 1.25rem 1rem; background: var(--paper); }
.plan.plus { border-color: var(--red); }
.plan h3 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.plan .price { margin: 0 0 0.75rem; color: var(--ink-dim); }
.plan ul { margin: 0; padding-left: 1.1rem; }
.plan li { margin: 0.25rem 0; }
.plan li::marker { color: var(--pencil); }
.fine { font: 0.8125rem/1.6 var(--mono); color: var(--pencil); margin: 0.75rem 0 0; }

.ask {
  margin: 1.25rem 0 0; padding: 1rem 1.25rem;
  background: var(--strip); border-left: 3px solid var(--sleep);
}
.ask p { margin: 0.25rem 0; }
.ask .q { font-style: italic; }

.promise { font-size: 1.1875rem; margin: 0; }

/* Long-form pages */

.doc { max-width: 40rem; }
.doc h1 { font-size: clamp(2rem, 5.5vw, 2.75rem); margin: 0 0 0.5rem; }
.doc h2 { font-size: 1.3125rem; margin: 2.25rem 0 0.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.doc p, .doc li { margin: 0.5rem 0; }
.doc ul { padding-left: 1.25rem; }
.doc li::marker { color: var(--pencil); }
.doc code { font: 0.9em var(--mono); }
.updated { font: 0.875rem/1.5 var(--mono); color: var(--pencil); margin: 0 0 1.5rem; }
.contact { font-size: 1.25rem; }
