/* ==========================================================================
   Farmlands — warm parchment by day, deep loam by night.
   ========================================================================== */

:root {
  color-scheme: light;

  --bg-primary: #F6F4EE;
  --bg-elevated: #EFECE3;
  --bg-inset: #F1EEE6;
  --text-primary: #232621;
  --text-muted: #5A5F55;
  --border-subtle: rgba(35, 38, 33, 0.14);
  --border-strong: rgba(35, 38, 33, 0.28);

  --accent-moss: #4A6B53;
  --accent-clay: #C86D51;
  --accent-wheat: #D4A359;
  --accent-moss-soft: rgba(74, 107, 83, 0.13);
  --accent-wheat-soft: rgba(212, 163, 89, 0.14);
  --accent-clay-soft: rgba(200, 109, 81, 0.12);

  --shadow-soft: 0 32px 80px -58px rgba(35, 38, 33, 0.62);
  --shadow-lift: 0 18px 36px -28px rgba(35, 38, 33, 0.45);

  --font-serif: 'Instrument Serif', 'Newsreader', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --page-gutter: clamp(1.25rem, 5vw, 5rem);
  --measure: 66ch;
  --radius: 2px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg-primary: #181A17;
  --bg-elevated: #20231F;
  --bg-inset: #1C1F1B;
  --text-primary: #E6E4DD;
  --text-muted: #9FA49A;
  --border-subtle: rgba(230, 228, 221, 0.14);
  --border-strong: rgba(230, 228, 221, 0.28);

  --accent-moss-soft: rgba(74, 107, 83, 0.2);
  --accent-wheat-soft: rgba(212, 163, 89, 0.12);
  --accent-clay-soft: rgba(200, 109, 81, 0.14);

  --shadow-soft: 0 32px 80px -52px rgba(0, 0, 0, 0.85);
  --shadow-lift: 0 18px 36px -24px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg-primary: #181A17;
    --bg-elevated: #20231F;
    --bg-inset: #1C1F1B;
    --text-primary: #E6E4DD;
    --text-muted: #9FA49A;
    --border-subtle: rgba(230, 228, 221, 0.14);
    --border-strong: rgba(230, 228, 221, 0.28);

    --accent-moss-soft: rgba(74, 107, 83, 0.2);
    --accent-wheat-soft: rgba(212, 163, 89, 0.12);
    --accent-clay-soft: rgba(200, 109, 81, 0.14);

    --shadow-soft: 0 32px 80px -52px rgba(0, 0, 0, 0.85);
    --shadow-lift: 0 18px 36px -24px rgba(0, 0, 0, 0.7);
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 65% 44% at 88% -6%, var(--accent-wheat-soft), transparent 70%),
    radial-gradient(ellipse 55% 42% at -4% 18%, var(--accent-moss-soft), transparent 72%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 320ms ease, color 320ms ease;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-clay);
  outline-offset: 4px;
}

::selection {
  background: var(--accent-moss);
  color: var(--bg-primary);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.035;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.grain svg {
  width: 100%;
  height: 100%;
}

[data-theme="dark"] .grain {
  mix-blend-mode: screen;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .grain {
    mix-blend-mode: screen;
  }
}

/* --------------------------------------------------------------------------
   Shared type details
   -------------------------------------------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow__rule {
  display: inline-block;
  width: 1.9rem;
  height: 1px;
  background: var(--accent-clay);
  flex: none;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.02;
}

em {
  color: var(--accent-moss);
  font-style: italic;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.9rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.button svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}

.button--solid {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-primary);
}

.button--solid:hover {
  background: var(--accent-moss);
  border-color: var(--accent-moss);
  color: #F6F4EE;
  transform: translateY(-1px);
}

.button--solid:active {
  transform: translateY(0);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 180ms ease, color 180ms ease;
}

.text-link:hover {
  border-color: var(--accent-clay);
  color: var(--accent-clay);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding: 0.9rem var(--page-gutter);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  background: color-mix(in srgb, var(--bg-primary) 84%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  text-decoration: none;
}

.brand__mark {
  width: 2.35rem;
  height: 2.35rem;
  color: var(--text-primary);
  flex: none;
  transition: transform 260ms ease;
}

.brand:hover .brand__mark {
  transform: rotate(-5deg);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1;
}

.brand__domain {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge__dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent-moss);
  box-shadow: 0 0 0 0 var(--accent-moss-soft);
  animation: status-pulse 2.8s ease-out infinite;
  flex: none;
}

@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 107, 83, 0.42);
  }
  70% {
    box-shadow: 0 0 0 0.42rem rgba(74, 107, 83, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 107, 83, 0);
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.15rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent-clay);
  color: var(--text-primary);
}

.theme-toggle__icon {
  width: 1rem;
  height: 1rem;
  flex: none;
}

[data-theme="dark"] .theme-toggle__icon {
  color: var(--accent-wheat);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding: clamp(4rem, 11vw, 8.5rem) var(--page-gutter) clamp(4rem, 9vw, 7rem);
}

.hero__copy {
  max-width: 46rem;
}

.hero__title {
  margin-top: 1.35rem;
  font-size: clamp(2.9rem, 11vw, 5.7rem);
  line-height: 0.96;
}

.hero__manifesto {
  max-width: 34rem;
  margin-top: clamp(1.4rem, 3vw, 2rem);
  color: var(--text-muted);
  font-size: clamp(1.02rem, 2.2vw, 1.22rem);
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: clamp(1.8rem, 4vw, 2.5rem);
}

.hero__motif {
  width: 100%;
  max-width: 32rem;
  align-self: end;
  justify-self: center;
  color: var(--accent-moss);
  opacity: 0.9;
}

.hero__motif svg {
  width: 100%;
  height: auto;
}

.hero__motif text {
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Section headings
   -------------------------------------------------------------------------- */

.plots,
.contact {
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) var(--page-gutter);
}

