/* Grow Where You Know — site styles.
   Palette + type system lifted directly from Gooses (Palette.swift /
   Typography.swift): paper/ink/muted neutrals, sleep/feed/diaper accents,
   serif for reading and headlines, monospace for labels and meta. */

:root {
  --paper:  #fcfbf8;
  --ink:    #1a1a1a;
  --muted:  #6b6b6b;
  --sleep:  #34507a;
  --feed:   #c46a2b;
  --diaper: #76814e;
  --hairline: rgba(26, 26, 26, 0.12);

  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #000000;
    --ink:    #cfc9bd;
    --muted:  #99958c;
    --sleep:  #8fa1bd;
    --feed:   #cc9975;
    --diaper: #a8b087;
    --hairline: rgba(207, 201, 189, 0.16);
  }
}

/* Explicit override for the live theme-toggle demo on gooses.html — set by
   theme-toggle.js, higher specificity than the bare :root above regardless
   of the prefers-color-scheme media query, so it always wins when present. */
:root[data-theme="dark"] {
  --paper:  #000000;
  --ink:    #cfc9bd;
  --muted:  #99958c;
  --sleep:  #8fa1bd;
  --feed:   #cc9975;
  --diaper: #a8b087;
  --hairline: rgba(207, 201, 189, 0.16);
}

:root[data-theme="light"] {
  --paper:  #fcfbf8;
  --ink:    #1a1a1a;
  --muted:  #6b6b6b;
  --sleep:  #34507a;
  --feed:   #c46a2b;
  --diaper: #76814e;
  --hairline: rgba(26, 26, 26, 0.12);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sleep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--sleep);
  outline-offset: 2px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- nav ---------- */

.nav {
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 24px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 22px;
}

.wordmark {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tabs a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.tabs a:hover { color: var(--ink); }

.tabs a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--sleep);
}

.subnav {
  border-bottom: 1px solid var(--hairline);
}

.subnav-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 9px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.subnav-inner a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.subnav-inner a:hover { color: var(--ink); }

.subnav-inner a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--sleep);
}

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

main { padding: 56px 0 40px; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 42px;
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

h1 .tm {
  font-size: 0.32em;
  font-weight: 400;
  vertical-align: super;
  color: var(--muted);
  margin-left: 2px;
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  margin: 44px 0 14px;
}

h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  margin: 28px 0 8px;
}

p { margin: 0 0 16px; }

.lede {
  font-size: 21px;
  color: var(--muted);
  max-width: 34ch;
}

.meta, .caption {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 40px 0;
}

ul.plain {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

ul.plain li {
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
}

ul.plain li:last-child { border-bottom: 1px solid var(--hairline); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
}

.dot.sleep  { background: var(--sleep); }
.dot.feed   { background: var(--feed); }
.dot.diaper { background: var(--diaper); }

/* ---------- cards / grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 8px 0 8px;
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
  body { font-size: 18px; }
}

.card {
  border: 1px solid var(--hairline);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover { border-color: var(--sleep); }

.card .card-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 8px;
}

.card .card-desc {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

/* ---------- pull-quote ---------- */

.pull-quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 32px;
  line-height: 1.3;
  color: var(--ink);
  max-width: 18ch;
  margin: 56px 0;
}

@media (max-width: 560px) {
  .pull-quote { font-size: 24px; margin: 40px 0; }
}

/* ---------- day-strip demo ---------- */

.strip-demo {
  margin: 32px 0 4px;
  overflow-x: auto;
}

.strip-demo svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 480px;
}

.strip-sleep       { fill: var(--sleep); }
.strip-feed        { stroke: var(--feed); stroke-width: 2; }
.strip-diaper-halo { fill: var(--paper); }
.strip-diaper      { fill: var(--diaper); }
.strip-axis-tick   { stroke: var(--hairline); stroke-width: 1; }

.strip-axis-label, .strip-day-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
}

.strip-demo-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.strip-demo-legend .swatch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch-sleep  { width: 14px; height: 7px; background: var(--sleep); display: inline-block; }
.swatch-feed   { width: 2px; height: 12px; background: var(--feed); display: inline-block; }
.swatch-diaper { width: 8px; height: 8px; border-radius: 50%; background: var(--diaper); display: inline-block; }

.theme-toggle {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 4px 0;
  margin-top: 14px;
  cursor: pointer;
}

.theme-toggle:hover { color: var(--ink); border-bottom-color: var(--sleep); }

/* ---------- footer ---------- */

footer.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 0 60px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

footer.site-footer a { color: var(--muted); }
footer.site-footer a:hover { color: var(--ink); }

footer.site-footer .footer-links { margin-top: 6px; }
