/* ==========================================================================
   Scott Rouse · Always for Children
   Built on the "Always for Children" design system.
   One stylesheet, no build step, no third-party requests.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL OFL; see assets/fonts) ---------- */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-variable.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-italic-variable.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans-variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans-italic-variable.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  /* Brand */
  --night: #13284a;        /* Hellgate Night: primary brand, headings, dark grounds */
  --night-700: #24426f;    /* hover on night elements, secondary links */
  --brick: #b32e25;        /* Schoolhouse Red: primary actions, eyebrows on light */
  --brick-700: #8f231c;    /* hover/pressed brick */
  --larch: #e2a632;        /* Larch Gold: accents on night; fill with night text */
  --larch-ink: #8a5a00;    /* gold as text on paper */
  --river: #2c6a63;        /* Clark Fork: secondary accent (tags, info) */

  /* Neutrals */
  --paper: #fbf8f2;        /* page ground */
  --white: #ffffff;        /* raised surfaces */
  --stone: #f2ece0;        /* alternate section ground */
  --rule: #ddd3c1;         /* hairlines, card borders */
  --ink: #1d2330;          /* body text */
  --muted: #5a606c;        /* secondary text */
  --on-night: #e9eef6;     /* text on night */
  --on-night-muted: #b7c3d6;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 12px;

  --wrap: 72rem;
  --narrow: 44rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section: clamp(3.5rem, 8vw, 6rem);

  /* The roof chevron from the mark, as a reusable mask */
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 36'%3E%3Cpath d='M0 28 L32 2 L64 28 L64 35 L32 9 L0 35 Z'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  color: var(--night);
  line-height: 1.12;
  margin: 0 0 0.55em;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); font-weight: 560; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.35rem; line-height: 1.25; }
h4 { font-size: 1.1rem; }

p, ul, ol, dl, blockquote, figure { margin: 0 0 1.1em; }
p { text-wrap: pretty; }
strong { font-weight: 650; }

a { color: var(--night); text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--brick); }
a:hover { color: var(--brick); }

:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; border-radius: 2px; }
.on-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--larch); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--night); color: var(--white); padding: 0.6rem 1rem; border-radius: var(--radius-md);
}
.skip-link:focus { top: 1rem; color: var(--white); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: var(--narrow); }

/* Eyebrow: small caps label led by the roof chevron */
.eyebrow {
  display: flex; align-items: center; gap: 0.6rem;
  font: 700 0.78rem/1.3 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brick);
  margin-bottom: 0.9rem;
}
.eyebrow::before {
  content: ""; flex: none; width: 1.2rem; height: 0.68rem;
  background: currentColor;
  -webkit-mask: var(--chevron) center / contain no-repeat;
          mask: var(--chevron) center / contain no-repeat;
}
.on-dark .eyebrow { color: var(--larch); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border: 2px solid var(--brick);
  border-radius: var(--radius-md);
  background: var(--brick);
  color: var(--white);
  font: 650 1rem/1.2 var(--sans);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--brick-700); border-color: var(--brick-700); color: var(--white); }
.btn--ghost { background: transparent; color: var(--night); border-color: var(--night); }
.btn--ghost:hover { background: var(--night); border-color: var(--night); color: var(--white); }
.on-dark .btn { background: var(--larch); border-color: var(--larch); color: var(--night); }
.on-dark .btn:hover { background: #f0bb52; border-color: #f0bb52; color: var(--night); }
.on-dark .btn--ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.65); }
.on-dark .btn--ghost:hover { background: var(--white); color: var(--night); border-color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.text-link { font-weight: 650; text-decoration: none; color: var(--night); }
.text-link::after { content: " \2192"; color: var(--brick); }
.text-link:hover { text-decoration: underline; }

/* ---------- Header ---------- */

.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); }
.site-header::before {
  content: ""; display: block; height: 5px;
  background: linear-gradient(90deg, var(--night) 0 72%, var(--brick) 72% 88%, var(--larch) 88% 100%);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem 2rem;
  padding-block: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: 1rem; text-decoration: none; }
.brand img { height: 2.9rem; width: auto; }
.brand__role {
  font: 600 0.72rem/1.35 var(--sans); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); padding-left: 1rem; border-left: 1px solid var(--rule); max-width: 12rem;
}

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a {
  display: inline-block; padding: 0.4rem 0;
  font-weight: 600; font-size: 0.97rem;
  text-decoration: none; color: var(--ink);
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--night); border-bottom-color: var(--brick); }
.site-nav a[aria-current="page"] { color: var(--night); border-bottom-color: var(--night); }

