/* ════════════════════════════════════════════════════════════════════════════
   Farmbox — foundations
   A quiet, editorial system. Deep forest and bone, one living green, one brass.
   Type does the work; there are no gradients and almost no rounded corners.
   ════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,300..700,0,0;1,9..144,300..600,0,0&family=Instrument+Sans:ital,wght@0,400..700;1,400..600&display=swap');

:root {
  /* ── Ink & ground ── */
  --ink:        #101410;
  --forest:     #16281D;
  --forest-2:   #1E3628;
  --forest-3:   #27412F;
  --moss:       #33513E;
  --leaf:       #7DB669;
  --leaf-deep:  #497437;   /* 4.90:1 on --bone — the green we set text in */
  --leaf-pale:  #C3DBB4;
  --bone:       #F6F2E9;
  --paper:      #FDFBF6;
  --sand:       #EDE6D7;
  --rule:       #DCD5C6;
  --rule-soft:  #E7E1D3;
  --stone:      #6E6A5E;   /* 4.84:1 on --bone */
  --stone-2:    #736D60;   /* 4.60:1 on --bone — the quietest tone we set text in */
  --clay:       #A98B54;   /* decorative brass: rules, borders, never text */
  --clay-deep:  #7E6234;   /* 5.10:1 on --bone — the brass we set text in */
  --terracotta: #8F3F26;   /* 7.22:1 against white, for the imported badge */
  --terracotta-soft: #B4593A; /* decorative only */

  /* ── Type ── */
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans:  'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --fs-display-xl: clamp(3.1rem, 7.6vw, 7rem);
  --fs-display:    clamp(2.3rem, 4.9vw, 4.25rem);
  --fs-h2:         clamp(1.85rem, 3.1vw, 2.9rem);
  --fs-h3:         clamp(1.32rem, 1.8vw, 1.6rem);
  --fs-lead:       clamp(1.06rem, 1.35vw, 1.28rem);
  --fs-body:       1.0625rem;
  --fs-small:      0.875rem;
  --fs-micro:      0.75rem;
  --fs-eyebrow:    0.6875rem;

  --tracking-eyebrow: 0.24em;
  --tracking-tight:  -0.022em;

  /* ── Space ── */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px; --s11: 176px;
  --gutter: clamp(20px, 5vw, 84px);
  --measure: 1340px;
  --measure-text: 62ch;

  /* ── Motion ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 180ms;
  --t-mid: 320ms;
  --t-slow: 780ms;

  --shadow-lift: 0 1px 2px rgba(16,20,16,.04), 0 12px 34px -18px rgba(16,20,16,.28);
  --shadow-deep: 0 2px 4px rgba(16,20,16,.05), 0 30px 70px -30px rgba(16,20,16,.38);
}

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

/* A display rule on a class beats the user-agent [hidden] rule, so state it once. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.62;
  font-variation-settings: 'opsz' 14, 'SOFT' 0, 'WONK' 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--leaf); color: var(--forest); }

/*
 * A two-tone ring so it survives every ground in the system: a near-black core
 * that reads on bone and paper, wrapped in a pale green halo that reads on
 * forest, ink and photographs.
 */
:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--leaf-pale);
  border-radius: 1px;
}
.on-dark :focus-visible, .ops-body :focus-visible, .foot :focus-visible,
.weekbar :focus-visible, .duo__art :focus-visible {
  outline-color: var(--leaf-pale);
  box-shadow: 0 0 0 4px rgba(16, 24, 16, .9);
}

/* ── Typography ─────────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-display); font-variation-settings: 'opsz' 96, 'SOFT' 0, 'WONK' 0; }
h2 { font-size: var(--fs-h2);      font-variation-settings: 'opsz' 60, 'SOFT' 0, 'WONK' 0; line-height: 1.1; }
h3 { font-size: var(--fs-h3);      font-variation-settings: 'opsz' 30, 'SOFT' 0, 'WONK' 0; line-height: 1.22; }

p { margin: 0 0 1.1em; max-width: var(--measure-text); }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 34%, transparent); text-underline-offset: 0.22em; }
a:hover { text-decoration-color: currentColor; }

.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--clay-deep);
  /* .eyebrow is usually a <p>, and the global measure on p would silently
     shrink it and break every centred instance. */
  max-width: none;
  margin: 0 0 var(--s4);
  display: block;
}
.eyebrow--leaf { color: var(--leaf); }
.eyebrow--brass { color: var(--clay); } /* decorative use on dark grounds only */
.eyebrow--stone { color: var(--stone-2); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.58;
  color: color-mix(in srgb, var(--ink) 82%, transparent);
  max-width: 54ch;
}

