:root {
  --field: #2e7d32;
  --field-deep: #1b5e20;
  --field-soft: #43a047;
  --leaf: #c8e6c9;
  --straw: #c9a227;
  --straw-soft: #e6c96a;
  --mist: #dce8de;
  --ink: #1b1b1b;
  --ink-muted: #5f6368;
  --paper: #f5f7f5;
  --white: #ffffff;
  --dusk: #0f2414;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;

  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 72rem;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: var(--space);
  top: -100px;
  z-index: 100;
  padding: 0.65rem 1rem;
  border-radius: 0.45rem;
  background: var(--field-deep);
  color: var(--white);
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0.75rem;
}

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

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  padding: 0 var(--space);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s ease;
  color: rgba(255, 255, 255, 0.82);
}

.site-header .brand-mark {
  color: var(--white);
}

.site-header .brand-icon {
  color: var(--field-deep);
}

.site-header .nav a:hover {
  color: var(--white);
}

.site-header.is-scrolled {
  color: var(--ink-muted);
  border-bottom-color: color-mix(in srgb, var(--ink) 8%, transparent);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}

.site-header.is-scrolled .brand-mark {
  color: var(--field-deep);
}

.site-header.is-scrolled .brand-icon {
  color: var(--field);
}

.site-header.is-scrolled .nav a:hover {
  color: var(--field-deep);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--field-deep);
  transition: color 0.3s ease;
}

.brand-icon {
  width: 1.7rem;
  height: 1.7rem;
  color: var(--field);
}

.nav {
  display: none;
  gap: 1.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.nav a {
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--field-deep);
}

.header-cta {
  display: none;
}

@media (min-width: 840px) {
  .nav {
    display: flex;
  }

  .header-cta {
    display: inline-flex;
  }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

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

.btn-sm {
  min-height: 2.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--field);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--field-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 18%, transparent);
}

.btn-ghost:hover {
  border-color: var(--field);
  color: var(--field-deep);
}

/* Hero */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  color: var(--white);
}

.hero-visual {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 75% 18%, rgba(201, 162, 39, 0.22), transparent 55%),
    linear-gradient(165deg, #14301a 0%, var(--field-deep) 42%, #2a4a1f 72%, #3d5c28 100%);
}

.hero-sky {
  position: absolute;
  inset: 0 0 48%;
  background:
    radial-gradient(ellipse 45% 35% at 18% 28%, rgba(255, 236, 179, 0.2), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 75%);
}

.hero-hills {
  position: absolute;
  inset: auto 0 0;
  height: 62%;
}

.hill {
  position: absolute;
  left: -8%;
  right: -8%;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform-origin: bottom center;
  animation: hill-rise 1.35s var(--ease) both;
}

