/* ============================================================
   Marble Creek Monarchs — stylesheet
   Tokens grounded in the preserve's own photography + mark
   ============================================================ */

:root {
  /* color */
  --bone:        #E7E4D2;
  --bone-deep:   #DCD8C2;
  --ink:         #22261C;
  --ink-soft:    #3B4030;
  --paper:       #F6F4EA;
  --rust:        #BD5B24;
  --rust-deep:   #9C4A1C;
  --liatris:     #6E5C82;
  --gold:        #B68A24;
  --line:        rgba(34, 38, 28, 0.14);

  /* Fixed accent-panel colors: the hero (over the dark photo) and the
     gift band are designed as a permanently dark panel with light
     text, regardless of the visitor's light/dark site theme below —
     so they read from their own tokens, never from --ink/--paper. */
  --overlay-ink:   #16180F;
  --overlay-paper: #F6F4EA;

  /* type */
  --serif: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --sans: "Work Sans", "Helvetica Neue", Arial, sans-serif;

  /* layout */
  --max: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bone: #1C1E16;
    --bone-deep: #16180F;
    --paper: #22261C;
    --ink: #EDE9D8;
    --ink-soft: #C9C4AE;
    --line: rgba(237, 233, 216, 0.14);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 560;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; max-width: 62ch; }

a { color: inherit; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.85em 1.6em;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn-rust {
  background: var(--rust);
  color: var(--paper);
}
.btn-rust:hover { background: var(--rust-deep); }

.btn-ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }

.btn-ghost-dark {
  background: transparent;
  border-color: rgba(34,38,28,0.35);
  color: var(--ink);
}
.btn-ghost-dark:hover { background: rgba(34,38,28,0.06); }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  padding: 1.1rem 0;
  transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header.is-scrolled {
  background: var(--paper);
  box-shadow: 0 1px 0 var(--line);
  padding: 0.7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--overlay-paper);
}
.site-header.is-scrolled .brand { color: var(--ink); }

.brand-mark {
  height: 34px;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
  transition: filter 0.3s ease;
}
.site-header.is-scrolled .brand-mark { filter: none; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 560;
  letter-spacing: -0.005em;
}
.brand-name .llc { font-family: var(--sans); font-weight: 400; font-size: 0.72em; opacity: 0.75; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.main-nav a {
  color: var(--overlay-paper);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.site-header.is-scrolled .main-nav a { color: var(--ink-soft); }
.main-nav a:hover { border-color: currentColor; }
.nav-links { display: flex; gap: 1.75rem; }

@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: var(--overlay-paper);
  overflow: hidden;
}
.hero picture,
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(18,20,12,0.82) 0%, rgba(18,20,12,0.32) 46%, rgba(18,20,12,0.08) 68%, rgba(18,20,12,0.18) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 8rem;
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
  width: 100%;
}
.hero-eyebrow-line {
  width: 46px;
  height: 2px;
  background: var(--rust);
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.1rem);
  max-width: 14ch;
}
.hero .lede {
  font-family: var(--sans);
  font-size: clamp(1.02rem, 2vw, 1.2rem);
  color: rgba(246, 244, 234, 0.88);
  max-width: 46ch;
  margin-top: 1.1rem;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-top: 1.9rem;
  flex-wrap: wrap;
}
.hero-actions .btn-ghost { color: var(--overlay-paper); }
.scroll-cue {
  font-size: 0.82rem;
  color: rgba(246,244,234,0.7);
  text-decoration: none;
}

.hero.reveal h1,
.hero.reveal .lede,
.hero.reveal .hero-actions,
.hero.reveal .hero-eyebrow-line {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero.reveal .hero-eyebrow-line { animation-delay: 0.05s; }
.hero.reveal h1 { animation-delay: 0.15s; }
.hero.reveal .lede { animation-delay: 0.32s; }
.hero.reveal .hero-actions { animation-delay: 0.48s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero.reveal h1, .hero.reveal .lede, .hero.reveal .hero-actions, .hero.reveal .hero-eyebrow-line {
    animation: none; opacity: 1; transform: none;
  }
  html { scroll-behavior: auto; }
}

/* ---------- creek divider motif ---------- */
.creek-divider {
  display: block;
  width: 100%;
  height: 28px;
}
.creek-divider path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.4;
}

/* ---------- section scaffolding ---------- */
section { position: relative; }
.section-pad { padding: clamp(4rem, 9vw, 7rem) 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rust-deep);
  margin-bottom: 0.9rem;
}

/* ---------- about ---------- */
.about {
  background: var(--paper);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  max-width: 12ch;
  margin-bottom: 1.3rem;
}
.about p { font-size: 1.05rem; color: var(--ink-soft); }

.about-figure {
  border-left: 1px solid var(--line);
  padding-left: clamp(1.5rem, 3vw, 2.5rem);
}
.about-figure .stat {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  color: var(--rust);
  line-height: 1;
}
.about-figure .stat-label {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  max-width: 26ch;
}
.about-figure + .about-figure { margin-top: 2.4rem; }

@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-figure { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 1.5rem; }
}

/* ---------- gallery ---------- */
.gallery { background: var(--bone); }
.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.gallery-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); max-width: 16ch; }
.gallery-head p { color: var(--ink-soft); max-width: 34ch; margin: 0; font-size: 0.98rem; }

/* A flexible mosaic rather than a fixed 6-tile layout, so photos can be
   added or removed over time without hand-tuning grid areas. The first
   (featured) photo spans a 2x2 block; everything else auto-flows into
   uniform cells at a fixed row height, dense-packed to avoid gaps. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: 130px;
  grid-auto-flow: dense;
  gap: 0.6rem;
}
.gallery-grid figure {
  margin: 0;
  overflow: hidden;
  position: relative;
  background: var(--bone-deep);
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.035); }

.g-big {
  grid-column: span 2;
  grid-row: span 2;
}
@media (min-width: 640px) {
  .gallery-grid { grid-auto-rows: 170px; }
}

figure.gallery-item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  color: rgba(246,244,234,0.92);
  background: linear-gradient(to top, rgba(18,20,12,0.72), rgba(18,20,12,0));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gallery-item:hover figcaption,
.gallery-item:focus-within figcaption { opacity: 1; }

.gallery-video {
  margin-top: 2.6rem;
}
.gallery-video-head h3 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  margin: 0 0 0.5rem;
}
.gallery-video-head p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 58ch;
  margin: 0 0 1.2rem;
}
.gallery-video-player {
  display: block;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background: #10120b;
}

@media (max-width: 760px) {
  .gallery-head { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  figure.gallery-item figcaption { opacity: 1; }
}

/* ---------- gift ---------- */
.gift {
  background: var(--overlay-ink);
  color: var(--overlay-paper);
}
.gift .wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.gift .eyebrow { color: var(--gold); }
.gift h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  max-width: 13ch;
}
.gift p {
  color: rgba(246,244,234,0.8);
  font-size: 1.03rem;
}
.gift-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}
.gift-actions .btn { width: max-content; }
.gift-note {
  font-size: 0.85rem;
  color: rgba(246,244,234,0.55);
  margin-top: 0.4rem;
}
@media (max-width: 800px) {
  .gift .wrap { grid-template-columns: 1fr; }
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--bone-deep);
  padding: 2.4rem 0;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-mark-footer { height: 24px; width: auto; color: var(--ink); opacity: 0.85; }
.footer-brand span { font-family: var(--serif); font-size: 0.95rem; }
.footer-meta { font-size: 0.82rem; color: var(--ink-soft); }
.footer-meta a { text-decoration: underline; text-underline-offset: 2px; }
