/* ==========================================================================
   Lazy K's Ranch — Design System
   Warm Craft / Farmhouse Americana
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=Encode+Sans:wght@400;500;600;700&family=Archivo+Black&display=swap');

:root {
  /* Brand */
  --brand: #2B5217;
  --brand-light: #3D6E20;
  --brand-dark: #1D3910;

  /* Backgrounds — three depth levels */
  --bg-base: #FAF6EC;
  --bg-elevated: #F2EBDA;
  --bg-floating: #FFFFFF;

  /* Text */
  --text-primary: #231F16;
  --text-body: #3A3527;
  --text-muted: #6B6551;
  --text-on-dark: #FAF6EC;

  /* Accent */
  --accent: #5C9A2F;
  --accent-hover: #4A7D25;
  --gold: #E8B923;
  --gold-dark: #C79A15;
  --barn-red: #8C2F1B;

  /* Borders */
  --border: rgba(43, 82, 23, 0.12);
  --border-strong: rgba(43, 82, 23, 0.24);

  /* Shadows — brand-tinted */
  --shadow-sm: 0 2px 8px rgba(43, 82, 23, 0.08);
  --shadow-md: 0 8px 32px rgba(43, 82, 23, 0.14), 0 2px 8px rgba(43, 82, 23, 0.07);
  --shadow-lg: 0 24px 64px rgba(43, 82, 23, 0.18), 0 8px 24px rgba(43, 82, 23, 0.09);

  /* Type */
  --font-display: 'Fjalla One', sans-serif;
  --font-body: 'Encode Sans', sans-serif;
  --font-stat: 'Archivo Black', sans-serif;

  /* Spacing tokens */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 9rem;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --container: 1200px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-body);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Grain texture overlay ---------- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hero-headline {
  font-size: clamp(2.75rem, 7vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
p.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--text-muted); line-height: 1.7; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--gold);
  display: inline-block;
}

.stat-number {
  font-family: var(--font-stat);
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--brand);
  line-height: 1;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-md);
}
section { position: relative; padding: var(--space-2xl) 0; }
.section-tight { padding: var(--space-xl) 0; }

.grain { position: relative; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.95rem 2rem;
  border-radius: var(--radius-sm);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background-color 0.2s ease;
  will-change: transform;
}
.btn-primary {
  background: var(--brand);
  color: var(--text-on-dark);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--brand-light); transform: scale(1.035); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn-secondary {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}
.btn-secondary:hover { background: var(--brand); color: var(--text-on-dark); transform: scale(1.035); }
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn-gold {
  background: var(--gold);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.btn-gold:hover { background: var(--gold-dark); transform: scale(1.035); }
.btn-gold:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem var(--space-md);
  max-width: var(--container);
  margin: 0 auto;
}
.logo-link { display: flex; align-items: center; gap: 0.6rem; }
.logo-link img { height: 76px; width: auto; }
.nav-links { display: flex; align-items: center; gap: var(--space-lg); }
.nav-links a {
  position: relative;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  padding: 0.4rem 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.25s ease, left 0.25s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; left: 0; }
.nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.nav-cta { display: flex; align-items: center; gap: var(--space-md); }
.nav-toggle { display: none; }
.nav-links .btn-primary { display: none; }

@media (max-width: 900px) {
  .nav-links { position: fixed; top: 74px; left: 0; right: 0; background: var(--bg-floating); flex-direction: column; align-items: flex-start; padding: var(--space-lg); gap: var(--space-md); box-shadow: var(--shadow-md); transform: translateY(-150%); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; }
  .nav-links.open { transform: translateY(0); opacity: 1; }
  .nav-toggle { display: block; font-size: 1.6rem; color: var(--brand); line-height: 1; }
  .nav-cta .btn-secondary,
  .nav-cta .btn-primary { display: none; }
  .nav-links .btn-primary {
    display: inline-flex !important; margin-top: 0.5rem;
  }
  .logo-link img { height: 44px; }
}

@media (max-width: 420px) {
  .logo-link img { height: 38px; }
  .nav-links { top: 68px; }
}

/* ---------- Hero ---------- */
/* ---------- Hero — scroll-scrubbed video ---------- */
.hero-scroll {
  position: relative;
  height: 320vh;
  background: var(--bg-base);
}
.hero-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: var(--bg-base);
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 4;
  transition: opacity 0.5s ease;
}
.hero-loading.hidden { opacity: 0; pointer-events: none; }
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 17, 12, 0.92) 0%, rgba(20, 17, 12, 0.72) 32%, rgba(20, 17, 12, 0.3) 58%, transparent 78%);
  pointer-events: none;
  z-index: 1;
}
.hero-caption {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-xl);
  color: var(--text-on-dark);
}
.hero-caption .eyebrow { color: var(--gold); justify-content: center; }
.hero-caption .eyebrow::before { background: var(--text-on-dark); }
.hero-headline-sm {
  font-family: var(--font-display);
  color: var(--text-on-dark);
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.5);
}
.lede-sm {
  font-size: clamp(0.92rem, 1.3vw, 1.05rem);
  color: rgba(250, 246, 236, 0.88);
  margin: 0 auto var(--space-md);
  max-width: 480px;
  line-height: 1.6;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.hero-ctas { display: flex; gap: var(--space-md); flex-wrap: wrap; justify-content: center; }
.scroll-hint {
  margin-top: var(--space-lg);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250, 246, 236, 0.65);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
}
.scroll-hint-arrow { display: inline-block; animation: scrollHintBounce 1.6s ease-in-out infinite; }
@keyframes scrollHintBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-hint-arrow { animation: none; }
}
@media (max-width: 700px) {
  .hero-scroll { height: 260vh; }
}

