/* ==========================================================================
   Fonts (self-hosted, Latin subset)
   ========================================================================== */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

@font-face {
  font-family: "Shadows Into Light Two";
  src: url("assets/fonts/shadows-into-light-two.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* ==========================================================================
   Design tokens: a garden sketch on graph paper
   ========================================================================== */
:root {
  --paper: #f4f5f0;          /* graph paper */
  --grid: #dfe7e3;           /* graph paper lines */
  --ink: #23303a;            /* fineliner */
  --ink-soft: #4e5b63;       /* secondary text, 6.3:1 on paper */
  --red: #c8473a;            /* marker: parcel boundary, fruit, focus outline, active callout */
  --red-text: #b8402f;       /* red for text and button hover, 5.0:1 on paper */
  --leaf: #7fa36b;           /* pencil: fruit trees */
  --canopy: #5f8a55;         /* pencil: large nut trees */
  --shrub: #a3bd7f;          /* pencil: shrubs */
  --hedge: #6d8f5a;          /* pencil: hedge */
  --herb: #c9cf7a;           /* pencil: beds and herbs */
  --meadow: #dcd98f;         /* pencil: flower meadow */
  --bloom: #d9a520;          /* pencil: flowers */
  --water: #7fb0c9;          /* pencil: ditch and pond */
  --sand: #e3d6b8;           /* pencil: paths and shed */
  --sand-dark: #d2b07c;      /* pencil: 1 ha hatching */

  --font-body: "Bricolage Grotesque", system-ui, sans-serif;
  --font-hand: "Shadows Into Light Two", "Segoe Print", "Bradley Hand", cursive;

  /* Type scale (Bringhurst: 18, 21, 24, 36, 48, 72+) */
  --text-s: 0.875rem;
  --text-m: 1.125rem;
  --text-l: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --text-2xl: clamp(2.25rem, 1.6rem + 2.8vw, 3.75rem);
  --text-3xl: clamp(3.75rem, 1.8rem + 8vw, 8rem);

  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --space-xl: clamp(4rem, 2.5rem + 6vw, 8rem);

  --container: 78rem;
  --cell: 24px;              /* graph paper cell */
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-m);
  font-optical-sizing: auto;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

figure {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.05;
  text-wrap: balance;
}

p {
  margin: 0 0 var(--space-s);
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--red-text);
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ==========================================================================
   Button
   ========================================================================== */
.button {
  display: inline-block;
  padding: 0.8em 1.4em;
  background: var(--ink);
  color: var(--paper);
  border-radius: 3px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.button:hover {
  background: var(--red-text);
  color: var(--paper);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   Sketches (inline SVG made by tools/sketch.py)
   ========================================================================== */
.sketch-defs {
  position: absolute;
}

.sketch {
  width: 100%;
  height: auto;
  overflow: visible;
}

.sketch .ink {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.sketch .thin { stroke-width: 1; }
.sketch .hair { stroke-width: 0.7; }
.sketch .thick { stroke-width: 2.6; }

.boundary {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.2;
  stroke-dasharray: 10 7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.sketch .hatch-sand {
  fill: none;
  stroke: var(--sand-dark);
  stroke-width: 1.8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.sketch .fill-ink { fill: var(--ink); }
.sketch .fill-fruit { fill: var(--red); }
.sketch .fill-bloom { fill: var(--bloom); }
.sketch .fill-herb { fill: var(--herb); opacity: 0.75; }
.sketch .fill-leaf { fill: var(--leaf); opacity: 0.8; }
.sketch .fill-canopy { fill: var(--canopy); opacity: 0.75; }
.sketch .fill-shrub { fill: var(--shrub); opacity: 0.85; }
.sketch .fill-hedge { fill: var(--hedge); opacity: 0.8; }
.sketch .fill-meadow { fill: var(--meadow); opacity: 0.7; }
.sketch .fill-water { fill: var(--water); opacity: 0.75; }
.sketch .fill-sand { fill: var(--sand); }

.sketch .path-band {
  fill: none;
  stroke: var(--sand);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sketch .hand {
  font-family: var(--font-hand);
  fill: var(--ink);
  stroke: var(--paper);
  stroke-width: 1.4;
  stroke-linejoin: round;
  paint-order: stroke;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-block: var(--space-m) var(--space-xl);
}

.hero-grid {
  display: grid;
  gap: var(--space-l);
  align-items: center;
}

.hero h1 {
  margin-bottom: var(--space-m);
  margin-left: -0.04em;
  font-size: var(--text-3xl);
  font-weight: 800;
  font-stretch: 80%;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.slogan {
  max-width: 32ch;
  margin-bottom: var(--space-m);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.2;
}

.intro {
  max-width: 64ch;
  margin-bottom: var(--space-s);
  color: var(--ink-soft);
}

.hero-text .button-row {
  margin-top: var(--space-l);
}

.hero-sketch {
  display: grid;
  gap: var(--space-m);
  width: 100%;
  max-width: 21rem;
  justify-self: center;
}

/* The parcel boundary draws itself once; the rest follows */
.reveal-path {
  fill: none;
  stroke: #fff;
  stroke-width: 16;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation: draw 1.8s cubic-bezier(0.6, 0, 0.3, 1) 0.3s forwards;
}

.draw-late {
  opacity: 0;
  animation: appear 0.8s ease 1.7s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes appear {
  to { opacity: 1; }
}

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: var(--space-xl);
    align-items: start;
  }
}

/* ==========================================================================
   Vision: plan with four themes
   ========================================================================== */
.vision {
  padding-bottom: var(--space-xl);
}

.vision-grid {
  display: grid;
  gap: var(--space-l);
}

.themes {
  display: grid;
  gap: var(--space-l);
}

.theme h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-s);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.2;
}

.theme p,
.about-text p {
  max-width: 36rem;
  color: var(--ink-soft);
}

.marker {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  font-family: var(--font-hand);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.marker svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.marker svg,
.callout .ink {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  transition: stroke 300ms ease;
}

.sketch .callout-bg {
  fill: var(--paper);
}

.sketch .callout-num {
  stroke-width: 0;
  transition: fill 300ms ease;
}

/* Small screens: the plan is too small for its labels; the texts explain it */
@media (max-width: 40rem) {
  .sketch .lbl {
    display: none;
  }
}

@media (min-width: 60rem) {
  .vision-grid {
    grid-template-columns: minmax(0, 2fr) minmax(20rem, 1fr);
    gap: var(--space-l);
  }

  /* main.js sets --plan-h so the stuck plan is centered on screen */
  .plan {
    position: sticky;
    top: max(1rem, calc((100svh - var(--plan-h, 100svh)) / 2));
    align-self: start;
  }

  .plan .sketch {
    max-height: calc(100svh - 2rem);
  }

  .themes {
    gap: 0;
  }

  /* Each theme gets room to scroll, so the plan can follow along */
  .theme {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 70vh;
  }

  /* main.js sets --plan-top so the first heading lines up with the top of the drawing */
  .theme:first-child {
    min-height: auto;
    padding-top: var(--plan-top, 0px);
    padding-bottom: 15vh;
  }

  /* Tall enough that the plan stays in place while this text is centered */
  .theme:last-child {
    min-height: 100vh;
  }

  /* main.js sets data-active on the plan; without it, all zones show */
  .plan .zone {
    transition: opacity 400ms ease;
  }

  .plan[data-active] .zone {
    opacity: 0.22;
  }

  .plan[data-active="1"] .zone[data-zone="1"],
  .plan[data-active="2"] .zone[data-zone="2"],
  .plan[data-active="3"] .zone[data-zone="3"],
  .plan[data-active="4"] .zone[data-zone="4"] {
    opacity: 1;
  }

  .plan[data-active="1"] .callout[data-zone="1"] .ink,
  .plan[data-active="2"] .callout[data-zone="2"] .ink,
  .plan[data-active="3"] .callout[data-zone="3"] .ink,
  .plan[data-active="4"] .callout[data-zone="4"] .ink,
  .theme.is-active .marker svg {
    stroke: var(--red);
  }

  .plan[data-active="1"] .callout[data-zone="1"] .callout-num,
  .plan[data-active="2"] .callout[data-zone="2"] .callout-num,
  .plan[data-active="3"] .callout[data-zone="3"] .callout-num,
  .plan[data-active="4"] .callout[data-zone="4"] .callout-num {
    fill: var(--red);
  }
}

/* ==========================================================================
   About: a photo print pinned on the graph paper
   ========================================================================== */
.about {
  padding-bottom: var(--space-xl);
}

.about-grid {
  display: grid;
  gap: var(--space-l);
  align-items: center;
}

.about-photo {
  width: 100%;
  max-width: 18rem;
  justify-self: center;
  padding: 0.6rem 0.6rem 0;
  background: #fff;
  box-shadow: 0 1px 2px rgb(35 48 58 / 0.18), 0 8px 24px rgb(35 48 58 / 0.12);
  transform: rotate(-1.5deg);
}

.about-photo img {
  width: 100%;
  height: auto;
}

.about-photo figcaption {
  padding-block: 0.5rem 0.7rem;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  line-height: 1;
  text-align: center;
}

@media (min-width: 60rem) {
  .about-grid {
    grid-template-columns: 22rem minmax(0, 1fr);
    gap: var(--space-xl);
  }

  .about-photo {
    max-width: none;
  }
}

/* ==========================================================================
   Contact: the call to action sits inside an empty parcel
   ========================================================================== */
.contact {
  padding-block: var(--space-l) var(--space-xl);
}

.contact-parcel {
  position: relative;
  max-width: 46rem;
  margin-inline: auto;
  padding: var(--space-xl) var(--space-l);
}

.contact-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.contact-dim {
  position: absolute;
  padding-inline: 0.4em;
  background: var(--paper);
  font-family: var(--font-hand);
  font-size: 1.25rem;
  line-height: 1;
}

.contact-dim-w {
  top: 0;
  left: 50%;
  transform: translate(-50%, -55%);
}

.contact-dim-h {
  top: 50%;
  right: 0;
  transform: translate(50%, -50%) rotate(-90deg);
}

.about h2,
.contact h2 {
  margin-bottom: var(--space-m);
  font-size: var(--text-2xl);
  font-stretch: 85%;
}

.contact p {
  max-width: 40ch;
  margin-bottom: var(--space-l);
  font-size: var(--text-l);
  line-height: 1.45;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: var(--text-s);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-m);
  padding-block: var(--space-m);
}

.site-footer p {
  margin: 0;
}

/* ==========================================================================
   Reduced motion: show everything at once
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-path {
    animation: none;
    stroke-dashoffset: 0;
  }

  .draw-late {
    animation: none;
    opacity: 1;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
