/* ===================================================================
   Troop 936 — troop936.org
   Palette drawn from the hero image: sunset gold, forest green,
   night navy, warm paper.
   =================================================================== */

:root {
  --ink: #16222e;          /* night navy */
  --ink-soft: #2b3a49;
  --pine: #24503a;         /* forest green */
  --pine-deep: #16301f;
  --gold: #eda32f;         /* sunset gold */
  --gold-deep: #c97e15;
  --paper: #faf7f0;        /* warm paper */
  --paper-dim: #f1ebdf;
  --white: #ffffff;
  --text: #2b3440;
  --text-soft: #55636f;
  --line: rgba(22, 34, 46, 0.12);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --header-h: 4.5rem;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(22, 34, 46, 0.10);
  --shadow-lift: 0 16px 40px rgba(22, 34, 46, 0.16);
}

/* ---------- Reset & base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
}

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

a:hover {
  color: var(--pine-deep);
}

/* Dark ring on light surfaces, gold ring on dark surfaces — one color
   cannot clear 3:1 (WCAG 1.4.11) on both. */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

.site-header :focus-visible,
.site-footer :focus-visible,
.hero :focus-visible,
.mission :focus-visible,
.ethos :focus-visible,
.skip-link:focus-visible {
  outline-color: var(--gold);
}

/* <main tabindex="-1"> is a skip-link landing target, not an interactive
   element — don't draw a page-sized ring around it. */
main:focus-visible {
  outline: none;
}

.wrap {
  width: min(72rem, 100% - 3rem);
  margin-inline: auto;
}

.wrap.narrow {
  width: min(46rem, 100% - 3rem);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -3.5rem;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--white);
  border-radius: 0 0 8px 8px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  color: var(--white);
}

/* ---------- Eyebrows, buttons ---------- */

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  /* Darker bronze than --gold-deep: clears 4.5:1 AA on --paper and --paper-dim */
  color: #955a0a;
  margin: 0 0 0.9rem;
}

.eyebrow.light {
  color: var(--gold);
}

.button {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
              background-color 0.15s ease, color 0.15s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(237, 163, 47, 0.35);
}

.button.primary:hover {
  background: #f5b246;
  border-color: #f5b246;
  color: var(--ink);
}

.button.ghost {
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.button.outline {
  border-color: var(--pine);
  color: var(--pine);
}

.button.outline:hover {
  background: var(--pine);
  color: var(--white);
}

/* ---------- Header & navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 34, 46, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(22, 34, 46, 0.96);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.header-inner {
  width: min(72rem, 100% - 2rem);
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  padding: 0.5rem 0;
}

.brand-logo {
  width: 2.75rem;
  height: auto;
  background: var(--white);
  border-radius: 50%;
  padding: 0.3rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--white);
}

.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.97rem;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.nav-cta {
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  margin-left: 0.35rem;
  padding-inline: 1.1rem;
  border-radius: 999px;
}

.nav-cta:hover {
  background: #f5b246;
  color: var(--ink);
}

.chevron {
  transition: transform 0.2s ease;
}

.has-dropdown.is-open .chevron {
  transform: rotate(180deg);
}

.dropdown {
  list-style: none;
  margin: 0;
  padding: 0.45rem;
  min-width: 12.5rem;
}

.dropdown a {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Desktop dropdown = floating panel */
@media (min-width: 861px) {
  .dropdown {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lift);
    border: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  }

  .has-dropdown.is-open .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .dropdown a {
    color: var(--ink-soft);
  }

  .dropdown a:hover {
    background: var(--paper-dim);
    color: var(--ink);
  }

  /* The dropdown panel is white even though it sits in the dark header */
  .site-header .dropdown :focus-visible {
    outline-color: var(--ink);
  }

  /* Without JS, hover/keyboard focus still opens the menu */
  html:not(.js) .has-dropdown:hover .dropdown,
  html:not(.js) .has-dropdown:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* ---------- Mobile navigation ---------- */

.menu-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.menu-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-button[aria-expanded="true"] .menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-button[aria-expanded="true"] .menu-bar:nth-child(2) {
  opacity: 0;
}

.menu-button[aria-expanded="true"] .menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 860.98px (not 860px) so no fractional-width gap opens up against the
   desktop block's min-width: 861px (e.g. at 125% browser zoom). */
@media (max-width: 860.98px) {
  html.js .menu-button {
    display: flex;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  /* Without JS the nav renders expanded, in normal flow, below the brand. */
  .site-nav {
    width: 100%;
    padding: 0.25rem 0 0.9rem;
  }

  /* With JS it becomes the hamburger-toggled overlay panel. */
  html.js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    background: rgba(22, 34, 46, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.35);
    display: none;
    padding: 0.75rem 1rem 1.25rem;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  html.js .site-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 0.8rem 0.9rem;
    font-size: 1.05rem;
  }

  .nav-cta {
    margin: 0.5rem 0 0;
    justify-content: center;
    text-align: center;
  }

  /* Mobile dropdown = accordion (left expanded when JS is unavailable) */
  .dropdown {
    padding: 0.15rem 0 0.35rem 0.9rem;
  }

  html.js .dropdown {
    display: none;
  }

  html.js .has-dropdown.is-open .dropdown {
    display: block;
  }

  .dropdown a {
    color: rgba(255, 255, 255, 0.85);
  }

  .dropdown a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
  }
}

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