@media (max-width: 86rem) { .brand__role { display: none; } }
@media (max-width: 47.99rem) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .brand img { height: 2.5rem; }
  .site-nav { width: 100%; border-top: 1px solid var(--rule); padding-top: 0.5rem; }
  .site-nav ul { gap: 0.1rem 1.15rem; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: var(--night);
  color: var(--on-night);
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(5rem, 11vw, 8rem);
  overflow: hidden;
  isolation: isolate;
}
/* Ridgeline: the mountains around Hellgate Canyon */
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: clamp(3.5rem, 9vw, 7rem); z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath fill='%231b3560' d='M0 120 L0 70 L120 52 L260 18 L380 46 L470 30 L600 64 L700 58 L760 74 L860 34 L980 8 L1120 48 L1240 36 L1340 60 L1440 50 L1440 120 Z'/%3E%3Cpath fill='%23223e6c' d='M0 120 L0 96 L180 80 L330 92 L520 70 L690 98 L800 94 L960 66 L1110 86 L1290 74 L1440 88 L1440 120 Z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
.hero .wrap {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
}
.hero h1 { color: var(--white); }
.hero h1 em { font-style: italic; font-weight: 480; color: var(--larch); display: block; }
.hero p:not(.eyebrow) { color: var(--on-night); font-size: 1.15rem; max-width: 36rem; }
.hero__photo { position: relative; justify-self: center; max-width: 23rem; width: 100%; }
.hero__photo img {
  position: relative; z-index: 1;
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.6);
}
.hero__photo::before {
  content: ""; position: absolute; z-index: 0;
  top: -0.9rem; right: -0.9rem; width: 70%; height: 70%;
  border-radius: var(--radius-lg); background: var(--larch);
}
.hero__photo::after {
  content: ""; position: absolute; z-index: 2;
  left: -1.6rem; bottom: 1.4rem; width: 4.5rem; height: 2.55rem;
  background: var(--brick);
  -webkit-mask: var(--chevron) center / contain no-repeat;
          mask: var(--chevron) center / contain no-repeat;
}

@media (max-width: 47.99rem) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero__photo { max-width: 16rem; justify-self: start; margin-left: 1.6rem; }
}

/* Interior page heading band */
.page-head {
  position: relative; background: var(--night); color: var(--on-night);
  padding-block: clamp(2.75rem, 6vw, 4.25rem);
  overflow: hidden; isolation: isolate;
}
.page-head::after {
  content: ""; position: absolute; z-index: -1; right: -2rem; bottom: -3.5rem;
  width: clamp(12rem, 30vw, 22rem); aspect-ratio: 64 / 36;
  background: #1b3560;
  -webkit-mask: var(--chevron) center / contain no-repeat;
          mask: var(--chevron) center / contain no-repeat;
}
.page-head h1 { color: var(--white); margin-bottom: 0.35em; font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page-head p:not(.eyebrow) { font-size: 1.15rem; max-width: 42rem; margin: 0; color: var(--on-night); }
.page-head .eyebrow { color: var(--larch); }
.page-head a { color: var(--white); text-decoration-color: var(--larch); }
.page-head .meta { color: var(--on-night-muted); font-size: 0.95rem; }

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section--stone { background: var(--stone); }
.section-head { max-width: 46rem; margin-bottom: 2.75rem; }
.section-head p:not(.eyebrow) { color: var(--muted); font-size: 1.12rem; }

/* Status strip */
.status { background: var(--larch); color: var(--night); font-size: 0.97rem; }
.status .wrap { padding-block: 0.95rem; display: flex; flex-wrap: wrap; gap: 0.4rem 2.5rem; }
.status strong { font-weight: 750; }

/* ---------- Cards / grids ---------- */

.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }

.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.6rem 1.4rem;
}
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--muted); }
.card p:last-child { margin-bottom: 0; }
.card__num {
  display: block; margin-bottom: 0.7rem;
  font: 500 2.2rem/1 var(--serif); color: var(--brick);
}
.card__label {
  display: block; margin-bottom: 0.8rem;
  font: 700 0.75rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--river);
}
a.card { display: block; text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
a.card:hover { border-color: var(--night); transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(19, 40, 74, 0.45); }
a.card:hover h3 { color: var(--brick); }

/* ---------- Split layout ---------- */

.split {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}
@media (max-width: 47.99rem) { .split { grid-template-columns: 1fr; } }

figure img { border-radius: var(--radius-lg); }
figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.7rem; }

/* ---------- Motto ---------- */

.motto { background: var(--white); padding-block: var(--section); border-block: 1px solid var(--rule); }
.motto .wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.motto__mark { width: clamp(4.5rem, 10vw, 7.5rem); }
.motto blockquote { margin: 0; max-width: 48rem; }
.motto blockquote p { font: italic 450 clamp(1.45rem, 3vw, 2.05rem)/1.4 var(--serif); color: var(--night); }
.motto cite { font: normal 650 0.95rem/1.4 var(--sans); color: var(--brick); }
@media (max-width: 40rem) { .motto .wrap { grid-template-columns: 1fr; } }

/* ---------- Steps ---------- */

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 1.25rem; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 1.4rem 1.4rem 1.4rem 4.4rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 1.3rem; top: 1.25rem;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--night); color: var(--white);
  font: 600 1.05rem/2.1rem var(--serif); text-align: center;
}
.steps h3, .prose .steps h3 { font-size: 1.2rem; margin: 0.15rem 0 0.3em; }
.steps p { color: var(--muted); }
.steps p:last-child { margin-bottom: 0; }