.ui { font-family: var(--sans); letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.muted { color: var(--stone); }
.small { font-size: var(--fs-small); }
.micro { font-family: var(--sans); font-size: var(--fs-micro); letter-spacing: .04em; color: var(--stone); }

.display-xl {
  font-size: var(--fs-display-xl);
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 0;
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.032em;
}
em.pen { font-style: italic; font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 1; }

/* ── Layout ─────────────────────────────────────────────────────────────── */

.wrap { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 940px; }
.section { padding-block: clamp(var(--s8), 11vw, var(--s11)); }
.section--tight { padding-block: clamp(var(--s7), 7vw, var(--s9)); }

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }
.rule--soft { background: var(--rule-soft); }
.rule--dark { background: rgba(246,242,233,.16); }

.on-dark { background: var(--forest); color: var(--bone); }
.on-dark h1, .on-dark h2, .on-dark h3 { color: var(--bone); }
.on-dark .lead { color: rgba(246,242,233,.76); }
.on-dark .muted { color: rgba(246,242,233,.6); }
.on-dark .eyebrow { color: var(--leaf); }

.grid { display: grid; gap: var(--s6); }
.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1020px) { .cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 680px)  { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  --btn-bg: var(--forest);
  --btn-fg: var(--bone);
  --btn-bd: var(--forest);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  padding: 16px 30px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  transition: color var(--t-mid) var(--ease-out), border-color var(--t-mid) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: var(--leaf);
  transform: translateY(101%);
  transition: transform 420ms var(--ease-out);
  z-index: 0;
}
.btn > * , .btn { position: relative; }
.btn span { position: relative; z-index: 1; }
.btn:hover::after { transform: translateY(0); }
.btn:hover { color: var(--forest); border-color: var(--leaf); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .38; pointer-events: none; }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--forest); --btn-bd: var(--rule); }
.btn--ghost:hover { color: var(--forest); }
.btn--light { --btn-bg: var(--bone); --btn-fg: var(--forest); --btn-bd: var(--bone); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: var(--bone); --btn-bd: rgba(246,242,233,.4); }
.btn--outline-light:hover { color: var(--forest); }
.btn--sm { padding: 11px 20px; font-size: 10px; letter-spacing: .17em; }
.btn--block { width: 100%; }

.link-arrow {
  font-family: var(--sans); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .19em; text-transform: uppercase; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
  border-bottom: 1px solid currentColor; padding-bottom: 5px;
  transition: gap var(--t-mid) var(--ease-out), color var(--t-mid) var(--ease-out);
}
.link-arrow:hover { gap: 16px; color: var(--leaf-deep); }
.on-dark .link-arrow:hover { color: var(--leaf); }

/* ── Forms ──────────────────────────────────────────────────────────────── */

.field { display: block; margin-bottom: var(--s5); }
.field > label,
.label {
  display: block;
  font-family: var(--sans); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--stone);
  margin-bottom: 9px;
}
.input, .select, .textarea {
  width: 100%;
  font-family: var(--serif); font-size: 1.02rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 13px 15px;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--stone-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--leaf-deep); background: #fff; }
.input:focus:not(:focus-visible), .select:focus:not(:focus-visible), .textarea:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236E6A5E' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; background-size: 11px;
  padding-right: 40px;
}
.hint { font-family: var(--sans); font-size: var(--fs-micro); color: var(--stone-2); margin-top: 7px; }
.error-text { font-family: var(--sans); font-size: var(--fs-small); color: var(--terracotta); margin-top: 8px; }

