/* D J Sommer Homes. Mobile first. Colours from their logo: the mint of the lettering, the ochre of the timber
   sketch, the black of the outline. The motif is the skillion roof in that sketch: one edge that rises, used on
   pictures and rules. Two halves play against each other down every page. */

@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-italic-400.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #ffffff;
  --paper-2: #f6f4ef;
  --ink: #191b18;
  --ink-2: #4a4d47;
  --ink-3: #6b6e66;
  --line: #e4e0d7;
  --mint: #88c4ab;
  --mint-wash: #e9f3ee;
  --mint-deep: #2b6b53;
  --mint-deeper: #1f5340;
  --ochre: #9c8433;
  --ochre-text: #7a6524;
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --fall: 7%;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --hd: 64px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--hd) + 12px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.62 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--mint-deep); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--mint-deeper); }
:focus-visible { outline: 2px solid var(--mint-deep); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.02; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding: 0; margin: 0; list-style: none; }
button { font: inherit; color: inherit; }
fieldset { min-width: 0; min-inline-size: 0; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 4px; text-decoration: none; }
.skip:focus { top: 1rem; color: #fff; }

/* the spine: one hairline down the middle of the page on wide screens */
@media (min-width: 960px) {
  body::before { content: ""; position: fixed; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line); z-index: -1; }
}