.section-heading {
  display: grid;
  gap: 1.1rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.section-heading h2,
.contact h2 {
  margin-top: 0.75rem;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
}

.section-heading__lede {
  max-width: 38rem;
  color: var(--text-muted);
  font-size: clamp(0.98rem, 1.8vw, 1.08rem);
}

/* --------------------------------------------------------------------------
   Test plots / field log
   -------------------------------------------------------------------------- */

.plots__frame {
  position: relative;
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}

.plots__frame::before,
.plots__frame::after {
  content: '';
  position: absolute;
  width: 0.95rem;
  height: 0.95rem;
  border-color: var(--accent-wheat);
  border-style: solid;
  pointer-events: none;
}

.plots__frame::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.plots__frame::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
}

.plots__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding: 0.15rem 0.15rem 0.95rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.plots-grid {
  display: grid;
  gap: 1px;
  border: 1px solid var(--border-subtle);
  background: var(--border-subtle);
}

.plots__fallback {
  padding: 1.5rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.plot-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 16rem;
  padding: 1.45rem 1.25rem 1.25rem;
  background: var(--bg-elevated);
  overflow: hidden;
  transition: background-color 200ms ease;
}

.plot-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--plot-accent, var(--accent-moss));
  opacity: 0.82;
}

.plot-card:hover {
  background: var(--bg-inset);
}

.plot-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.plot-card__season {
  color: var(--accent-wheat);
}

.plot-card__badge {
  align-self: flex-start;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--plot-accent, var(--accent-moss));
  border-radius: 999px;
  color: var(--plot-accent, var(--accent-moss));
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.plot-card__title {
  margin-top: 0.1rem;
  font-size: clamp(1.25rem, 3.5vw, 1.55rem);
  line-height: 1.12;
}

.plot-card__title a {
  text-decoration: none;
}

.plot-card__title a:hover {
  color: var(--plot-accent, var(--accent-moss));
}

.plot-card__description {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.plot-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.plot-card__foot a {
  color: var(--plot-accent, var(--accent-moss));
  text-decoration: none;
}

.plot-card__foot a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact {
  padding-top: clamp(1rem, 3vw, 2rem);
}

.contact__inner {
  display: grid;
  gap: clamp(1.75rem, 5vw, 3.5rem);
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, var(--accent-moss-soft), transparent 58%),
    var(--bg-elevated);
  box-shadow: var(--shadow-lift);
}

.contact__copy {
  max-width: 38rem;
}

.contact__lede {
  max-width: 34rem;
  margin-top: 1rem;
  color: var(--text-muted);
}

.contact-slot {
  align-self: center;
  justify-self: start;
  width: 100%;
  max-width: 30rem;
}

.contact__trigger {
  width: 100%;
}

.contact__reveal {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--border-subtle);
}

.contact__label {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact__address {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: clamp(0.92rem, 3.5vw, 1.12rem);
  overflow-wrap: anywhere;
}

.contact__mailto {
  margin-top: 0.9rem;
  color: var(--accent-moss);
}

.contact__hint {
  margin-top: 0.8rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.contact__status {
  min-height: 1.4rem;
  margin-top: 0.7rem;
  color: var(--accent-moss);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.25rem) var(--page-gutter) clamp(2.25rem, 6vw, 3.5rem);
  border-top: 1px solid var(--border-subtle);
}

.site-footer__name {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.1;
}

.site-footer__brand p:last-child {
  max-width: 32rem;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-self: end;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 560px) and (max-width: 767px) {
  .plots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: center;
  }

  .hero__title {
    font-size: clamp(2.9rem, 5.6vw, 5.4rem);
  }

  .hero__motif {
    justify-self: end;
  }

  .section-heading {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    align-items: end;
  }

  .section-heading__lede {
    justify-self: end;
    text-align: right;
  }

  .plots-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact__inner {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.72fr);
    align-items: center;
  }

  .contact-slot {
    justify-self: end;
  }

  .site-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .site-footer__meta {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    text-align: right;
  }
}

@media (max-width: 767px) {
  .site-header {
    flex-wrap: wrap;
  }

  .site-header__actions {
    display: contents;
  }

  .status-badge {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 479px) {
  .theme-toggle__label {
    display: none;
  }

  .theme-toggle {
    width: 2.15rem;
    justify-content: center;
    padding-inline: 0;
  }

  .brand__mark {
    width: 2rem;
    height: 2rem;
  }

  .brand__name {
    font-size: 1.2rem;
  }

  .hero__actions {
    align-items: stretch;
  }

  .hero__actions .button {
    width: 100%;
  }

  .hero__actions .text-link {
    align-self: flex-start;
  }

  .plot-card {
    min-height: 14rem;
  }
}

@media (max-width: 379px) {
  .status-badge {
    padding-inline: 0.5rem;
    font-size: 0.5rem;
  }

  .plots__meta span:last-child {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .status-badge__dot {
    animation: none;
  }
}