/* ── Tags & pills ───────────────────────────────────────────────────────── */

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 9.5px; font-weight: 600;
  letter-spacing: .17em; text-transform: uppercase;
  padding: 4px 9px 3px;
  border: 1px solid var(--rule);
  color: var(--stone);
  background: transparent;
  white-space: nowrap;
}
.tag--leaf { border-color: color-mix(in srgb, var(--leaf-deep) 45%, transparent); color: var(--leaf-deep); }
.tag--clay { border-color: color-mix(in srgb, var(--clay) 52%, transparent); color: var(--clay-deep); }
.tag--terra { border-color: color-mix(in srgb, var(--terracotta) 45%, transparent); color: var(--terracotta); }
.tag--solid { background: var(--forest); border-color: var(--forest); color: var(--bone); }

/* ── Header ─────────────────────────────────────────────────────────────── */

.masthead {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bone) 88%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid) var(--ease-out), background var(--t-mid) var(--ease-out);
}
.masthead.is-stuck { border-bottom-color: var(--rule); }
.masthead--dark { background: color-mix(in srgb, var(--forest) 86%, transparent); color: var(--bone); }
.masthead--dark.is-stuck { border-bottom-color: rgba(246,242,233,.14); }

.masthead__inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s5);
  min-height: 78px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand svg, .brand img { width: 34px; height: 34px; flex: none; }
.brand__name {
  font-family: var(--serif); font-size: 1.32rem; font-weight: 400; letter-spacing: -.012em;
  font-variation-settings: 'opsz' 40, 'SOFT' 0, 'WONK' 0;
  line-height: 1;
}
.brand__tag {
  display: block; font-family: var(--sans); font-size: 8.5px; font-weight: 600;
  letter-spacing: .3em; text-transform: uppercase; color: var(--leaf-deep); margin-top: 4px;
}
.masthead--dark .brand__tag { color: var(--leaf); }

.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.nav a:not(.btn) {
  font-family: var(--sans); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .17em; text-transform: uppercase; text-decoration: none;
  color: inherit; opacity: .74;
  transition: opacity var(--t-fast) var(--ease-out);
}
.nav a:not(.btn):hover, .nav a[aria-current='page'] { opacity: 1; }
.nav a { white-space: nowrap; }
@media (max-width: 1040px) { .nav .nav-hide-md { display: none; } }
@media (max-width: 860px) { .nav .nav-hide { display: none; } }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.foot { background: var(--forest); color: var(--bone); padding-block: var(--s9) var(--s6); }
.foot a { color: rgba(246,242,233,.72); text-decoration: none; }
.foot a:hover { color: var(--leaf); }
.foot__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--s7); }
@media (max-width: 860px) { .foot__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot__grid { grid-template-columns: 1fr; } }
.foot h3 {
  font-family: var(--sans); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--leaf); margin-bottom: var(--s4);
  line-height: 1.4;
}
/* The brand tag reads on the dark footer in leaf, not the darker leaf-deep. */
.foot .brand__tag { color: var(--leaf); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.foot li { font-size: var(--fs-small); }

/* ── Reveal on scroll ───────────────────────────────────────────────────── */

/*
 * Nothing is hidden until the script that can unhide it is running. `.js-reveal`
 * is set on <html> by site.js as its first act, so a page whose JavaScript never
 * arrives is a page that is merely still, rather than a page that is blank.
 * The content security policy forbids an inline script, so this is a class on
 * the root rather than the usual one-liner in the head.
 */
.js-reveal .reveal { opacity: 0; transform: translateY(22px); }
.js-reveal .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal, .js-reveal .reveal.is-in { opacity: 1; transform: none; transition: none; }
}

/*
 * Someone who has asked their machine to stop moving things means all of it —
 * the hero drift, the scroll cue, the crate filling, the lines sliding in.
 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Utility ────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* …except when it is focused, at which point it is the most important thing
   on the page. */
.sr-only:focus, .sr-only:focus-visible {
  position: fixed; top: 12px; left: 12px; z-index: 999;
  width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none;
  background: var(--forest); color: var(--bone);
  font-family: var(--sans); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  padding: 14px 22px; text-decoration: none;
}
.stack > * + * { margin-top: var(--flow, var(--s4)); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hide-sm { }
@media (max-width: 680px) { .hide-sm { display: none !important; } }

/* A picture that failed to load. Hidden rather than removed, so it keeps its
   space and the panel behind it stays the right shape. */
img.is-missing { visibility: hidden; }
