/* ---------- Tokens ---------- */
:root {
  --mist:     #EEF1EA;  /* page */
  --sage:     #C8D4BE;  /* soft green surfaces */
  --fern:     #4E6B50;  /* green accent, buttons */
  --pine:     #1F2E25;  /* text */
  --lavender: #DCD4EA;  /* light purple surfaces */
  --heather:  #6E5F92;  /* purple accent, links, focus */
  --cream:    #FAF8F2;  /* cards, text on photos */

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);

  --shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 322 398'%3E%3Cpath d='M18 57 Q161 -10 304 57 C308 162 294 242 259 296 C235 335 199 363 161 381 C123 363 87 335 63 296 C28 242 14 162 18 57Z'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .18 0 0 0 0 .14 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--pine);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* paper grain over the whole page */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: var(--grain); opacity: .22; mix-blend-mode: multiply;
}
img { display: block; max-width: 100%; }
a { color: var(--heather); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--heather); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-weight: 350; line-height: 1.05; margin: 0; letter-spacing: -.01em; }

/* ---------- Background artwork ---------- */
.topo {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: var(--fern); opacity: .13;
  -webkit-mask: url("assets/topo.svg") center / cover no-repeat;
          mask: url("assets/topo.svg") center / cover no-repeat;
}
.topo-dark { background: var(--heather); opacity: .16; }
.sprig {
  position: absolute; pointer-events: none; z-index: 0;
  width: clamp(6rem, 12vw, 11rem); aspect-ratio: 260 / 600;
  background: var(--fern); opacity: .45;
  -webkit-mask: url("assets/sprig.svg") center / contain no-repeat;
          mask: url("assets/sprig.svg") center / contain no-repeat;
}
.framed { /* double line, like the crest */
  border: 1px solid var(--sage);
  outline: 1px solid var(--sage); outline-offset: -7px;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem var(--gutter);
  transition: background .4s, color .4s;
}
.nav.solid { background: color-mix(in srgb, var(--mist) 88%, transparent); backdrop-filter: blur(10px); box-shadow: 0 1px 0 color-mix(in srgb, var(--sage) 80%, transparent); }
.nav.on-photo:not(.solid) { color: var(--cream); }
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-size: 1.15rem; }
.crest {
  width: 1.6rem; height: 2rem; background: currentColor;
  -webkit-mask: url("assets/crest.svg") center / contain no-repeat;
          mask: url("assets/crest.svg") center / contain no-repeat;
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: inherit; text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }
.pill { padding: .45rem 1.1rem; border-radius: 999px; border: 1px solid currentColor; }
.pill:hover { text-decoration: none !important; background: var(--lavender); color: var(--pine); border-color: var(--lavender); }

/* ---------- Hero: film inside the shield ---------- */
.hero { height: 230vh; position: relative; }
.hero-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.topo-hero { opacity: .16; }
.window {
  --h: 52vh;
  position: absolute; inset: 0; z-index: 1;
  -webkit-mask: var(--shield) center 30% / auto var(--h) no-repeat;
          mask: var(--shield) center 30% / auto var(--h) no-repeat;
}
.film { position: absolute; inset: 0; background: var(--sage); }
.film .frame {
  position: absolute; inset: 0; background: center / cover no-repeat;
  opacity: 0; transition: opacity 2.4s ease;
}
.film .frame.on { opacity: 1; animation: drift 14s ease-out forwards; }
@keyframes drift { from { transform: scale(1.12) translate(1.5%, 1%); } to { transform: scale(1) translate(0, 0); } }
.film video { width: 100%; height: 100%; object-fit: cover; }
.film::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,32,24,.62), rgba(20,32,24,0) 55%);
  opacity: var(--shade, 0);
}
.hills {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 30vh; z-index: 2;
  transform: translateY(calc(var(--sink, 0) * 100%));
}
.hills .h1 { fill: var(--lavender); }
.hills .h2 { fill: var(--sage); }
.hills .h3 { fill: var(--mist); }

.hero-copy {
  position: absolute; left: 0; right: 0; bottom: 5vh; z-index: 3;
  text-align: center; padding: 0 var(--gutter); color: var(--pine);
}
.hero-copy.light { color: var(--cream); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 4.4rem); font-weight: 300; transition: color .5s; }
.hero-copy p { margin: .6rem 0 0; font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-style: italic; transition: color .5s; }

