/* ═══ Vincent William — The Farms
   A plain-scrolling page built around one hand-drawn map. On wide screens the
   map stays beside the text and redraws the road to whichever farm you are
   reading about; on phones each farm carries its own small road map. ═══ */
@font-face{font-family:"Newsreader";src:url("/fonts/Newsreader-normal.woff2") format("woff2");
  font-weight:200 800;font-style:normal;font-display:swap}
@font-face{font-family:"Newsreader";src:url("/fonts/Newsreader-italic.woff2") format("woff2");
  font-weight:200 800;font-style:italic;font-display:swap}

:root{
  --paper:#F4EEE3;
  --paper-2:#ECE4D5;
  --ink:#2B241B;
  --ink-2:rgba(43,36,27,.78);
  --muted:rgba(43,36,27,.55);
  --rule:rgba(43,36,27,.14);
  --soil:#8A5A33;
  --water:#DCE0D4;
  --hatch:#8E9C93;
  --sea:#5E7472;
  --cream:#F6F0E6;
  --serif:"Newsreader",Georgia,serif;
  --sans:ui-sans-serif,-apple-system,"Helvetica Neue",Arial,sans-serif;
  --out:cubic-bezier(.16,1,.3,1);
  --gut:clamp(20px,4.5vw,72px);
  --head:88px;
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--head) + 16px);background:var(--paper)}
body{margin:0;background:var(--paper);color:var(--ink);font:400 clamp(17px,.25vw + 15.6px,19px)/1.62 var(--serif);
  font-optical-sizing:auto;-webkit-font-smoothing:antialiased;overflow-x:clip}
img,video{display:block;max-width:100%;height:auto}
a{color:inherit}
h1,h2{font-family:var(--serif);font-weight:300;margin:0;letter-spacing:-.02em;line-height:1.04;text-wrap:balance}
em{font-style:italic}
p{margin:0 0 1em}
::selection{background:var(--soil);color:var(--cream)}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* ── header ── */
#top{position:sticky;top:0;z-index:30;height:var(--head);display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px;
  padding:0 var(--gut);background:rgba(244,238,227,.9);backdrop-filter:blur(10px);border-bottom:1px solid var(--rule)}
#top .logo img{height:58px;width:auto}
#top .book{display:flex;gap:10px;justify-self:end}
#top .book a,.btns a{font:500 12px/1 var(--sans);letter-spacing:.12em;text-transform:uppercase;text-decoration:none;color:inherit;
  border:1px solid currentColor;border-radius:999px;padding:0 20px;height:42px;display:inline-flex;align-items:center;white-space:nowrap;
  transition:background .25s,color .25s}
#top .book a:hover{background:var(--ink);color:var(--paper)}

/* ── layout: reading column + map column ── */
.page{max-width:1360px;margin:0 auto;padding:0 var(--gut);display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:clamp(32px,5vw,88px)}
.page > *:not(.map-col){grid-column:1}
.map-col{grid-column:2;grid-row:1 / span 9}
.atlas-map{position:sticky;top:calc(var(--head) + 20px);height:calc(100svh - var(--head) - 40px);margin:0;
  display:flex;align-items:center;justify-content:center}
.atlas-svg{width:auto;height:100%;max-width:100%}

/* ── intro ── */
.intro{padding:clamp(56px,10vh,110px) 0 clamp(40px,7vh,80px)}
.intro h1{font-size:clamp(46px,5.2vw,84px)}
.intro h1 em{color:var(--soil)}
.lede{margin:.8em 0 1.4em;max-width:30em;font-size:1.12em;color:var(--ink-2)}
.index{list-style:none;margin:0;padding:0;border-top:1px solid var(--rule)}
.index a{display:grid;grid-template-columns:1fr auto;align-items:baseline;gap:10px;padding:12px 4px;
  border-bottom:1px solid var(--rule);text-decoration:none;transition:background .3s,padding .4s var(--out)}
.index b{font-weight:400;font-size:1.1em}
.index i{color:var(--muted);font-size:.9em}
.index a:hover,.index a.on{padding-left:12px;background:var(--paper-2)}

/* ── a farm ── */
.farm{padding:clamp(48px,9vh,96px) 0;border-top:1px solid var(--rule)}
.lead{margin:0}
.lead img,.lead video{width:100%;aspect-ratio:3/2;object-fit:cover;border-radius:14px;background:var(--paper-2)}
.lead.paper img{aspect-ratio:3/2;object-fit:contain;padding:18px 0;background:var(--paper-2)}
figcaption{margin-top:8px;font-style:italic;font-size:.82em;line-height:1.4;color:var(--muted)}
.text{margin-top:30px}
.text h2{margin-bottom:.45em}
.text p{color:var(--ink-2)}
.farm h2{font-size:clamp(38px,3.6vw,56px)}
.visit{font-style:italic;color:var(--soil);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:5px}
.visit::after{content:" →"}
.visit:hover{color:var(--ink)}
.pair{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:32px}
.pair.one{grid-template-columns:minmax(0,.62fr)}
.pair figure{margin:0}
.pair img{width:100%;aspect-ratio:4/5;object-fit:cover;border-radius:12px}
.pair.one img{aspect-ratio:auto}