/* ---- type ---- */
.label { display: inline-flex; align-items: center; gap: .7em; font: 600 .6875rem/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 1.4rem; }
.label::before { content: ""; width: 1.9em; height: 1px; background: var(--ochre); transform: rotate(-7deg); transform-origin: left; }
.label.plain::before { display: none; }
.huge { font-size: clamp(3.2rem, 15vw, 9.5rem); line-height: .9; letter-spacing: -.035em; }
.big { font-size: clamp(2.5rem, 10vw, 6rem); line-height: .95; letter-spacing: -.03em; }
.mid { font-size: clamp(1.9rem, 6vw, 3.4rem); line-height: 1; }
.serif-i { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.lede { font-size: clamp(1.08rem, 2.6vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 34em; }
.small { font-size: .875rem; color: var(--ink-3); }
.caption { font: 500 .6875rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: .7rem 0 0; }

/* ---- layout ---- */
.wrap { padding-inline: var(--gutter); max-width: 1440px; margin-inline: auto; }
.section { padding-block: clamp(3.2rem, 10vw, 8.5rem); }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.half { min-width: 0; }
@media (min-width: 960px) {
  .split { grid-template-columns: 1fr 1fr; gap: 0; }
  .split > .half { padding-inline: var(--gutter); }
  .split > .half:first-child { padding-left: 0; }
  .split > .half:last-child { padding-right: 0; }
}
.tint { background: var(--paper-2); }

/* the skillion edge: pictures whose top edge rises to the right, like the roof in their logo */
.skillion { clip-path: polygon(0 var(--fall), 100% 0, 100% 100%, 0 100%); }
.frame { position: relative; overflow: hidden; background: var(--paper-2); }
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 52px; padding: .85rem 1.5rem; border-radius: 999px; border: 1px solid transparent; font: 600 1rem/1.1 var(--sans); text-decoration: none; cursor: pointer; transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn-call { background: var(--mint-deep); color: #fff; }
.btn-call:hover { background: var(--mint-deeper); color: #fff; }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-quiet { padding-inline: 0; min-height: 44px; color: var(--ink); border-radius: 0; background: none; border: 0; border-bottom: 1px solid var(--ochre); }
.btn-quiet:hover { color: var(--mint-deep); }
.btns { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }
.arrow { transition: transform .3s var(--ease); }
a:hover .arrow, button:hover .arrow { transform: translateX(3px); }

/* ---- the header ---- */
.hd { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); border-bottom: 1px solid transparent; transition: transform .35s var(--ease), border-color .3s, box-shadow .3s; }
@supports (backdrop-filter: blur(8px)) { .hd { background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.4) blur(12px); } }
.hd-in { display: flex; align-items: center; gap: 1rem; height: var(--hd); }
.brand { display: block; flex: none; line-height: 0; }
.brand img { width: 118px; height: auto; mix-blend-mode: multiply; }
.hd .nav { display: none; }
.hd-call { margin-left: auto; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; border-radius: 999px; background: var(--mint-deep); color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; }
.hd-call:hover { background: var(--mint-deeper); color: #fff; }
.hd-call svg { width: 1.05em; height: 1.05em; }
.hd-call .num { display: none; }
.menu { position: relative; }
.menu > summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; border-radius: 999px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary span, .menu > summary span::before, .menu > summary span::after { display: block; width: 20px; height: 1.5px; background: var(--ink); position: relative; transition: transform .3s var(--ease); }
.menu > summary span::before, .menu > summary span::after { content: ""; position: absolute; left: 0; }
.menu > summary span::before { top: -6px; }
.menu > summary span::after { top: 6px; }
.menu[open] > summary span { background: transparent; }
.menu[open] > summary span::before { transform: translateY(6px) rotate(45deg); }
.menu[open] > summary span::after { transform: translateY(-6px) rotate(-45deg); }
.menu-panel { position: fixed; left: 0; right: 0; top: var(--hd); bottom: 0; background: var(--paper); padding: 1.5rem var(--gutter) 7rem; overflow-y: auto; border-top: 1px solid var(--line); }
.menu-panel a { display: block; padding: .55rem 0; font: 500 clamp(1.7rem, 7vw, 2.4rem)/1.15 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.menu-panel a[aria-current="page"] { color: var(--mint-deep); }
.menu-panel .label { margin: 1.8rem 0 .4rem; }
.menu-panel .sub a { font: 400 1.05rem/1.4 var(--sans); padding: .45rem 0; color: var(--ink-2); }
.hd.is-scrolled { border-bottom-color: var(--line); }
.hd.is-hidden { transform: translateY(-100%); }
@media (min-width: 1080px) {
  .menu { display: none; }
  .hd .nav { display: flex; gap: clamp(1rem, 2vw, 2rem); margin-left: auto; }
  .hd .nav a { color: var(--ink); text-decoration: none; font-size: .95rem; padding: .5rem 0; position: relative; }
  .hd .nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: .2rem; height: 1px; background: var(--ochre); transform: scaleX(0) rotate(-2deg); transform-origin: left; transition: transform .35s var(--ease); }
  .hd .nav a:hover::after, .hd .nav a[aria-current="page"]::after { transform: scaleX(1) rotate(-2deg); }
  .hd-call { margin-left: 1.5rem; }
  .hd-call .num { display: inline; }
  .hd-call .word { display: none; }
  .brand img { width: 132px; }
  .hd.is-hidden { transform: none; }
}

/* ---- the tape: the page's progress, drawn as a tape measure blade pulled out along the top ---- */
.tape { position: fixed; left: 0; right: 0; top: 0; height: 5px; z-index: 60; pointer-events: none; }
.tape i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0);
  background:
    repeating-linear-gradient(90deg, rgba(25, 27, 24, .55) 0 1px, transparent 1px 10px) bottom / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, rgba(25, 27, 24, .8) 0 1px, transparent 1px 50px) bottom / 100% 4px no-repeat,
    #d8bf6a; }
.tape b { position: absolute; top: 0; width: 14px; height: 9px; border-radius: 0 0 3px 3px; background: var(--ink); left: 0; transform: translateX(-14px); }
@supports (animation-timeline: scroll()) {
  .tape i { animation: tape-out linear both; animation-timeline: scroll(root); }
  .tape b { animation: tape-case linear both; animation-timeline: scroll(root); }
}
@keyframes tape-out { to { transform: scaleX(1); } }
@keyframes tape-case { to { left: 100%; } }

/* ---- phone bar: the number never leaves a phone screen ---- */
.bar { position: fixed; left: .6rem; right: .6rem; bottom: calc(.6rem + env(safe-area-inset-bottom)); z-index: 45; display: grid; grid-template-columns: 1.15fr 1fr; gap: .5rem; padding: .45rem; border-radius: 999px; background: rgba(25, 27, 24, .94); box-shadow: 0 10px 30px rgba(25, 27, 24, .25); transition: transform .4s var(--ease), opacity .4s; }
.bar a, .bar button { display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 48px; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 0; cursor: pointer; }
.bar .b-call { background: var(--mint); color: var(--ink); }
.bar .b-brief { background: transparent; color: #fff; }
.bar svg { width: 1.05em; height: 1.05em; }
.bar.is-away { transform: translateY(140%); opacity: 0; }
@media (min-width: 1080px) { .bar { display: none; } }
body { padding-bottom: 84px; }
@media (min-width: 1080px) { body { padding-bottom: 0; } }

/* ---- the opening ---- */
.open { padding-top: clamp(.9rem, 3vw, 3rem); }
.open-grid { display: grid; gap: 1.2rem; grid-template-areas: "text" "pic" "trust"; }
.open-text { grid-area: text; }
.open .where { font: 600 .6875rem/1.3 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 1rem; }
.open h1 { font-size: clamp(4.4rem, 27vw, 15rem); line-height: .82; letter-spacing: -.045em; margin-left: -.04em; }
.open h1 .dot { color: var(--mint); }
.open .who { margin: 1rem 0 .7rem; }
.open .who img { width: 132px; mix-blend-mode: multiply; }
.open .what { font-size: clamp(1.02rem, 3vw, 1.4rem); line-height: 1.45; color: var(--ink); max-width: 30em; margin-bottom: 1.1rem; }
.open .btns { gap: .5rem 1.2rem; }
.open .trust { grid-area: trust; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 1.4rem 0 0; font-size: .875rem; color: var(--ink-2); }
.open .trust li { display: flex; align-items: center; gap: .5rem; }
.open .trust li::before { content: ""; width: 9px; height: 9px; background: var(--mint); clip-path: polygon(0 35%, 100% 0, 100% 100%, 0 100%); }
.open-pic { grid-area: pic; position: relative; aspect-ratio: 1 / .78; margin: .6rem 0 1rem; }
.open-pic .frame { position: absolute; inset: 0; }
.open-pic img { animation: drift 28s var(--ease) both; transform-origin: 60% 70%; }
.open-pic figcaption { position: absolute; left: 0; bottom: -1.9rem; margin: 0; }
@keyframes drift { from { transform: scale(1.12) translate3d(-1.5%, 1%, 0); } to { transform: scale(1.01) translate3d(0, 0, 0); } }
/* on the home page the header's logo waits until the opening has scrolled by: the town comes first */
.hd.on-home .brand { transition: opacity .4s var(--ease), visibility .4s; }
.hd.on-home:not(.is-scrolled) .brand { opacity: 0; visibility: hidden; }
@media (max-width: 959px) { .open .btn-quiet { min-height: 40px; } }
@media (min-width: 960px) {
  .open { padding-top: clamp(1.5rem, 4vw, 3.5rem); }
  .open-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; grid-template-areas: "text pic" "trust pic"; gap: 0; min-height: calc(100svh - var(--hd) - 2rem); padding-bottom: 3rem; }
  .open-text { padding-right: var(--gutter); align-self: center; }
  .open h1 { font-size: clamp(6rem, 12vw, 13.5rem); }
  .open .where { margin-bottom: 1.6rem; }
  .open .who { margin: 1.6rem 0 1.2rem; }
  .open .who img { width: 170px; }
  .open .trust { padding-right: var(--gutter); margin-top: 2rem; }
  .open-pic { aspect-ratio: auto; height: 100%; min-height: 520px; margin: 0 calc(-1 * var(--gutter)) 0 0; }
}

/* ---- section heads ---- */
.head { display: grid; gap: 1rem; margin-bottom: clamp(1.6rem, 5vw, 3.5rem); }
.head .lede { margin: 0; }
@media (min-width: 960px) { .head.split { align-items: end; } }

/* ---- two ways of building (home) ---- */
.ways-tabs { position: relative; display: flex; gap: .4rem; margin: 0 0 1.4rem; border: 0; padding: 0; }
.ways-tabs label { flex: 1; text-align: center; padding: .75rem .6rem; border-radius: 999px; border: 1px solid var(--line); font-size: .9rem; font-weight: 600; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s; }
.ways input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ways:has(#way-a:checked) label[for="way-a"], .ways:has(#way-b:checked) label[for="way-b"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ways:has(#way-a:focus-visible) label[for="way-a"], .ways:has(#way-b:focus-visible) label[for="way-b"] { outline: 2px solid var(--mint-deep); outline-offset: 2px; }
.way { display: none; }
.ways:has(#way-a:checked) .way-a, .ways:has(#way-b:checked) .way-b { display: block; }
.way h3 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 .4rem; }
.way > p { color: var(--ink-2); max-width: 30em; }
.way-pics { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.2rem; }
.way-pics a { display: block; text-decoration: none; color: inherit; }
.way-pics a:first-child { grid-column: 1 / -1; }
.way-pics .frame { aspect-ratio: 3 / 2; }
.way-pics a:first-child .frame { clip-path: polygon(0 var(--fall), 100% 0, 100% 100%, 0 100%); }
.way-pics img { transition: transform .9s var(--ease); }
.way-pics a:hover img { transform: scale(1.035); }
.way-pics .caption { margin-top: .45rem; }
@media (max-width: 959px) {
  .way-pics { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) .4rem; scrollbar-width: none; }
  .way-pics::-webkit-scrollbar { display: none; }
  .way-pics a { scroll-snap-align: start; scroll-margin-left: var(--gutter); }
  .way-pics a:first-child { grid-column: auto; }
  .way-pics a:first-child .frame { clip-path: none; }
  .way > p { margin-bottom: .2rem; }
  .way h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (min-width: 960px) {
  .ways-tabs { display: none; }
  .way { display: block !important; }
}

/* ---- swipe rows ---- */
.row { display: grid; grid-auto-flow: column; grid-auto-columns: min(82%, 380px); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--gutter) 1rem; margin-inline: calc(-1 * var(--gutter)); scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior-x: contain; }
.row > * { scroll-snap-align: start; scroll-margin-left: var(--gutter); }
@media (min-width: 1200px) { .row.five { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; margin: 0; padding: 0; } }

/* ---- the build, in five steps ---- */
.step { display: block; color: inherit; text-decoration: none; }
.step .frame { aspect-ratio: 4 / 3; border-radius: 2px; }
.step .n { font: 500 .6875rem/1 var(--sans); letter-spacing: .2em; color: var(--ochre-text); margin: 1rem 0 .5rem; display: block; }
.step h3 { font-size: 1.6rem; margin-bottom: .4rem; }
.step p { font-size: .95rem; color: var(--ink-2); margin: 0; }

/* ---- what clients say ---- */
.say { margin: 0; }
.say blockquote { margin: 0; font: 400 clamp(1.6rem, 5vw, 2.6rem)/1.18 var(--serif); font-style: italic; letter-spacing: -.01em; text-wrap: pretty; }
.say blockquote::before { content: "\201C"; display: block; font: 500 5rem/0.6 var(--serif); font-style: normal; color: var(--mint); margin-bottom: .6rem; }
.say figcaption { margin-top: 1.4rem; font-size: .95rem; color: var(--ink-2); }
.facts { display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts > div { padding: 1.2rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .25rem; }
.facts dt { font: 600 .6875rem/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
.facts dd { margin: 0; font: 500 1.35rem/1.25 var(--serif); }
.facts dd a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--ochre); }
.from-site { font-size: .8125rem; color: var(--ink-3); margin-top: 1.2rem; }
.minis { margin-top: 1.8rem; }
@media (min-width: 960px) { .minis { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; margin: 0; padding: 0; gap: .8rem; } }
.mini { background: var(--paper); border: 1px solid var(--line); padding: 1.4rem 1.4rem 1.2rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; min-height: 100%; }
.mini p { font: 400 1.12rem/1.42 var(--serif); font-style: italic; margin: 0; }
.mini span { font-size: .875rem; color: var(--ink-2); }

/* ---- talk to the builder ---- */
.talk h2 { margin-bottom: 1.2rem; }
.contact-list { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.contact-list a, .contact-list div { display: grid; gap: .15rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.contact-list span { font: 600 .6875rem/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
.contact-list b { font: 500 clamp(1.5rem, 5vw, 2.3rem)/1.1 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; }
.contact-list a:hover b { color: var(--mint-deep); }
.contact-list a.email b { font-size: clamp(1.15rem, 4.2vw, 1.8rem); }

/* ---- inner page openings ---- */
.page-open { padding-block: clamp(1.5rem, 5vw, 4rem) clamp(2.5rem, 6vw, 5rem); }
.page-open .crumbs { font-size: .8125rem; color: var(--ink-3); margin-bottom: 1.6rem; }
.page-open .crumbs a { color: var(--ink-3); }
.page-open h1 { font-size: clamp(3rem, 13vw, 8.5rem); line-height: .9; letter-spacing: -.04em; }
.page-open .lede { margin-top: 1.4rem; }
.page-pic { aspect-ratio: 3 / 2; margin-top: 2rem; }
.page-pic img { view-transition-name: carry; }
@media (min-width: 960px) {
  .page-open .split { align-items: end; }
  .page-pic { margin-top: 0; }
}

/* ---- long text ---- */
.prose { max-width: 38em; }
.prose h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin: 2.6rem 0 1rem; }
.prose h3 { font-size: 1.45rem; margin: 2rem 0 .6rem; }
.prose ul { list-style: none; margin: 0 0 1.2em; }
.prose ul li { position: relative; padding-left: 1.4rem; margin-bottom: .45rem; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .62em; width: .7rem; height: 1px; background: var(--ochre); transform: rotate(-7deg); }
.prose > :first-child { margin-top: 0; }

/* ---- service cards / links between pages ---- */
.tiles { display: grid; gap: 1.6rem; }
@media (min-width: 720px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .tiles.three { grid-template-columns: repeat(3, 1fr); } }
.tile { display: block; color: inherit; text-decoration: none; }
.tile .frame { aspect-ratio: 3 / 2; }
.tile img { transition: transform .9s var(--ease); }
.tile:hover img { transform: scale(1.035); }
.tile h3 { font-size: 1.7rem; margin: 1rem 0 .35rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.tile p { color: var(--ink-2); margin: 0; font-size: .98rem; }
.tile .arrow { width: 1.1rem; flex: none; color: var(--ochre); }

/* ---- steps on the build process page ---- */
.chapters { display: grid; gap: clamp(3rem, 8vw, 6rem); }
.chapter { display: grid; gap: 1.6rem; }
.chapter .frame { aspect-ratio: 4 / 3; }
.chapter .n { font: 500 clamp(4rem, 14vw, 8rem)/.8 var(--serif); color: var(--mint); letter-spacing: -.04em; display: block; margin-bottom: .6rem; }
.chapter h2 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 1rem; }
@media (min-width: 960px) {
  .chapter { grid-template-columns: 1fr 1fr; gap: 0; align-items: center; }
  .chapter > div { padding-left: var(--gutter); }
  .chapter:nth-child(even) .frame { order: 2; }
  .chapter:nth-child(even) > div { padding-left: 0; padding-right: var(--gutter); }
}

/* ---- the gallery ---- */
.filters { position: relative; display: flex; gap: .4rem; overflow-x: auto; padding: 0 var(--gutter) .3rem; margin: 0 calc(-1 * var(--gutter)) 1.6rem; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filters label { flex: none; padding: .65rem 1.05rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background-color .25s, color .25s, border-color .25s; }
.filters label small { font-weight: 500; color: var(--ink-3); margin-left: .3rem; }
.filters input:checked + label { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters input:checked + label small { color: rgba(255, 255, 255, .7); }
.filters input:focus-visible + label { outline: 2px solid var(--mint-deep); outline-offset: 2px; }
.gal { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (min-width: 720px) { .gal { grid-template-columns: repeat(3, 1fr); gap: .9rem; } }
@media (min-width: 1200px) { .gal { grid-template-columns: repeat(4, 1fr); } }
.gal li { min-width: 0; }
.gal a { display: block; color: inherit; text-decoration: none; }
.gal .frame { aspect-ratio: 3 / 2; }
.gal img { transition: transform .9s var(--ease); }
.gal a:hover img { transform: scale(1.04); }
.gal .caption { margin-top: .4rem; }
.gal li.wide { grid-column: span 2; }
.gal li.wide .frame { clip-path: polygon(0 var(--fall), 100% 0, 100% 100%, 0 100%); }
.gallery:has(#f-slope:checked) .gal li:not([data-tags~="slope"]),
.gallery:has(#f-rural:checked) .gal li:not([data-tags~="rural"]),
.gallery:has(#f-modern:checked) .gal li:not([data-tags~="modern"]),
.gallery:has(#f-general:checked) .gal li:not([data-tags~="general"]) { display: none; }
.gallery:has(#f-all:not(:checked)) .gal li.wide { grid-column: auto; }
.gallery:has(#f-all:not(:checked)) .gal li.wide .frame { clip-path: none; }

/* the picture, opened large */
.lightbox { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100%; background: rgba(246, 244, 239, .97); color: var(--ink); }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: .8rem var(--gutter); }
.lb-pic { display: grid; place-items: center; padding: 0 var(--gutter); min-height: 0; }
.lb-pic img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; view-transition-name: lb; }
.lb-cap { padding: 1rem var(--gutter) 1.6rem; max-width: 46em; }
.lb-cap b { display: block; font: 500 1.5rem/1.2 var(--serif); }
.lb-cap p { color: var(--ink-2); margin: .3rem 0 0; font-size: .95rem; }
.lb-nav { display: flex; gap: .4rem; }
.icon-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---- forms and the drawer ---- */
.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .4rem; font-size: .875rem; font-weight: 600; color: var(--ink); }
.form input, .form textarea { width: 100%; font: 400 1rem/1.4 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid #cfcabf; border-radius: 6px; padding: .85rem .9rem; min-height: 50px; }
.form textarea { resize: vertical; min-height: 110px; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--mint-deep); outline-offset: 0; border-color: var(--mint-deep); }
.form .two { display: grid; gap: 1rem; }
@media (min-width: 560px) { .form .two { grid-template-columns: 1fr 1fr; } }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .8125rem; color: var(--ink-3); margin: 0; }
.notes { display: none; background: var(--mint-wash); border-left: 2px solid var(--mint-deep); padding: .8rem 1rem; font-size: .92rem; }
.notes.has { display: block; }
.notes b { display: block; font: 600 .6875rem/1.3 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--mint-deeper); margin-bottom: .35rem; }
.notes ul li { display: flex; justify-content: space-between; gap: .8rem; align-items: start; padding: .15rem 0; }
.notes button { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 0 .2rem; font-size: 1.1rem; line-height: 1; min-width: 28px; min-height: 28px; }

.drawer { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; max-height: 100%; height: 100%; background: transparent; overflow: visible; }
.drawer::backdrop { background: rgba(25, 27, 24, .38); }
.drawer[open] { display: flex; align-items: flex-end; }
.drawer-in { position: relative; width: 100%; max-height: 92svh; overflow-y: auto; background: var(--paper); border-radius: 18px 18px 0 0; padding: 1.6rem var(--gutter) calc(1.6rem + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(25, 27, 24, .18); }
.drawer-in::before { content: ""; display: block; width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: -.6rem auto 1.2rem; }
.drawer h2 { font-size: clamp(2rem, 7vw, 2.8rem); margin-bottom: .6rem; padding-right: 3rem; }
.drawer .lede { font-size: 1rem; margin-bottom: 1.2rem; }
.drawer .x { position: absolute; top: 1rem; right: 1rem; }
.drawer .or { margin: 1.2rem 0 0; font-size: .92rem; color: var(--ink-2); }
.drawer[open] .drawer-in { animation: rise .5s var(--ease) both; }
.drawer.closing .drawer-in { animation: sink .3s ease-in both; }
.drawer[open]::backdrop { animation: fade .4s ease both; }
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sink { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 960px) {
  .drawer[open] { justify-content: flex-end; align-items: stretch; }
  .drawer-in { width: 50%; max-height: none; height: 100%; border-radius: 0; padding: 3rem var(--gutter); display: flex; flex-direction: column; justify-content: center; box-shadow: -20px 0 60px rgba(25, 27, 24, .14); }
  .drawer-in::before { display: none; }
  @keyframes rise { from { transform: translateX(100%); } to { transform: none; } }
  @keyframes sink { to { transform: translateX(100%); } }
}

/* ---- confirmation notice (after a form is sent) ---- */
.sent { background: var(--mint-wash); border-left: 2px solid var(--mint-deep); padding: 1rem 1.2rem; margin-bottom: 1.6rem; }

/* ---- footer ---- */
.ft { border-top: 1px solid var(--line); padding-block: clamp(2.4rem, 7vw, 5rem) 1.4rem; font-size: .92rem; color: var(--ink-2); }
.ft-grid { display: grid; gap: 1.6rem; }
@media (min-width: 960px) { .ft-grid { grid-template-columns: 1fr 1fr; gap: 0; } .ft-grid > div:last-child { padding-left: var(--gutter); } }
.ft .brand img { width: 150px; }
.ft-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.ft h2 { font: 600 .6875rem/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .8rem; }
.ft li { margin-bottom: .3rem; }
.ft li a { display: inline-block; padding: .2rem 0; }
.ft a { color: var(--ink); text-decoration: none; }
.ft a:hover { color: var(--mint-deep); text-decoration: underline; }
.ft .lic { margin-top: 1.2rem; }
.ft-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--ink-3); }
.ft-end a { color: var(--ink-3); }

/* ---- arrival as sections scroll in (only with scripts on, and only if motion is welcome) ---- */
@media (prefers-reduced-motion: no-preference) {
  .js .rv { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .js .rv.in { opacity: 1; transform: none; }
  .js .rv-pic { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); transition: clip-path 1.2s var(--ease); }
  .js .rv-pic.in { clip-path: polygon(0 var(--fall), 100% 0, 100% 100%, 0 100%); }
  @view-transition { navigation: auto; }
  ::view-transition-group(carry) { animation-duration: .6s; animation-timing-function: var(--ease); }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .open-pic img { animation: none; transform: none; }
}

@media print {
  .hd, .bar, .tape, .drawer, .ft-end { display: none !important; }
  body { padding: 0; }
}

/* ---- small helpers (kept out of the markup so the security policy can forbid inline styles) ---- */
.mt { margin-top: 1.6rem; }
.mt-l { margin-top: 2.6rem; }
.pt0 { padding-top: 0; }
.pb-section { padding-bottom: clamp(4rem, 10vw, 7rem); }
.ar32 { aspect-ratio: 3 / 2; }
.lede.s { font-size: 1.05rem; }
.gal.two { grid-template-columns: 1fr 1fr; }
.ft-blurb { max-width: 24em; margin-top: 1rem; }
@media (max-width: 959px) { .ft-blurb { display: none; } }
.form-h { margin: 0 0 1.2rem; }
fieldset.filters { border: 0; padding: 0 var(--gutter) .3rem; }
figure.mini { margin: 0; }
.mini blockquote { margin: 0; }
