/* Emerald Heights Trail Cam: palette & type follow emeraldheights.com */
:root {
  --navy: #233f59;
  --navy-deep: #112337;
  --navy-mid: #1a273e;
  --slate: #43698d;
  --pale-blue: #becfdd;
  --copper: #c67d24;
  --copper-hover: #dc9642;
  --green: #5c7949;
  --leaf: #98c358;
  --text: #4d4c4e;
  --ink: #2c2c2c;
  --cream: #f4f0e7;
  --grey: #f2f3f5;
  --white: #fff;
  --radius: 20px;
  --shadow: 0 10px 30px -12px rgba(17, 35, 55, .28);
  --wrap: 1200px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}
img, video { max-width: 100%; display: block; }
a { color: var(--slate); }
h1, h2, h3 { color: var(--navy); font-weight: 500; line-height: 1.15; margin: 0; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: #fff; padding: 8px 12px; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* pills */
.pill {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .55em 1.3em; border-radius: 100px;
  font-weight: 500; font-size: .95rem; letter-spacing: .02em;
  text-decoration: none; border: 0; cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  font-family: inherit;
}
.pill:hover { transform: translateY(-1px); }
.pill:focus-visible, button:focus-visible, a:focus-visible, .card:focus-visible {
  outline: 3px solid var(--copper-hover); outline-offset: 3px;
}
.pill-copper { background: var(--copper); color: #fff; }
.pill-copper:hover { background: var(--copper-hover); }
.pill-navy { background: var(--navy); color: #fff; }
.pill-navy:hover { background: var(--slate); }
.pill-ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--pale-blue); }
.pill-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.pill.big { font-size: 1.1rem; padding: .85em 1.8em; }

/* top bar + header */
.topbar { background: var(--navy-deep); color: #dfe7ee; font-size: .9rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; }
.topbar .pill { padding: .45em 1.1em; font-size: .9rem; }
.site-header { background: #fff; border-bottom: 1px solid #e7e9ec; position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 12px; }
.brand img { height: 72px; width: auto; }
.header-nav { display: flex; align-items: center; gap: 28px; }
.header-nav a:not(.pill) { color: var(--navy); text-decoration: none; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; }
.header-nav a:not(.pill):hover { color: var(--copper); }

/* hero */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(152, 195, 88, .18), transparent 60%),
    linear-gradient(180deg, var(--cream), #faf7f1);
  padding: 64px 0 56px;
}
.hero-inner { text-align: center; max-width: 820px; }
.script, .script-sm { font-family: "Kristi", cursive; color: var(--copper); font-weight: 400; line-height: 1; }
.script { font-size: 3.4rem; margin: 0 0 4px; }
.script-sm { display: block; font-size: 2.2rem; margin-bottom: 2px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
.lede { font-size: 1.15rem; max-width: 620px; margin: 16px auto 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 36px auto 0; max-width: 720px; }
.stats div { background: #fff; border-radius: var(--radius); padding: 18px 12px; box-shadow: var(--shadow); }
.stats dt { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); }
.stats dd { margin: 4px 0 0; font-size: 1.5rem; color: var(--navy); font-weight: 500; }

/* sections */
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.latest { padding: 64px 0 24px; }
.latest .section-title { margin-bottom: 24px; }

/* featured card */
.feature {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 0;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  background: var(--navy-deep); color: #e8eef3;
}
.feature-media { position: relative; cursor: pointer; background: #000; aspect-ratio: 16 / 9; }
.feature-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.feature-media:hover img { transform: scale(1.02); }
.feature-body { padding: 32px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.feature-body h3 { color: #fff; font-size: 2rem; }
.feature-body .sci { font-style: italic; color: var(--pale-blue); margin: -8px 0 0; }
.feature-body p { margin: 0; }
.feature-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 100px; font-size: .85rem;
  background: rgba(255, 255, 255, .1); color: #e8eef3;
}
.tag svg { font-size: 1rem; }

/* play badge */
.play {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%;
  background: rgba(17, 35, 55, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; color: #fff; border: 2px solid rgba(255, 255, 255, .85);
  transition: transform .2s, background .2s; pointer-events: none;
}
.play svg { font-size: 30px; fill: currentColor; stroke: none; margin-left: 4px; }
.feature-media:hover .play { transform: scale(1.08); background: var(--copper); }

/* gallery */
.gallery-section { padding: 48px 0 80px; }
.gallery-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .9rem; padding: .4em 1em; border-radius: 100px; cursor: pointer;
  background: var(--grey); color: var(--navy); border: 1.5px solid transparent;
}
.chip:hover { border-color: var(--pale-blue); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; }
.chip .n { opacity: .65; margin-left: 4px; }
.day { margin-top: 36px; }
.day h3 {
  font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--slate);
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
.day h3::after { content: ""; flex: 1; height: 1px; background: #e3e6ea; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.card {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  cursor: pointer; text-align: left; padding: 0; border: 0; font: inherit; color: inherit;
  transition: transform .25s, box-shadow .25s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -16px rgba(17, 35, 55, .4); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--grey); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .badge {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(17, 35, 55, .78); color: #fff; font-size: .78rem; padding: 3px 10px 3px 8px; border-radius: 100px;
}
.thumb .badge svg { fill: currentColor; stroke: none; }
.thumb .badge.wait { background: rgba(198, 125, 36, .9); }
.card-body { padding: 14px 18px 18px; }
.card-body h4 { margin: 0; color: var(--navy); font-weight: 500; font-size: 1.15rem; line-height: 1.25; }
.card-body p { margin: 4px 0 0; font-size: .9rem; color: var(--text); }
.gallery-note { margin: 8px 0 0; font-size: .95rem; color: var(--slate); }
.gallery-note a { color: var(--copper); font-weight: 500; }
.more { margin-top: 26px; }
.more-title {
  margin: 0 0 10px; font-size: 1rem; font-weight: 500; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
.more-title .n {
  font-size: .78rem; background: var(--grey); color: var(--slate); border-radius: 100px; padding: 1px 9px;
}
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.card.mini {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; box-shadow: none;
  background: var(--grey); overflow: hidden; display: block;
}
.card.mini:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgba(17, 35, 55, .45); }
.card.mini img { width: 100%; height: 100%; object-fit: cover; }
.mini-time {
  position: absolute; left: 6px; bottom: 6px; font-size: .72rem; color: #fff;
  background: rgba(17, 35, 55, .72); padding: 1px 7px; border-radius: 100px;
}
.mini-badge {
  position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(17, 35, 55, .72); color: #fff; font-size: 11px;
}
.mini-badge svg { fill: currentColor; stroke: none; }
.mini-badge.wait { background: rgba(198, 125, 36, .92); }
.mini-badge.wait svg { fill: none; stroke: currentColor; }
.rules { margin-top: 28px; background: #fff; border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow); }
.rules h3 { font-size: 1.3rem; margin-bottom: 8px; }
.rules p, .rules li { font-size: 1rem; }
.rules ul { padding-left: 1.2em; margin: 8px 0; }
.empty { text-align: center; padding: 48px 0; font-size: 1.1rem; }

/* about */
.about { background: var(--cream); padding: 64px 0; }
.about-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.about h2 { font-size: 2rem; margin-bottom: 12px; }
.about .fine { font-size: .9rem; color: var(--slate); }
.about-inner > .pill { justify-self: center; }

/* footer */
.site-footer { background: var(--navy-deep); color: #c9d4de; padding: 48px 0 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.site-footer img { width: 200px; height: auto; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: #fff; text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--copper-hover); }
.footer-note { flex-basis: 100%; font-size: .85rem; margin: 8px 0 0; color: #8fa3b6; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: #08101a;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .2s ease;
}
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lb-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; width: min(1400px, 100%); max-height: 100%; align-items: center; }
.lb-media { position: relative; display: flex; justify-content: center; align-items: center; min-height: 0; }
.lb-media img, .lb-media video { max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); width: auto; max-width: 100%; border-radius: 12px; background: #000; }
.lb-media video { width: 100%; }
.lb-info { color: #d6dfe7; overflow-y: auto; max-height: calc(100vh - 64px); }
.lb-kicker { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; color: var(--copper-hover); margin: 0 0 6px; }
.lb-info h2 { color: #fff; font-size: 2rem; }
.lb-sci { font-style: italic; color: var(--pale-blue); margin: 2px 0 0; min-height: 0; }
.lb-sci:empty { display: none; }
.lb-desc { margin: 14px 0 0; }
.lb-desc:empty { display: none; }
.lb-stage { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; justify-content: center; }
.lb-actions .note { display: inline-flex; align-items: center; gap: 10px; text-align: left; }
.lb-actions .note.warn { color: #f3c58a; }
.spinner {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25); border-top-color: var(--copper-hover);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.lb-actions .pill-ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35); }
.lb-actions .pill-ghost:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.lb-actions .note { font-size: .9rem; color: var(--pale-blue); align-self: center; }
.meta { display: grid; gap: 14px; margin: 0; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 18px; }
.meta div { display: grid; grid-template-columns: 28px 1fr; align-items: start; column-gap: 10px; }
.meta svg { font-size: 22px; color: var(--pale-blue); grid-row: span 2; margin-top: 2px; }
.meta dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: #8fa3b6; }
.meta dd { margin: 0; color: #fff; font-size: 1.05rem; }
.lb-count { font-size: .85rem; color: #8fa3b6; margin-top: 18px; }
.lb-close, .lb-nav {
  position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; font-size: 22px;
}
.lb-close:hover, .lb-nav:hover { background: var(--copper); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 372px; top: 50%; transform: translateY(-50%); }
.lb-nav:disabled { opacity: .25; cursor: default; background: rgba(255, 255, 255, .1); }
.lb-mbar { display: none; }
.lb-playover {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; cursor: pointer;
  background: rgba(17, 35, 55, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, .9); color: #fff; display: grid; place-items: center;
  transition: transform .2s, background .2s;
}
.lb-playover svg { font-size: 34px; fill: currentColor; stroke: none; margin-left: 5px; }
.lb-playover:hover { background: var(--copper); transform: scale(1.06); }

@media (max-width: 960px) {
  .feature { grid-template-columns: 1fr; }
  /* phone/tablet viewer: the overlay scrolls; controls stay pinned */
  .lightbox {
    display: block; padding: 0; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .lb-body {
    grid-template-columns: 1fr; gap: 16px; max-height: none;
    padding: calc(68px + env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));
  }
  .lb-media img, .lb-media video { max-height: 62vh; max-height: 62dvh; border-radius: 10px; }
  .lb-info { max-height: none; overflow: visible; }
  .lb-count { display: none; }
  .lb-nav { display: none; }
  .lb-close {
    position: fixed; z-index: 5; width: 44px; height: 44px;
    top: calc(12px + env(safe-area-inset-top)); right: 12px;
    background: rgba(255, 255, 255, .16);
  }
  .lightbox::before {
    content: ""; position: fixed; z-index: 4; left: 0; right: 0; top: 0;
    height: calc(68px + env(safe-area-inset-top));
    background: linear-gradient(#08101a 70%, rgba(8, 16, 26, 0));
    pointer-events: none;
  }
  .lb-mbar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(8, 16, 26, .96); border-top: 1px solid rgba(255, 255, 255, .1);
    color: #8fa3b6; font-size: .9rem;
  }
  .lb-mbtn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px;
    border: 0; border-radius: 100px; background: rgba(255, 255, 255, .12); color: #fff;
    font: inherit; font-size: 1rem; cursor: pointer;
  }
  .lb-mbtn:disabled { opacity: .3; }
  .about-inner { grid-template-columns: 1fr; }
  .about-inner > .pill { justify-self: start; }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .header-nav a:not(.pill) { display: none; }
  .brand img { height: 54px; }
  .topbar-note { display: none; }
  .topbar-inner { justify-content: center; }
  .topbar .pill { width: 100%; justify-content: center; }
  .hero { padding: 40px 0; }
  .script { font-size: 2.8rem; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stats div { padding: 12px 6px; }
  .stats dt { font-size: .65rem; }
  .stats dd { font-size: 1.15rem; }
  .feature-body { padding: 22px; }
  .feature-body h3 { font-size: 1.6rem; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { border-radius: 14px; }
  .card-body { padding: 10px 12px 12px; }
  .card-body h4 { font-size: 1rem; }
  .card-body p { font-size: .8rem; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- elements that only appear on larger screens ---------- */
.gallery-aside, .card-desc, .lb-keys { display: none; }
.feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.feature-more {
  font: inherit; font-size: .95rem; color: var(--pale-blue); background: none; border: 0;
  padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.feature-more:hover { color: #fff; }
.feature-media video { width: 100%; height: 100%; object-fit: contain; background: #000; }
kbd {
  font-family: inherit; font-size: .8em; padding: 1px 6px; border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06);
}

/* ---------- desktop / laptop: use the extra room ---------- */
@media (min-width: 961px) {
  .lb-keys { display: block; font-size: .82rem; color: #8fa3b6; margin-top: 6px; }
  .lightbox { padding: 24px 76px; }
  .lb-body { grid-template-columns: minmax(0, 1fr) clamp(270px, 27vw, 380px); gap: clamp(20px, 2.5vw, 36px); }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
  .lb-info h2 { font-size: 2.3rem; }
  .lb-desc { font-size: 1.1rem; }
}

@media (min-width: 1100px) {
  :root { --wrap: 1440px; }
  body { font-size: 19px; }
  .wrap { width: min(var(--wrap), 100% - 80px); }

  /* compact two-column hero so the latest video is visible without scrolling */
  .hero { padding: 44px 0 40px; }
  .hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; text-align: left; max-width: none; }
  .hero .lede { margin-left: 0; }
  .hero .stats { margin: 0; max-width: none; }
  .stats dd { font-size: 1.8rem; }

  .latest { padding-top: 44px; }
  .feature { grid-template-columns: 2fr 1fr; }
  .feature-body { padding: 40px; }
  .feature-body h3 { font-size: 2.3rem; }
  .feature-body p { font-size: 1.1rem; }

  /* gallery + sticky guide */
  .gallery-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; }
  .chips { display: none; }
  .gallery-aside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 120px; margin-top: 36px; }
  .aside-card { background: var(--cream); border-radius: var(--radius); padding: 22px 24px; }
  .aside-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
  .visitor-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
  .visitor {
    width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
    font: inherit; font-size: 1rem; color: var(--navy); background: transparent; border: 0;
    border-radius: 10px; padding: 8px 12px; cursor: pointer; text-align: left;
  }
  .visitor:hover { background: rgba(255, 255, 255, .7); }
  .visitor[aria-pressed="true"] { background: var(--navy); color: #fff; }
  .visitor .n { font-size: .85rem; opacity: .7; }
  .aside-rules { margin: 0; padding-left: 1.1em; font-size: .95rem; display: grid; gap: 6px; }
  .aside-link { display: inline-block; margin-top: 10px; color: var(--copper); font-weight: 500; font-size: .95rem; }
  .aside-portal { justify-content: center; font-size: 1.05rem; padding: .85em 1.4em; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 26px; }
  .card-body { padding: 16px 20px 20px; }
  .card-body h4 { font-size: 1.25rem; }
  .card-desc {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 8px !important; color: var(--text);
  }
  .mini-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
  .more-title { font-size: 1.1rem; }
}

/* photo and video share one box sized from the photo's real proportions,
   so nothing squashes or jumps when the clip starts */
.lb-media img, .lb-media video {
  --ar: 1.7778;
  aspect-ratio: var(--ar);
  width: min(100%, calc((100vh - 140px) * var(--ar)));
  width: min(100%, calc((100dvh - 140px) * var(--ar)));
  height: auto; max-height: none; object-fit: contain;
}
@media (max-width: 960px) {
  .lb-media img, .lb-media video {
    width: min(100%, calc(62vh * var(--ar)));
    width: min(100%, calc(62dvh * var(--ar)));
  }
}
