/* ============================================================
   Kings Contractors — shared stylesheet
   Loaded once, cached across every page (home + all projects).
   ============================================================ */

:root {
  /* palette */
  --bg:        #110F0C;
  --bg-2:      #14110D;
  --surface:   #171410;
  --surface-2: #1A1713;
  --ink:       #F5F0E6;
  --ink-75: rgba(245,240,230,0.75);
  --ink-65: rgba(245,240,230,0.65);
  --ink-60: rgba(245,240,230,0.60);
  --ink-55: rgba(245,240,230,0.55);
  --ink-50: rgba(245,240,230,0.50);
  --ink-45: rgba(245,240,230,0.45);
  --ink-40: rgba(245,240,230,0.40);
  --gold:    #C9A961;
  --gold-hi: #DFC07F;
  --line:      rgba(245,240,230,0.10);
  --line-soft: rgba(245,240,230,0.07);
  --gold-line: rgba(201,169,97,0.35);

  /* type */
  --display: 'Fraunces', Georgia, serif;
  --body: 'DM Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --maxw: 1240px;
  --pad: clamp(20px, 5vw, 56px);
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.section { padding-block: clamp(44px, 7vw, 64px); }
.section--tight { padding-block: clamp(40px, 6vw, 56px); }
.divider-top { border-top: 1px solid var(--line); }

/* ---------- type helpers ---------- */
.eyebrow {
  display: block; font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 14px;
}
.h1 { font-family: var(--display); font-weight: 500; line-height: 1.03;
      letter-spacing: -.01em; font-size: clamp(36px, 5.4vw, 64px); margin: 0; color: var(--ink); }
.h2 { font-family: var(--display); font-weight: 500; line-height: 1.15;
      font-size: clamp(26px, 3vw, 36px); margin: 0 0 14px; color: var(--ink); }
.h2--lg { font-size: clamp(30px, 4.4vw, 54px); }
em.accent, .accent { color: var(--gold); font-style: italic; }
.lead { font-size: clamp(15.5px, 1.6vw, 17px); line-height: 1.65; color: var(--ink-65); max-width: 60ch; }
.muted { color: var(--ink-60); }

/* ---------- buttons ---------- */
.btn, .btn-outline {
  display: inline-block; padding: 14px 24px; border-radius: 3px;
  font-weight: 600; font-size: 14px; line-height: 1;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.btn { background: var(--gold); color: #14110D; box-shadow: 0 8px 24px rgba(201,169,97,.22); }
.btn:hover { background: var(--gold-hi); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(201,169,97,.35); }
.btn-outline { border: 1px solid rgba(245,240,230,.3); color: var(--ink); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- nav (sticky, mobile-collapsible, JS-free) ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(14,12,10,.92);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner { display: flex; align-items: center; gap: 16px 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto;
         font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.brand img { width: 32px; height: 32px; }
.nav-links { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.nav-links a { color: var(--ink-70, rgba(245,240,230,.7)); font-size: 13.5px;
               padding-bottom: 3px; border-bottom: 1px solid transparent;
               transition: color .25s ease, border-color .25s ease; }
.nav-links a:hover { color: var(--ink); border-color: var(--gold); }
.nav-links a.btn { color: #14110D; border-bottom: 0; padding: 10px 20px; }
.nav-links a.btn:hover { color: #14110D; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; cursor: pointer; width: 42px; height: 40px; border-radius: 3px;
              border: 1px solid rgba(245,240,230,.18); color: var(--ink);
              align-items: center; justify-content: center; }
.nav-burger svg { width: 20px; height: 20px; }

/* ---------- hero contact card (home) ---------- */
.contact-card {
  border: 1px solid var(--gold-line); background: rgba(26,23,19,.55);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 28px; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.contact-card .row { display: block; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.contact-card .row strong { display: block; font-size: 16px; }
.contact-card .row span { font-size: 12px; color: var(--ink-50); }
.contact-card .row:last-child { border-bottom: 1px solid var(--line-soft); }

/* ---------- marquee ---------- */
.marquee-mask { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line);
  overflow: hidden; -webkit-mask-image: linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);
          mask-image: linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent); }
.marquee { display: flex; width: max-content; gap: 40px; animation: marquee 22s linear infinite;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-40); white-space: nowrap; }
@keyframes marquee { from { transform: translateX(0);} to { transform: translateX(-50%);} }

/* ---------- ambient gold glow ---------- */
.glow-wrap { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; animation: floatGlow 8s ease-in-out infinite; }
@keyframes floatGlow { 0%,100%{opacity:.5;transform:scale(1)} 50%{opacity:.85;transform:scale(1.08)} }

/* ---------- generic cards + grids ---------- */
.grid { display: grid; gap: 24px; }
.auto-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.auto-svc { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.auto-proc { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.auto-spec { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px; }
.auto-scope { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 4px; }
.svc { padding: 30px 26px; transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.svc:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(0,0,0,.35); border-color: var(--gold-line); }
.svc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.svc-num { font-family: var(--display); font-size: 14px; color: var(--gold); }
.svc-dot { width: 7px; height: 7px; background: var(--gold); border-radius: 1px; }
.svc h3, .proc h3 { font-family: var(--display); font-weight: 500; color: var(--ink); margin: 0 0 10px; }
.svc h3 { font-size: 21px; }
.card p { font-size: 14.5px; line-height: 1.6; color: var(--ink-60); margin: 0; }

.proc { padding: 26px 22px; }
.proc-num { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--gold-line);
  display: flex; align-items: center; justify-content: center; font-family: var(--display);
            font-size: 14px; color: var(--gold); margin-bottom: 18px; }
.proc h3 { font-size: 19px; margin-bottom: 8px; }
.proc p { font-size: 14px; }

/* ---------- stats ---------- */
.stats { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 4px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); padding: 32px 0; }
.stat { text-align: center; padding: 0 20px; border-left: 1px solid var(--line-soft); }
.stat:first-child { border-left: 0; }
.stat .num { font-family: var(--display); font-weight: 500; color: var(--gold); margin: 0;
             font-size: clamp(32px, 3.2vw, 44px); }
.stat .lbl { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-50); margin: 8px 0 0; }

/* ---------- project cards (home work grid) ---------- */
.work-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.project-card { display: flex; flex-direction: column; overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease; }
.project-card:hover { transform: translateY(-8px); box-shadow: 0 24px 48px rgba(0,0,0,.45); border-color: var(--gold-line); }
.project-card figure { margin: 0; position: relative; overflow: hidden; }
.project-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform .6s ease; }
.project-card:hover img { transform: scale(1.06); }
.project-card figure::after { content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 50%, rgba(10,9,7,.55)); pointer-events:none; }
.project-body { padding: 24px 26px 28px; flex: 1; display: flex; flex-direction: column; }
.tag { align-self: flex-start; margin-bottom: 14px; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-line); padding: 4px 10px; border-radius: 3px; }
.project-body h3 { font-family: var(--display); font-weight: 500; font-size: 22px; margin: 0 0 8px; }
.project-body p { font-size: 14px; color: var(--ink-55); margin: 0 0 20px; flex: 1; }
.arrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

/* ---------- about section (image + text) ---------- */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; align-items: center; }
.split--top { align-items: start; }
.frame { margin: 0; border-radius: 3px; overflow: hidden; }
.frame img { width: 100%; display: block; object-fit: cover; transition: transform .6s ease; }
.frame--portrait img { aspect-ratio: 4/5; }
.frame:hover img { transform: scale(1.04); }
.byline { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.byline .name { font-family: var(--display); font-size: 17px; }
.byline .role { font-size: 13px; color: var(--ink-50); }

/* ---------- contact / CTA band ---------- */
.cta-band { background: linear-gradient(180deg, var(--surface-2), var(--bg-2));
  border-top: 1px solid rgba(201,169,97,.2); position: relative; overflow: hidden; }
.cta-inner { position: relative; padding-block: clamp(48px, 7vw, 68px); }
.contact-facts { display: flex; gap: 48px; flex-wrap: wrap; padding-top: 26px; border-top: 1px solid rgba(245,240,230,.12); }
.contact-facts .k { font-size: 12px; color: var(--ink-50); margin-bottom: 4px; }
.contact-facts .v { font-family: var(--display); font-size: 16px; }

/* ---------- footer ---------- */
.footer { padding-block: 48px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; padding-bottom: 32px; }
.footer h4 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 14px; font-weight: 600; }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-links a { color: var(--ink-65); transition: color .2s ease; }
.footer-links a:hover { color: var(--gold); }
.footer p { font-size: 13.5px; color: var(--ink-50); max-width: 32ch; margin: 0; }
.footer-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding-top: 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-40); }