.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 1.75rem; margin-bottom: 0.55rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 1rem; height: 0.57rem; background: var(--brick);
  -webkit-mask: var(--chevron) center / contain no-repeat;
          mask: var(--chevron) center / contain no-repeat;
}

.note {
  background: var(--stone);
  border: 1px solid var(--rule);
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius-lg);
  font-size: 0.98rem;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- Prose ---------- */

.prose { max-width: var(--narrow); }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose > :first-child, .prose .mt-0 { margin-top: 0; }
.prose ul:not([class]) { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--brick); }

.priority { padding-block: 2.5rem; border-top: 1px solid var(--rule); }
.priority:first-of-type { border-top: 0; padding-top: 0; }
.priority h2 { margin-top: 0; display: flex; align-items: baseline; gap: 0.9rem; }
.priority h2 span { font-weight: 500; color: var(--brick); }
.priority .bottom-line { font: italic 450 1.25rem/1.45 var(--serif); color: var(--night); }

.media { display: grid; grid-template-columns: 1fr 13rem; gap: 2rem; align-items: start; }
.media--left { grid-template-columns: 13rem 1fr; }
.media--left > figure { order: -1; }
@media (max-width: 40rem) {
  .media, .media--left { grid-template-columns: 1fr; }
  .media figure { max-width: 16rem; }
}
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 30rem; margin-bottom: 1.1em; }
.photo-pair figure { margin: 0; }
.photo-pair img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }

.qa dt { font: 600 1.25rem/1.35 var(--serif); color: var(--night); margin-top: 2.25rem; }
.qa dd { margin: 0.6rem 0 0; }

/* ---------- Posts ---------- */

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding-block: 1.6rem; border-bottom: 1px solid var(--rule); }
.post-list li:first-child { padding-top: 0; }
.post-list h2, .post-list h3 { font-size: 1.45rem; margin-bottom: 0.25em; }
.post-list h2 a, .post-list h3 a { text-decoration: none; }
.post-list h2 a:hover, .post-list h3 a:hover { color: var(--brick); }
.post-list p { margin-bottom: 0.4em; }
.meta { font-size: 0.9rem; color: var(--muted); }
.tag {
  display: inline-block; font: 700 0.7rem/1 var(--sans); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--white); background: var(--river);
  padding: 0.32rem 0.5rem; border-radius: var(--radius-sm); margin-left: 0.5rem; vertical-align: 1px;
}
.archive-note { font-size: 0.95rem; color: var(--muted); font-style: italic; }

.back-link { display: inline-block; margin-bottom: 1rem; font-weight: 650; text-decoration: none; }
.back-link::before { content: "\2190 "; color: var(--larch); }
.page-head .back-link:hover { color: var(--larch); }

/* ---------- Contact ---------- */

.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.contact-list li { padding: 1.25rem 1.5rem; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--white); }
.contact-list .label {
  display: block; font: 700 0.75rem/1 var(--sans); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brick); margin-bottom: 0.55rem;
}
.contact-list a { font-size: 1.15rem; font-weight: 650; }
address { font-style: normal; }

/* ---------- Footer ---------- */

.site-footer { background: var(--night); color: var(--on-night-muted); font-size: 0.95rem; }
.site-footer a { color: var(--on-night); text-decoration: none; }
.site-footer a:hover { color: var(--larch); text-decoration: underline; }
.site-footer h2 {
  font: 700 0.75rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--larch); margin-bottom: 1rem;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.5fr repeat(3, 1fr); padding-block: 3.75rem 2.75rem; }
@media (max-width: 55rem) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 30rem) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.45rem; }
.footer-brand img { height: 3rem; width: auto; }
.footer-brand p { margin-top: 1.1rem; max-width: 20rem; }

.disclaimer { border-top: 1px solid #2a4370; padding-block: 1.5rem 2rem; font-size: 0.85rem; color: var(--on-night-muted); }
.disclaimer p { margin-bottom: 0.6em; max-width: 60rem; }
.paid-for { display: inline-block; border: 1px solid #4a6390; padding: 0.4rem 0.65rem; color: var(--on-night); border-radius: var(--radius-sm); }

/* ---------- Utilities ---------- */

.mt-0 { margin-top: 0; }

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

/* ---------- Print ---------- */

@media print {
  .site-nav, .skip-link, .btn-row, .site-footer .footer-grid,
  .hero::after, .page-head::after, .hero__photo::before, .hero__photo::after { display: none; }
  .hero, .page-head, .site-footer { background: none; color: #000; padding-block: 1rem; }
  .hero h1, .page-head h1, .hero p, .page-head p, .disclaimer, .paid-for { color: #000; }
  body { font-size: 11pt; background: #fff; }
  a { color: #000; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
