/* ============================================================
   sanders.farm — "Warm farmhouse, four seasons"
   Plain CSS, no build step. Self-hosted assets only (CSP-safe).
   ============================================================ */

:root {
  --bg:        #faf6ef;   /* cream / linen */
  --ink:       #2b2117;   /* warm brown/charcoal text */
  --ink-soft:  #6b5d4b;
  --sage:      #6b8e5a;   /* primary accent */
  --clay:      #c06a4b;   /* secondary accent */
  --card:      #fffdf8;
  --line:      #e3d9c6;
  --shadow:    rgba(60, 45, 25, .14);

  --accent:    var(--sage);
  --accent-2:  var(--clay);

  /* friendly serif headings — drop a self-hosted Fraunces in /fonts/ + @font-face
     and add `font-src 'self';` to _headers to upgrade. Georgia is the graceful fallback. */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Seasonal accent tints (body.season-*) ---------- */
body.season-spring { --accent:#5fa05a; --accent-2:#c7864b; }
body.season-summer { --accent:#7ba23f; --accent-2:#e0a32e; }
body.season-autumn { --accent:#b5642d; --accent-2:#9c7b2e; }
body.season-winter { --accent:#5d7d6f; --accent-2:#7d8a86; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
  background-color: var(--bg);
  /* subtle paper/linen texture, pure CSS (no external image) */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(107,142,90,.05), transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(192,106,75,.05), transparent 60%),
    repeating-linear-gradient(45deg, rgba(120,100,70,.018) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(-45deg, rgba(120,100,70,.018) 0 2px, transparent 2px 4px);
  min-height: 100vh;
}

h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; }

a { color: var(--accent); }
a:hover { color: var(--accent-2); }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 20;
  background: var(--card); padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.muted { color: var(--ink-soft); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: clamp(2.5rem, 7vw, 5rem) 1.25rem 2rem;
  position: relative;
}
.hero h1 {
  font-size: clamp(2.2rem, 7vw, 4rem);
  margin: .4rem 0 .3rem;
  color: var(--ink);
}
.welcome { font-size: 1.2rem; margin: 0 0 .25rem; }
.sub-line { margin: 0 auto .9rem; max-width: 38ch; color: var(--ink-soft); }

.hero-art { color: var(--accent); height: 120px; margin: 0 auto; }
.motif { width: 120px; height: 120px; display: none; }
body.season-spring .motif-spring,
body.season-summer .motif-summer,
body.season-autumn .motif-autumn,
body.season-winter .motif-winter { display: inline-block; }
/* fallback if no season class yet */
body:not([class*="season-"]) .motif-summer { display: inline-block; }

.almanac-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .6rem 1.2rem;
  display: inline-block;
  max-width: 90%;
  box-shadow: 0 4px 14px var(--shadow);
}
.almanac-line .saying { color: var(--accent-2); }

/* seed easter-egg button */
.seed {
  font: inherit; background: none; border: none; cursor: pointer;
  padding: 0 .1rem; line-height: 1; transition: transform .15s ease;
}
.seed:hover { transform: translateY(-2px) rotate(-8deg); }
.seed.sprouting { animation: pop .4s ease; }
@keyframes pop { 50% { transform: scale(1.6) rotate(12deg); } }

.bloom {
  position: fixed; pointer-events: none; font-size: 1.4rem;
  animation: floatUp 1.6s ease-out forwards; z-index: 30;
}
@keyframes floatUp {
  to { transform: translateY(-90px) rotate(40deg); opacity: 0; }
}

/* ---------- Sections ---------- */
main { max-width: 1000px; margin: 0 auto; padding: 0 1.25rem 1rem; }
.section { margin: 2.4rem 0; }
.section h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0 0 .15rem; color: var(--ink); }
.section h2 .leaf { color: var(--accent); }
.section-note { margin: 0 0 1.1rem; color: var(--ink-soft); }

.grid { display: grid; gap: 1rem; }
.folks-grid  { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.barn-grid   { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.field-grid  { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.garden-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- "Wooden sign" cards ---------- */
.sign {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 6px 16px var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
a.sign { text-decoration: none; color: inherit; display: block; }
.sign:hover { transform: translateY(-4px); box-shadow: 0 12px 24px var(--shadow); }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 1.6rem;
  color: var(--ink-soft);
  background: rgba(255,255,255,.4);
}

/* folks */
.folk { text-align: center; }
.folk .avatar {
  width: 64px; height: 64px; border-radius: 50%;
  margin: 0 auto .5rem; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 1.4rem; font-weight: 700;
  font-family: var(--serif);
}
.folk .name { font-weight: 700; font-family: var(--serif); }
.folk .role { color: var(--accent-2); font-size: .9rem; text-transform: lowercase; }
.folk .status { font-size: .85rem; color: var(--ink-soft); margin-top: .35rem; }

/* barn links */
.barn-link { text-align: center; }
.barn-link .icon { font-size: 1.8rem; display: block; margin-bottom: .3rem; }
.barn-link .label { font-weight: 600; }

/* field photos */
.photo { aspect-ratio: 4 / 3; overflow: hidden; padding: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.placeholder {
  display: grid; place-items: center; color: var(--ink-soft);
  background: repeating-linear-gradient(45deg, rgba(107,142,90,.08) 0 10px, transparent 10px 20px);
}

/* garden */
.garden-item .title { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.garden-item .blurb { color: var(--ink-soft); margin: .3rem 0 .6rem; }
.tag {
  display: inline-block; font-size: .75rem; font-weight: 700;
  padding: .15rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}
.tag.planted   { background: #e7d8c2; color: #7a5a30; }
.tag.growing   { background: #d6e7c8; color: #486b34; }
.tag.harvested { background: #f0d6cb; color: #9c4b2e; }

.stub p { margin: .3rem 0; }

/* ---------- Footer ---------- */
.footer {
  text-align: center; padding: 2rem 1.25rem 3rem; margin-top: 1.5rem;
  border-top: 1px solid var(--line); color: var(--ink-soft);
}
.footer .emails { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }
.footer .made { margin-top: .6rem; font-size: .9rem; }

/* mark [FILL IN] placeholders so Ryan can spot them */
[data-fill] { box-shadow: inset 0 -2px 0 rgba(192,106,75,.35); }

/* ---------- Micro-motion ---------- */
.sway { transform-origin: 60px 110px; animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.rays { animation: spin 60s linear infinite; transform-origin: 60px 58px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fireflies (night only) ---------- */
.fireflies { position: fixed; inset: 0; pointer-events: none; z-index: 1; display: none; }
.fireflies span {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #ffe9a8; box-shadow: 0 0 8px 2px rgba(255,233,168,.8);
  opacity: 0; animation: glow 6s ease-in-out infinite;
}
.fireflies span:nth-child(1){ left: 12%; top: 30%; animation-delay: 0s; }
.fireflies span:nth-child(2){ left: 28%; top: 60%; animation-delay: 1.2s; }
.fireflies span:nth-child(3){ left: 45%; top: 20%; animation-delay: 2.1s; }
.fireflies span:nth-child(4){ left: 62%; top: 50%; animation-delay: .6s; }
.fireflies span:nth-child(5){ left: 78%; top: 35%; animation-delay: 3s; }
.fireflies span:nth-child(6){ left: 88%; top: 70%; animation-delay: 1.8s; }
.fireflies span:nth-child(7){ left: 20%; top: 80%; animation-delay: 2.6s; }
.fireflies span:nth-child(8){ left: 55%; top: 78%; animation-delay: .3s; }
.fireflies span:nth-child(9){ left: 70%; top: 15%; animation-delay: 3.6s; }
.fireflies span:nth-child(10){ left: 38%; top: 42%; animation-delay: 4.2s; }
@keyframes glow {
  0%, 100% { opacity: 0; transform: translateY(0); }
  20%, 60% { opacity: 1; }
  50% { transform: translateY(-18px); }
}

/* ---------- Barn cat (Konami) ---------- */
.barn-cat {
  position: fixed; bottom: 8px; left: -60px; font-size: 2rem; z-index: 40;
  pointer-events: none;
}
.barn-cat.run { animation: walk 7s linear forwards; }
@keyframes walk {
  to { left: calc(100% + 60px); }
}

/* ============================================================
   Dark "evening" variant — warm dusk palette + fireflies
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #161a12;
    --ink:      #ece6d6;
    --ink-soft: #b3ab95;
    --card:     #20261b;
    --line:     #353d2c;
    --shadow:   rgba(0, 0, 0, .45);
    --sage:     #8fae72;
    --clay:     #d98a64;
  }
  body.season-spring { --accent:#88b06d; --accent-2:#d59060; }
  body.season-summer { --accent:#a6c065; --accent-2:#e6b552; }
  body.season-autumn { --accent:#cf8048; --accent-2:#c0a04f; }
  body.season-winter { --accent:#7fa091; --accent-2:#9aa6a0; }

  .fireflies { display: block; }
  .folk .avatar { color: #161a12; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .fireflies span { opacity: .7; }
}