/* ---------- project page specifics ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 20px 0; color: var(--ink-50); }
.crumbs a { color: inherit; }
.crumbs .here { color: var(--ink); }
.meta-row { display: flex; gap: 48px; flex-wrap: wrap; padding: 24px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.meta-row .k { font-size: 12px; color: var(--ink-50); margin-bottom: 4px; }
.meta-row .v { font-family: var(--display); font-size: 16px; }
.hero-16x9 { margin: 0; border-radius: 4px; overflow: hidden; }
.hero-16x9 img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }

.spec { border-top: 2px solid var(--gold); padding-top: 14px; }
.spec .num { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 3vw, 40px); color: var(--ink); }
.spec .lbl { font-size: 13px; color: var(--ink-55); line-height: 1.4; }

.scope-item { border-top: 1px solid var(--line); padding-top: 16px; }
.scope-item .num { font-family: var(--display); font-size: 14px; color: var(--gold); margin-bottom: 8px; }
.scope-item h3 { font-family: var(--display); font-weight: 500; font-size: 18px; margin: 0 0 10px; color: var(--ink); }
.scope-item ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.65; color: var(--ink-60); }
.scope-item li { margin-bottom: 4px; }

.credit .who { font-family: var(--display); font-size: 24px; margin: 0 0 12px; color: var(--ink); }
.credit p { font-size: 14.5px; line-height: 1.6; max-width: 70ch; color: var(--ink-55); margin: 0; }

/* ---------- gallery (masonry) ---------- */
.gallery { columns: 3 260px; column-gap: 8px; }
.gallery figure { margin: 0 0 8px; break-inside: avoid; border-radius: 2px; overflow: hidden; position: relative; }
.gallery button.tile { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery button.tile.video { cursor: pointer; }
.gallery img { width: 100%; display: block; transition: transform .5s ease; }
.gallery button.tile:hover img { transform: scale(1.04); }
.play-badge { position: absolute; inset: 0; background: rgba(10,9,7,.25);
  display: flex; align-items: center; justify-content: center; pointer-events: none; }
.play-badge span { width: 56px; height: 56px; border-radius: 50%; background: rgba(245,240,230,.92);
  display: flex; align-items: center; justify-content: center; }
.play-badge span::before { content:""; width: 0; height: 0; border-style: solid;
  border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #14110D; margin-left: 3px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(8,7,5,.94); z-index: 60;
  display: none; align-items: center; justify-content: center; padding: 40px; }
.lightbox.open { display: flex; }
.lightbox img, .lightbox video { max-width: min(1100px, 88vw); max-height: 82vh;
  object-fit: contain; border-radius: 2px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb-btn { position: absolute; background: none; border: 1px solid rgba(245,240,230,.3); color: var(--ink);
  border-radius: 2px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color .2s ease, color .2s ease; }
.lb-btn:hover { border-color: var(--gold); color: var(--gold); }
.lb-close { top: 24px; right: 28px; width: 40px; height: 40px; font-size: 18px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 22px; }
.lb-prev { left: 24px; } .lb-next { right: 24px; }

/* ---------- fade-up entrance ---------- */
.fade-up { animation: fadeUp .7s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px);} to { opacity: 1; transform: translateY(0);} }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .contact-facts, .meta-row { gap: 28px 40px; }
}

@media (max-width: 768px) {
  /* collapse nav into a burger menu (pure CSS) */
  .nav-burger { display: flex; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(14,12,10,.98);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 18px;
    max-height: 0; overflow: hidden; opacity: 0; visibility: hidden;
    transition: max-height .3s ease, opacity .25s ease, padding .3s ease;
  }
  .nav-toggle:checked ~ .nav-links {
    max-height: 380px; opacity: 1; visibility: visible;
  }
  .nav-links a { padding: 13px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
  .nav-links a.btn { margin-top: 12px; text-align: center; padding: 13px 20px; border-bottom: 0; }
  .nav-inner { position: relative; flex-wrap: wrap; }

  /* gallery -> 2 columns */
  .gallery { columns: 2 160px; }

  /* stat borders read better stacked */
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px 0; }
  .stat { border-left: 0; }

  .lightbox { padding: 16px; }
  .lb-prev { left: 10px; } .lb-next { right: 10px; }
  .lb-close { top: 14px; right: 14px; }
}

@media (max-width: 480px) {
  .gallery { columns: 1; }
  .contact-facts, .meta-row { gap: 22px 32px; }
  .btn, .btn-outline { width: 100%; text-align: center; }
  .footer-bar { flex-direction: column; }
}
