/* ==========================================================================
   Flynnbuild Carpentry & Joinery — Design System
   Tokens sourced from Flynnbuild OS /brand/tokens.md — do not invent values.
   Palette locked to the four confirmed colours. No accent colour is
   approved for client-facing use (see decisions.md item 7) so none is used.
   ========================================================================== */

:root {
  /* Colour */
  --color-black: #000000;
  --color-white: #FFFFFF;
  --color-grey: #4A4A4A;
  --color-paper: #F5F5F3;

  /* Type */
  --font-stack: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --size-display: 40px;   --lh-display: 48px; --wt-display: 700;
  --size-h1: 32px;        --lh-h1: 40px;      --wt-h1: 700;
  --size-h2: 24px;        --lh-h2: 32px;      --wt-h2: 600;
  --size-h3: 19px;        --lh-h3: 28px;      --wt-h3: 600;
  --size-body: 16px;      --lh-body: 26px;    --wt-body: 400;
  --size-label: 13px;     --lh-label: 18px;   --wt-label: 600;

  /* Spacing (8px base grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-full: 999px;

  /* Border */
  --border-default: 1px solid var(--color-grey);
  --border-on-dark: 1px solid rgba(255,255,255,0.35);
  --border-hairline: 1px solid rgba(0,0,0,0.12);

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
}

/* Breakpoints (reference, standard defaults — see tokens.md):
   mobile 0–599px / tablet 600–959px / desktop 960px+ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  font-weight: var(--wt-body);
  color: var(--color-black);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding-left: 1.1em; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}
@media (max-width: 599px) {
  .container { padding: 0 var(--space-3); }
}

section { padding: var(--space-8) 0; }
@media (max-width: 599px) {
  section { padding: var(--space-6) 0; }
}
.section-tight { padding: var(--space-6) 0; }

.bg-paper { background: var(--color-paper); }
.bg-black { background: var(--color-black); color: var(--color-white); }
.bg-white { background: var(--color-white); }

/* Type utilities */
.type-display { font-size: var(--size-display); line-height: var(--lh-display); font-weight: var(--wt-display); margin: 0 0 var(--space-4); }
.type-h1 { font-size: var(--size-h1); line-height: var(--lh-h1); font-weight: var(--wt-h1); margin: 0 0 var(--space-3); }
.type-h2 { font-size: var(--size-h2); line-height: var(--lh-h2); font-weight: var(--wt-h2); margin: 0 0 var(--space-3); }
.type-h3 { font-size: var(--size-h3); line-height: var(--lh-h3); font-weight: var(--wt-h3); margin: 0 0 var(--space-2); }
.type-label {
  font-size: var(--size-label); line-height: var(--lh-label); font-weight: var(--wt-label);
  text-transform: uppercase; letter-spacing: 0.04em; display: inline-block;
}
.type-lead { font-size: 19px; line-height: 30px; font-weight: 400; }
.text-grey { color: var(--color-grey); }
.max-prose { max-width: 62ch; }

@media (max-width: 599px) {
  .type-display { font-size: 32px; line-height: 40px; }
  .type-h1 { font-size: 26px; line-height: 34px; }
}

/* Buttons — 44px minimum tap target */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-black); color: var(--color-white); }
.btn-primary:hover { background: #1a1a1a; }
.btn-primary:focus-visible { outline: 3px solid var(--color-black); outline-offset: 3px; }
.btn-outline { background: transparent; color: var(--color-black); border-color: var(--color-black); }
.btn-outline:hover { background: var(--color-black); color: var(--color-white); }
.btn-outline-onDark { background: transparent; color: var(--color-white); border: var(--border-on-dark); }
.btn-outline-onDark:hover { background: var(--color-white); color: var(--color-black); }
.btn-white { background: var(--color-white); color: var(--color-black); }
.btn-white:hover { background: var(--color-paper); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--color-black); outline-offset: 2px;
}
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-white);
  border-bottom: var(--border-hairline);
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
}
.site-header__logo img { height: 68px; width: auto; }
.site-header__nav { display: flex; align-items: center; gap: var(--space-5); }
.site-header__nav a {
  text-decoration: none; font-size: 15px; font-weight: 600; color: var(--color-black);
  padding: var(--space-2) 0; border-bottom: 2px solid transparent;
}
.site-header__nav a:hover, .site-header__nav a[aria-current="page"] { border-bottom-color: var(--color-black); }
.site-header__actions { display: flex; align-items: center; gap: var(--space-3); }
.site-header__phone {
  display: flex; align-items: center; gap: var(--space-2);
  text-decoration: none; font-weight: 600; font-size: 15px; color: var(--color-black);
}
.nav-toggle {
  display: none; background: none; border: var(--border-default); border-radius: var(--radius-md);
  width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 959px) {
  .site-header__nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-white); border-bottom: var(--border-hairline);
    flex-direction: column; align-items: stretch; gap: 0; padding: var(--space-3) var(--space-3) var(--space-4);
  }
  .site-header__nav.is-open { display: flex; }
  .site-header__nav.is-open .nav-list { flex-direction: column; gap: 0; width: 100%; }
  .site-header__nav a { display: block; padding: var(--space-3) 0; border-bottom: var(--border-hairline); }
  .site-header__phone-label { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* Hero */
.hero { padding: var(--space-8) 0; }
.hero--photo {
  position: relative; color: var(--color-white); padding: var(--space-8) 0;
  background-size: cover; background-position: center;
}
.hero--photo::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,.65) 100%);
}
.hero--photo .container { position: relative; z-index: 1; }
.trust-strip {
  display: flex; flex-wrap: wrap; gap: var(--space-5);
  margin-top: var(--space-6); padding-top: var(--space-5);
  border-top: var(--border-on-dark);
}
.trust-strip--light { border-top: var(--border-hairline); }
.trust-item .type-label { display: block; margin-bottom: var(--space-1); opacity: .8; }
.trust-item strong { font-size: 19px; font-weight: 700; display: block; }

