/* Trades Landing Page System: components (tl-*), adapted for D1 Painting Solutions.
   Needs theme.css first. Mobile-first; main breakpoint 720px. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; }
.tl-page { font: 400 1rem/1.55 var(--font-body); color: var(--text); background: var(--ground); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
.tl-page img, .tl-page picture { max-width: 100%; display: block; }
.tl-page :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tl-dark :focus-visible, .tl-hero :focus-visible, .tl-footer :focus-visible, .tl-callbar :focus-visible { outline-color: var(--focus-on-dark); }
.tl-container { max-width: var(--container); margin: 0 auto; padding-inline: var(--space-5); }
.tl-section { padding-block: var(--space-8); }
@media (min-width: 720px) { .tl-section { padding-block: var(--space-9); } }
.tl-dark { background: var(--ink); color: var(--on-dark); }
.tl-page [id] { scroll-margin-top: calc(var(--header-h) + 12px); }
.tl-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; }
.tl-skip { position: absolute; left: var(--space-4); top: -100px; z-index: 100; background: var(--ink); color: var(--on-dark); padding: 12px 18px; border-radius: var(--radius-md); font-weight: 700; }
.tl-skip:focus { top: var(--space-4); }

/* ---------- Draft copy placeholders (visible during client review) ---------- */
.copy-placeholder {
  --ph-ink: var(--accent-2-strong);
  display: inline;
  padding: 0.1em 0.4em;
  border: 1.5px dashed color-mix(in srgb, var(--ph-ink) 70%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: inherit;
  font-style: normal;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.copy-placeholder::before {
  content: "Draft";
  display: inline-block;
  margin-inline-end: 0.45em;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  background: var(--ph-ink);
  color: var(--surface);
  font: 700 0.65rem/1.2 var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 0.2em;
}
:is(.tl-dark, .tl-hero, .tl-trust, .tl-footer, .tl-card--cta) .copy-placeholder { --ph-ink: var(--accent-2); }
:is(.tl-dark, .tl-hero, .tl-trust, .tl-footer, .tl-card--cta) .copy-placeholder::before { color: var(--ink); }
p.copy-placeholder, div.copy-placeholder { display: block; padding: 0.6em 0.8em; }

/* ---------- Type ---------- */
.tl-eyebrow { margin: 0 0 0.75rem; font: 700 0.875rem/1.3 var(--font-body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-2-strong); }
:is(.tl-dark, .tl-hero) .tl-eyebrow { color: var(--accent-2); }
.tl-h1 { margin: 0; font: 700 clamp(2.5rem, 1.6rem + 3.4vw, 4.25rem)/1.02 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.tl-h1 em, .tl-h2 em { font-style: normal; color: var(--accent); }
.tl-h2 { margin: 0; font: 700 clamp(2.125rem, 1.5rem + 2.2vw, 3.25rem)/1.05 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }
.tl-h3 { margin: 0; font: 600 1.5rem/1.15 var(--font-display); letter-spacing: -0.01em; }
.tl-lead { font-size: 1.25rem; line-height: 1.55; text-wrap: pretty; }
.tl-body-lg { font-size: 1.125rem; line-height: 1.6; color: var(--text-muted); text-wrap: pretty; max-width: 62ch; }
.tl-dark .tl-body-lg { color: var(--on-dark-soft); }

/* ---------- Buttons ---------- */
.tl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--tap-min); padding: 0.5rem 1.375rem; border: 2px solid transparent; border-radius: var(--radius-md); font: 700 1rem/1.1 var(--font-body); text-decoration: none; text-align: center; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s, filter .15s; }
.tl-btn svg { width: 18px; height: 18px; flex: none; stroke: currentColor; }
.tl-btn--lg { min-height: var(--tap-cta); padding-inline: 1.75rem; font-size: 1.0625rem; }
.tl-btn--block { display: flex; width: 100%; }
.tl-btn--primary { background: var(--accent); color: var(--on-accent); font-weight: 800; letter-spacing: 0.02em; }
.tl-btn--primary:hover { filter: brightness(1.06); }
.tl-btn--call { border-color: var(--accent-2); color: var(--on-dark); background: transparent; }
.tl-btn--call svg { stroke: var(--accent-2); }
.tl-btn--call:hover { background: var(--accent-2); color: var(--ink); }
.tl-btn--call:hover svg { stroke: var(--ink); }
.tl-btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.tl-btn--outline:hover { background: var(--ink); color: var(--on-dark); }
.tl-btn--light { background: var(--surface); color: var(--text); }
.tl-btn--light:hover { background: var(--ground); }
.tl-btn--ink { background: var(--ink); color: var(--on-dark); font-weight: 800; letter-spacing: 0.02em; }
.tl-btn--ink:hover { background: var(--ink-2); }
.tl-btn--ghost-ink { border-color: var(--on-accent); color: var(--on-accent); background: transparent; }
.tl-btn--ghost-ink:hover { background: var(--on-accent); color: var(--accent); }
.tl-btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Top bar ---------- */
.tl-topbar { background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 0.9375rem; }
.tl-topbar .tl-container { display: flex; flex-wrap: wrap; gap: 4px var(--space-5); justify-content: space-between; align-items: center; padding-block: 8px; }
.tl-topbar a { color: var(--on-accent); font-weight: 800; text-decoration: none; }
.tl-topbar a:hover { text-decoration: underline; }

/* ---------- Header (light: the logo is designed for light grounds) ---------- */
.tl-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border-soft); }
.tl-header .tl-container { display: flex; gap: var(--space-3) var(--space-6); align-items: center; justify-content: space-between; min-height: var(--header-h); padding-block: 10px; }
.tl-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); flex: none; }
.tl-brand img { height: 48px; width: auto; }
.tl-brand__name { display: grid; font: 600 0.95rem/1.15 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; }
.tl-brand__name span:last-child { color: var(--text-subtle); font-weight: 500; }
.tl-nav { display: none; gap: 4px 28px; }
.tl-nav a { color: var(--text); text-decoration: none; font-weight: 600; padding: 14px 0; border-bottom: 2px solid transparent; }
.tl-nav a:hover { border-bottom-color: var(--accent); }
.tl-header__actions { display: flex; gap: var(--space-3); flex: none; }
.tl-header__actions .tl-btn--outline span { display: none; }
@media (min-width: 720px) { .tl-header__actions .tl-btn--outline span { display: inline; } }
@media (min-width: 1100px) { .tl-nav { display: flex; } }
@media (max-width: 719px) {
  .tl-has-callbar .tl-header__actions, .tl-has-callbar .tl-topbar a { display: none; }
  .tl-topbar { font-size: 0.875rem; }
  .tl-brand img { height: 42px; }
  :root { --header-h: 64px; }
}
@media (max-width: 380px) { .tl-brand__name { font-size: 0.8rem; letter-spacing: 0.12em; } }