.hill-far {
  bottom: 28%;
  height: 42%;
  background: linear-gradient(180deg, #4a7a3a, #2f5a2a);
  opacity: 0.55;
  animation-delay: 0.05s;
}

.hill-mid {
  bottom: 14%;
  height: 48%;
  background: linear-gradient(180deg, #3f6f34, #244a20);
  opacity: 0.85;
  animation-delay: 0.14s;
}

.hill-near {
  bottom: 0;
  height: 38%;
  background: linear-gradient(180deg, var(--field-soft), var(--field-deep) 70%, #122a16);
  animation-delay: 0.22s;
}

@keyframes hill-rise {
  from {
    transform: translateY(18%) scaleY(0.85);
    opacity: 0.35;
  }
  to {
    transform: translateY(0) scaleY(1);
  }
}

.hero-fence {
  position: absolute;
  inset: auto 0 12%;
  height: 14%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: clamp(0.75rem, 3vw, 2rem);
  padding: 0 6vw;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.hero-fence span {
  display: block;
  width: 4px;
  height: 100%;
  margin: 0 auto;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, rgba(232, 214, 160, 0.55), rgba(120, 90, 40, 0.35));
  transform-origin: bottom center;
  animation: post-rise 1.1s var(--ease) both;
}

.hero-fence span:nth-child(1) { animation-delay: 0.28s; height: 72%; }
.hero-fence span:nth-child(2) { animation-delay: 0.34s; height: 88%; }
.hero-fence span:nth-child(3) { animation-delay: 0.4s; height: 100%; }
.hero-fence span:nth-child(4) { animation-delay: 0.46s; height: 82%; }
.hero-fence span:nth-child(5) { animation-delay: 0.52s; height: 94%; }
.hero-fence span:nth-child(6) { animation-delay: 0.58s; height: 76%; }
.hero-fence span:nth-child(7) { animation-delay: 0.64s; height: 90%; }
.hero-fence span:nth-child(8) { animation-delay: 0.7s; height: 68%; }

@keyframes post-rise {
  from {
    transform: scaleY(0.4);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.hero-haze {
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(180deg, transparent, rgba(10, 24, 14, 0.45) 40%, rgba(8, 18, 10, 0.7));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100% - 2 * var(--space), var(--max));
  margin: 0 auto;
  padding: calc(var(--header-h) + 1.5rem) 0 clamp(5rem, 14vh, 8rem);
}

.hero-brand {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7.2vw, 5.25rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.hero-title {
  margin: 0 0 0.9rem;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.8vw, 2.65rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--straw-soft);
}

.hero-lede {
  margin: 0 0 1.75rem;
  max-width: 36rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.88);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero .btn-ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

.hero .btn-ghost:hover {
  border-color: var(--white);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.hero .btn-primary {
  background: var(--straw);
  color: var(--dusk);
}

.hero .btn-primary:hover {
  background: var(--straw-soft);
}

/* Sections */

.section {
  padding: clamp(4.5rem, 10vw, 7.5rem) 0;
}

.section-inner {
  width: min(100% - 2 * var(--space), var(--max));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--field);
}

.section-title {
  margin: 0 0 1rem;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--field-deep);
}

.section-lede {
  margin: 0 0 2.5rem;
  max-width: 40rem;
  color: var(--ink-muted);
  font-size: 1.08rem;
}

/* Day chain */

.section-pitch {
  background:
    linear-gradient(180deg, var(--paper), #e8efe8);
}

.chain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

@media (min-width: 900px) {
  .chain {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.chain-step {
  display: grid;
  gap: 0.35rem;
  padding-top: 1rem;
  border-top: 2px solid color-mix(in srgb, var(--field) 50%, var(--mist));
}

.chain-index {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--straw);
}

.chain-step strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.chain-step span:last-child {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* Modules */

.section-modules {
  background: var(--white);
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

@media (min-width: 720px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.module {
  padding: 1.5rem 1.25rem 1.5rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

@media (min-width: 720px) {
  .module:nth-child(odd) {
    padding-right: 1.75rem;
    border-right: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  }

  .module:nth-child(even) {
    padding-left: 1.75rem;
  }
}

@media (min-width: 1040px) {
  .module {
    padding: 1.6rem 1.5rem 1.6rem 0;
    border-right: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  }

  .module:nth-child(3n) {
    border-right: none;
    padding-right: 0;
  }

  .module:nth-child(3n + 1) {
    padding-left: 0;
  }

  .module:nth-child(3n + 2),
  .module:nth-child(3n) {
    padding-left: 1.5rem;
  }
}

.module h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--field);
}

.module p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

/* Offline dashboard */

.section-offline {
  background:
    radial-gradient(ellipse 70% 50% at 85% 18%, rgba(201, 162, 39, 0.14), transparent 55%),
    linear-gradient(160deg, #122818 0%, #0f2414 55%, #1a3020 100%);
  color: var(--mist);
}

.section-offline .eyebrow {
  color: var(--straw-soft);
}

.section-offline .section-title {
  color: var(--white);
  max-width: 14ch;
}

.section-offline .section-lede {
  color: color-mix(in srgb, var(--mist) 82%, transparent);
}

.offline-layout {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 920px) {
  .offline-layout {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 3.5rem;
  }
}

.offline-note {
  margin: -1rem 0 0;
  color: color-mix(in srgb, var(--mist) 70%, transparent);
  font-size: 0.95rem;
}

.dash-panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  padding: 1.35rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.dash-lookup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--straw-soft);
}

.dash-badge {
  padding: 0.35rem 0.7rem;
  border-radius: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: #e8f5e9;
  color: var(--field);
}

.dash-widgets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 520px) {
  .dash-widgets {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dash-widgets li {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0.7rem;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  opacity: 0.4;
  transform: translateY(10px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), border-color 0.45s ease;
}

.dash-widgets li.is-active {
  opacity: 1;
  transform: translateY(0);
}

.dash-widgets li[data-accent="animals"].is-active { border-left-color: #43a047; }
.dash-widgets li[data-accent="pregnant"].is-active { border-left-color: #ec407a; }
.dash-widgets li[data-accent="heat"].is-active { border-left-color: #fb8c00; }
.dash-widgets li[data-accent="sick"].is-active { border-left-color: #e53935; }
.dash-widgets li[data-accent="treatments"].is-active { border-left-color: #1e88e5; }
.dash-widgets li[data-accent="calving"].is-active { border-left-color: #8e24aa; }
.dash-widgets li[data-accent="tags"].is-active { border-left-color: #f9a825; }
.dash-widgets li[data-accent="weight"].is-active { border-left-color: #558b2f; }

.dash-widgets span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--mist) 75%, transparent);
}

.dash-widgets strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
}

/* Floor */

.section-floor {
  background: #e8efe8;
}

.floor-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 800px) {
  .floor-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 2.5rem;
  }
}

.floor-points li {
  display: grid;
  gap: 0.4rem;
  padding-left: 1.1rem;
  border-left: 3px solid var(--field);
}

.floor-points strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--field-deep);
}

.floor-points span {
  color: var(--ink-muted);
}

/* Contact */

.section-contact {
  background:
    linear-gradient(145deg, var(--field-deep), var(--field) 55%, #2a4a22);
  color: var(--white);
}

.section-contact .eyebrow {
  color: var(--straw-soft);
}

.section-contact .section-title {
  color: var(--white);
  max-width: 18ch;
}

.section-contact .section-lede {
  color: rgba(255, 255, 255, 0.82);
}

.contact-panel {
  max-width: 40rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-contact .btn-primary {
  background: var(--straw);
  color: var(--dusk);
}

.section-contact .btn-primary:hover {
  background: var(--straw-soft);
}

.contact-meta {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.62);
}

/* Footer */

.site-footer {
  background: #0a160c;
  color: rgba(255, 255, 255, 0.55);
  padding: 1.5rem var(--space);
}

.footer-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.9rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--white);
}

.footer-tag {
  color: var(--straw);
}

.footer-address {
  width: min(100%, var(--max));
  margin: 0.85rem auto 0;
  font-style: normal;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.42);
}

.footer-address a:hover {
  color: var(--straw-soft);
}

/* Reveal */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

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

  .reveal,
  .hill,
  .hero-fence span,
  .dash-widgets li {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
