/* biome-ignore-all lint/style/noDescendingSpecificity: state classes (.is-in) and em accents layer over base rules; source order is the cascade contract */
/* Field Notes editorial system for the www pages (packages/content/editorial, succession planting
   is the reference): tokens, labels and margin asides, two-part serif headlines that turn into
   leaf-green italic, numbered hairlines, pull quotes, and plans as approach columns. Loaded after
   site.css by pages set this way; each page keeps its own sections in its own sheet. Its tokens
   come from Lushly's tree, linked before it as /site/theme/editorial.css. */

/* A garden picture sits on its hour's sky. Evening is the renderer's own
   (hero/garden.json); morning is the product hero's clearer blue. The tree holds them as
   --sky-*. */
[data-sky="morning"] {
  background: var(--sky-morning);
}

[data-sky="evening"] {
  background: var(--sky-evening);
}

/* Editorial primitives ------------------------------------------------ */

.ed-label {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moss);
}

.tiny-rule {
  display: block;
  inline-size: 1.875rem;
  block-size: 1px;
  margin-block: 1.5rem 1rem;
  background: var(--fn-clay);
}

.ed-aside {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.5;
  color: var(--fn-muted);
  max-inline-size: 16rem;
}

.ed-num {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fn-clay);
}

.ed-head {
  max-inline-size: 48rem;
  margin-block-end: clamp(2.5rem, 5vw, 4rem);
}

/* The section headline; a page reuses it for any headline set this way (.ed-h2). */
.ed-head h2,
.ed-h2 {
  margin-block: 1.1rem 1.25rem;
  font-size: clamp(2.35rem, 4.6vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-inline-size: 15ch;
}

.ed-head h2 em,
.ed-h2 em {
  display: block;
  font-style: italic;
  color: var(--leaf-ink);
}

.ed-dek {
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  line-height: 1.65;
  color: var(--fn-muted);
  max-inline-size: 36rem;
}

/* A margin column for the label and an aside, beside a measure of text. */
.ed-grid {
  display: grid;
  grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: start;
}

.ed-margin {
  position: sticky;
  inset-block-start: 7rem;
  padding-block-start: 0.6rem;
}

.ed-section {
  position: relative;
  padding-block: clamp(4.5rem, 10vw, 8rem);
}

/* Sections part on a hairline inside the wrap, never edge to edge. */
.ed-section::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  border-block-start: 1px solid var(--fn-line);
}

.js .ed-reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 900ms var(--ease-out),
    transform 900ms var(--ease-out);
}

.js .ed-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* A pull quote between the hero and the year ---------------------------- */

.ed-quote-band {
  padding-block: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  background: var(--year-winter);
}

.ed-quote {
  max-inline-size: min(62rem, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  border-block: 1px solid var(--fn-line);
  text-align: center;
}

.ed-quote-line {
  margin-inline: auto;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.8vw, 4rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.04em;
  color: var(--moss);
  max-inline-size: 22ch;
  text-wrap: balance;
}

.ed-quote em {
  font-style: italic;
  color: var(--leaf-ink);
}

.ed-quote figcaption {
  margin-block-start: 1.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fn-muted);
}

/* Plans: Field Notes' approach variations ------------------------------ */

.tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vw, 3.25rem);
}

.tier {
  display: flex;
  flex-direction: column;
  padding-block-start: 1.4rem;
  border-block-start: 3px solid var(--moss);
}

.tier:nth-child(2) {
  border-block-start-color: var(--leaf-ink);
}

.tier:nth-child(3) {
  border-block-start-color: var(--fn-clay);
}

.tier-num {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fn-muted);
}

.tier-num span {
  margin-inline-start: 0.5rem;
  color: var(--moss);
}

.tier h3 {
  margin-block: 1.1rem 0.9rem;
  font-size: clamp(1.625rem, 2.4vw, 2.125rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.tier > p:not(.tier-num) {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--ink-2);
}

.tier-fit {
  margin-block-start: auto;
  padding-block-start: 1.25rem;
}

.tier-fit-label {
  margin: 1.25rem 0 0.35rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--fn-line);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--moss);
}

.tier-fit p {
  font-size: 0.875rem;
  color: var(--fn-muted);
}

.js .tiers-grid.ed-reveal {
  opacity: 1;
  transform: none;
}

.js .tiers-grid.ed-reveal .tier {
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity 800ms var(--ease-out),
    transform 800ms var(--ease-out);
  transition-delay: calc(var(--i) * 130ms);
}

.js .tiers-grid.ed-reveal.is-in .tier {
  opacity: 1;
  transform: none;
}

.tiers-link {
  margin-block-start: 2.5rem;
  font-weight: 500;
}

/* Narrow screens: the margin column folds into a kicker above the headline; its asides are for
   wide pages. */
