/* Palette themes — swap data-theme on <html> to preview */
:root,
[data-theme="sage_and_honey"] {
  --bg: #F2F5F0;
  --surface: #E4EBDD;
  --card: #FFFFFF;
  --primary: #5F7356;
  --primary-light: #7A8B6F;
  --primary-dark: #3D4A38;
  --accent: #D4A017;
  --accent-deep: #B8890F;
  --text: #2C3328;
  --text-muted: #5F7356;
  --white: #FFFFFF;
  --on-accent: #2C3328;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  --radius: 16px;
  --shadow: 0 8px 32px rgba(61, 74, 56, 0.1);
  --max-width: 1120px;
}

/* Mid — soft dusk sage between mist and night */
[data-theme="sage_and_honey_mid"] {
  --bg: #C5CFBC;
  --surface: #B0BCAA;
  --card: #D8DFD0;
  --primary: #455542;
  --primary-light: #5E6F58;
  --primary-dark: #2E382A;
  --accent: #D4A017;
  --accent-deep: #B8890F;
  --text: #1F2820;
  --text-muted: #455542;
  --white: #FFFFFF;
  --on-accent: #1F2820;
  --shadow: 0 8px 28px rgba(46, 56, 42, 0.18);
}

/* Dark Sage & Honey — deep green night, honey pops */
[data-theme="sage_and_honey_dark"] {
  --bg: #1A2118;
  --surface: #252E22;
  --card: #2F3A2C;
  --primary: #8FA382;
  --primary-light: #A8B89C;
  --primary-dark: #121610;
  --accent: #E8B84A;
  --accent-deep: #F0C86A;
  --text: #E8EDE4;
  --text-muted: #A8B89C;
  --white: #FFFFFF;
  --on-accent: #1A2118;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="terracotta_and_tide"] {
  --bg: #F3EBE3;
  --surface: #E8DDD2;
  --card: #FFFFFF;
  --primary: #B8614A;
  --primary-light: #CF7A62;
  --primary-dark: #7A3F2E;
  --accent: #3D7A8C;
  --accent-deep: #2E5F6E;
  --text: #3A2E28;
  --text-muted: #8B6B5A;
  --white: #FFFFFF;
  --on-accent: #FFFFFF;
  --shadow: 0 8px 32px rgba(122, 63, 46, 0.1);
}

[data-theme="dusk_and_peach"] {
  --bg: #F5F3F0;
  --surface: #EBE7E2;
  --card: #FFFFFF;
  --primary: #6E6478;
  --primary-light: #8B8499;
  --primary-dark: #4A4354;
  --accent: #E0936B;
  --accent-deep: #C97852;
  --text: #2E2A32;
  --text-muted: #6E6478;
  --white: #FFFFFF;
  --on-accent: #2E2A32;
  --shadow: 0 8px 32px rgba(74, 67, 84, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__logo {
  height: 78px;
  width: auto;
  max-width: min(480px, 70vw);
  object-fit: contain;
}

.nav__links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav__links a {
  color: var(--text);
}

.nav__links a:hover {
  color: var(--primary);
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

/* ── Hero ── */
.hero {
  position: relative;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/public/images/hero-wildflowers.jpg");
  background-image: image-set(
    url("/public/images/hero-wildflowers.webp") type("image/webp"),
    url("/public/images/hero-wildflowers.jpg") type("image/jpeg")
  );
  background-size: cover;
  background-position: center bottom;
  opacity: 0.5;
  z-index: -2;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 70%,
    var(--bg) 100%
  );
  z-index: -1;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero__logo {
  width: min(320px, 78vw);
  height: auto;
  margin: 0 auto 1.5rem;
  object-fit: contain;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero__tagline {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--primary-light);
  max-width: 540px;
  margin: 0 auto 2rem;
}

.hero__cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

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

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn--primary:hover {
  background: var(--accent-deep);
  color: var(--on-accent);
}

.btn--secondary {
  background: var(--card);
  color: var(--text);
  border: 2px solid color-mix(in srgb, var(--primary) 25%, transparent);
}

.btn--secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Sections ── */
.section {
  padding: 4.5rem 1.5rem;
}

.section--alt {
  background: var(--surface);
}

.section--dark {
  background: var(--primary-dark);
  color: var(--bg);
}

.section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

.section--dark .section__label {
  color: var(--accent);
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  margin-bottom: 1.25rem;
  line-height: 1.25;
}

.section--dark .section__title {
  color: var(--bg);
}

.section__text {
  max-width: 680px;
  margin-bottom: 1rem;
}

#story .section__text {
  max-width: none;
}

.section--dark .section__text {
  color: color-mix(in srgb, var(--bg) 85%, var(--white));
}

.story-figure {
  float: left;
  margin: 0.1em 1em 0.6em 0;
  shape-outside: margin-box;
}

.story-figure__thumb {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  /* Reserve float box before the image loads (759×1024 source) */
  height: calc(1.05rem * 1.65 * 8);
  aspect-ratio: 759 / 1024;
  width: auto;
  line-height: 0;
}

.story-figure__thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.story-figure__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
}

#story-content::after {
  content: "";
  display: table;
  clear: both;
}

