/* The Sussex Flint Company — site styles
   Palette derives from the material: chalk, knapped flint, lime mortar, brick quoins. */

:root {
  --chalk: #F1EFE8;
  --chalk-2: #E7E3DA;
  --mortar: #CFC5AF;
  --flint: #1C1E21;
  --flint-2: #2A2D31;
  --ink: #1B1D20;
  --ink-2: #4E5358;
  --line: #D3CEC3;
  --line-dark: #3A3E43;
  --brick: #9A4E35;
  --brick-2: #7E3E2A;
  --moss: #6E7D6A;
  --on-dark: #EDE9DF;
  --on-dark-2: #B8B3A6;

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --max: 1360px;
  --gutter: clamp(20px, 4vw, 64px);
  --r: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--brick); text-underline-offset: 0.18em; }
a:hover { color: var(--brick-2); }
:focus-visible { outline: 2px solid var(--brick); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--flint); color: var(--on-dark); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type scale ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--brick); }
.dark .eyebrow { color: var(--on-dark-2); }
.display { font-size: clamp(2.6rem, 6.2vw, 5.4rem); line-height: 0.98; }
.h2 { font-size: clamp(2rem, 3.8vw, 3.1rem); line-height: 1.05; }
.h3 { font-size: clamp(1.35rem, 2vw, 1.7rem); line-height: 1.2; }
.lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 34em; }
.dark .lead { color: var(--on-dark-2); }
em.it { font-style: italic; color: var(--brick); }
.dark em.it { color: #D69C86; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 22px;
  background: var(--flint); color: var(--on-dark);
  font-family: var(--sans); font-size: 0.95rem; letter-spacing: 0.02em;
  text-decoration: none; border-radius: var(--r);
  transition: background .2s ease, transform .2s ease;
  min-height: 48px;
}
.btn:hover { background: var(--brick); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--on-dark); }
.dark .btn { background: var(--on-dark); color: var(--flint); }
.dark .btn:hover { background: var(--brick); color: #fff; }
.dark .btn.ghost { background: transparent; color: var(--on-dark); box-shadow: inset 0 0 0 1px var(--on-dark-2); }
.dark .btn.ghost:hover { background: var(--on-dark); color: var(--flint); }
.arrow-link { text-decoration: none; font-size: 0.95rem; letter-spacing: 0.02em; border-bottom: 1px solid var(--brick); padding-bottom: 2px; }
.arrow-link:hover { color: var(--brick-2); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--chalk) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { font-family: var(--serif); font-size: 1.3rem; text-decoration: none; letter-spacing: -0.005em; white-space: nowrap; }
.brand span { color: var(--brick); }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a { text-decoration: none; font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); }
.nav .btn { padding: 11px 16px; min-height: 40px; font-size: 0.85rem; color: var(--on-dark); text-transform: none; letter-spacing: 0.02em; }
.nav .btn:hover { color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--r); width: 44px; height: 44px; cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 0 auto 4px; }
.nav-toggle span:last-child { margin-bottom: 0; }
@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: inline-block; }
  /* The header carries backdrop-filter, which makes it the containing block for any fixed descendant —
     so a fixed panel with inset:72px 0 0 0 resolved against the 72px header and collapsed to zero
     height, spilling its links over the hero with no background behind them. Position the panel
     absolutely under the sticky header instead: an opaque, content-height, full-width sheet that sits
     inside the header's own stacking context (z-index 50), and therefore above every page element. */
  .site-header .wrap { position: relative; }
  body.nav-open .nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0; width: 100%;
    background: var(--chalk); opacity: 1;
    padding: 12px var(--gutter) 28px;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px -20px rgba(27, 29, 32, 0.28);
    z-index: 49; overflow-x: hidden;
  }
  body.nav-open .nav a:not(.btn) {
    font-size: 1.15rem; padding: 16px 0; min-height: 48px; display: flex; align-items: center;
    border-bottom: 1px solid var(--line); text-transform: none; letter-spacing: 0; color: var(--ink);
  }
  body.nav-open .nav a:not(.btn):last-of-type { border-bottom: 0; }
  body.nav-open .nav .btn { margin-top: 20px; font-size: 1rem; padding: 16px 20px; justify-content: center; }
}

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100svh - 72px); border-bottom: 1px solid var(--line); }
/* Centred within the usable hero height, but biased above centre: a small top allowance and a larger
   bottom one, so the eyebrow starts ~100px below the header at 1440×900 and the group stays visually
   tied to the image rather than sinking towards the fold. */