/* Cards */
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 899px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--color-white);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card__media { aspect-ratio: 4/3; overflow: hidden; background: var(--color-paper); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.card__body p { flex: 1; }
.card--link { text-decoration: none; color: inherit; }
.tag {
  display: inline-block; padding: var(--space-1) var(--space-2);
  background: var(--color-paper); border-radius: var(--radius-full);
  font-size: var(--size-label); font-weight: var(--wt-label); text-transform: uppercase; letter-spacing: 0.04em;
  width: fit-content;
}
.tag--dark { background: var(--color-black); color: var(--color-white); }
.tag--soon { background: transparent; border: var(--border-default); color: var(--color-grey); }

/* Process steps */
.steps { counter-reset: step; }
.step { display: flex; gap: var(--space-4); padding: var(--space-4) 0; border-top: var(--border-hairline); }
.step:first-child { border-top: none; }
.step__num {
  counter-increment: step; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--color-black); color: var(--color-white);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.step__num::before { content: counter(step); }

/* Footer */
.site-footer { background: var(--color-black); color: var(--color-white); padding: var(--space-7) 0 var(--space-5); }
.site-footer a { text-decoration: none; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-6); }
@media (max-width: 899px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 599px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer__grid > div:first-child { display: flex; align-items: center; }
.site-footer__logo img { height: 84px; }
.site-footer h4 { font-size: var(--size-label); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-3); color: rgba(255,255,255,.7); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer ul a:hover { text-decoration: underline; }
.site-footer__bottom {
  margin-top: var(--space-6); padding-top: var(--space-4); border-top: var(--border-on-dark);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3);
  font-size: 14px; color: rgba(255,255,255,.65);
}

/* CTA band */
.cta-band { background: var(--color-black); color: var(--color-white); text-align: center; }
.cta-band .type-h1 { margin-bottom: var(--space-3); }

/* Forms */
label { display: block; font-size: var(--size-label); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-2); }
input, textarea, select {
  width: 100%; font-family: var(--font-stack); font-size: 16px;
  padding: var(--space-3); border: var(--border-default); border-radius: var(--radius-sm);
  background: var(--color-white); color: var(--color-black); margin-bottom: var(--space-4);
  min-height: 44px;
}
textarea { min-height: 140px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 599px) { .form-row { grid-template-columns: 1fr; } }

/* Photo detail / joint focus blocks */
.detail-shot { border-radius: var(--radius-lg); overflow: hidden; }
.detail-shot img { width: 100%; height: 100%; object-fit: cover; }
.detail-shot img.obj-left { object-position: left center; }

/* Two column feature */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-7); align-items: center; }
@media (max-width: 899px) { .split { grid-template-columns: 1fr; gap: var(--space-5); } }
.split.reverse .split__media { order: 2; }
@media (max-width: 899px) { .split.reverse .split__media { order: initial; } }

/* Breadcrumb */
.breadcrumb { font-size: 14px; color: var(--color-grey); margin-bottom: var(--space-4); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--color-black); color: var(--color-white);
  padding: var(--space-3); z-index: 200; border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; }

/* Coming soon */
.coming-soon-panel {
  border: 2px dashed var(--color-grey); border-radius: var(--radius-lg);
  padding: var(--space-6); text-align: center; background: var(--color-paper);
}

.divider { height: 1px; background: var(--border-hairline); border: none; margin: 0; }

.list-check { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.list-check li { padding-left: var(--space-4); position: relative; }
.list-check li::before { content: "\2022"; position: absolute; left: 0; color: var(--color-grey); }

/* Gallery lightbox */
.gallery-item { background: none; display: block; width: 100%; }
.gallery-item img { transition: transform .3s ease; }
.gallery-item:hover img { transform: scale(1.03); }
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.97);
  display: none; align-items: center; justify-content: center;
}
.lightbox.is-open { display: flex; }
.lightbox__img-wrap { max-width: 92vw; max-height: 86vh; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lightbox__img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-md); }
.lightbox__close, .lightbox__prev, .lightbox__next {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: none;
  border-radius: var(--radius-full); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
}
.lightbox__close:hover, .lightbox__prev:hover, .lightbox__next:hover { background: rgba(255,255,255,.25); }
.lightbox__close { top: var(--space-4); right: var(--space-4); }
.lightbox__prev { left: var(--space-4); top: 50%; transform: translateY(-50%); }
.lightbox__next { right: var(--space-4); top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: var(--space-4); left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.75); font-size: 14px; }
@media (max-width: 599px) {
  .lightbox__prev { left: var(--space-2); width: 40px; height: 40px; }
  .lightbox__next { right: var(--space-2); width: 40px; height: 40px; }
  .lightbox__close { top: var(--space-2); right: var(--space-2); width: 40px; height: 40px; }
}