/* ---------- Intro ---------- */
.intro { position: relative; padding: clamp(5rem, 11vw, 8rem) var(--gutter); overflow: hidden; }
.intro > * { position: relative; z-index: 1; }
.intro .topo, .intro .sprig { position: absolute; z-index: 0; }
.sprig-l { left: -1rem; top: 2rem; transform: rotate(-12deg); }
.sprig-r { right: -1rem; bottom: 1rem; transform: scaleX(-1) rotate(-8deg); background: var(--heather); opacity: .35; }
.intro-text {
  max-width: 28ch; margin: 0 auto; text-align: center;
  font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.35; font-weight: 300;
}
.always {
  list-style: none; padding: 0; margin: clamp(3rem, 7vw, 5rem) auto 0; max-width: 62rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem;
}
.always li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem; font-size: 1.05rem; }
.always svg {
  width: 3.6rem; height: 3.6rem; padding: .8rem; border-radius: 50%;
  background: var(--cream); fill: none; stroke: var(--fern); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  box-shadow: 0 0 0 1px var(--sage), 0 0 0 6px var(--cream), 0 0 0 7px var(--sage);
}
.always li:nth-child(even) svg { stroke: var(--heather); }

/* ---------- Houses ---------- */
.houses { position: relative; padding: 2rem 0 7rem; scroll-margin-top: 4rem; }
.section-title { text-align: center; font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 300; margin-bottom: 2.5rem; }
.tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 13rem)); justify-content: center;
  gap: clamp(.75rem, 3vw, 2.5rem); padding: 0 var(--gutter) 3.5rem;
}
.tab {
  font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--pine);
  display: flex; flex-direction: column; align-items: center; gap: .55rem; text-align: center;
}
.tab .arch {
  width: 100%; aspect-ratio: 4 / 5; border-radius: 999px 999px 1rem 1rem; overflow: hidden;
  box-shadow: 0 0 0 1px var(--sage), 0 0 0 6px var(--mist), 0 0 0 7px var(--sage);
  transition: box-shadow .35s, filter .35s;
  filter: saturate(.55) brightness(1.04);
}
.tab .arch img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.tab:hover .arch img { transform: scale(1.05); }
.tab .t-name { font-size: clamp(1.5rem, 3vw, 2.2rem); font-style: italic; font-weight: 300; line-height: 1; }
.tab .t-place { font-size: .95rem; color: color-mix(in srgb, var(--pine) 65%, transparent); line-height: 1.3; }
.tab[aria-selected="true"] .arch {
  filter: none;
  box-shadow: 0 0 0 2px var(--heather), 0 0 0 7px var(--mist), 0 0 0 8px var(--heather);
}
.tab[aria-selected="true"] .t-name { color: var(--heather); }

.house { position: relative; animation: show .6s ease; }
@keyframes show { from { opacity: 0; } to { opacity: 1; } }

.strip-wrap { position: relative; z-index: 1; }
.strip {
  display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--gutter); scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.shot {
  flex: 0 0 auto; height: clamp(16rem, 58vh, 34rem); aspect-ratio: 4 / 3;
  border: 0; padding: 0; margin: 0; cursor: zoom-in; background: var(--sage);
  border-radius: 1.25rem; overflow: hidden; scroll-snap-align: center;
}
.shot:first-child { aspect-ratio: 3 / 4; border-radius: 999px 999px 1.25rem 1.25rem; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.shot:hover img { transform: scale(1.04); }
.strip-btn {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 3rem; height: 3rem; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--cream); color: var(--pine); font-size: 1.6rem; line-height: 1;
  box-shadow: 0 6px 20px rgba(31,46,37,.15);
}
.strip-btn.prev { left: calc(var(--gutter) - 1.5rem); }
.strip-btn.next { right: calc(var(--gutter) - 1.5rem); }
.strip-btn:hover { background: var(--lavender); }

