/* ============================================================
   RESIDENTIAL REPOINTING — Repointing & Heritage Restoration, Sydney
   Design tokens + base stylesheet
   Direction: Heritage-premium tension (high-contrast serif + grotesque)
   ============================================================ */

/* ============================================================
   FONTS — self-hosted, latin subset, variable
   Fraunces carries opsz / wght / SOFT / WONK; Outfit carries wght.
   ============================================================ */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/Fraunces-Variable.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/Fraunces-Italic-Variable.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
  font-style: italic;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-Variable.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-display: swap;
  font-style: normal;
}

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* Palette — mono + one masonry accent */
  --bone:        #F6F3EE;  /* page background */
  --bone-deep:   #EDE8DF;  /* alternating section */
  --bone-line:   #E2DCD0;  /* hairline on bone */
  --ink:         #1A1A18;  /* near-black charcoal */
  --ink-soft:    #45433D;  /* body text */
  --ink-mute:    #8A857A;  /* decorative captions / labels only */
  --clay:        #B4541E;  /* masonry accent — clay terracotta */
  --paper:       #FBFAF6;  /* card / input surfaces */

  /* Type */
  --serif: 'Fraunces', Georgia, serif;  /* display / headings */
  --sans:  'Outfit', system-ui, -apple-system, sans-serif;
  --mono:  'SF Mono', 'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  /* Fluid type scale */
  --fs-mega:  clamp(3.4rem, 9.5vw, 9rem);
  --fs-h1:    clamp(2.6rem, 6vw, 5.25rem);
  --fs-h2:    clamp(2rem, 4.2vw, 3.5rem);
  --fs-h3:    clamp(1.4rem, 2.2vw, 2rem);
  --fs-lead:  clamp(1.18rem, 1.7vw, 1.6rem);
  --fs-body:  1.075rem;
  --fs-label: 0.74rem;

  /* Spacing / rhythm */
  --section-y: clamp(5.5rem, 11vw, 11rem);
  --gutter:    clamp(1.5rem, 5vw, 6rem);
  --maxw:      1480px;
  --measure:   62ch;

  /* Detailing */
  --rule: 1px solid var(--bone-line);
  --rule-ink: 1px solid rgba(26,26,24,0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
}
/* `height: auto` is not in the prototype and is not optional here: the
   prototype's <img> tags carry no dimensions, but wp_get_attachment_image()
   emits width/height attributes, and that presentational height wins over
   `aspect-ratio` (which only fills in a dimension that is auto). Without this,
   .about__media renders at the file's full height instead of 4:5. Rules that
   deliberately set a height (.hero__img, .ba__* img, .gtile img) out-specify it. */
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--clay); color: var(--bone); }

h1, h2, h3 { font-family: var(--serif); font-optical-sizing: auto; font-weight: 600; font-variation-settings: 'SOFT' 0, 'WONK' 1; margin: 0; line-height: 1.04; letter-spacing: -0.01em; }
p { margin: 0; }

/* Anchor targets clear the fixed nav */
:where(#about, #services, #work, #gallery, #pricing, #contact, #main) { scroll-margin-top: 96px; }
@media (max-width: 700px) {
  :where(#about, #services, #work, #gallery, #pricing, #contact, #main) { scroll-margin-top: 78px; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Visible focus everywhere. Inputs opt out in favour of a clay border. */
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.pricing :focus-visible,
.lightbox :focus-visible { outline-color: var(--bone); }

.skip-link {
  position: absolute;
  top: 0; left: var(--gutter);
  z-index: 200;
  transform: translateY(-140%);
  background: var(--ink);
  color: var(--bone);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9em 1.4em;
  border-radius: 0;
  transition: transform .4s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ============================================================
   SHARED PRIMITIVES
   ============================================================ */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--deep { background: var(--bone-deep); }

/* The tuckpointing-line motif — a fine mortar joint */
.joint {
  height: 1px;
  background: rgba(26,26,24,0.16);
  border: 0;
  width: 100%;
}
.joint--accent { position: relative; }
.joint--accent::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 56px; height: 1px;
  background: var(--clay);
}

/* Eyebrow / label with mortar-joint marker */
.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}
.eyebrow::before {
  content: "";
  width: 34px; height: 1px;
  background: var(--clay);
  display: inline-block;
  flex: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1.05em 1.9em;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bone);
  border-radius: 0;
  transition: background .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease);
}
.btn .arrow { transition: transform .45s var(--ease); }
.btn:hover { background: var(--clay); border-color: var(--clay); color: var(--bone); }
.btn:hover .arrow { transform: translateX(5px); }

.btn--light { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.btn--light:hover { background: var(--clay); border-color: var(--clay); color: var(--bone); }

/* Text link with mortar-joint underline */
.tlink {
  position: relative;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  padding-bottom: 3px;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.tlink::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transform-origin: left;
  transition: transform .5s var(--ease), background .5s var(--ease);
}
.tlink:hover::after { background: var(--clay); transform: scaleX(1.0); }
.tlink:hover { color: var(--clay); }

/* Striped image placeholders (for slots awaiting client photos) */
.ph {
  position: relative;
  background-color: var(--bone-deep);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(26,26,24,0.045) 0, rgba(26,26,24,0.045) 1px,
    transparent 1px, transparent 11px
  );
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--bone-line);
}
.ph span {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
  text-align: center;
  padding: 0.6em 1em;
  background: var(--bone);
  border: 1px solid var(--bone-line);
  max-width: 80%;
}

/* Scroll-reveal. The `js` class is set by site.js before paint, so the page
   stays visible if the script never runs. */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: .08s; }
.js .reveal.d2 { transition-delay: .16s; }
.js .reveal.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
