/* ==========================================================================
   Base — reset, typography, layout primitives, shared components
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  /* Offset anchor targets so the sticky bar never covers a section heading. */
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  /* Parchment tooth: two soft radial washes instead of a stock paper photo.
     Keeps the warm western ground with no licensing exposure and no payload. */
  background-image:
    radial-gradient(
      ellipse 80% 60% at 20% 0%,
      color-mix(in srgb, var(--rope-cream) 55%, transparent),
      transparent 70%
    ),
    radial-gradient(
      ellipse 70% 50% at 85% 100%,
      color-mix(in srgb, var(--parchment-edge) 45%, transparent),
      transparent 70%
    );
  background-attachment: fixed;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  line-height: var(--lh-head);
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}

p {
  margin: 0 0 var(--sp-4);
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--star-blue-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

:focus-visible {
  outline: 3px solid var(--star-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Layout primitives ---------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--section-y);
}

.section--alt {
  background: color-mix(in srgb, var(--parchment-deep) 70%, transparent);
  border-block: 1px solid var(--rule);
}

.measure {
  max-width: var(--measure);
}

.center {
  text-align: center;
  margin-inline: auto;
}

/* Centered *block*, left-aligned *text*. Long copy set centered is hard to
   read past a few lines — the eye loses the start of each line. Use this for
   body paragraphs; keep .center for headings and short ledes. */
.prose {
  max-width: var(--measure);
  margin-inline: auto;
  text-align: left;
}

/* Visually hidden but available to screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--sp-4);
  transform: translateY(-120%);
  z-index: 100;
  background: var(--saddle-dark);
  color: var(--star-white);
  padding: var(--sp-3) var(--sp-6);
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--star-white);
}

/* --- Section headings ------------------------------------------------------ */

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 var(--sp-3);
}

.section-title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--sp-6);
}

.lede {
  font-size: var(--fs-lg);
  color: var(--text-soft);
}

/* Small five-star rule that echoes the logo. Decorative only. */
.star-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin: var(--sp-6) auto;
}

.star-rule::before,
.star-rule::after {
  content: "";
  flex: 1 1 auto;
  max-width: 6rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--parchment-edge));
}

.star-rule::after {
  background: linear-gradient(90deg, var(--parchment-edge), transparent);
}

.star-rule i {
  width: 0.6rem;
  height: 0.6rem;
  /* Five-pointed star via clip-path — no icon font, no SVG request. */
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
  background: var(--parchment-edge);
}

.star-rule i:nth-child(1) { background: var(--star-blue); }
.star-rule i:nth-child(2) { background: var(--star-gold); }
.star-rule i:nth-child(3) { background: var(--saddle); }
.star-rule i:nth-child(4) { background: var(--star-green); }
.star-rule i:nth-child(5) { background: var(--star-red); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.2;
  padding: var(--sp-4) var(--sp-8);
  border-radius: var(--radius);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--star-red);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--star-red-ink);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  color: var(--saddle-dark);
  border-color: var(--saddle);
}

.btn--secondary:hover {
  background: color-mix(in srgb, var(--saddle) 10%, transparent);
  color: var(--saddle-dark);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.btn-row--center {
  justify-content: center;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
}

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

.grid {
  display: grid;
  gap: var(--sp-6);
}

.stack > * + * {
  margin-top: var(--sp-4);
}
