/* Plastering IOM Ltd: cool wet-lime world.
   Grounds: water-dark #171D1E, slaked grey-blue #2E3A3D, lime-putty chalk #EDEFEE.
   Signal: sand-ochre #C88A3C for actions and grade marks only.
   Sections meet as coats meet: a keyed edge strip sits at the top of each layer. */

:root {
  --water-dark: #171D1E;
  --slaked: #2E3A3D;
  --chalk: #EDEFEE;
  --ochre: #C88A3C;
  --ochre-hover: #D99A4B;
  --text-on-dark: #EDEFEE;
  --tint-on-dark: #B9C7CB;
  --text-on-light: #171D1E;
  --tint-on-light: #3C4A4E;
  --hairline-dark: #41545A;
  --hairline-light: #BFC9C4;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 72rem;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: #3E4F53 var(--water-dark);
}

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--water-dark); }
::-webkit-scrollbar-thumb { background: #3E4F53; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #4E6268; }

body {
  margin: 0;
  background: var(--water-dark);
  color: var(--text-on-dark);
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ochre); color: var(--water-dark); }

h1, h2, h3 {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 1.2rem + 4.6vw, 5rem); max-width: 16ch; }
h2 { font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.8rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem); }

p { margin: 0 0 1em; max-width: 70ch; }

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(var(--wrap), 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- Keyed strata edges ---------- */
/* Each section below the hero wears a strip of the coat beneath it,
   scored with diagonal key marks in its own colour. */

section { position: relative; margin: 0; padding: clamp(3.5rem, 3rem + 3vw, 6.5rem) 0; }

.services::before, .work::before, .finishes::before, .areas::before, .contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background-color: var(--under);
  background-image: repeating-linear-gradient(
    115deg,
    var(--over) 0 2px,
    transparent 2px 10px
  );
}

/* ---------- Section grounds ---------- */

.hero    { --ground: var(--water-dark); background: var(--water-dark); color: var(--text-on-dark); }
.services { --under: var(--water-dark); --over: var(--slaked);    background: var(--slaked);    color: var(--text-on-dark); }
.work    { --under: var(--slaked);    --over: var(--water-dark); background: var(--water-dark); color: var(--text-on-dark); }
.finishes { --under: var(--water-dark); --over: var(--chalk);     background: var(--chalk);     color: var(--text-on-light); }
.areas   { --under: var(--chalk);     --over: var(--slaked);    background: var(--slaked);    color: var(--text-on-dark); }
.contact { --under: var(--slaked);    --over: var(--water-dark); background: var(--water-dark); color: var(--text-on-dark); }

/* Tinted secondary text, from the hue, never grey-on-grey */
.hero .hero-phone, .hero figcaption,
.services p, .work p, .areas p, .contact p,
.site-header, .site-footer { color: var(--tint-on-dark); }

.finishes .mix-note, .finishes .empty-state { color: var(--tint-on-light); }

.services h2, .services h3, .work h2, .areas h2, .contact h2,
.contact h3, .services .coat p, .work .section-intro, .areas .section-intro { color: inherit; }

.services .coat p, .contact-details p { color: var(--tint-on-dark); }

/* ---------- Header ---------- */

