/* Brother of the Brush, Bristol. Single light theme: the page emulates a printed trade card. */
:root {
  --paper: #eeece4;       --on-paper: #1b2226;
  --muted: #4b555a;
  --card: #f9f8f3;        --on-card: #1b2226;
  --plate: #dedbd0;       --on-plate: #1b2226;
  --green: #1f4a3a;       --on-green: #eeece4;
  --green-deep: #163629;  --on-green-deep: #eeece4;
  --ink: #1b2226;         --on-ink: #eeece4;
  --gold: #cfc6a6;
  --line: #6b7478;
  --error: #8e2b2b;

  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --caps: "Playfair Display SC", Georgia, serif;
  --body: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;

  --tile: 64px;
  --radius: 2px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --tilt: 0deg;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--on-paper);
  background: var(--paper);
  padding-bottom: 76px;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; }
p { margin: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }

/* Preview ribbon: in flow at the top, so it never covers content or the dock */
.ribbon {
  margin: 0;
  padding: 6px 16px;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--on-ink);
  background: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font: 600 1rem/1 var(--body);
  text-decoration: none;
  white-space: nowrap;
  color: var(--on-green);
  background: var(--green);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: scale 0.15s ease-out;
}
/* Hover lays a coat across the button, left to right, like a roller pass */
.btn::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: var(--green-deep);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.35s var(--ease-out);
}
.btn:hover { color: var(--on-green-deep); }
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); transform-origin: left center; }
.btn:active { scale: 0.96; }
.btn--ghost { color: var(--green); background: var(--paper); }
.btn--ghost::before { background: var(--plate); }
.btn--ghost:hover { color: var(--on-plate); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 0.9375rem; }
.btn--block { width: 100%; }
.textlink { display: inline-block; margin-top: 14px; font-weight: 600; }
.textlink::after {
  content: "\2192" / "";
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.25s var(--ease-out);
}
.textlink:hover::after, .textlink:focus-visible::after { transform: translateX(4px); }

/* Header */
.top { border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.mark { display: flex; flex-direction: column; text-decoration: none; color: var(--on-paper); line-height: 1.1; }
.mark__name { font-family: var(--caps); font-weight: 700; font-size: 1.125rem; }
.mark__place { font-family: var(--caps); font-size: 0.875rem; color: var(--muted); letter-spacing: 0.08em; }
.nav { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav a:not(.btn) { position: relative; color: var(--on-paper); text-decoration: none; font-weight: 600; font-size: 0.9375rem; }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  background: var(--green);
  transform: scaleX(0); transform-origin: right center;
  transition: transform 0.3s var(--ease-out);
}
.nav a:not(.btn):hover::after, .nav a:not(.btn):focus-visible::after { transform: scaleX(1); transform-origin: left center; }
.nav__hide { display: none; }

/* Hero */
.hero {
  display: grid;
  gap: 36px;
  padding-top: 40px;
  padding-bottom: 56px;
}
.hero__strip {
  font-family: var(--caps);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.35rem, 7.5vw, 4.1rem); max-width: 13ch; }