.hero-copy { padding: clamp(48px, 7vh, 72px) var(--gutter) clamp(120px, 22vh, 220px); display: flex; flex-direction: column; justify-content: center; }
.hero-copy .display { margin-bottom: 24px; }
.hero-copy .lead { margin-bottom: 36px; }
.hero-actions { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.hero-media { position: relative; overflow: hidden; background: var(--flint); min-height: 0; }
/* The photograph fills the hero rather than sizing it: absolutely positioned, so the hero's height comes
   from its min-height and the copy column, never from the image's intrinsic 4:3 proportions. */
.hero-media picture, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-media img { object-fit: cover; object-position: 50% 30%; }
.hero-media::after { content: ""; position: absolute; inset: 0; box-shadow: inset 8px 0 0 var(--chalk); pointer-events: none; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-media { order: -1; aspect-ratio: 4 / 5; }
  .hero-media::after { box-shadow: none; }
  .hero-copy { padding: 32px var(--gutter) 48px; justify-content: flex-start; }
}
@media (max-width: 640px) {
  /* Mobile only: copy first. The H1 is the first major content after the header and the photograph
     follows the CTAs — DOM order, which already reads copy → image, is simply no longer overridden. */
  .hero-media { order: 0; }
  .hero-copy { padding-bottom: 36px; }
}

/* ---------- fact band ---------- */
.dark { background: var(--flint); color: var(--on-dark); }
.facts { padding: clamp(44px, 6vw, 72px) 0; }
.facts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.fact { border-top: 1px solid var(--line-dark); padding-top: 22px; }
.fact .h3 { margin-bottom: 10px; }
.fact p { color: var(--on-dark-2); font-size: 0.98rem; }
@media (max-width: 760px) { .facts-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- services overview ---------- */
.section { padding: clamp(64px, 9vw, 128px) 0; }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.split .sticky { position: sticky; top: 100px; }
.groups { display: grid; gap: 0; border-top: 1px solid var(--line); }
.group { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.group .h3 { margin-bottom: 6px; }
.group p { color: var(--ink-2); font-size: 0.98rem; }
.group ul { display: grid; gap: 8px; }
.group li { padding-left: 18px; position: relative; }
.group li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 2px; background: var(--brick); }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split .sticky { position: static; }
  .group { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- landscape band ---------- */
.band { position: relative; min-height: 62vh; display: grid; align-items: end; color: var(--on-dark); overflow: hidden; }
.band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band .band-copy { position: relative; padding: clamp(40px, 6vw, 80px) var(--gutter); max-width: 44em; }
.band::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,22,25,.86) 0%, rgba(20,22,25,.45) 40%, rgba(20,22,25,0) 72%); z-index: 1; }
.band .band-copy { z-index: 2; }
.band .h2 { margin-bottom: 14px; }
.band p { color: var(--on-dark); max-width: 34em; font-size: 1.08rem; }

/* ---------- craft ---------- */
.craft { background: var(--chalk-2); }
.craft-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.craft-copy .h2 { margin-bottom: 22px; }
.craft-copy p { max-width: 36em; }
.craft-facts { margin-top: 32px; border-top: 1px solid var(--line); }
.craft-facts div { display: grid; grid-template-columns: 11rem 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.craft-facts dt { color: var(--ink-2); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; padding-top: 4px; }
.craft-facts dd { margin: 0; }
.craft-media { display: grid; grid-template-columns: 7fr 5fr; gap: 16px; align-items: end; }
.craft-media figure { margin: 0; }
.craft-media .tall img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.craft-media .short img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.craft-media .short { margin-bottom: 22%; }
figcaption { font-size: 0.8rem; color: var(--ink-2); margin-top: 10px; letter-spacing: 0.02em; }
.dark figcaption { color: var(--on-dark-2); }
@media (max-width: 900px) {
  .craft-grid { grid-template-columns: 1fr; }
  .craft-media { order: -1; }
  .craft-facts div { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- work mosaic ---------- */
.work-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.mosaic { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(120px, auto); gap: 16px; }
.mosaic figure { margin: 0; display: grid; grid-template-rows: 1fr auto; min-height: 0; }
.mosaic picture { min-height: 0; display: block; height: 100%; }
.mosaic img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.m-a { grid-column: 1 / 8; grid-row: 1 / 3; } .m-a img { aspect-ratio: 4 / 3; }
.m-b { grid-column: 8 / 13; grid-row: 1 / 2; } .m-b img { aspect-ratio: 5 / 4; }
.m-c { grid-column: 8 / 13; grid-row: 2 / 3; } .m-c img { aspect-ratio: 5 / 4; }
.m-d { grid-column: 1 / 5; grid-row: 3 / 4; } .m-d img { aspect-ratio: 3 / 4; }
.m-e { grid-column: 5 / 9; grid-row: 3 / 4; } .m-e img { aspect-ratio: 3 / 4; }
.m-f { grid-column: 9 / 13; grid-row: 3 / 4; } .m-f img { aspect-ratio: 3 / 4; }
@media (max-width: 760px) {
  .mosaic { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .m-a { grid-column: 1 / 3; grid-row: auto; } .m-a img { aspect-ratio: 4 / 5; }
  .m-b, .m-c, .m-d, .m-e { grid-column: auto; grid-row: auto; }
  .m-f { grid-column: 1 / 3; grid-row: auto; } .m-f img { aspect-ratio: 4 / 3; }
  .m-b img, .m-c img { aspect-ratio: 4 / 5; }
}

/* ---------- gallery (work page) ---------- */
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; object-fit: cover; }
.g-8 { grid-column: span 8; } .g-4 { grid-column: span 4; } .g-6 { grid-column: span 6; } .g-12 { grid-column: span 12; }
.g-8 img { aspect-ratio: 4 / 3; } .g-4 img { aspect-ratio: 3 / 4; } .g-6 img { aspect-ratio: 4 / 5; } .g-12 img { aspect-ratio: 21 / 9; }
@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr 1fr; gap: 12px; }
  .g-8, .g-12 { grid-column: span 2; } .g-4, .g-6 { grid-column: span 1; }
  .g-8 img { aspect-ratio: 4 / 5; } .g-12 img { aspect-ratio: 4 / 3; }
}

/* ---------- page hero (inner pages) ---------- */
.page-hero { position: relative; min-height: 60vh; display: grid; align-items: end; color: var(--on-dark); overflow: hidden; background: var(--flint); }
.page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.page-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,22,25,.9) 0%, rgba(20,22,25,.62) 38%, rgba(20,22,25,.28) 70%, rgba(20,22,25,.18) 100%); z-index: 1; }
.page-hero .wrap { position: relative; z-index: 2; padding-top: clamp(96px, 14vh, 160px); padding-bottom: clamp(36px, 5vw, 64px); }
.page-hero .display { font-size: clamp(2.4rem, 5.2vw, 4.4rem); max-width: 14em; }
.page-hero .eyebrow { color: var(--on-dark-2); }
.page-hero .lead { margin-top: 16px; color: var(--on-dark); }