.site-header {
  background: var(--water-dark);
  border-bottom: 1px solid var(--hairline-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  padding-block: 0.9rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
}

.site-name {
  margin: 0;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.site-name a { color: var(--text-on-dark); text-decoration: none; }
.site-name a:hover { text-decoration: underline; text-decoration-color: var(--ochre); }

.site-name-link { display: inline-flex; align-items: center; gap: 0.55rem; }
.site-logo { height: 2.4rem; width: auto; display: block; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--tint-on-dark);
  padding-block: 0.25rem;
}

.site-nav a:hover { color: var(--text-on-dark); text-decoration: underline; text-decoration-color: var(--ochre); }
.site-nav a[aria-current="page"] { color: var(--text-on-dark); text-decoration: underline; text-decoration-color: var(--ochre); }

.site-phone { margin: 0; font-size: 0.95rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.65rem; }
.site-phone-label { color: var(--ochre); font-weight: 700; }
.site-phone a { color: var(--text-on-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.site-phone a:hover { text-decoration: underline; text-decoration-color: var(--ochre); }

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  background: var(--ochre);
  color: var(--water-dark);
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.3;
}

.button:hover { background: var(--ochre-hover); }
.button:active { transform: translateY(1px); }

.button-small { padding: 0.45rem 0.9rem; font-size: 0.95rem; }

.button-quiet {
  display: inline-block;
  color: var(--text-on-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--ochre);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  padding: 0.75rem 0;
}

.button-quiet:hover { color: var(--ochre); }

/* ---------- Hero ---------- */

.hero { padding-top: clamp(2.5rem, 2rem + 3vw, 5rem); }

.hero-grid {
  display: grid;
  gap: 2.5rem;
}

.hero-text {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.3rem);
  color: var(--tint-on-dark);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
  margin-top: 1.75rem;
}

.hero-phone { margin-top: 1.25rem; font-size: 0.95rem; }
.hero-phone-number { color: var(--text-on-dark); }

.hero-figure { margin: 0; }

.hero-figure img {
  width: 100%;
  border-radius: 2px;
}

.hero figcaption {
  font-size: 0.85rem;
  margin-top: 0.6rem;
  max-width: 60ch;
}

@media (min-width: 62rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    gap: 4rem;
  }
}

/* ---------- What we do: the coat list ---------- */

.section-intro {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.2rem);
  max-width: 62ch;
  margin-bottom: 2.5rem;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--tint-on-dark);
  margin-bottom: 1.25rem;
}

.breadcrumb a { color: inherit; text-decoration: underline; text-decoration-color: transparent; }
.breadcrumb a:hover { text-decoration-color: var(--ochre); }

.coat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.coat {
  padding: 1.5rem 0;
  border-top: 1px solid var(--hairline-dark);
  display: grid;
  gap: 0.25rem;
}

.coat h3 { margin: 0; }
.coat p { margin: 0; max-width: 62ch; }

@media (min-width: 62rem) {
  .coat {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 2.5rem;
    align-items: baseline;
  }
}

/* ---------- Recent work catalogue ---------- */

.work-list { display: grid; gap: 3rem; }

.work-item {
  border-top: 1px solid var(--hairline-dark);
  padding-top: 1.75rem;
  display: grid;
  gap: 1.25rem;
}

.work-item-image {
  width: 100%;
  border-radius: 2px;
}

.work-item-title { margin: 0 0 0.35rem; }
.work-item-description { margin: 0; color: var(--tint-on-dark); max-width: 62ch; }

.work-item-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0 0;
  padding: 0;
  max-width: 62ch;
}

.work-item-tag {
  font-family: 'Martian Mono', ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--text-on-dark);
  border: 1px solid var(--hairline-dark);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
}

@media (min-width: 62rem) {
  .work-item {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto 1fr;
    gap: 0.5rem 2.5rem;
    align-items: start;
  }
  .work-item-image { grid-column: 1; grid-row: 1 / span 2; }
  .work-item-image ~ .work-item-title,
  .work-item-image ~ .work-item-description { grid-column: 2; }
  .work-item-tags { grid-column: 1 / -1; }
  .work-item-image:only-child { grid-column: 1 / -1; }
}

/* ---------- Finishes catalogue (the light region) ---------- */

.finishes h2 { max-width: 20ch; }

.mix-note {
  max-width: 62ch;
  font-size: 0.95rem;
  border-top: 1px solid var(--hairline-light);
  padding-top: 1.25rem;
  margin-bottom: 2.75rem;
}

.mix {
  font-family: 'Martian Mono', ui-monospace, monospace;
  font-weight: 600;
  font-size: 0.9em;
  color: var(--text-on-light);
  white-space: nowrap;
}

.finish-list { display: grid; gap: 0; }

.finish-item {
  border-top: 1px solid var(--hairline-light);
  padding: 1.75rem 0;
  display: grid;
  gap: 1rem;
}

.finish-item-image {
  width: 100%;
  border-radius: 2px;
}

.finish-item-name { margin: 0 0 0.35rem; }
.finish-item-description { margin: 0; max-width: 62ch; color: var(--tint-on-light); }

.finish-item-bestfor {
  margin: 0;
  max-width: 62ch;
  color: var(--text-on-light);
}

.finish-item-bestfor-label {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--ochre);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

