/* Homesteed v2. Palette taken from the photographs: slate brand colour, steel window frames, brass fittings, plaster. */
:root {
  --slate: #3b4051;
  --ink: #22252f;
  --steel: #1f2a28;
  --brass: #a9874f;
  --plaster: #f2f2ef;
  --stone: #d8d8d3;
  --white: #fff;
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  /* Never narrower than the notch or rounded corners of a phone held sideways */
  --gutter: max(clamp(20px, 5vw, 72px), env(safe-area-inset-left), env(safe-area-inset-right));
  --bar: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; overflow-wrap: break-word; -webkit-tap-highlight-color: rgba(169, 135, 79, 0.25); background: var(--plaster); color: var(--ink); font: 400 1.0625rem/1.65 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid #866a3a; outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.7rem, 6.2vw, 5.4rem); }
h2 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }
h3 { font-size: clamp(1.5rem, 2.2vw, 1.9rem); }
p { margin: 0 0 1em; max-width: 62ch; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--white); padding: 10px 14px; }

/* Header */
.head { position: sticky; top: 0; z-index: 50; background: var(--slate); color: var(--white); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px var(--gutter); }
.head .logo { display: block; padding: 6px 0; }
.head .logo img { height: 38px; width: auto; }
.nav { display: flex; gap: clamp(16px, 2.4vw, 36px); align-items: center; }
.nav a { text-decoration: none; font-size: 0.98rem; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--brass); }
.nav .cta { border: 1px solid rgba(255, 255, 255, 0.6); padding: 8px 18px; }
.nav .cta:hover { background: var(--white); color: var(--slate); border-color: var(--white); }
.menu { display: none; background: none; border: 1px solid rgba(255, 255, 255, 0.6); color: inherit; font: inherit; padding: 10px 16px; min-height: 44px; cursor: pointer; }
/* iPad portrait: the full menu still fits with a slightly smaller logo */
@media (max-width: 900px) {
  .head .logo img { height: 30px; }
  .nav { gap: 18px; }
  .nav a { font-size: 0.95rem; padding: 12px 0; }
  .nav .cta { padding: 10px 14px; }
}
/* Phones: menu button and a drop-down list */
@media (max-width: 720px) {
  .head .logo img { height: 34px; }
  .menu { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--slate); flex-direction: column; align-items: stretch; gap: 0; padding: 4px var(--gutter) 24px; max-height: calc(100vh - 66px); max-height: calc(100dvh - 66px); overflow-y: auto; box-shadow: 0 18px 30px rgba(20, 24, 30, 0.35); }
  .nav.open { display: flex; }
  .nav a { font-size: 1.2rem; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
  .nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--brass); }
  .nav .cta { margin-top: 18px; padding: 14px 18px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.6); }
}

/* Buttons */
.btn { display: inline-block; text-decoration: none; text-align: center; padding: 14px 26px; min-height: 48px; font-weight: 500; border: 1px solid var(--ink); background: var(--ink); color: var(--white); cursor: pointer; font-family: var(--body); font-size: 1rem; }
.btn:hover { background: #866a3a; border-color: #866a3a; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.on-dark .btn { background: var(--white); color: var(--ink); border-color: var(--white); }
.on-dark .btn:hover { background: #866a3a; border-color: #866a3a; color: var(--white); }
.on-dark .btn.ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.7); }
.on-dark .btn.ghost:hover { background: var(--white); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Hero */
.hero { position: relative; height: min(86vh, 860px); height: min(86svh, 860px); min-height: 520px; background: var(--steel); color: var(--white); overflow: hidden; }
.hero .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.hero .slide.on { opacity: 1; }
.hero .slide img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 24, 30, 0.92), rgba(20, 24, 30, 0.62) 55%, rgba(20, 24, 30, 0.38)); }
.hero .words { position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: clamp(36px, 7vh, 80px); max-width: 980px; }
.hero h1, .hero p { text-shadow: 0 1px 18px rgba(20, 24, 30, 0.55); }
.hero p { font-size: 1.2rem; margin-top: 18px; max-width: 52ch; }
.hero .pause { position: absolute; z-index: 2; right: var(--gutter); bottom: 20px; background: none; border: 0; color: var(--white); font: inherit; font-size: 0.9rem; text-decoration: underline; cursor: pointer; padding: 12px 0 12px 12px; min-height: 44px; }
.banner { height: min(52vh, 520px); height: min(52svh, 520px); min-height: 340px; }
/* Phones: the buttons sit above the pause control instead of beside it */
@media (max-width: 720px) {
  .hero .words { bottom: 64px; }
  .hero.banner .words { bottom: 32px; }
  .hero .pause { bottom: 10px; }
  .hero p { font-size: 1.1rem; }
}
@media (max-width: 360px) { h1 { font-size: 2.3rem; } .hero p { font-size: 1rem; } }
/* A phone held sideways: keep the whole hero on screen */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { height: calc(100vh - 66px); height: calc(100svh - 66px); min-height: 300px; }
  .banner { min-height: 240px; }
  .hero h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); }
  .hero p { display: none; }
  .hero .words { bottom: 24px; right: 30%; }
  .hero .actions { margin-top: 18px; }
  .hero .pause { bottom: 18px; }
}