.hero h1 em { font-weight: 400; color: var(--green); display: inline-block; padding-bottom: 0.08em; }
.hero__sub { margin-top: 18px; max-width: 42ch; font-size: 1.125rem; color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* The hung drop: two lengths of paper, pattern matched across the seam */
.wall {
  margin: 0;
  order: -1;
  justify-self: start;
  width: calc(var(--tile) * 4);
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: calc(var(--tile) * 3.4);
  position: relative;
  box-shadow: 0 24px 50px -30px rgba(22, 54, 41, 0.55);
}
.wall__cornice {
  height: 14px;
  background: var(--card);
  border-bottom: 3px double var(--line);
}
.wall__skirting {
  height: 22px;
  background: var(--card);
  border-top: 2px solid var(--line);
}
.wall__drops { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; }
.drop {
  position: relative;
  margin-top: calc(var(--tile) * -1);
  height: calc(100% + var(--tile) * 2);
  background: #1f4a3a url("wallpaper.svg") 0 0 / var(--tile) calc(var(--tile) * 4 / 3) repeat;
}
.drop::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 30%, transparent 75%, rgba(0, 0, 0, 0.12));
  pointer-events: none;
}
.drop--second { box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.35), inset 2px 0 0 rgba(255, 255, 255, 0.12); }
/* The paperhanger's smoothing brush: its head rides the leading edge of each length */
.drop::before {
  content: "";
  position: absolute; inset: 0 -4px; z-index: 1;
  background: linear-gradient(to bottom, transparent calc(100% - 22px), var(--ink) calc(100% - 22px), var(--ink) calc(100% - 13px), var(--gold) calc(100% - 13px));
  transform: translateY(-100%);
  pointer-events: none;
}
.wall__seam {
  position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); width: 2px;
  background: var(--gold);
  opacity: 0;
  transform-origin: top center;
}
.plumb {
  position: absolute;
  top: 14px;
  left: calc(50% + var(--tile) * 0.5);
  width: 1px;
  height: 62%;
  background: var(--gold);
  transform-origin: top center;
}
.plumb__bob {
  position: absolute; bottom: -18px; left: -6px;
  width: 13px; height: 18px;
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* Signature: two lengths are hung and brushed down, the second lands half a
   repeat out, slides to match, and the seam flashes true. Done by ~1.25s.
   The headline never animates, so it is readable on the first frame. */
@media (prefers-reduced-motion: no-preference) {
  .drop { animation: unroll 0.5s var(--ease-out) 0.05s both; }
  .drop::before { animation: brush 0.5s var(--ease-out) 0.05s both; }
  .drop--second { animation: unroll 0.45s var(--ease-out) 0.35s both, match 0.4s var(--ease) 0.8s both; }
  .drop--second::before { animation: brush 0.45s var(--ease-out) 0.35s both; }
  .wall__seam { animation: seam 0.45s var(--ease-out) 0.8s both; }
  .plumb { animation: settle 1.1s var(--ease) 0.1s both; }
  .hero__sub, .hero__cta, .hero__strip { animation: rise 0.5s var(--ease-out) both; }
  .hero__sub { animation-delay: 0.06s; }
  .hero__cta { animation-delay: 0.12s; }
}
@keyframes unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes brush { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes match { from { transform: translateY(calc(var(--tile) * -0.5)); } to { transform: none; } }
@keyframes seam { 0% { opacity: 1; transform: scaleY(0); } 55% { opacity: 1; transform: scaleY(1); } 100% { opacity: 0; transform: scaleY(1); } }
@keyframes settle { 0% { transform: rotate(7deg); } 40% { transform: rotate(-3deg); } 70% { transform: rotate(1deg); } 100% { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Services */
.services { display: grid; gap: 28px; padding-block: 32px 64px; }
.lead-service {
  display: grid;
  grid-template-rows: 110px auto;
  color: var(--on-card);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.lead-service__swatch { background: #1f4a3a url("wallpaper.svg") 0 0 / 60px 80px repeat; }
.lead-service__body { padding: 28px 22px 30px; }
.lead-service h3 { font-size: clamp(2rem, 5vw, 2.75rem); }
.lead-service__tag { font-family: var(--display); font-style: italic; font-size: 1.25rem; color: var(--green); margin: 6px 0 14px; }
.lead-service p:not(.lead-service__tag) { max-width: 46ch; }
.other-services { display: grid; gap: 26px; align-content: center; }
.other-services article + article { padding-top: 26px; border-top: 1px solid var(--line); }
.other-services h3 { font-size: 1.625rem; margin-bottom: 6px; }
.other-services p { color: var(--muted); max-width: 40ch; }

/* Manifesto band, edged with the paper itself */
.manifesto {
  color: var(--on-green);
  background: var(--green);
  padding-block: 64px;
  position: relative;
}
.manifesto::before, .manifesto::after {
  content: ""; position: absolute; left: 0; right: 0; height: 12px;
  background: var(--gold);
}
.manifesto::before { top: 0; }
.manifesto::after { bottom: 0; }
.manifesto__text {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4.4vw, 2.75rem);
  line-height: 1.25;
  max-width: 30ch;
}
.manifesto__text em { color: var(--gold); display: inline-block; padding-bottom: 0.08em; }

/* Transformations */
.gallery { padding-block: 72px 64px; }
.gallery__head { max-width: 44ch; margin-bottom: 32px; }
.gallery__head h2 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: 12px; }
.gallery__head p { color: var(--muted); }
.gallery__head strong { color: var(--on-paper); }
.plates { display: grid; gap: 14px; }
.plate {
  position: relative;
  min-height: 220px;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
  background: #1f4a3a url("wallpaper.svg") 0 0 / 72px 96px repeat;
  border-radius: var(--radius);
  overflow: hidden;
}
.plate--paper {
  color: var(--on-plate);
  background: var(--plate);
  border: 2px dashed var(--line);
  align-items: center;
}
.plate--wide { background-size: 48px 64px; }
.plate--pair { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; padding: 0; min-height: 300px; background: var(--plate); }
.plate__half { position: relative; }
.plate__half--before {
  background: repeating-linear-gradient(135deg, var(--plate) 0 14px, #c4bfb0 14px 16px);
}
.plate__half--after { background: #1f4a3a url("wallpaper.svg") 0 0 / 72px 96px repeat; box-shadow: inset 2px 0 0 var(--paper); }
.plate__tag {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--caps); font-size: 0.9375rem; letter-spacing: 0.06em;
  padding: 2px 10px;
  color: var(--on-card);
  background: var(--card);
}
.plate--pair .plate__note { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); }
.plate__note {
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  padding: 8px 14px;
  color: var(--on-card);
  background: var(--card);
  border: 1px solid var(--line);
}
.plate--paper .plate__note { color: var(--on-plate); background: var(--plate); border: 0; }

/* Quote */
.quote { display: grid; gap: 40px; padding-block: 56px 80px; border-top: 1px solid var(--line); }
.quote__card { display: flex; justify-content: center; align-items: flex-start; }
.card {
  transform: rotate(var(--tilt));
  transition: transform 0.4s var(--ease-out);
  width: 100%;
  max-width: 400px;
  padding: 10px;
  text-align: center;
  color: var(--on-card);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -28px rgba(22, 54, 41, 0.6);
}
.card > * { border-inline: 3px double var(--green); padding-inline: 16px; }
.card > :first-child { border-top: 3px double var(--green); padding-top: 26px; }
.card > :last-child { border-bottom: 3px double var(--green); padding-bottom: 26px; }
.card__name { font-family: var(--caps); font-weight: 700; font-size: clamp(1.5rem, 6vw, 1.9rem); line-height: 1.15; color: var(--green); }
.card__trade { font-family: var(--caps); letter-spacing: 0.08em; padding-top: 6px; }
.card__spec { font-family: var(--display); font-style: italic; font-size: 1.125rem; padding-block: 14px; }
.card__spec::before, .card__spec::after { content: " ~ "; color: var(--muted); }
.card__area { font-family: var(--caps); font-size: 0.9375rem; letter-spacing: 0.06em; color: var(--muted); }
.card__contact { display: flex; flex-direction: column; gap: 4px; padding-top: 18px; }
.card__contact a { color: var(--on-card); text-decoration: none; font-weight: 600; }
.card__contact a:first-child { font-family: var(--display); font-size: 1.5rem; }
.card__email, .foot__email { overflow-wrap: anywhere; font-size: 0.9375rem; }

.quote__form h2 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
.quote__intro { margin: 10px 0 24px; color: var(--muted); max-width: 46ch; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font: inherit;
  color: var(--on-card);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--green); outline-offset: 1px; }
.field [aria-invalid="true"] { border: 2px solid var(--error); }
.field__help { font-size: 0.875rem; color: var(--muted); }
.field__error { font-size: 0.9375rem; font-weight: 600; color: var(--error); }
.sent {
  margin-top: 8px;
  padding: 22px;
  color: var(--on-card);
  background: var(--card);
  border: 2px solid var(--green);
}
.sent__title { font-family: var(--display); font-size: 1.5rem; margin-bottom: 8px; color: var(--green); }

/* Footer */
.foot { color: var(--on-green-deep); background: var(--green-deep); padding-block: 48px; }
.foot a { color: var(--on-green-deep); }
.foot__in { display: grid; gap: 32px; }
.foot__in p + p { margin-top: 10px; }
.foot__name { font-family: var(--caps); font-weight: 700; font-size: 1.25rem; }
.foot h2 { font-family: var(--caps); font-size: 1.125rem; margin-bottom: 8px; }
.foot__privacy { max-width: 48ch; }
.foot__small { font-size: 0.875rem; color: var(--gold); }

/* Mobile dock */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  color: var(--on-ink);
  background: var(--ink);
}
.dock .btn { width: 100%; }
.btn--ghost-dark { color: var(--on-ink); background: var(--ink); border-color: var(--on-ink); }
.btn--ghost-dark::before { background: var(--green); }
.btn--ghost-dark:hover { color: var(--on-green); }

@media (min-width: 600px) {
  .nav__hide { display: list-item; }
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .dock { display: none; }
  .wrap { padding-inline: 32px; }
  .plates { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 170px; }
  .plate { min-height: 0; }
  .plate--pair { grid-column: 1 / span 4; grid-row: span 2; min-height: 0; }
  .plate--tall { grid-column: 5 / span 2; grid-row: span 2; }
  .plate--paper { grid-column: 1 / span 2; }
  .plate--wide { grid-column: 3 / span 4; }
  .foot__in { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  :root { --tile: 96px; }
  .hero { grid-template-columns: 1.15fr 0.85fr; align-items: center; padding-top: 56px; padding-bottom: 80px; }
  .wall { order: 0; justify-self: center; height: min(calc(var(--tile) * 5), 70vh); }
  .services { grid-template-columns: 1.6fr 1fr; gap: 56px; }
  .lead-service { grid-template-rows: none; grid-template-columns: 0.7fr 2fr; }
  .lead-service__body { padding: 40px 36px; }
  .quote { grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: start; }
  :root { --tilt: -1.5deg; }
  .card { margin-top: 24px; }
  .card:hover { transform: rotate(0deg) translateY(-4px); }
}

/* ---------- Motion: scroll choreography, form states, dock ---------- */

/* Form micro-interactions */
.field label { justify-self: start; transition: transform 0.2s var(--ease-out); }
.field:focus-within label { transform: translateX(4px); color: var(--green); }
.sent__tick { width: 1.1em; height: 1.1em; margin-right: 8px; vertical-align: -0.12em; fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.thread { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .field__error:not([hidden]) { animation: rise 0.25s var(--ease-out) both; }
  .field [aria-invalid="true"] { animation: nudge 0.32s ease-out; }
  #quote-form.is-leaving { opacity: 0; transform: translateY(-12px); transition: opacity 0.15s ease-in, transform 0.15s ease-in; }
  .sent:not([hidden]) { animation: unroll 0.6s var(--ease-out) both; }
  .sent:not([hidden]) .sent__tick path { stroke-dasharray: 1; animation: draw 0.45s var(--ease-out) 0.35s both; }

  /* Reveals. Nothing is pre-hidden: the base state is always the finished
     page, so a no-JS view or an unscrolled full-page capture shows every
     section. app.js adds .in on entry, which plays a one-shot keyframe whose
     backwards fill covers only its own stagger delay. */
  .manifesto__text .rv { display: inline-block; }
  html.js .rv.in { animation: reveal 0.7s var(--ease-out) var(--d, 0ms) backwards; }

  /* Wallpaper lengths unroll from the top as they are hung */
  html.js .rv--unroll.in { animation: unroll 0.8s var(--ease-out) var(--d, 0ms) backwards; }

  /* The manifesto band: its gold edges are drawn across like a lining paper strip */
  html.js .rv--edge.in { animation: none; }
  html.js .rv--edge.in::before { transform-origin: left center; animation: edge 0.9s var(--ease-out) backwards; }
  html.js .rv--edge.in::after { transform-origin: right center; animation: edge 0.9s var(--ease-out) 0.15s backwards; }

  /* Trade card is laid down on the table */
  html.js .rv--card.in { animation: card-in 0.8s var(--ease-out) backwards; }

  /* Mobile dock arrives once the hero call button has scrolled away */
  html.js .dock { transform: translateY(110%); transition: transform 0.35s var(--ease-out); }
  html.js .dock.on { transform: none; }

  /* Before / after: the new paper wipes across the old as the plate scrolls through */
  /* fill-mode none: outside the range the plate shows its finished state */
  @supports (animation-timeline: view()) {
    .plate__half--after { animation: wipe linear none; animation-timeline: view(); animation-range: entry 0% cover 50%; }
  }
  @supports not (animation-timeline: view()) {
    html.js .plate--pair.in .plate__half--after { animation: wipe 1s var(--ease-out) 0.5s backwards; }
  }

  /* A plumb line down the margin measures how far through the page you are */
  @supports (animation-timeline: scroll()) {
    @media (min-width: 1280px) {
      .thread {
        display: block;
        position: fixed; top: 0; bottom: 0; left: 24px; width: 2px;
        background: var(--green);
        transform-origin: top center;
        animation: grow linear both;
        animation-timeline: scroll(root);
      }
    }
  }
}
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes reveal { from { opacity: 0; transform: translateY(16px); filter: blur(4px); } }
@keyframes edge { from { transform: scaleX(0); } }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) rotate(calc(var(--tilt) + 4deg)); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

