/* greenfield.css — standalone prototype. Scroll-driven day -> night.
   Lives ALONGSIDE the production site; touches nothing in style.css. */

/* ─── tokens (most are live-driven by greenfield.js) ─────────────────────── */
:root {
  --fg:        rgb(22 22 18);
  --muted:     rgb(60 64 56);
  --line:      rgba(22, 22, 18, 0.16);
  --accent:    rgb(22 22 18);
  --surface:   rgba(250, 250, 245, 0.50);

  /* sky tint gradient stops (soft-light over the photo) */
  --sky-top:    rgba(150, 190, 255, 0.10);
  --sky-mid:    rgba(160, 200, 255, 0.04);
  --sky-ground: rgba(120, 160, 90, 0.06);

  /* photo grade + night overlay */
  --photo-bright:   1.05;
  --photo-sat:      1.06;
  --photo-contrast: 1.0;
  --night:          0;
  --glow:           rgba(255, 240, 200, 1);
  --glow-a:         0;
  --halo:           rgba(255, 255, 255, 0.55);

  --maxw: 1180px;
  --pad:  2.8vw;
  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);

  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ─── reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  background: #1a2230; /* fallback while the photo loads */
  transition: color 120ms linear;
}

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

/* legibility halo — keeps text readable directly on the photo, no visible box */
.nav-inner, .intro-lede, .intro-links, .scroll-cue,
.section-head h2, .section-blurb, .post-row, .footer {
  text-shadow: 0 1px 18px var(--halo), 0 0 3px var(--halo);
}

/* ─── fixed sky ──────────────────────────────────────────────────────────── */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  isolation: isolate;       /* keep blend modes off the page content */
  overflow: hidden;
  pointer-events: none;
}
.sky > * { position: absolute; inset: 0; }

.sky-photo {
  background: url('img/greenfield.jpg') center 58% / cover no-repeat;
  filter: brightness(var(--photo-bright)) saturate(var(--photo-sat)) contrast(var(--photo-contrast));
  will-change: filter;
}
.sky-tint {
  background: linear-gradient(
    to bottom,
    var(--sky-top) 0%,
    var(--sky-mid) 62%,
    var(--sky-ground) 100%
  );
  mix-blend-mode: color; /* recolor sky hue, keep the photo's light structure */
}
.sky-glow {
  background: radial-gradient(125% 62% at 50% 64%, var(--glow) 0%, transparent 58%);
  opacity: var(--glow-a);
  mix-blend-mode: screen;
}
.sky-night {
  background: rgb(10 14 34);
  opacity: var(--night);
  mix-blend-mode: multiply;
}

/* ─── layout ─────────────────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* ─── nav ────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: transparent;
}
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px var(--pad);
  max-width: var(--maxw); margin: 0 auto;
}
.nav-side { display: flex; align-items: center; }
.nav-side-right { justify-content: flex-end; }
.nav-brand {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg);
}
.nav-links { display: flex; gap: 26px; justify-content: center; }
.nav-links a {
  color: var(--muted);
  transition: color 200ms var(--ease);
}
.nav-links a:hover,
.nav-links a:focus-visible { color: var(--fg); outline: none; }
.clock { color: var(--muted); }

/* ─── intro (first viewport, centered) ───────────────────────────────────── */
.intro {
  position: relative;
  min-height: calc(100svh - 64px);
  display: grid;
  place-items: center;
  text-align: center;
}
.intro-card {
  max-width: 680px;
  transform: translateY(-9vh); /* center within the sky, above the horizon */
}
.intro-lede {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(19px, 2.1vw, 26px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 28px;
}
.intro-lede a {
  border-bottom: 1px solid var(--accent);
  transition: opacity 200ms var(--ease);
}
.intro-lede a:hover { opacity: 0.7; }
.intro-links {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 15px;
}
.intro-links a {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.intro-links a:hover,
.intro-links a:focus-visible { color: var(--fg); border-color: var(--fg); outline: none; }

.scroll-cue {
  position: absolute;
  left: 0; right: 0;
  bottom: 3.5vh;
  display: grid;
  place-items: center;
  color: var(--fg);
}
.scroll-cue svg { display: block; animation: cue 2.6s var(--ease) infinite; }
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50%      { transform: translateY(6px); opacity: 1; }
}

/* ─── home sheet (sections injected by site.js) ──────────────────────────── */
.home-sheet { display: block; }

.section {
  padding: clamp(56px, 12vh, 130px) 0;
  scroll-margin-top: 92px; /* land below the nav with sky above the title */
  text-align: center;
}
.section-head {
  margin-bottom: 28px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0;
}
.section-head .mono { display: none; } /* redundant with the title */
.section-blurb {
  color: var(--muted);
  max-width: 48ch;
  margin: 10px auto 0;
}

.posts {
  display: flex; flex-direction: column;
  align-items: center;
  list-style: none; margin: 0; padding: 0;
}
.post-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 6px 16px;
  padding: 11px 0;
}
.post-row .date { color: var(--muted); font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.02em; text-transform: uppercase; }
.post-row .title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(17px, 1.6vw, 21px);
  color: var(--fg);
  letter-spacing: -0.01em;
}
.post-row .arrow {
  color: var(--muted);
  transition: transform 280ms var(--ease), color 200ms var(--ease);
}
.post-row:hover .title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.post-row:hover .arrow { transform: translateX(4px); color: var(--fg); }

/* ─── footer ─────────────────────────────────────────────────────────────── */
.footer {
  margin-top: 56px;
  padding: 36px clamp(20px, 3vw, 40px) 56px;
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 20px;
}
.footer .mono a { color: var(--muted); transition: color 200ms var(--ease); }
.footer .mono a:hover { color: var(--fg); }

/* ─── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .nav-links { gap: 16px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue svg { animation: none; }
}