/* ---------- Hero ---------- */
.tl-hero { position: relative; overflow: hidden; background: var(--ink); color: var(--on-dark); isolation: isolate; }
.tl-hero__bg, .tl-hero__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 55%; z-index: -2; }
.tl-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--overlay-strong) 0%, var(--overlay-strong) 34%, var(--overlay-soft) 100%); }
@media (max-width: 899px) { .tl-hero::before { background: linear-gradient(180deg, var(--overlay-soft) 0%, var(--overlay-strong) 45%); } }
.tl-hero .tl-container { display: flex; flex-wrap: wrap; gap: var(--space-7); align-items: center; padding-block: 3.5rem 4.5rem; }
.tl-hero__copy { flex: 1 1 520px; min-width: 0; }
.tl-hero__copy .tl-lead { margin: var(--space-5) 0 0; color: var(--on-dark-soft); max-width: 36rem; }
.tl-hero__copy > .tl-btn-row { margin-top: 2.25rem; }
.tl-hero__form { flex: 1 1 340px; max-width: 470px; }
@media (min-width: 720px) { .tl-hero .tl-container { padding-block: 4.5rem 5.5rem; } }

/* ---------- Check list ---------- */
.tl-checks { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: var(--space-3); font-size: 1.125rem; font-weight: 600; }
.tl-checks li { display: flex; gap: var(--space-3); align-items: center; }
.tl-checks svg { width: 22px; height: 22px; flex: none; stroke: var(--accent); }

/* ---------- Quote form ---------- */
.tl-quote { position: relative; background: var(--surface); color: var(--text); border-radius: var(--radius-lg); border-top: var(--rule-accent) solid var(--accent); box-shadow: var(--shadow-form); padding: var(--space-5); }
.tl-quote :focus-visible { outline-color: var(--focus); }
@media (min-width: 720px) { .tl-quote { padding: var(--space-6); } }
.tl-quote__title { margin: 0; font: 700 2rem/1.05 var(--font-display); letter-spacing: -0.015em; }
.tl-quote__intro { margin: 8px 0 22px; color: var(--text-muted); }
.tl-quote form { display: grid; gap: 14px; }
.tl-field { display: grid; gap: 6px; align-content: start; }
.tl-field label { font-weight: 600; font-size: 0.9375rem; }
.tl-field label small { font-weight: 400; font-size: 0.9375rem; color: var(--text-subtle); }
.tl-field :is(input, select, textarea) { width: 100%; min-height: var(--tap-min); padding: 0.625rem 0.875rem; border: 1.5px solid var(--border-input); border-radius: var(--radius-md); background: var(--field); color: var(--text); font: 400 1rem/1.4 var(--font-body); }
.tl-field select { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F1915' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.tl-field textarea { resize: vertical; min-height: 96px; field-sizing: content; max-height: 18rem; }
.tl-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.tl-field__error { display: none; margin: 0; color: var(--error); font-size: 0.875rem; font-weight: 600; }
.tl-field :is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) { border-color: var(--error); background-color: var(--error-tint); }
.tl-field :is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) + .tl-field__error { display: block; }
.tl-quote__turnstile:empty { display: none; }
.tl-quote__fine { margin: 0; text-align: center; font-size: 0.875rem; color: var(--text-subtle); }
.tl-quote__fine a { color: var(--text); font-weight: 700; }
.tl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Trust strip ---------- */
.tl-trust { background: var(--ink-2); color: var(--on-dark); }
.tl-trust .tl-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px var(--space-6); padding-block: 28px; }
.tl-trust__item { display: grid; gap: 4px; align-content: start; border-left: var(--rule-stat) solid var(--accent); padding-left: var(--space-4); }
.tl-trust__item strong { font: 700 1.5rem/1.15 var(--font-display); }
.tl-trust__item span { color: var(--on-dark-muted); }

