/* ==========================================================================
   Two Bears Farms — site styles
   Colors and fonts live in the :root block right below, so they're easy to change.
   ========================================================================== */

@font-face {
  font-family: "Ogg";
  src: url("../fonts/ogg-bold.woff2") format("woff2"), url("../fonts/ogg-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #231F20;       /* logo black: main text */
  --quiet: #5F5A52;     /* softer body text */
  --warm: #F7F4EE;      /* warm white page background */
  --forest: #2C372A;    /* dark green: buttons, footer, Life on the Farm */
  --leaf: #465643;      /* links */
  --pale: #CFE5B8;      /* pistachio light green sections */
  --bark: #6B4A2F;      /* brown "Meet everyone" button */
  --line: #D8D4CB;
  --field-border: #8A857C;
  --serif: "Ogg", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1200px;
  --gutter: 32px;
  --section: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--warm);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--leaf); }
a:hover { color: var(--forest); }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; }
.bg-forest :focus-visible, .hero :focus-visible, .site-footer :focus-visible { outline-color: #FFFFFF; }

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.h2 { font-size: clamp(32px, 4vw, 48px); line-height: 1.1; }
.lead { margin: 0; font-size: 19px; line-height: 1.65; color: var(--quiet); text-wrap: pretty; }

.skip-link {
  position: absolute; left: 16px; top: -80px; z-index: 10;
  padding: 12px 18px; background: var(--forest); color: #FFFFFF; font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 16px; color: #FFFFFF; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: var(--wrap); margin: 0 auto; }
.section { padding: var(--section) var(--gutter); }
.bg-pale { background: var(--pale); }
.bg-forest { background: var(--forest); color: #FFFFFF; }
.bg-forest h2 { color: #FFFFFF; }
.bg-white { background: #FFFFFF; }
.center-stack { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 0;
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn svg { flex: none; }
.btn-green { background: var(--forest); color: #FFFFFF; }
.btn-green:hover { background: #1F281E; color: #FFFFFF; }
.btn-white { background: #FFFFFF; color: var(--forest); }
.btn-white:hover { background: var(--warm); color: var(--forest); }
.btn-bark { background: var(--bark); color: #FFFFFF; }
.btn-bark:hover { background: #573C26; color: #FFFFFF; }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  max-width: var(--wrap); margin: 0 auto; padding: 16px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px 40px;
}
.logo { display: block; }
.logo img { height: 56px; width: auto; }
.nav-desktop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 36px; font-size: 16px; }
.nav-desktop > a { color: var(--ink); text-decoration: none; padding: 12px 0; }
.nav-desktop > a:hover { color: var(--leaf); }
.nav-desktop > a[aria-current="page"] { border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.nav-social { display: flex; align-items: center; gap: 4px; padding-left: 20px; border-left: 1px solid var(--line); }
.icon-link { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--ink); }
.icon-link:hover { color: var(--leaf); }
.menu-toggle {
  display: none; width: 48px; height: 48px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 0; background: #FFFFFF; color: var(--ink); cursor: pointer;
}
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.mobile-menu { background: #FFFFFF; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mobile-menu[hidden] { display: none; }
.mobile-menu .menu-link {
  display: flex; align-items: center; min-height: 52px; padding: 0 20px;
  border-bottom: 1px solid var(--line); color: var(--ink); font-size: 17px; text-decoration: none;
}
.menu-social { display: flex; gap: 8px; padding: 12px 14px; }

/* ---------- Hero (first photo) ---------- */
.hero { padding: 0 var(--gutter); }
.hero-box {
  position: relative; max-width: var(--wrap); margin: 0 auto; overflow: hidden; display: flex;
  height: clamp(320px, calc(100vh - 210px), 440px);
  height: clamp(320px, calc(100svh - 210px), 440px);
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 17%; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 26, 18, 0.62) 0%, rgba(20, 26, 18, 0.28) 32%, rgba(20, 26, 18, 0) 55%);
}
.hero-content {
  position: relative; width: 100%; padding: 40px 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.hero h1 { max-width: 980px; color: #FFFFFF; font-size: clamp(34px, 4.2vw, 54px); line-height: 1.12; text-wrap: balance; }
.hero .btn { align-self: flex-end; }

/* ---------- Welcome ---------- */
.welcome { padding-top: 28px; overflow-x: clip; }
.welcome-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 48px 72px; }
.welcome-text { flex: 7 1 520px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.welcome-title { width: fit-content; max-width: 100%; }
.welcome-sub { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.welcome-photo { flex: 5 1 360px; min-width: 0; }
.welcome-photo img { width: 100%; height: 560px; object-fit: cover; }

/* Scroll effect: the heading starts centered under the first photo, then moves left and down
   while the text rises in and the photo slides in from the right. Browsers without
   scroll-linked animation (and phones, and "reduce motion") simply show the finished layout. */
@keyframes tbf-slide-in { from { opacity: 0; transform: translateX(45%); } to { opacity: 1; transform: none; } }
@keyframes tbf-drop { from { transform: translateY(0); } to { transform: translateY(110px); } }
@keyframes tbf-center-to-left { from { transform: translateX(calc((min(100vw - 64px, 1200px) - 100%) / 2)); } to { transform: none; } }
@keyframes tbf-fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: scroll()) {
  @media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
    .welcome-photo { animation: tbf-slide-in linear both; animation-timeline: scroll(root block); animation-range: 20px 480px; }
    .welcome-text { animation: tbf-drop linear both; animation-timeline: scroll(root block); animation-range: 0px 480px; }
    .welcome-title { animation: tbf-center-to-left linear both; animation-timeline: scroll(root block); animation-range: 0px 480px; }
    .welcome-sub { animation: tbf-fade-up linear both; animation-timeline: scroll(root block); animation-range: 40px 360px; }
  }
}

/* ---------- Our Animals (home) ---------- */
.animals-preview { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.animals-preview img { width: 100%; height: 380px; object-fit: cover; }

/* ---------- Carousels ---------- */
.carousel { width: 100%; display: flex; flex-direction: column; gap: 20px; }
.carousel-track {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 3); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track li { scroll-snap-align: start; }
.carousel-track img { width: 100%; height: 440px; object-fit: cover; }
.carousel--four .carousel-track { grid-auto-columns: calc((100% - 36px) / 4); gap: 12px; }
.carousel--four .carousel-track img { height: 320px; }
.carousel-controls { display: none; justify-content: center; gap: 20px; }
.js .carousel-controls { display: flex; }
.arrow {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--forest); border-radius: 0; background: transparent; color: var(--forest); cursor: pointer;
}
.arrow:hover { background: rgba(44, 55, 42, 0.08); }
.bg-forest .arrow { border-color: #FFFFFF; color: #FFFFFF; }
.bg-forest .arrow:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- From the Farm (shop) ---------- */
.shop-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 56px; align-items: center; }
.eggs { display: grid; grid-template-columns: 3fr 2fr; grid-template-rows: 256px 256px; gap: 12px; }
.eggs img { width: 100%; height: 100%; object-fit: cover; }
.eggs img:first-child { grid-row: 1 / span 2; }
.shop-text { display: flex; flex-direction: column; gap: 20px; }
.shop-text h2 { color: var(--forest); }
.shop-text p { margin: 0; font-size: 19px; line-height: 1.65; text-wrap: pretty; }
.shop-text p a { font-weight: 500; }
.btn-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 8px; }
.btn-stack .btn { width: 280px; max-width: 100%; }

/* ---------- Get in Touch ---------- */
.contact-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 56px; }
.contact-photo { flex: 1 1 360px; min-height: 420px; position: relative; }
.contact-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.contact-body { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.contact-body .lead a { font-weight: 500; }
.form-box { background: #FFFFFF; padding: 32px; margin-top: 8px; }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 15px; font-weight: 500; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; height: 52px; padding: 0 14px;
  border: 1px solid var(--field-border); border-radius: 0; background: #FFFFFF; color: var(--ink);
  font: inherit; font-size: 16px;
}
.field textarea { height: auto; padding: 14px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--leaf); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin: 0; color: #9A2B1E; font-size: 15px; }
.form-error[hidden] { display: none; }
.form-submit { align-self: flex-start; }
.form-thanks { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 0; text-align: center; }
.form-thanks[hidden] { display: none; }
.form-thanks h3 { font-size: 28px; }
.form-thanks p { margin: 0; font-size: 18px; color: var(--quiet); }
.btn-outline { background: transparent; color: var(--forest); border: 1px solid var(--forest); min-height: 48px; padding: 0 24px; font-size: 15px; }
.btn-outline:hover { background: rgba(44, 55, 42, 0.06); color: var(--forest); }
.follow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; font-size: 16px; }
.follow span { color: var(--quiet); }
.follow a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; font-weight: 500; color: var(--leaf); }

/* ---------- Thank-you band ---------- */
.thanks-title { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.35; max-width: 1200px; text-wrap: balance; }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest); color: var(--warm); }
.footer-in { max-width: var(--wrap); margin: 0 auto; padding: 56px var(--gutter) 32px; display: flex; flex-direction: column; gap: 36px; }
.footer-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 32px 48px; }
.footer-top .footer-logo { height: 60px; width: auto; }
.footer-info { margin: 0; font-size: 15px; line-height: 1.7; color: var(--pale); }
.footer-info a { color: var(--pale); }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; font-size: 15px; }
.footer-nav > a { color: var(--warm); text-decoration: none; padding: 6px 0; }
.footer-nav > a:hover { color: #FFFFFF; text-decoration: underline; }
.footer-social { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.footer-social .icon-link { color: var(--warm); }
.copyright { font-size: 13px; color: var(--pale); border-top: 1px solid rgba(247, 244, 238, 0.2); padding-top: 20px; }

/* ---------- Meet Our Animals page ---------- */
.intro { padding: 40px var(--gutter) 32px; }
.intro-in { max-width: var(--wrap); margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.intro h1 { font-size: clamp(40px, 5.5vw, 68px); line-height: 1.05; }
.intro .lead { max-width: 620px; }
.chips { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; margin-top: 12px; }
.chips a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 8px;
  border: 1px solid var(--line); background: #FFFFFF; color: var(--ink);
  font-size: 14px; line-height: 1.25; text-align: center; text-decoration: none;
}
.chips a:hover { border-color: var(--forest); color: var(--forest); }
.breed { padding: 56px var(--gutter); scroll-margin-top: 8px; }
.breed-in { max-width: var(--wrap); margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.breed-head { display: flex; flex-direction: column; gap: 10px; }
.breed h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; }
.breed-head p { margin: 0; font-size: 18px; line-height: 1.6; color: var(--quiet); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.photo-grid img { width: 100%; height: 400px; object-fit: cover; }
.two-bears { padding-top: 56px; background: var(--pale); }
.two-bears h2 { max-width: 1000px; margin: 0 auto 28px; padding: 0 var(--gutter); text-align: center; }
.bears-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.bears-grid img { width: 100%; height: 640px; object-fit: cover; }

/* ---------- 404 ---------- */
.not-found { padding: 120px var(--gutter); }

/* ==========================================================================
   Phones and small tablets
   ========================================================================== */
@media (max-width: 760px) {
  :root { --gutter: 20px; --section: 48px; }
  .js .nav-desktop { display: none; }
  .js .menu-toggle { display: flex; }
  .site-header { padding: 14px 20px; }
  .logo img { height: 48px; }

  .hero { padding: 0; }
  .hero-box { height: auto; min-height: 500px; }
  .hero-content { min-height: 500px; padding: 28px 20px; }
  .hero h1 { font-size: 30px; }

  .h2 { font-size: 28px; }
  .welcome-title { font-size: 25px; }
  .welcome-photo img { height: 300px; }

  .animals-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .animals-preview img { height: 190px; }

  .carousel-track, .carousel--four .carousel-track { grid-auto-columns: 100%; gap: 12px; }
  .carousel-track img, .carousel--four .carousel-track img { height: 340px; }

  .btn-row, .btn-stack { flex-direction: column; align-items: stretch; width: 100%; }
  .btn-row .btn, .btn-stack .btn { width: 100%; }

  .eggs { grid-template-rows: 170px 170px; gap: 8px; }
  .contact-photo { min-height: 240px; }
  .form-box { padding: 20px; }
  .thanks-title { font-size: 21px; }

  .footer-in { padding: 40px 20px 28px; }

  .intro { padding: 28px 20px 24px; }
  .breed { padding: 48px 20px; }
  .breed h2 { font-size: 28px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .photo-grid img { height: 180px; }
  .photo-grid img:first-child:nth-last-child(odd) { grid-column: 1 / -1; height: 240px; }
  .bears-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bears-grid img { height: 300px; }
}

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