/* ── after the farms ── */
.also{padding:clamp(48px,9vh,96px) 0 clamp(70px,12vh,130px);border-top:1px solid var(--rule)}
.also h2{font-size:clamp(30px,2.8vw,42px);margin-bottom:.5em}
.also p{color:var(--ink-2)}
.close{position:relative;min-height:78svh;display:grid;place-items:center;padding:100px var(--gut);text-align:center;
  overflow:hidden;background:#1E1912;color:var(--cream)}
.close video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.62}
.close::before{content:"";position:absolute;inset:0;z-index:1;background:radial-gradient(90% 80% at 50% 50%,rgba(20,16,12,.2),rgba(20,16,12,.65))}
.close-in{position:relative;z-index:2;max-width:620px}
.close h2{font-size:clamp(44px,5vw,80px);margin-bottom:.3em}
.close p{color:rgba(246,240,230,.88)}
.btns{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-top:1.4em}
.btns a{height:46px;padding:0 24px}
.btns .solid{background:var(--cream);color:var(--ink);border-color:var(--cream)}
.btns a:hover{background:var(--cream);color:var(--ink)}
.btns .solid:hover{background:transparent;color:var(--cream)}
.credits{max-width:820px;margin:0 auto;padding:34px var(--gut) 44px;text-align:center;font-size:13px;line-height:1.6;color:var(--muted)}
.credits p{margin:0}

