/* dev.moodyteas.co
   Direction: Moody Teas Brand Guide v6. Sage is a fill, Steel Teal is for links,
   Charcoal for text. Archivo Black / Fraunces / Questrial stand in for the
   commercial Colville / Diverda / Questrial. Dials: ENERGY 2 / RHYTHM 2 / MOTION 1.
   Accent: each write-up's mood color, used once as a filled chip and a heavy rule. */

:root {
  --bg: #ffffff;
  --surface: #f5f3ee;
  --text: #545454;
  --text-strong: #2f3432;
  --muted: #6b6457;
  --link: #4f6168;
  --link-hover: #2f3e44;
  --rule: #d9d5cc;
  --band: #7d988e;
  --band-text: #ffffff;
  --code-bg: #f3f1ec;
  --focus: #1f5f6e;
  --mood-focus: #8f0000;
  --mood-calm: #74c1e9;
  --mood-wellness: #1a9983;
  --mood-invigorate: #9fba81;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1d2120;
  --surface: #262b29;
  --text: #d9d5cc;
  --text-strong: #f3f0ea;
  --muted: #b3ab9c;
  --link: #a9c3cb;
  --link-hover: #d4e6eb;
  --rule: #3b423f;
  --band: #4e6a60;
  --band-text: #ffffff;
  --code-bg: #262b29;
  --focus: #a9c3cb;
  --mood-focus: #b02a2a;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d2120;
    --surface: #262b29;
    --text: #d9d5cc;
    --text-strong: #f3f0ea;
    --muted: #b3ab9c;
    --link: #a9c3cb;
    --link-hover: #d4e6eb;
    --rule: #3b423f;
    --band: #4e6a60;
    --band-text: #ffffff;
    --code-bg: #262b29;
    --focus: #a9c3cb;
    --mood-focus: #b02a2a;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 "Questrial", system-ui, sans-serif;
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
a:active { color: var(--text-strong); }
a, button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--bg); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Sage band: the one place the brand color is a big fill. */
.band { background: var(--band); color: var(--band-text); }
.band-inner, .wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }
.band-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4.5rem; flex-wrap: wrap; padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.wordmark {
  font-family: "Archivo Black", sans-serif; font-size: 1.6rem; line-height: 1;
  color: var(--band-text); text-decoration: none; letter-spacing: -0.01em;
}
.wordmark:hover { color: var(--band-text); text-decoration: none; }
.wordmark span { font-family: "Fraunces", serif; font-weight: 600; font-style: italic; }

/* White fill, dark text: white text on Sage is only 3.1:1, too low at this size. */
.theme-toggle {
  font: inherit; font-size: 0.95rem; color: #2f3432;
  background: #ffffff; border: 2px solid #ffffff; border-radius: 6px;
  min-height: 44px; padding: 0 0.9rem;
}
.theme-toggle:hover { background: #e6ece9; border-color: #e6ece9; }
.theme-toggle:active { background: #cfd9d4; border-color: #cfd9d4; }

nav.site { border-bottom: 1px solid var(--rule); }
nav.site ul { list-style: none; margin: 0 auto; padding: 0 1rem; max-width: 46rem; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
nav.site a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--text-strong); }
nav.site a:hover { text-decoration: underline; }
nav.site a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--band); }

main { display: block; padding: 2.5rem 0 4rem; }

h1, h2, h3 { color: var(--text-strong); line-height: 1.15; }
h1 { font-family: "Archivo Black", sans-serif; font-weight: 400; font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 1.25rem; letter-spacing: -0.015em; }
h2 { font-family: "Fraunces", serif; font-weight: 700; font-size: 1.65rem; margin: 3rem 0 0.75rem; }
h3 { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.25rem; margin: 2rem 0 0.5rem; }

.lede { font-size: 1.25rem; line-height: 1.55; color: var(--text-strong); max-width: 38rem; }

p, li { max-width: 40rem; }

/* Write-up list on the home page */
.posts { list-style: none; padding: 0; margin: 1rem 0 0; }
.posts li { padding: 1.25rem 0; border-top: 1px solid var(--rule); }
.posts li:last-child { border-bottom: 1px solid var(--rule); }
.posts h3 { margin: 0.4rem 0 0.35rem; font-size: 1.4rem; }
.posts h3 a { color: var(--text-strong); text-decoration: none; }
.posts h3 a:hover { text-decoration: underline; }
.posts p { margin: 0; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; font-size: 0.95rem; color: var(--muted); }

/* Identity motif: every write-up carries a mood (one of the nine) and a steep time. */
.mood {
  display: inline-block; padding: 0.1rem 0.6rem; border-radius: 4px;
  font-size: 0.85rem; font-weight: 400; color: #ffffff; background: var(--mood-focus);
}
.mood-focus { background: var(--mood-focus); }

/* Write-up page */
.post-head { border-top: 10px solid var(--mood-focus); padding-top: 1.5rem; margin-bottom: 2rem; }
.post-head h1 { margin-top: 0.75rem; }
.post h2 { margin-top: 2.5rem; }
.post figure { margin: 1.5rem 0; }

pre, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
code { background: var(--code-bg); padding: 0.08em 0.3em; border-radius: 3px; color: var(--text-strong); }
pre {
  background: var(--code-bg); color: var(--text-strong); padding: 1rem;
  border-radius: 6px; overflow-x: auto; line-height: 1.5; border: 1px solid var(--rule);
}
pre code { background: none; padding: 0; font-size: 0.85rem; }

.numbers { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.98rem; }
.numbers th, .numbers td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.numbers th { color: var(--text-strong); font-weight: 400; font-family: "Fraunces", serif; }
.table-scroll { overflow-x: auto; }

.callout { background: var(--surface); padding: 1.1rem 1.25rem; border-radius: 6px; margin: 1.5rem 0; }
.callout p { margin: 0; }

/* Built page: grouped plain lists, not a card grid. */
.tools { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.tools li { padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.tools strong { color: var(--text-strong); font-family: "Fraunces", serif; font-weight: 600; font-size: 1.1rem; }
.tools p { margin: 0.2rem 0 0; }
.tools .with { color: var(--muted); font-size: 0.95rem; }

.repo { background: var(--surface); border-radius: 6px; padding: 1.25rem 1.25rem 1.4rem; margin-top: 1rem; }
.repo h3 { margin-top: 0; }

footer.site { border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; font-size: 0.95rem; color: var(--muted); }
footer.site p { margin: 0.25rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