/* ---------- services page ---------- */
.service-group { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); padding: clamp(48px, 7vw, 96px) 0; border-top: 1px solid var(--line); align-items: start; }
.service-group:first-of-type { border-top: 0; }
.service-group figure { margin: 0; position: sticky; top: 100px; }
.service-group figure img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.service-group .h2 { margin-bottom: 12px; }
.service-group > div > p { color: var(--ink-2); max-width: 36em; margin-bottom: 28px; }
.service-list { border-top: 1px solid var(--line); }
.service-list div { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 15rem 1fr; gap: 20px; }
.service-list dt { font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; }
.service-list dd { margin: 0; color: var(--ink-2); font-size: 0.98rem; }
@media (max-width: 860px) {
  .service-group { grid-template-columns: 1fr; }
  .service-group figure { position: static; }
  .service-group figure img { aspect-ratio: 4 / 3; }
  .service-list div { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- estimate ---------- */
.estimate { padding: clamp(64px, 9vw, 120px) 0; }
.estimate-grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.estimate .h2 { margin-bottom: 18px; }
.estimate .lead { margin-bottom: 32px; }
.include { border-top: 1px solid var(--line-dark); }
.include li { padding: 14px 0; border-bottom: 1px solid var(--line-dark); display: grid; grid-template-columns: 2rem 1fr; gap: 12px; color: var(--on-dark); }
.include li span { color: var(--on-dark-2); font-family: var(--serif); font-size: 1.1rem; }
.include-label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--on-dark-2); margin-bottom: 14px; }
.email-line { margin-top: 22px; color: var(--on-dark-2); font-size: 0.95rem; }
.email-line a { color: var(--on-dark); }
@media (max-width: 860px) { .estimate-grid { grid-template-columns: 1fr; } }

/* ---------- contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 6fr 6fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-card { border: 1px solid var(--line); padding: clamp(24px, 3vw, 40px); background: var(--chalk-2); }
.contact-card .h3 { margin-bottom: 8px; }
.contact-card .big { font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 2rem); word-break: break-word; }
.contact-list { margin-top: 26px; border-top: 1px solid var(--line); }
.contact-list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 2rem 1fr; gap: 12px; }
.contact-list li span { color: var(--brick); font-family: var(--serif); }
.contact-media figure { margin: 0; }
.contact-media img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: 0.92rem; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; align-items: start; }
.site-footer .brand { font-size: 1.15rem; color: var(--ink); display: inline-block; margin-bottom: 10px; }
.site-footer ul { display: grid; gap: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .legal { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.hero-media img { transform: scale(1.04); transition: transform 1.4s ease; }
.hero-media.in img { transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .hero-media img { opacity: 1; transform: none; transition: none; }
}
.no-js .reveal { opacity: 1; transform: none; }