.hero {
  position: relative;
  min-height: clamp(34rem, 92vh, 56rem);
  min-height: clamp(34rem, 92svh, 56rem);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  /* Pull the hero up behind the translucent sticky header */
  margin-top: calc(var(--header-h) * -1);
  padding-top: var(--header-h);
}

.hero-media,
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(22, 34, 46, 0.35) 0%,
      rgba(22, 34, 46, 0.05) 30%,
      rgba(22, 34, 46, 0.25) 62%,
      rgba(22, 34, 46, 0.88) 100%);
}

.hero-content {
  position: relative;
  padding: 6rem 0 4.5rem;
  color: var(--white);
  max-width: 46rem;
}

.hero .eyebrow {
  color: var(--gold);
}

.hero h1 {
  color: var(--white);
  font-size: clamp(3rem, 9vw, 5.5rem);
  margin-bottom: 0.15em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.hero-pillars {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

.hero-pillars span {
  margin-inline: 0.35rem;
  color: rgba(255, 255, 255, 0.75);
}

.hero-lede {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

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

.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  scroll-margin-top: var(--header-h);
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section h2 {
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
}

.section-lede {
  font-size: 1.15rem;
  color: var(--text-soft);
}

/* Hello */

.hello {
  background: var(--paper);
}

.meeting-callout {
  margin-top: 1.75rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.4rem;
}

.meeting-callout p {
  margin: 0;
}

.meeting-callout .meeting-label {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.meeting-callout .meeting-details {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--pine-deep);
}

.meeting-callout .meeting-address {
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

/* Mission */

.mission {
  background: var(--pine-deep);
  background-image: linear-gradient(160deg, var(--pine-deep), var(--pine));
}

.mission .eyebrow {
  color: var(--gold);
}

.mission-statement {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  line-height: 1.4;
  color: var(--white);
  margin: 0;
}

/* Values */

.values {
  background: var(--paper);
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.value-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.value-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.value-icon {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(237, 163, 47, 0.16);
  color: var(--gold-deep);
  margin-bottom: 1.1rem;
}

.value-icon svg {
  width: 2rem;
  height: 2rem;
}

.value-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.4em;
}

.value-card p {
  color: var(--text-soft);
  margin: 0;
}

/* Trail ethos */

.ethos {
  position: relative;
  background-image: url("assets/hero-1600.webp");
  background-size: cover;
  background-position: center 30%;
  color: var(--white);
}

.ethos-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 20, 0.78);
}

.ethos .wrap {
  position: relative;
  text-align: center;
}

.ethos blockquote {
  margin: 0;
}

.ethos blockquote p {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 3.2vw, 1.85rem);
  line-height: 1.45;
  margin: 0;
}

/* Practice */

.practice {
  background: var(--paper-dim);
}

.practice-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.5rem;
}

.practice-item {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem 1.1rem 3.1rem;
  box-shadow: var(--shadow);
}

.practice-item::before {
  content: "";
  position: absolute;
  left: 1.1rem;
  top: 1.3rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background:
    var(--pine)
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="m4 8.4 2.7 2.7L12 5.6" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>')
    center / 0.75rem no-repeat;
}

/* Connect / direction */

.connect {
  background: var(--paper);
  text-align: center;
}

.connect .wrap {
  margin-inline: auto;
}

.connect p {
  color: var(--text-soft);
}

.connect .hero-actions {
  justify-content: center;
  margin: 1.6rem 0 1.4rem;
}

.connect-note {
  font-size: 0.98rem;
}

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

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.85);
  padding: 2.75rem 0 2.25rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.footer-brand img {
  background: var(--white);
  border-radius: 50%;
  padding: 0.28rem;
  width: 2.5rem;
  height: auto;
}

.footer-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  margin: 0;
}

.footer-sub {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-fine {
  width: 100%;
  margin: 0.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Scroll-reveal ----------
   Hidden state only applies once JS adds the `js` class, so content
   stays visible when JavaScript is unavailable. */

html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .button,
  .value-card,
  .chevron,
  .menu-bar {
    transition: none;
  }
}

/* ---------- Responsive grids ---------- */

@media (max-width: 960px) {
  .value-grid {
    grid-template-columns: 1fr;
    max-width: 33rem;
    margin-inline: auto;
  }
}

@media (max-width: 700px) {
  .practice-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding-bottom: 3.5rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