/* ---------- Section heading ---------- */
.tl-heading { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-7); align-items: end; justify-content: space-between; margin-bottom: 2.5rem; }
.tl-heading > div { max-width: 680px; }
.tl-heading > p { margin: 0; max-width: 440px; }

/* ---------- Cards ---------- */
.tl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--space-5); }
.tl-card { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border-soft); }
.tl-card > picture img, .tl-card > .tl-ph { width: 100%; height: 240px; object-fit: cover; }
.tl-card__body { padding: var(--space-5) var(--space-5) 1.75rem; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tl-card__body > p { margin: 0; font-size: 1.0625rem; color: var(--text-muted); flex: 1; }
.tl-card__link { font-weight: 700; color: var(--text); text-underline-offset: 3px; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.tl-card--cta { background: var(--ink); color: var(--on-dark); border: 0; border-top: var(--rule-accent) solid var(--accent); padding: 2.25rem var(--space-6); justify-content: space-between; gap: var(--space-5); }
.tl-card--cta .tl-h3 { font-size: 2rem; font-weight: 700; line-height: 1.08; }
.tl-card--cta p { margin: 12px 0 0; font-size: 1.0625rem; color: var(--on-dark-soft); }
.tl-card--cta .tl-btn-stack { display: grid; gap: var(--space-3); }
.tl-card--cta :focus-visible { outline-color: var(--focus-on-dark); }

/* ---------- Project gallery ---------- */
.tl-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.tl-gallery figure { margin: 0; position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--ink-2); }
.tl-gallery a { display: block; color: inherit; }
.tl-gallery img { width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; transition: scale .4s ease; }
@media (hover: hover) { .tl-gallery a:hover img { scale: 1.035; } }
.tl-gallery figcaption { position: absolute; left: 12px; bottom: 12px; right: 12px; width: fit-content; background: var(--scrim); color: var(--on-dark); font-weight: 600; font-size: 0.875rem; padding: 6px 12px; border-radius: var(--radius-sm); pointer-events: none; }
.tl-gallery a:focus-visible { outline-offset: -4px; outline-color: var(--accent); }
.tl-gallery__note { margin: var(--space-5) 0 0; }

/* Lightbox (native dialog) */
.tl-lightbox { padding: 0; border: 0; background: transparent; max-width: min(92vw, 900px); max-height: 92dvh; overflow: visible; }
.tl-lightbox::backdrop { background: rgb(20 16 13 / 0.88); }
.tl-lightbox img { max-width: 100%; max-height: 82dvh; width: auto; height: auto; border-radius: var(--radius-md); margin-inline: auto; }
.tl-lightbox p { margin: 10px 0 0; color: #fff; text-align: center; font-weight: 600; }
.tl-lightbox__close { position: absolute; top: -56px; right: 0; min-height: var(--tap-min); min-width: var(--tap-min); border-radius: var(--radius-pill); border: 0; background: var(--surface); color: var(--ink); font: 700 1rem/1 var(--font-body); padding: 0 18px; cursor: pointer; }
.tl-lightbox__close:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Process steps ---------- */
.tl-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--space-5); }
.tl-steps li { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 1.75rem; display: grid; gap: 10px; align-content: start; }
.tl-steps__num { font: 700 3.25rem/1 var(--font-display); color: var(--accent-2-strong); }
.tl-steps p { margin: 0; font-size: 1.0625rem; color: var(--text-muted); }
.tl-steps a { color: var(--text); font-weight: 700; }