/* ── map ink ── */
.m-water{fill:var(--water)}
.m-hatch{stroke:var(--hatch);opacity:.5}
.m-ripple{fill:none;stroke:var(--hatch);stroke-width:1;opacity:.75;vector-effect:non-scaling-stroke;stroke-linejoin:round}
.m-ripple2{opacity:.4}
.m-land{fill:var(--paper)}
.m-border{fill:none;stroke:var(--ink);stroke-width:.8;stroke-dasharray:5 4;opacity:.28;vector-effect:non-scaling-stroke}
.m-river{fill:none;stroke:#6F8A8A;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.m-coast{fill:none;stroke:var(--ink);stroke-width:1.5;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.m-lake{font-family:var(--serif);font-style:italic;letter-spacing:.3em;fill:var(--sea)}
.m-rivername{font-family:var(--serif);font-style:italic;fill:var(--sea)}
.m-county{font-family:var(--serif);letter-spacing:.38em;fill:var(--ink);opacity:.3}
.m-town{font-family:var(--serif);font-style:italic;fill:var(--ink-2)}
.m-town-dot{fill:var(--ink)}
.m-road{fill:none;stroke:var(--soil);stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;
  transition:opacity .6s var(--out),stroke-width .6s var(--out)}
.js [data-draw] .m-road{transition:stroke-dashoffset 2.8s cubic-bezier(.45,.05,.25,1) calc(var(--i,0) * .5s + .2s),opacity .6s var(--out)}
[data-draw].drawn .m-road,html:not(.js) .m-road{stroke-dashoffset:0}
/* once a farm is in focus the opening draw is done: no stagger left to fight the redraw */
.js .atlas-map .settled .m-road{transition:opacity .6s var(--out),stroke-width .6s var(--out)}
.m-farm{fill:var(--paper);stroke:var(--ink);stroke-width:1.3;vector-effect:non-scaling-stroke;transition:fill .4s}
.m-farm-dot{fill:var(--soil)}
.m-inn{fill:var(--ink)}
.m-label{font-family:var(--serif);fill:var(--ink);transition:opacity .5s}
.m-innname{font-family:var(--serif);font-style:italic;fill:var(--ink)}
.m-pin{cursor:pointer}
.m-pin:hover .m-label,.m-pin.on .m-label{fill:var(--soil)}
.m-pin.on .m-farm{fill:var(--soil)}
.m-pin.on .m-farm-dot{fill:var(--paper)}
/* one farm in focus: its road stays, the rest fade back */
.atlas-svg.focus .m-road:not(.on){opacity:.3}
.atlas-svg.focus .m-road.on{stroke-width:3.4}
.atlas-svg.focus .m-pin:not(.on) .m-label{opacity:.35}

/* ── gentle reveals (only once farms.js runs) ── */
.js [data-reveal]{opacity:0;translate:0 22px;transition:opacity 1.1s var(--out),translate 1.1s var(--out)}
.js [data-reveal].in{opacity:1;translate:none}
@media (prefers-reduced-motion:reduce){
  .js [data-reveal]{opacity:1;translate:none;transition:none}
  .js [data-draw] .m-road{transition:none;stroke-dashoffset:0}
}

.deck,.map-credit{display:none}

/* ── phones and narrow tablets ── */
@media (max-width:979px){
  :root{--head:64px}
  #top{grid-template-columns:auto 1fr auto;padding:0 14px}
  #top .menu-label{display:none}
  #top .logo{justify-self:center}
  #top .logo img{height:40px}
  #top .book a{height:36px;padding:0 14px;font-size:11px}
  #top .book .room{display:none}
  /* without JavaScript: one plain column */
  .page{display:block}
  .map-col{margin:0 0 20px}
  .atlas-map{position:static;height:auto;display:block}
  .atlas-svg{width:100%;height:auto}
  .intro{padding-bottom:32px}

  /* with JavaScript: the winery-guide layout, a full map with cards on it */
  .js body{height:100svh;overflow:hidden;overscroll-behavior:none}
  .js .page > :not(.map-col),.js .close,.js .credits{display:none}
  .js .map-col{position:fixed;inset:var(--head) 0 0;margin:0;z-index:1;background:var(--water)}
  .js .atlas-map{position:absolute;inset:0;height:auto}
  .js .atlas-svg{width:100%;height:100%;max-width:none}
  .js .map-credit{display:block;position:absolute;z-index:2;top:8px;right:8px;margin:0;padding:4px 7px;border-radius:6px;
    background:rgba(244,238,227,.82);font:10px/1 var(--sans);color:var(--muted)}
  /* like the winery guide: only the farm in view is named; towns appear once the camera is close */
  .js .m-pin:not(.on) .m-label,.js .atlas-svg.focus .m-pin:not(.on) .m-label{opacity:0}
  .js .atlas-svg:not(.focus) :is(.m-town,.m-town-dot,.m-county,.m-rivername){opacity:0}
  .js .atlas-svg :is(.m-town,.m-town-dot,.m-county,.m-rivername){transition:opacity .6s var(--out)}

  .js .deck{display:flex;align-items:flex-end;gap:10px;position:fixed;left:0;right:0;bottom:0;z-index:5;
    padding:0 7vw calc(14px + env(safe-area-inset-bottom));overflow-x:auto;scroll-snap-type:x mandatory;
    scrollbar-width:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  .deck::-webkit-scrollbar{display:none}
  .card{flex:0 0 86vw;max-width:420px;scroll-snap-align:center;scroll-snap-stop:always;overflow:hidden;
    border-radius:18px;background:var(--paper);box-shadow:0 18px 40px -18px rgba(43,36,27,.55),0 0 0 1px var(--rule)}
  .card-img{width:100%;height:clamp(120px,19svh,170px);object-fit:cover}
  .card-img.paper{object-fit:contain;background:var(--paper-2);padding:8px 0}
  .card-body{padding:14px 18px 16px}
  .card h3,.card .card-title{margin:0 0 .2em;font:300 30px/1.05 var(--serif);letter-spacing:-.02em;color:var(--ink)}
  .card-title em{color:var(--soil)}
  .card p{margin:0;font-size:15px;line-height:1.45;color:var(--ink-2)}
  .card-actions{display:flex;justify-content:space-between;align-items:center;margin-top:14px}
  .card-actions .more{padding:8px 0;border:0;background:none;font:italic 16px/1 var(--serif);color:var(--soil);
    text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:5px;cursor:pointer}
  .card-actions .next{height:42px;padding:0 20px;border:0;border-radius:999px;background:var(--ink);color:var(--paper);
    font:500 12px/42px var(--sans);letter-spacing:.1em;text-transform:uppercase;text-decoration:none;cursor:pointer}
  .card.intro-card .card-title{font-size:36px;margin-bottom:.35em}
  .intro-card,.end-card{align-self:flex-end}
}

/* the farm story slides up from the bottom */
.sheet{position:fixed;inset:auto 0 0;width:100%;max-width:none;max-height:90svh;margin:0;padding:0;border:0;
  border-radius:20px 20px 0 0;background:var(--paper);color:var(--ink);overflow-y:auto;overscroll-behavior:contain;
  transform:translateY(100%);transition:transform .42s var(--out)}
.sheet.is-open{transform:none}
.sheet::backdrop{background:rgba(30,25,18,.42);opacity:0;transition:opacity .42s}
.sheet.is-open::backdrop{opacity:1}
.sheet-top{position:sticky;top:0;z-index:2;display:grid;place-items:center;height:46px;background:var(--paper);touch-action:none;cursor:grab}
.grip{width:42px;height:5px;border-radius:3px;background:rgba(43,36,27,.22)}
.sheet-close{position:absolute;right:12px;top:7px;height:32px;padding:0 12px;border:0;background:none;
  font:italic 16px/32px var(--serif);color:var(--soil);cursor:pointer}
.sheet-body{padding:0 20px calc(36px + env(safe-area-inset-bottom))}
.sheet .farm{padding:0;border:0}
.sheet .text{margin-top:20px}
.sheet .farm h2{font-size:38px}
.sheet .visit{display:inline-block;margin:0 18px 6px 0}
@media (prefers-reduced-motion:reduce){.sheet,.sheet::backdrop{transition:none}}
