/* ==========================================================================
   Quinn's Eagle Scout Project — stylesheet
   Mobile-first. Single stylesheet. System fonts (no external requests).
   Palette evokes the Scouting outdoors: pine green, khaki/cream, eagle gold.
   ========================================================================== */

/* ---- Design tokens ------------------------------------------------------ */
:root {
  /* Color */
  --pine:        #1f4032;
  --pine-700:    #17342a;
  --pine-900:    #0e2419;
  --moss:        #3a6b52;
  --gold:        #c68a1d;
  --gold-deep:   #a8721a;
  --ember:       #a23a2c;
  --cream:       #f6efe1;
  --paper:       #fbf8f0;
  --sand:        #ece0c8;
  --ink:         #22261f;
  --ink-soft:    #515a4b;
  --line:        rgba(31, 64, 50, 0.16);
  --line-soft:   rgba(31, 64, 50, 0.08);
  --white:       #ffffff;

  /* Type */
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing / shape */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(14, 36, 25, 0.06), 0 10px 30px -12px rgba(14, 36, 25, 0.28);
  --shadow-sm: 0 1px 3px rgba(14, 36, 25, 0.10);
  --wrap: 1120px;
  --wrap-narrow: 760px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Prevent intrinsic min-content of children from forcing grids/flex wider
   than the viewport (a common source of horizontal overflow on phones). */
.hero-grid > *, .split > *, .glance > *, .features > * { min-width: 0; }

img { max-width: 100%; height: auto; display: block; image-orientation: from-image; }
[hidden] { display: none !important; }

a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; color: var(--pine-900); letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.25rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.2rem); margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 0 0 0.4em; }
p  { margin: 0 0 1.05em; }
.lead { font-size: clamp(1.1rem, 2.3vw, 1.3rem); color: var(--ink-soft); line-height: 1.55; }

/* ---- Skip link / a11y --------------------------------------------------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--pine); color: var(--white); padding: 0.7em 1.1em; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: var(--white); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

/* ---- Layout ------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.2rem); }
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--tight { padding-block: clamp(2.2rem, 5vw, 3.5rem); }
.narrow { max-width: var(--wrap-narrow); }

/* ---- Header / nav ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 240, 0.9);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 66px;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--pine-900); font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; line-height: 1.1; }
.brand:hover { color: var(--pine-900); }
.brand .mark { flex: none; width: 34px; height: 34px; }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--moss); }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); cursor: pointer; color: var(--pine);
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav-links { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.35rem; }
.nav-links a {
  display: block; padding: 0.55em 0.85em; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--pine-700); font-weight: 600; font-size: 0.97rem;
}
.nav-links a:hover { background: var(--cream); color: var(--pine-900); }
.nav-links a[aria-current="page"] { color: var(--gold-deep); }
.nav-links .btn { color: var(--white); }
.nav-links .btn:hover { color: var(--white); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 0.9em 1.4em; border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--gold); color: #2a1e05; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--gold-deep); color: #2a1e05; }
.btn--pine { background: var(--pine); color: var(--white); }
.btn--pine:hover { background: var(--pine-700); color: var(--white); }
.btn--ghost { background: transparent; color: var(--pine); border-color: var(--line); }
.btn--ghost:hover { background: var(--cream); color: var(--pine-900); }
.btn--lg { font-size: 1.08rem; padding: 1.05em 1.7em; }
.btn--block { display: flex; width: 100%; }

/* ---- Hero --------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 82% -10%, rgba(198, 138, 29, 0.16), transparent 60%),
    linear-gradient(180deg, var(--cream), var(--paper));
  border-bottom: 1px solid var(--line-soft);
}
.hero .wrap { position: relative; z-index: 2; padding-block: clamp(3rem, 8vw, 5.5rem); }
.hero-grid { display: grid; gap: clamp(2rem, 4vw, 3rem); align-items: center; }
.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.55em;
  max-width: 100%;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--moss); margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--gold); border-radius: 2px; }
.hero h1 { max-width: 15ch; }
.hero .lead { max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.hero-note { margin-top: 1.4rem; font-size: 0.92rem; color: var(--ink-soft); max-width: 48ch; }
.hero-note strong { color: var(--pine-700); }

/* decorative ridgeline at bottom of hero */
.ridge { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; width: 100%; height: auto; color: var(--paper); }

/* ---- At-a-glance cards -------------------------------------------------- */
.glance { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
.glance .card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.2rem; box-shadow: var(--shadow-sm);
}
.card .k { display: flex; align-items: center; gap: 0.5em; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--moss); margin-bottom: 0.35rem; }
.card .v { font-family: var(--font-display); font-size: 1.18rem; color: var(--pine-900); line-height: 1.2; }
.card .v small { display:block; font-family: var(--font-body); font-size: 0.86rem; font-weight: 500; color: var(--ink-soft); margin-top: 0.2rem; }