@media (max-width: 960px) {
  .ed-grid,
  .tiers-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ed-margin {
    position: static;
  }

  .ed-margin .tiny-rule,
  .ed-margin .ed-aside {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .ed-reveal,
  .js .tiers-grid.ed-reveal .tier {
    transition: none;
  }
}

/* The in-page choice follows the same path as the device preference. */

:root.reduce-motion.js .ed-reveal,
:root.reduce-motion.js .tiers-grid.ed-reveal .tier {
  transition: none;
}

@media (min-width: 961px) {
  /* Section heads fill their width: headline on the left, its dek on the right. */

  .ed-head {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: clamp(2rem, 5vw, 5rem);
    align-items: end;
    max-inline-size: none;
  }

  .ed-head > .ed-label {
    grid-column: 1 / -1;
  }

  .ed-head > h2 {
    margin-block-end: 0;
  }

  .ed-head > .ed-dek {
    padding-block-end: 0.4rem;
  }
}

@media (min-width: 1100px) {
  /* Only beside the garden: stacked under it on a phone, the words follow the picture closely. */

  .closing--garden .wrap {
    padding-block-start: clamp(8rem, 17vh, 10rem);
  }
}

/* The garden, cropped: one example garden carried through every page. Each crop is a cutout
   from a hero capture (/site/hero/desktop-<hour>-*.avif) on its hour's sky. --zoom is the
   cutout's width in box widths; --x and --y are the point it centres, as fractions of the
   cutout; --ratio is the box's height over its width, which a page's sheet may override. */
.garden-crop {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / var(--ratio, 0.5);
}

.garden-crop img {
  position: absolute;
  max-inline-size: none;
  block-size: auto;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  inline-size: calc(var(--zoom, 1) * 100%);
  transform: translate(calc(var(--x, 0.5) * -100%), calc(var(--y, 0.5) * -100%));
}

/* Each hour's sky, as the hero draws it behind the same cutout. */
.garden-crop[data-hour="dawn"] {
  background: linear-gradient(#414e58, #736666 55%, #ca9c72);
}

.garden-crop[data-hour="morning"] {
  background: linear-gradient(#8fb2c4, #c6d3cf 55%, #ecdcb8);
}

.garden-crop[data-hour="midday"],
.garden-crop[data-hour="afternoon"] {
  background: linear-gradient(#b7cbd2, #d0dad3 55%, #e8e2cc);
}

.garden-crop[data-hour="evening"] {
  background: linear-gradient(#a7bac1, #c2c9c3 55%, #e2d6be);
}

.garden-crop[data-hour="dusk"] {
  background: linear-gradient(#202d3b, #5a4b4e 55%, #b0865f);
}

.garden-crop[data-hour="winter"] {
  background: linear-gradient(#c5d2d8, #dde4e3 55%, #e9e9e1);
}

.garden-crop[data-hour="spring"] {
  background: linear-gradient(#b4cdd6, #d3dfd6 55%, #e6e6cc);
}

.garden-crop[data-hour="fall"] {
  background: linear-gradient(#b8c4c6, #d8d5c4 55%, #ecd6b0);
}

.garden-crop[data-hour="dawn"] img,
.garden-crop[data-hour="dusk"] img {
  filter: brightness(1.3) saturate(1.05);
}

/* After dark the lawn stays quiet. */

.closing [data-garden-still] .garden-frame {
  filter: brightness(1.32) saturate(0.82);
}

@media (max-width: 960px) {
  /* Phone: a section's label sits close above its headline. */

  .ed-grid {
    row-gap: 0.25rem;
  }

  .ed-grid .ed-h2 {
    margin-block-start: 0.6rem;
  }
}

.product-hero-art figcaption a {
  color: var(--moss);
  font-weight: 500;
  text-underline-offset: 0.2em;
}

/* The sign-up field reads on every hour's sky. */

.closing .signup input {
  background: rgba(16, 38, 29, 0.5);
  border-color: rgba(251, 250, 243, 0.6);
}

.closing .signup input::placeholder {
  color: rgba(251, 250, 243, 0.82);
}

/* The market garden, at scale. */

.farm-scene {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 1 / 0.5;
  background: linear-gradient(#b7cbd2, #d0dad3 55%, #e8e2cc);
}

.farm-scene img {
  display: block;
  inline-size: 104%;
  max-inline-size: none;
  block-size: auto;
}

/* One divider per boundary: a tinted band is its own edge, so the hairline steps aside. */

.chapter-section--study::before,
.chapter-section--study + .ed-section::before,
.chapter-section--forest + .ed-section::before,
.about-stands::before,
.about-stands + .ed-section::before,
.compare-section + .ed-section::before {
  border-color: transparent;
}

@media (max-width: 600px) {
  /* Phone: sections part on less air. */

  main:has(.product-hero, .price-hero, .about-hero) .ed-section {
    padding-block: 3.25rem;
  }
}

/* The Farm plan's rule is gold: clay is the colour of the page's one button. */

.tiers-grid .tier:nth-child(3) {
  border-block-start-color: var(--fn-ochre);
}

/* The margin line under its headline on a phone; in the margin on a wide page. */

p.ed-aside.ed-aside--inline {
  display: none;
}

@media (max-width: 960px) {
  p.ed-aside.ed-aside--inline {
    display: block;
    max-inline-size: 30rem;
    margin-block: 0.75rem 1.25rem;
    font-size: 1.0625rem;
  }
}

@media (min-width: 1100px) {
  /* The closing's moon hangs clear of the headline. */

  .closing [data-garden-moon] {
    translate: -2.5rem -6.5rem;
  }
}