@media (min-width: 62rem) {
  .finish-item {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 2.5rem;
    align-items: start;
  }
  .finish-item-image { grid-column: 2; grid-row: 1 / span 3; }
  .finish-item-name, .finish-item-description, .finish-item-bestfor { grid-column: 1; }
  .finish-item-image:only-child { grid-column: 1 / -1; }
}

/* ---------- Empty states ---------- */

.empty-state {
  border: 1px dashed var(--hairline-dark);
  border-radius: 2px;
  padding: 1.5rem 1.75rem;
  max-width: 62ch;
  margin: 0;
}

.empty-light { border-color: var(--hairline-light); }

/* ---------- Areas ---------- */

.areas .section-intro { margin-bottom: 0; }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; }
.contact-row dd { overflow-wrap: anywhere; }

.contact-list {
  margin: 1.75rem 0 0;
  display: grid;
  gap: 0;
}

.contact-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--hairline-dark);
}

.contact-row dt { font-weight: 700; color: var(--ochre); }
.contact-row dd { margin: 0; color: var(--text-on-dark); }

@media (min-width: 62rem) {
  .contact-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 4rem; align-items: start; }
}

/* ---------- Quote form ---------- */

.quote-form { display: grid; gap: 1.25rem; }

.quote-form .button { justify-self: start; }

.field { display: grid; gap: 0.35rem; }

.field label { font-weight: 700; color: var(--text-on-dark); }

.field input, .field textarea {
  font: inherit;
  color: var(--text-on-dark);
  background: var(--slaked);
  border: 1px solid var(--hairline-dark);
  border-radius: 2px;
  padding: 0.65rem 0.8rem;
  caret-color: var(--ochre);
  width: 100%;
}

.field textarea {
  resize: vertical;
  min-height: 5.5rem;
  max-height: 16rem;
}

.field input:hover, .field textarea:hover { border-color: #55696F; }

.field input:focus, .field textarea:focus {
  outline: 2px solid var(--ochre);
  outline-offset: 1px;
  border-color: transparent;
}

.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: #D97A4A;
  outline: 2px solid #D97A4A;
  outline-offset: 1px;
}

.field-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--tint-on-dark);
}

.form-note {
  margin: 0;
  font-size: 0.9rem;
  border-top: 1px solid var(--hairline-dark);
  padding-top: 1rem;
}

.form-confirmation {
  border: 1px solid var(--ochre);
  border-radius: 2px;
  padding: 1.75rem;
  align-self: start;
}

.form-confirmation h3 { margin-top: 0; }
.form-confirmation p { margin-bottom: 0; }
.confirm-phone { color: var(--text-on-dark); font-weight: 700; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--water-dark);
  border-top: 1px solid var(--hairline-dark);
  padding: 2.5rem 0;
  font-size: 0.95rem;
}

.footer-inner p { margin: 0 0 0.35rem; }
.footer-name { color: var(--text-on-dark); font-weight: 700; }
.footer-reg { font-size: 0.85rem; opacity: 0.8; }
.footer-reg a { color: inherit; text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 0.15s var(--ease-out-expo); }
.footer-reg a:hover { text-decoration-color: var(--ochre); }

.social-link { display: inline-flex; align-items: center; gap: 0.4rem; }
.social-icon { flex-shrink: 0; }
.footer-credit a:hover { color: var(--text-on-dark); }

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ochre);
  color: var(--water-dark);
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 2px;
  z-index: 10;
  transition: top 0.3s var(--ease-out-expo);
}

.skip-link:focus { top: 1rem; text-decoration: none; }

/* ---------- The one authored motion moment: hero settle on load ---------- */
/* Fail-safe: the hidden state only applies once script.js itself has run and
   set .motion-armed, so a script error can never strand the hero invisible. */

.js.motion-armed [data-animate] {
  opacity: 0;
  transform: translateY(22px);
}

.js.motion-armed body.motion-on [data-animate] {
  opacity: 1;
  transform: none;
  transition:
    opacity 1s var(--ease-out-expo),
    transform 1s var(--ease-out-expo);
}

.js.motion-armed body.motion-on .hero-figure[data-animate] { transition-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js.motion-armed [data-animate] { opacity: 1; transform: none; }
  .js.motion-armed body.motion-on [data-animate] { transition: none; }
  .skip-link { transition: none; }
}