/* ---- Generic content ---------------------------------------------------- */
.bg-cream { background: var(--cream); }
.bg-pine { background: var(--pine); color: #eaf2ec; }
.bg-pine h2, .bg-pine h3 { color: var(--white); }
.bg-pine a { color: #ffe7b3; }
.bg-pine .lead { color: #d6e4db; }
.bg-pine .notice { background: rgba(255,255,255,0.07); border-left-color: var(--gold); color: #e7f0ea; }

.prose p { max-width: 68ch; }
.prose h2 { margin-top: 0; }

.split { display: grid; gap: clamp(1.8rem, 4vw, 3rem); align-items: center; }

/* ---- Feature list ------------------------------------------------------- */
.features { display: grid; gap: 1.1rem; grid-template-columns: 1fr; list-style: none; margin: 0; padding: 0; }
.feature { display: flex; gap: 0.9rem; align-items: flex-start; }
.feature .ico {
  flex: none; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center; background: var(--cream); color: var(--gold-deep);
  border: 1px solid var(--line);
}
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 0.15rem; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* ---- Stat band ---------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: center; }
.stat .num { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--gold); line-height: 1; }
.bg-pine .stat .num { color: #f2c15f; }
.stat .cap { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.35rem; }
.bg-pine .stat .cap { color: #cfe0d4; }

/* ---- Media / figures ---------------------------------------------------- */
.figure { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.figure img { width: 100%; }
.figure figcaption { padding: 0.8rem 1rem; font-size: 0.9rem; color: var(--ink-soft); border-top: 1px solid var(--line-soft); }
.figure--duo .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.figure--duo .duo img { width: 100%; height: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 25%; }

/* ---- Story timeline ----------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; }
.timeline li { position: relative; padding-left: 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--cream); }
.timeline li::after { content: ""; position: absolute; left: 5px; top: 1.4em; bottom: -1.4rem; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--moss); }
.timeline h3 { margin: 0.1rem 0 0.2rem; }
.timeline p { margin: 0; color: var(--ink-soft); }
.timeline .planned::before { background: var(--white); border: 2px solid var(--gold); }

/* ---- Photo gallery ------------------------------------------------------ */
.gallery { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.gallery .figure img { aspect-ratio: 3 / 4; object-fit: cover; object-position: center 22%; }
.gallery .figure.tiger img { aspect-ratio: 3 / 4; object-position: center 20%; }
/* Dog photos vary in shape — scale to fit (never crop) so no faces are cut off. */
.gallery--dogs .figure img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--white); }

/* Per-dog carousel: < > buttons appear only with JS, only when >1 photo. */
.dog-carousel { position: relative; }
.dog-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line);
  color: var(--pine); place-items: center; cursor: pointer;
  box-shadow: var(--shadow-sm); display: none; padding: 0;
}
.js .dog-nav { display: grid; }
.dog-nav svg { width: 20px; height: 20px; }
.dog-nav:hover { background: #fff; color: var(--pine-900); }
.dog-prev { left: 8px; }
.dog-next { right: 8px; }
.dog-count {
  position: absolute; bottom: 8px; right: 8px; display: none;
  background: rgba(14, 36, 25, 0.72); color: #fff; font-size: 0.72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; letter-spacing: 0.02em;
}
.js .dog-count { display: block; }

/* ---- Donate page -------------------------------------------------------- */
.donate-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.4rem, 4vw, 2.2rem); box-shadow: var(--shadow); text-align: center;
}
.donate-card .amount-goal { font-family: var(--font-display); font-size: 2.4rem; color: var(--pine-900); }
.paypal-note { font-size: 0.86rem; color: var(--ink-soft); margin-top: 1rem; }
.fallback-link { font-size: 0.92rem; }

.qr-block { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); }
.qr-block img { width: 180px; height: 180px; margin: 0 auto 0.5rem; border-radius: var(--radius-sm); }
.qr-block .paypal-note { margin-top: 0.2rem; }

.give-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.give-list li { display: flex; gap: 0.7rem; align-items: flex-start; }
.give-list .check { flex: none; color: var(--moss); margin-top: 0.15rem; }

.notice {
  border-left: 4px solid var(--gold); background: var(--cream);
  padding: 1rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.96rem;
}
.notice strong { color: var(--pine-900); }

/* ---- Materials contact form -------------------------------------------- */
.materials-form { display: grid; gap: 1rem; max-width: 34rem; margin-top: 0.4rem; }
.materials-form .field { display: grid; gap: 0.35rem; }
.materials-form label { font-weight: 600; font-size: 0.95rem; color: var(--pine-900); }
.materials-form .opt { font-weight: 400; color: var(--ink-soft); font-size: 0.85rem; }
.materials-form input, .materials-form textarea {
  font: inherit; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.65em 0.8em; width: 100%;
}
.materials-form textarea { resize: vertical; min-height: 6em; }
.materials-form input:focus-visible, .materials-form textarea:focus-visible { border-color: var(--gold); outline-offset: 1px; }
.materials-form .btn { justify-self: start; }
.materials-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; font-size: 0.95rem; font-weight: 600; }
.form-status.is-ok { color: var(--moss); }
.form-status.is-error { color: var(--ember); }

/* ---- CTA band ----------------------------------------------------------- */
.cta-band { text-align: center; }
.cta-band .lead { margin-inline: auto; }
.cta-band .hero-cta { justify-content: center; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { background: var(--pine-900); color: #c8d6cb; padding-block: 2.6rem; font-size: 0.94rem; }
.site-footer a { color: #ffe7b3; }
.footer-grid { display: grid; gap: 1.6rem; grid-template-columns: 1fr; }
.site-footer h3 { color: var(--white); font-size: 1rem; margin-bottom: 0.5rem; }
.site-footer .brand { color: var(--white); }
.site-footer .brand small { color: #9fbfa9; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.footer-fine { margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.84rem; color: #93a89a; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0.15rem;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 0.6rem clamp(1.1rem, 4vw, 2.2rem) 1rem; box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 0.8em 0.7em; }
  .nav-links .btn { margin-top: 0.4rem; }
}

@media (min-width: 761px) {
  .nav-toggle { display: none; }
}

@media (min-width: 480px) and (max-width: 719px) {
  .gallery--four { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 720px) {
  .glance { grid-template-columns: repeat(4, 1fr); }
  .features { grid-template-columns: 1fr 1fr; gap: 1.6rem 2.2rem; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery--four { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; }
  .split { grid-template-columns: 1fr 1fr; }
  .split.split--media-first > :first-child { order: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