.house-body {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem); padding: 3.5rem var(--gutter) 0; max-width: 78rem; margin: 0 auto;
}
.house-body > * { position: relative; z-index: 1; }
.bignum {
  position: absolute !important; z-index: 0 !important; left: calc(var(--gutter) + 8rem); top: 1.5rem;
  font-size: clamp(14rem, 28vw, 26rem); line-height: .8; font-weight: 300; font-style: italic;
  color: transparent; -webkit-text-stroke: 1.5px var(--heather); opacity: .3;
  pointer-events: none; user-select: none;
}
.house-body h2 { font-size: clamp(3rem, 7vw, 5.4rem); font-weight: 300; font-style: italic; }
.house-line { font-size: 1.35rem; font-style: italic; margin: .6rem 0 1.25rem; color: var(--fern); }
.facts { display: flex; flex-wrap: wrap; gap: .2rem 0; margin: 0 0 1.4rem; font-size: 1rem; color: color-mix(in srgb, var(--pine) 72%, transparent); }
.facts span + span::before { content: ""; display: inline-block; width: .3rem; height: .3rem; border-radius: 50%; background: var(--heather); margin: 0 .75rem .2rem; }
.house-about { max-width: var(--measure); margin: 0; line-height: 1.75; }
.features {
  list-style: none; padding: 0; margin: 2rem 0 0; max-width: var(--measure);
  display: grid; grid-template-columns: 1fr 1fr; gap: .55rem 1.5rem; font-size: 1.02rem;
}
.features li { display: flex; gap: .65rem; align-items: baseline; }
.features li::before { /* small leaf */
  content: ""; flex: 0 0 auto; width: .7rem; height: .7rem; translate: 0 .05rem;
  background: var(--fern); border-radius: 0 100% 0 100%; transform: rotate(-10deg);
}
.features li:nth-child(even)::before { background: var(--heather); }

/* Ratings */
.ratings { display: grid; gap: 1rem; align-content: start; }
.rating {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .25rem 1.25rem;
  padding: 1.5rem 1.75rem; border-radius: 1.25rem; text-decoration: none; color: var(--pine);
  background: var(--cream); transition: background .3s;
}
a.rating:hover { background: #fff; }
.rating .score { grid-row: span 2; font-size: 3.2rem; font-weight: 300; line-height: 1; font-variant-numeric: lining-nums; }
.rating .score small { font-size: 1.1rem; color: color-mix(in srgb, var(--pine) 55%, transparent); }
.rating .src { font-size: 1.15rem; }
.rating .meta { font-size: .95rem; color: color-mix(in srgb, var(--pine) 65%, transparent); }
.rating.empty .score { font-size: 2rem; color: var(--heather); }
.stars { color: var(--fern); letter-spacing: .1em; }
.quote { position: relative; margin: 0; padding: 1.6rem 1.75rem 1.4rem 3.4rem; background: var(--lavender); border-radius: 1.25rem; }
.quote::before { content: "“"; position: absolute; left: 1.1rem; top: .5rem; font-size: 4rem; line-height: 1; color: var(--heather); }
.quote p { margin: 0; font-size: 1.25rem; font-style: italic; line-height: 1.45; }
.quote cite { display: block; margin-top: .6rem; font-style: normal; font-size: .95rem; color: var(--heather); }
.house-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }

/* Getting there */
.route {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 78rem; margin: clamp(4rem, 8vw, 6rem) auto 0; padding: 0 var(--gutter); align-items: center;
}
.map {
  border-radius: 1.5rem; overflow: hidden; background: var(--sage); padding: 7px; background-clip: padding-box;
}
.map iframe {
  display: block; width: 100%; height: clamp(18rem, 48vh, 28rem); border: 0; border-radius: 1.1rem;
  filter: saturate(.6) sepia(.12) hue-rotate(10deg) contrast(.96);
}
.route h3 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; }
.route .from { font-style: italic; color: var(--fern); font-size: 1.2rem; margin: .5rem 0 1.25rem; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .9rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2rem 1fr; gap: .9rem; align-items: start; line-height: 1.5; }
.steps li::before {
  content: counter(s); width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--lavender); color: var(--heather); font-size: 1rem; font-style: italic;
}
.route .note { font-size: .95rem; color: color-mix(in srgb, var(--pine) 65%, transparent); margin: 1rem 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 999px; font: inherit; font-size: 1.05rem;
  text-decoration: none; cursor: pointer; border: 1px solid var(--fern);
  background: var(--fern); color: var(--cream); transition: background .25s, color .25s;
}
.btn:hover { background: var(--pine); border-color: var(--pine); }
.btn.ghost { background: transparent; color: var(--fern); }
.btn.ghost:hover { background: var(--sage); color: var(--pine); border-color: var(--sage); }