/* ── Brand cards ── */
.brands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.brand-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s;
}

.brand-card:hover {
  transform: translateY(-4px);
}

.brand-card__logo {
  width: min(220px, 70%);
  height: auto;
  max-height: 220px;
  margin: 0 auto 1.25rem;
  object-fit: contain;
}

.brand-card__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.25rem;
}

.brand-card__subtitle {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

.brand-card__desc {
  text-align: center;
  font-size: 0.98rem;
  color: var(--text-muted);
}

/* ── Gallery ── */
.gallery-groups {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2.5rem;
}

.gallery-group__header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gallery-group__title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.gallery-group__subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-light);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.gallery__item {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  position: relative;
  padding: 0;
  border: none;
  cursor: zoom-in;
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery__item:hover,
.gallery__item:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  outline: none;
}

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

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.gallery__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--primary-light);
  font-size: 0.85rem;
  background: linear-gradient(135deg, var(--surface), var(--bg));
}

.gallery__placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.5;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem 2rem;
  background: color-mix(in srgb, var(--primary-dark) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox__img {
  max-width: 100%;
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: calc(var(--radius) - 4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  background: var(--surface);
}

.lightbox__caption {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--white);
  text-align: center;
  opacity: 0.9;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  border: none;
  background: color-mix(in srgb, var(--white) 14%, transparent);
  color: var(--white);
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover,
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  background: color-mix(in srgb, var(--white) 28%, transparent);
  outline: none;
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.75rem;
  line-height: 1;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__nav--prev {
  left: 0.75rem;
}

.lightbox__nav--next {
  right: 0.75rem;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 4rem 0.5rem 1.5rem;
  }

  .lightbox__nav {
    top: auto;
    bottom: 1rem;
    transform: none;
  }

  .lightbox__nav--prev {
    left: calc(50% - 3.5rem);
  }

  .lightbox__nav--next {
    right: calc(50% - 3.5rem);
  }

  .lightbox__img {
    max-height: min(70vh, 700px);
  }
}

/* ── Cams ── */
.cams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.cam-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cam-card__header {
  padding: 1.25rem 1.5rem 0.75rem;
}

.cam-card__logo {
  height: 72px;
  width: auto;
  margin-bottom: 0.75rem;
  object-fit: contain;
  opacity: 0.95;
}

.cam-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--bg);
}

.cam-card__desc {
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--bg) 80%, var(--white));
  opacity: 0.9;
  margin-top: 0.35rem;
}

.cam-card__embed {
  aspect-ratio: 16/9;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-card__embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.cam-card__placeholder {
  text-align: center;
  padding: 2rem;
  color: color-mix(in srgb, var(--bg) 70%, var(--white));
  opacity: 0.7;
  font-size: 0.9rem;
}

/* ── Contact form ── */
.contact-form {
  max-width: 36rem;
  margin-top: 1.5rem;
  position: relative;
}

.contact-form label {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  font: inherit;
  color: var(--text);
  background: #f4f6f1;
  border: 1.5px solid color-mix(in srgb, var(--primary) 28%, transparent);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.contact-form textarea {
  min-height: 7rem;
  resize: vertical;
}

.contact-form .btn {
  margin-top: 0.25rem;
}

.form-status {
  min-height: 1.4em;
  margin: 0.85rem 0 0;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-status.ok {
  color: var(--primary-dark);
}

.form-status.err {
  color: #8b3a2a;
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* ── Footer ── */
.footer {
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--primary-light);
  border-top: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

.footer__logo {
  height: 120px;
  width: auto;
  margin: 0 auto 1rem;
  object-fit: contain;
  opacity: 0.9;
}

.footer a {
  color: var(--primary-light);
}

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

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
    gap: 0.75rem;
  }

  .nav__links.is-open {
    display: flex;
  }

  .nav__toggle {
    display: block;
  }

  .hero {
    padding: 3.5rem 1.25rem 3rem;
  }

  .section {
    padding: 3rem 1.25rem;
  }
}