/* Sections */
.sec { padding: clamp(64px, 9vw, 128px) var(--gutter); }
.sec.tight { padding-top: 0; }
.sec.slate { background: var(--slate); color: var(--white); }
.sec.white { background: var(--white); }
.lede { font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.2; max-width: 30ch; margin: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.split.top { align-items: start; }
.split > img { width: 100%; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }
.facts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--stone); }
.facts li { padding: 16px 0; border-bottom: 1px solid var(--stone); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head a { font-weight: 500; padding: 10px 0; }

/* The window wall: projects as panes in a steel-framed window */
.wall { background: var(--steel); padding: var(--bar); display: grid; gap: var(--bar); grid-template-columns: repeat(4, 1fr); }
.wall a { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; color: var(--white); text-decoration: none; background: var(--slate); }
.wall img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.wall a:focus-visible img { transform: scale(1.05); }
@media (hover: hover) { .wall a:hover img { transform: scale(1.05); } }
.wall span { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 16px 14px; font-family: var(--display); font-size: clamp(1.2rem, 1.8vw, 1.6rem); line-height: 1.1; background: linear-gradient(to top, rgba(20, 24, 30, 0.85), transparent); }
@media (max-width: 900px) { .wall { --bar: 6px; } .wall span { padding: 40px 12px 12px; } }
@media (max-width: 720px) { .wall { grid-template-columns: repeat(2, 1fr); } }

/* How we work */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: clamp(28px, 4vw, 48px); }
.steps div { border-top: 2px solid var(--brass); padding-top: 18px; }
.steps h3 { margin-bottom: 10px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

/* Reviews */
.reviews { display: grid; gap: clamp(40px, 6vw, 72px); }
.review { margin: 0; display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.review img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.review blockquote { margin: 0; font-family: var(--display); font-size: clamp(1.4rem, 2.3vw, 1.95rem); line-height: 1.3; max-width: 34ch; }
.review figcaption { margin-top: 16px; font-size: 0.98rem; }
.review.plain { grid-template-columns: 1fr; align-items: start; }
.reviews.pair { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .reviews.pair { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .review { grid-template-columns: minmax(0, 240px) 1fr; } }
/* Phones: the photo runs full width above the quote, cropped wide so the quote stays near the top */
@media (max-width: 600px) { .review { grid-template-columns: 1fr; } .review img { aspect-ratio: 3 / 2; } }

/* Project page */
.intro { max-width: 900px; }
.intro p { font-size: 1.2rem; margin-top: 22px; }
.crumb { display: inline-block; margin-bottom: 8px; padding: 10px 0; }
.gallery { columns: 3; column-gap: var(--bar); background: var(--steel); padding: var(--bar) var(--bar) 0; }
.gallery button { display: block; width: 100%; padding: 0; border: 0; margin: 0 0 var(--bar); background: var(--slate); cursor: zoom-in; break-inside: avoid; }
.gallery img { width: 100%; }
@media (max-width: 900px) { .gallery { --bar: 6px; } }
@media (max-width: 720px) { .gallery { columns: 2; } }
.next { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.next a.big { font-family: var(--display); font-size: clamp(1.8rem, 3.4vw, 2.8rem); text-decoration: none; border-bottom: 1px solid var(--brass); }

/* Lightbox */
dialog.box { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
dialog.box::backdrop { background: rgba(20, 24, 30, 0.94); }
dialog.box img { position: absolute; inset: 56px 64px; margin: auto; max-width: calc(100% - 128px); max-height: calc(100% - 112px); object-fit: contain; }
dialog.box img { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
dialog.box button { position: absolute; background: none; border: 0; color: var(--white); font: 500 1rem var(--body); padding: 14px; min-width: 48px; min-height: 48px; cursor: pointer; }
dialog.box .count { position: absolute; top: 22px; left: 18px; margin: 0; color: rgba(255, 255, 255, 0.8); font-size: 0.95rem; }
dialog.box .x { top: 8px; right: 12px; }
dialog.box .prev { left: 4px; top: 50%; }
dialog.box .nxt { right: 4px; top: 50%; }
@media (max-width: 700px), (max-height: 560px) { dialog.box img { inset: 56px 8px 64px; max-width: calc(100% - 16px); max-height: calc(100% - 120px); } dialog.box .prev, dialog.box .nxt { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); } }

/* FAQ */
.faq { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--stone); }
.faq summary { cursor: pointer; list-style: none; padding: 22px 40px 22px 0; position: relative; font-family: var(--display); font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.2; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-family: var(--body); font-size: 1.5rem; color: var(--brass); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 22px; margin: 0; }

/* Contact */
.contact-lines { font-size: 1.2rem; }
.contact-lines a { display: block; width: fit-content; padding: 6px 0; }
form.enquiry { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin-top: 8px; }
form.enquiry label { display: grid; gap: 6px; font-weight: 500; font-size: 0.98rem; }
form.enquiry .wide { grid-column: 1 / -1; }
form.enquiry input, form.enquiry textarea { font: inherit; padding: 13px 14px; border: 1px solid #8a8d96; background: var(--white); color: var(--ink); width: 100%; border-radius: 0; }
form.enquiry textarea { min-height: 150px; resize: vertical; }
form.enquiry small { grid-column: 1 / -1; color: #555a66; }
/* One column whenever the form shares the row with the photo on a tablet, and on phones */
@media (max-width: 900px) { form.enquiry { grid-template-columns: 1fr; } }

/* Call to action and footer */
.cta-band { text-align: left; }
.cta-band h2 { max-width: 18ch; }
.foot { background: var(--steel); color: var(--white); padding: clamp(48px, 6vw, 80px) var(--gutter) max(32px, env(safe-area-inset-bottom)); }
.foot .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot img { height: 34px; width: auto; margin-bottom: 18px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 8px; }
.foot li a { display: inline-block; }
.foot h2 { font-family: var(--body); font-size: 0.98rem; font-weight: 600; letter-spacing: 0; margin-bottom: 14px; }
.foot .small { max-width: none; margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.9rem; color: rgba(255, 255, 255, 0.75); }
@media (max-width: 720px) { .foot .cols { grid-template-columns: 1fr 1fr; gap: 32px 24px; } .foot .cols > :first-child { grid-column: 1 / -1; } }
@media (max-width: 420px) { .foot .cols { grid-template-columns: 1fr; } }

/* Touch screens: every link and control is at least 44px tall */
@media (pointer: coarse) {
  .foot li { margin-bottom: 0; }
  .foot li a { padding: 11px 0; }
  .sec-head a, .crumb { padding: 11px 0; }
  .contact-lines a { padding: 10px 0; }
  .next a.big { display: inline-block; padding: 4px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wall img { transition: none; }
  .hero .slide { transition: none; }
}