/* ---------- Book ---------- */
.book {
  position: relative; background: var(--lavender);
  padding: clamp(3rem, 7vw, 5rem) var(--gutter) clamp(4rem, 8vw, 6rem);
  margin-top: 6rem; scroll-margin-top: 4rem;
}
.book > * { position: relative; z-index: 1; }
.book .edge { position: absolute; left: 0; bottom: calc(100% - 1px); width: 100%; height: clamp(3rem, 8vw, 7rem); fill: var(--lavender); z-index: 0; }
.book .topo, .book .sprig { position: absolute; z-index: 0; }
.sprig-book { right: 2vw; top: -4rem; background: var(--heather); opacity: .4; transform: rotate(14deg); }
.book h2 { font-size: clamp(2.6rem, 6vw, 4.6rem); text-align: center; font-weight: 300; }
.book-lede { text-align: center; max-width: 36ch; margin: 1rem auto 3rem; font-size: 1.25rem; }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; max-width: 72rem; margin: 0 auto; }
.book-card { background: var(--cream); border-radius: 999px 999px 1.5rem 1.5rem; padding: .6rem; display: flex; flex-direction: column; }
.book-card img { aspect-ratio: 4 / 4.2; object-fit: cover; width: 100%; border-radius: 999px 999px 1rem 1rem; }
.book-card .in { padding: 1.25rem 1rem 1rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; text-align: center; align-items: center; }
.book-card h3 { font-size: 2.2rem; font-style: italic; font-weight: 300; }
.book-card .mini { font-size: 1rem; color: color-mix(in srgb, var(--pine) 70%, transparent); margin: 0; }
.book-card .house-cta { margin-top: auto; padding-top: .5rem; justify-content: center; }
.book-card .btn { padding: .6rem 1.2rem; font-size: 1rem; }
.contact { text-align: center; margin-top: 3.5rem; font-size: 1.2rem; }
.contact:empty { display: none; }
.contact a { color: var(--pine); }
.contact span + span::before { content: ""; display: inline-block; width: .35rem; height: .35rem; border-radius: 50%; background: var(--heather); margin: 0 1rem .2rem; }

/* ---------- Footer ---------- */
.footer { background: var(--lavender); text-align: center; padding: 1rem var(--gutter) 3rem; color: var(--pine); }
.logo-full {
  display: inline-block; width: 9rem; height: 9.6rem; background: var(--heather);
  -webkit-mask: url("assets/logo.svg") center / contain no-repeat;
          mask: url("assets/logo.svg") center / contain no-repeat;
}
.footer p { margin: .5rem 0 0; font-size: .95rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgba(20, 30, 24, .94); color: var(--cream);
  display: none; align-items: center; justify-content: center;
}
.lightbox[open] { display: flex; animation: show .3s ease; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; max-width: min(92vw, 1400px); }
.lightbox img { max-height: 82vh; width: auto; margin: 0 auto; border-radius: .75rem; }
.lightbox figcaption { text-align: center; font-style: italic; margin-top: .9rem; opacity: .85; }
.lb-close, .lb-nav { position: absolute; background: none; border: 0; color: inherit; cursor: pointer; font-family: var(--serif); }
.lb-close { top: 1rem; right: 1.5rem; font-size: 2.5rem; line-height: 1; }
.lb-nav { top: 50%; translate: 0 -50%; font-size: 3.5rem; padding: 1rem; }
.lb-prev { left: 1rem; } .lb-next { right: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .house-body, .route { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr; max-width: 24rem; }
  .strip-btn { display: none; }
  .shot { height: auto; width: 82vw; }
  .nav-links a:not(.pill) { display: none; }
  .window { -webkit-mask-position: center 28%; mask-position: center 28%; }
  .always { grid-template-columns: 1fr 1fr; gap: 2rem 1rem; }
  .tab .t-place { display: none; }
  .bignum { top: 0; }
  .features { grid-template-columns: 1fr; }
  .sprig-l { top: auto; bottom: -2rem; }
  .hills { height: 20vh; }
  .lb-nav { font-size: 2.5rem; padding: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .film .frame.on { animation: none; }
  .house, .lightbox[open] { animation: none; }
}
