/* ==========================================================================
   Keep Spicewood Strong — page layout.
   Consumes tokens from theme.css. MOBILE FIRST: every base rule targets the
   small screen, and breakpoints only ever ADD. Most families will only ever
   see this on a phone.
   ========================================================================== */

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

/* `hidden` must win over any display rule below, or conditional sections
   (Today's Bonus) leak onto the page when they have nothing to say. */
[hidden] { display: none !important; }

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

body {
  /* Nothing may cause sideways scroll on a phone. */
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }

.ks-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ks-yellow);
  color: var(--ks-ink);
  border: var(--ks-outline) solid var(--ks-ink);
  padding: .6rem 1rem;
  z-index: 100;
}
.ks-skip:focus { left: .5rem; top: .5rem; }

/* --- Masthead ------------------------------------------------------------ */
.ks-masthead {
  background-color: var(--ks-blue);
  border-bottom: var(--ks-outline) solid var(--ks-ink);
  padding-block: 1rem;
  /* Respect notched phones. */
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}
.ks-masthead__inner { display: grid; gap: .75rem; }

.ks-brand {
  display: grid;
  justify-items: center;
  text-decoration: none;
  line-height: .85;
}
.ks-brand__kicker {
  font-family: var(--ks-font-head);
  font-size: clamp(1rem, .7rem + 1.6vw, 1.6rem);
  text-transform: uppercase;
  color: var(--ks-paper);
  -webkit-text-stroke: 1.5px var(--ks-ink);
  paint-order: stroke fill;
  transform: skewX(-8deg);
}
.ks-brand__kicker--end { align-self: start; }

.ks-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem .75rem;
}
.ks-nav a {
  font-family: var(--ks-font-head);
  text-transform: uppercase;
  font-size: var(--ks-step--1);
  letter-spacing: .03em;
  color: var(--ks-paper);
  text-decoration: none;
  background: var(--ks-ink);
  border-radius: 999px;
  /* 44px minimum touch target — thumbs, not cursors. */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 .9rem;
}
.ks-nav a:hover { background: var(--ks-red); }

/* --- Hero ---------------------------------------------------------------- */
.ks-hero { padding-block: clamp(1.25rem, .8rem + 2vw, 2.5rem); display: grid; gap: 1.25rem; }

.ks-tagline {
  font-family: var(--ks-font-display);
  font-size: var(--ks-step-2);
  letter-spacing: .05em;
  text-align: center;
  margin: 0;
  color: var(--ks-red);
}

.ks-hero__goal { display: grid; gap: .75rem; }
.ks-hero__amount { font-family: var(--ks-font-head); font-size: var(--ks-step-2); margin: 0; }
.ks-hero__next { margin: 0; font-weight: 700; }
.ks-fineprint { font-size: var(--ks-step--1); color: var(--ks-muted); margin: 0; }

.ks-hero .ks-btn { justify-content: center; min-height: 52px; }

/* Full-width give button on phones; content-width once there's room. */
@media (min-width: 34rem) {
  .ks-hero .ks-btn { justify-self: start; }
}

.ks-bonus { display: grid; justify-items: center; gap: .5rem; text-align: center; }
.ks-bonus p { font-weight: 700; margin: 0; }

/* --- Sections ------------------------------------------------------------ */
.ks-section { padding-block: clamp(1.5rem, 1rem + 2.5vw, 3rem); display: grid; gap: 1rem; }
.ks-lede { margin: 0; max-width: 60ch; }

.ks-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--ks-gap);
  /* One column on a phone. */
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) { .ks-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .ks-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 40rem) { .ks-grid--tight { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 56rem) { .ks-grid--tight { grid-template-columns: repeat(3, 1fr); } }

.ks-card { display: grid; gap: .6rem; align-content: start; }
.ks-card__title { font-family: var(--ks-font-head); font-size: var(--ks-step-1); text-transform: uppercase; margin: 0; line-height: 1; }
.ks-card__blurb { margin: 0; }
.ks-card .ks-btn { justify-content: center; min-height: 48px; font-size: var(--ks-step-0); }

.ks-empty { color: var(--ks-muted); text-align: center; }

.ks-trophy { display: grid; gap: .4rem; text-align: center; }
.ks-trophy__emoji { font-size: 2.5rem; line-height: 1; }
.ks-trophy__name { font-family: var(--ks-font-head); text-transform: uppercase; font-size: var(--ks-step-1); margin: 0; }
.ks-trophy__criteria { margin: 0; font-size: var(--ks-step--1); }
.ks-trophy__holder { font-weight: 900; }

.ks-promise { text-align: center; }
.ks-promise p { margin: .5rem 0 0; max-width: 55ch; margin-inline: auto; }

/* --- Footer -------------------------------------------------------------- */
.ks-footer {
  background-color: var(--ks-yellow);
  border-top: var(--ks-outline) solid var(--ks-ink);
  padding-block: 1.5rem;
  margin-top: 2rem;
  text-align: center;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}
.ks-footer p { margin: .25rem 0; }

/* --- Wider screens: masthead becomes a single row ------------------------ */
@media (min-width: 52rem) {
  .ks-masthead__inner {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1.5rem;
  }
  .ks-brand { justify-items: start; }
  .ks-nav { justify-content: flex-end; }
}

/* --- The creed ------------------------------------------------------------
   The emotional close of the page. Three parts, then the chain that ties them.

   Colour is carried by the top rule of each panel, never by the heading text:
   panther blue (#25A3E0) on white measures 2.84:1, below the WCAG AA minimum,
   so headings stay ink black and the brand colour lives where contrast can't
   be harmed. */
.ks-creed { text-align: center; }
.ks-creed > .ks-h2 { justify-self: center; }
.ks-creed__list { margin-top: .5rem; text-align: left; }

.ks-creed__item { border-top-width: 12px; }
.ks-creed__item--1 { border-top-color: var(--ks-red); }
.ks-creed__item--2 { border-top-color: var(--ks-blue); }
.ks-creed__item--3 { border-top-color: var(--ks-yellow); }

.ks-creed__title {
  font-family: var(--ks-font-head);
  font-size: var(--ks-step-1);
  text-transform: uppercase;
  line-height: 1;
  margin: 0 0 .5rem;
  color: var(--ks-ink);
}
.ks-creed__body { margin: 0; }

/* The payoff line. Reads as a comic caption, not a footnote. */
.ks-creed__chain {
  font-family: var(--ks-font-display);
  font-size: var(--ks-step-2);
  letter-spacing: .03em;
  line-height: 1.15;
  color: var(--ks-ink);
  background: var(--ks-yellow);
  border: var(--ks-outline) solid var(--ks-ink);
  border-radius: var(--ks-radius);
  box-shadow: var(--ks-shadow-pop);
  margin: .5rem 0 0;
  padding: .7em 1em;
  /* Keep the three clauses together on a phone rather than orphaning a word. */
  text-wrap: balance;
}
