:root {
  color-scheme: light dark;
  --paper: #f4efe4;
  --ink: #1c211c;
  --muted: #646a61;
  --line: rgba(28, 33, 28, 0.18);
  --panel: rgba(255,255,255,0.55);
  --accent: #355c3a;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: inherit; }
.site-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}
.wordmark { font-family: system-ui, sans-serif; letter-spacing: .12em; text-decoration: none; font-size: .82rem; }
nav { display: flex; gap: 1rem; font-family: system-ui, sans-serif; font-size: .9rem; }
nav a { text-decoration: none; }
main:not(.viewer-stage) { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.hero { padding: clamp(5rem, 12vw, 10rem) 0 5rem; max-width: 900px; }
.eyebrow { font-family: system-ui, sans-serif; text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; color: var(--muted); }
h1 { font-size: clamp(3rem, 8vw, 7.5rem); line-height: .95; font-weight: 500; margin: .35em 0; }
.lede { font-size: clamp(1.2rem, 2.2vw, 1.8rem); line-height: 1.45; max-width: 42rem; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }
.button { display: inline-block; padding: .8rem 1rem; border: 1px solid var(--line); text-decoration: none; font-family: system-ui, sans-serif; border-radius: 999px; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.states { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.states article { background: var(--paper); padding: 1.25rem; min-height: 180px; }
.states span { font-size: 1.8rem; }
h2, h3 { font-weight: 500; }
.states h2 { margin-bottom: .25rem; }
.states p, .work-card p, .cultivate p { color: var(--muted); line-height: 1.5; }
.section { padding: 7rem 0; }
.section-heading { max-width: 44rem; margin-bottom: 2rem; }
.section-heading h2, .cultivate h2 { font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: 1; margin: .3em 0; }
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.work-card { border: 1px solid var(--line); padding: 1.5rem; min-height: 220px; text-decoration: none; background: var(--panel); }
.work-card:hover { border-color: var(--accent); }
.work-card span { font-size: 2rem; }
.work-card h3 { font-size: 1.8rem; margin: 1rem 0 .4rem; }
.cultivate { padding: 5rem 0 8rem; border-top: 1px solid var(--line); }
.cultivate p { max-width: 46rem; font-size: 1.1rem; }
footer { border-top: 1px solid var(--line); padding: 2rem clamp(1rem, 4vw, 4rem); color: var(--muted); font-family: system-ui, sans-serif; }

/* Full-screen Harvest reader */
.viewer-page {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #1d211c;
  color: white;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  overscroll-behavior: none;
  touch-action: pan-y;
}

.reader-chrome {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto 0;
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  align-items: center;
  gap: .75rem;
  padding: max(.75rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .75rem max(.75rem, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(12,14,12,.76), rgba(12,14,12,.28), transparent);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.chrome-visible .reader-chrome {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.reader-icon {
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(22,25,21,.52);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  text-decoration: none;
  font: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}

.reader-back span { font-size: 2.3rem; line-height: .8; margin-top: -.14rem; }
.reader-menu span { font-size: 1rem; letter-spacing: .1em; transform: translateY(-.12rem); }
.reader-title { text-align: center; line-height: 1.12; text-shadow: 0 1px 10px rgba(0,0,0,.65); }
.reader-title strong { display: block; font-size: .96rem; }
.reader-title span { display: block; margin-top: .12rem; font-size: .72rem; opacity: .72; }

.viewer-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: max(.25rem, env(safe-area-inset-top)) max(.25rem, env(safe-area-inset-right)) max(.25rem, env(safe-area-inset-bottom)) max(.25rem, env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 42%, #33382f 0, #20241e 55%, #161915 100%);
  user-select: none;
  -webkit-user-select: none;
}

.book-spread {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
  justify-items: center;
  perspective: 1800px;
}

.pdf-page {
  background: white;
  aspect-ratio: 210 / 297;
  width: auto;
  height: min(100%, calc(100vw * 1.414));
  max-width: 50%;
  max-height: 100%;
  box-shadow: 0 12px 50px rgba(0,0,0,.46);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.pdf-page canvas { width: 100%; height: 100%; object-fit: contain; }

.viewer-status {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.placeholder-cover {
  width: min(92vw, 54vh);
  aspect-ratio: 210 / 297;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  color: #f4efe4;
  background:
    radial-gradient(circle at 50% 30%, rgba(133,157,116,.28), transparent 30%),
    linear-gradient(155deg, #283126, #11150f 72%);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 60px rgba(0,0,0,.5);
}
.placeholder-cover .eyebrow { color: rgba(244,239,228,.65); }
.placeholder-cover h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(3.2rem, 15vw, 7rem); margin: .25em 0 .1em; }
.placeholder-year { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-size: 1.4rem; }
.placeholder-note { max-width: 15rem; margin-top: auto; margin-bottom: 1.5rem; opacity: .65; font-size: .86rem; line-height: 1.45; }

.page-zone {
  position: absolute;
  z-index: 12;
  top: 16%;
  bottom: 16%;
  width: 22%;
  border: 0;
  background: transparent;
  color: transparent;
  -webkit-tap-highlight-color: transparent;
}
.page-zone-prev { left: 0; }
.page-zone-next { right: 0; }

.chrome-control {
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.chrome-visible .chrome-control { opacity: 1; pointer-events: auto; }

.reader-progress {
  position: absolute;
  z-index: 30;
  left: max(1rem, env(safe-area-inset-left));
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(.65rem, env(safe-area-inset-bottom));
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.24);
}
.reader-progress span { display: block; width: 0; height: 100%; background: rgba(255,255,255,.9); transition: width .18s ease; }

.page-indicator {
  position: absolute;
  z-index: 31;
  left: 50%;
  bottom: max(1.15rem, calc(env(safe-area-inset-bottom) + .5rem));
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: .42rem .75rem;
  color: white;
  background: rgba(15,18,14,.56);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font: 600 .78rem/1 ui-sans-serif, system-ui, sans-serif;
}

.sheet-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.reader-sheet {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78dvh, 620px);
  overflow-y: auto;
  padding: .55rem max(1rem, env(safe-area-inset-right)) max(1rem, calc(env(safe-area-inset-bottom) + .5rem)) max(1rem, env(safe-area-inset-left));
  color: #171916;
  background: rgba(246,244,238,.97);
  border-radius: 1.4rem 1.4rem 0 0;
  box-shadow: 0 -14px 50px rgba(0,0,0,.28);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.sheet-handle { width: 2.5rem; height: .3rem; margin: 0 auto .55rem; border-radius: 999px; background: rgba(25,27,24,.22); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; min-height: 2.8rem; }
.sheet-header h2 { margin: 0; font-size: 1.12rem; font-weight: 700; }
.sheet-done { border: 0; background: transparent; color: #315f3a; font: 700 1rem/1 inherit; padding: .75rem 0 .75rem 1rem; }
.sheet-section { padding: 1rem 0; border-top: 1px solid rgba(23,25,22,.12); }
.sheet-section h3 { margin: 0 0 .75rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: #676b64; font-weight: 700; }
.page-stepper { display: grid; grid-template-columns: 2.7rem auto 4.2rem auto 2.7rem; align-items: center; justify-content: center; gap: .45rem; }
.page-stepper button { width: 2.7rem; height: 2.7rem; border: 0; border-radius: 999px; background: #e6e4de; color: #171916; font-size: 1.7rem; }
.page-stepper label { font-weight: 600; }
.page-stepper input { width: 4.2rem; border: 1px solid rgba(23,25,22,.16); border-radius: .65rem; padding: .55rem .4rem; background: white; color: #171916; text-align: center; font: inherit; }
.page-stepper span { color: #676b64; white-space: nowrap; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; padding: .2rem; border-radius: .75rem; background: #e4e2dc; }
.segmented-control button { border: 0; border-radius: .6rem; padding: .7rem .55rem; background: transparent; color: #3d403b; font: 600 .86rem/1.2 inherit; }
.segmented-control button[aria-pressed="true"] { background: white; color: #171916; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.sheet-actions { display: grid; gap: .55rem; }
.sheet-actions a { display: block; padding: .8rem 1rem; border-radius: .75rem; color: #315f3a; background: white; text-align: center; text-decoration: none; font-weight: 650; }

@media (max-width: 760px), (orientation: portrait) {
  .site-header { align-items: flex-start; }
  nav { flex-wrap: wrap; justify-content: flex-end; }
  .states { grid-template-columns: 1fr; }
  .states article { min-height: auto; }
  .work-grid { grid-template-columns: 1fr; }
  .book-spread { grid-template-columns: 1fr; }
  .pdf-page { width: min(100%, calc(100dvh / 1.414)); height: auto; max-width: 100%; max-height: 100%; }
  .pdf-page.secondary { display: none; }
}

@media (min-width: 761px) and (orientation: landscape) {
  .reader-sheet { left: auto; right: 1rem; bottom: 1rem; width: min(390px, calc(100% - 2rem)); border-radius: 1.25rem; padding-bottom: 1rem; }
  .book-spread { padding: 1rem 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