/* ---------- About split ---------- */
.tl-split { display: flex; flex-wrap: wrap; gap: 3.5rem; align-items: center; }
.tl-split > * { flex: 1 1 420px; min-width: 0; }
.tl-split__media img, .tl-split__media .tl-ph { width: 100%; height: clamp(320px, 42vw, 520px); object-fit: cover; border-radius: var(--radius-lg); }
.tl-values { margin: var(--space-6) 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--space-4) var(--space-5); }
.tl-values div { border-top: 2px solid var(--line-dark); padding-top: 14px; }
.tl-values h3 { margin: 0 0 4px; font: 600 1.25rem/1.2 var(--font-display); color: var(--accent); }
.tl-values p { margin: 0; color: var(--on-dark-muted); }
.tl-mt { margin-top: var(--space-5); margin-bottom: 0; }
.tl-mt-lg { margin-top: 2.25rem; }
.tl-mb { margin-bottom: 2.25rem; }

/* ---------- Area chips ---------- */
.tl-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.tl-chips li { background: var(--surface); border: 1.5px solid var(--border-soft); border-radius: var(--radius-pill); padding: 12px 22px; font-weight: 700; font-size: 1.0625rem; }
.tl-split--tight { gap: var(--space-6) 3.5rem; }

/* ---------- CTA band with paint-drip edge (from the logo's drips) ---------- */
.tl-band { position: relative; background: var(--accent); color: var(--on-accent); }
.tl-band::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 40px; z-index: 1; pointer-events: none;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 40'%3E%3Cpath d='M0 0H240V6H213V14a4 4 0 0 1-8 0V6H158V34a8 8 0 0 1-16 0V6H100V18a5 5 0 0 1-10 0V6H44V30a7 7 0 0 1-14 0V6H0Z'/%3E%3C/svg%3E") 0 0 / 240px 40px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 40'%3E%3Cpath d='M0 0H240V6H213V14a4 4 0 0 1-8 0V6H158V34a8 8 0 0 1-16 0V6H100V18a5 5 0 0 1-10 0V6H44V30a7 7 0 0 1-14 0V6H0Z'/%3E%3C/svg%3E") 0 0 / 240px 40px repeat-x;
}
.tl-band .tl-container { display: flex; flex-wrap: wrap; gap: 28px var(--space-7); align-items: center; justify-content: space-between; padding-block: var(--space-8); }
.tl-band .tl-h2 { color: var(--on-accent); }
.tl-band p { margin: 12px 0 0; font-size: 1.1875rem; font-weight: 500; }
.tl-band :focus-visible { outline-color: var(--ink); }

/* ---------- Footer ---------- */
.tl-footer { background: var(--ink); color: var(--on-dark-muted); }
.tl-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-6); padding-block: 5rem var(--space-6); }
.tl-footer__cols > div { display: grid; gap: 8px; align-content: start; }
.tl-footer h2 { margin: 0 0 6px; font: 600 1.125rem/1.2 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark); }
.tl-footer a { color: var(--on-dark-muted); }
.tl-footer a:hover { color: var(--on-dark); }
.tl-footer a.tl-footer__phone { color: var(--on-dark); font-weight: 700; text-decoration: none; font-size: 1.125rem; }
.tl-footer__logo { height: 120px; width: auto; justify-self: start; }
.tl-footer__cols p { margin: 6px 0 0; }
.tl-footer__base { border-top: 1px solid var(--line-dark); padding-block: 20px 32px; font-size: 0.875rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- Mobile call bar ---------- */
.tl-callbar { position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--ink); border-top: 1px solid var(--line-dark); }
.tl-callbar .tl-btn { min-height: 52px; font-size: 0.9375rem; padding-inline: 12px; }
.tl-has-callbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { .tl-callbar { display: none; } .tl-has-callbar { padding-bottom: 0; } }

/* ---------- Placeholder image (photo still to come) ---------- */
.tl-ph { display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center;
  background: repeating-linear-gradient(135deg, var(--border-soft) 0 2px, transparent 2px 14px), var(--ground);
  color: var(--text-subtle); font: 600 0.875rem/1.3 var(--font-body); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Thank-you / 404 ---------- */
.tl-thanks { min-height: 100dvh; display: flex; align-items: center; text-align: center; background: var(--ground); }
.tl-thanks .tl-container { max-width: 640px; display: grid; justify-items: center; gap: 20px; padding-block: var(--space-7); }
.tl-thanks__logo { height: 120px; width: auto; }
.tl-thanks__icon { width: 64px; height: 64px; stroke: var(--success); }
.tl-thanks .tl-body-lg { margin: 0; }
.tl-thanks .tl-btn-row { justify-content: center; }
.tl-thanks a:not(.tl-btn) { color: var(--text); font-weight: 700; }

/* ---------- Forced colours ---------- */
@media (forced-colors: active) {
  .tl-btn { border-color: ButtonText; }
  .copy-placeholder { border-color: CanvasText; }
  .tl-trust__item, .tl-card--cta, .tl-quote { border-color: CanvasText; }
}
.tl-section--flush { padding-top: 0; }