/* ---------- Stat bar ---------- */
.stat-bar {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  text-align: center;
  padding: var(--space-xl) 0;
}
.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.4rem;
}
@media (max-width: 800px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Divider ---------- */
.divider {
  width: 100%;
  height: 24px;
  display: block;
  color: var(--gold);
}

/* ---------- Cards / grids ---------- */
.card {
  background: var(--bg-floating);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.image-wrap { position: relative; overflow: hidden; border-radius: var(--radius-md); }
.image-wrap img { transition: transform 0.6s ease; }
.image-wrap:hover img { transform: scale(1.05); }
.image-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(35, 31, 22, 0.55) 0%, transparent 55%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; gap: var(--space-lg); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Product cards ---------- */
.product-card { display: flex; flex-direction: column; }
.product-card .image-wrap { aspect-ratio: 4/3; }
.product-card .image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: var(--space-md); }
.product-badge {
  display: inline-block;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--gold); color: var(--text-primary);
  padding: 0.25rem 0.6rem; border-radius: 4px; margin-bottom: 0.6rem;
}

/* ---------- Family / team ---------- */
.person-card { text-align: center; }
.person-card .image-wrap { border-radius: 50%; width: 180px; height: 180px; margin: 0 auto var(--space-sm); }
.person-card .image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.person-name { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-primary); }
.person-role { color: var(--accent); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.5rem; }

/* ---------- Testimonials ---------- */
.testimonial-card {
  background: var(--bg-floating);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.testimonial-quote { font-size: 1.1rem; color: var(--text-body); margin-bottom: var(--space-md); font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 0.8rem; }
.testimonial-author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.testimonial-name { font-weight: 700; color: var(--text-primary); font-size: 0.92rem; }
.testimonial-loc { color: var(--text-muted); font-size: 0.82rem; }
.star-row { color: var(--gold); letter-spacing: 2px; margin-bottom: 0.6rem; }

/* ---------- Steps (How It Works) ---------- */
.step-card { position: relative; padding-left: 3.6rem; }
.step-number {
  position: absolute; left: 0; top: 0;
  width: 2.6rem; height: 2.6rem;
  background: var(--brand); color: var(--text-on-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-stat); font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}

/* ---------- Badges row ---------- */
.badge-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.trust-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--bg-floating); border: 1px solid var(--border-strong);
  padding: 0.6rem 1.1rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; color: var(--brand-dark);
}

/* ---------- Section variants ---------- */
.section-dark {
  background: var(--brand-dark);
  color: var(--text-on-dark);
}
.section-dark h2, .section-dark h3 { color: var(--text-on-dark); }
.section-dark .eyebrow { color: var(--gold); }
.section-dark p { color: rgba(250, 246, 236, 0.82); }

.section-elevated { background: var(--bg-elevated); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-dark);
  color: rgba(250, 246, 236, 0.85);
  padding: var(--space-2xl) 0 var(--space-lg);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}
.footer-grid h4 { color: var(--text-on-dark); font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: var(--space-sm); }
.footer-grid a, .footer-grid p { color: rgba(250, 246, 236, 0.72); font-size: 0.92rem; display: block; margin-bottom: 0.5rem; }
.footer-grid a:hover { color: var(--gold); }
.footer-logo { height: 72px; margin-bottom: var(--space-sm); }
.footer-bottom {
  border-top: 1px solid rgba(250, 246, 236, 0.15);
  padding-top: var(--space-md);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-sm);
  font-size: 0.8rem; color: rgba(250, 246, 236, 0.55);
}
.social-row { display: flex; gap: var(--space-sm); }
.social-row a {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(250,246,236,0.1);
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.2s ease, transform 0.25s ease;
}
.social-row a:hover { background: var(--gold); color: var(--brand-dark); transform: translateY(-3px); }

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

/* ---------- Page hero (interior pages) ---------- */
.page-hero {
  padding: 9rem 0 var(--space-2xl);
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}
.page-hero h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: var(--space-md); }
.form-group label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.4rem; color: var(--text-primary); }
.form-group input, .form-group textarea {
  width: 100%; padding: 0.85rem 1rem;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-floating);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92, 154, 47, 0.15);
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.max-w-content { max-width: 680px; }
.reveal { opacity: 0; transform: translateY(28px); }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: var(--text-on-dark);
  padding: 0.8rem 1.2rem; z-index: 10000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Lazy load fade-in */
img[loading="lazy"] { opacity: 0; transition: opacity 0.4s ease; }
img[loading="lazy"].loaded { opacity: 1; }
