/* ==========================================================================
   Dominion Architects — shared stylesheet
   Design system: warm white background, editorial serif headlines (Fraunces),
   tracked uppercase sans nav (Inter), generous whitespace, hairline dividers.
   Add a page? Copy header/footer markup from an existing page and add a
   <li> to both nav lists below (desktop nav + footer sitemap).
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f5f1;
  --color-ink: #15140f;
  --color-muted: #6f6b63;
  --color-line: #e4e0d8;
  --color-accent: #ee0000;
  --font-display: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-brand: 'Poppins', 'Century Gothic', -apple-system, sans-serif;
  /* Exact colors sampled from the real logo file — used for every text
     rendering of the wordmark (preloader, footer) so it matches the actual
     brand mark, not the site's general ink/muted text colors. */
  --logo-dark: #555555;
  --logo-light: #949494;
  --container: 1360px;
  --pad: clamp(24px, 5vw, 80px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ---------- Preloader (intro animation, index.html only) ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 999;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  cursor: pointer;
  transition: opacity .6s ease, visibility .6s ease;
}
.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
/* Grid (not flex) so the bar always sits at the true center of this block,
   regardless of "DOMINION" and "ARCHITECTS" being different lengths — the
   two 1fr columns stay equal width, with each word pinned to the inside
   edge of its column. This center line is what the words/hint below align to. */
.preloader-logo {
  font-family: var(--font-brand);
  font-weight: 300;
  font-size: clamp(28px, 6vw, 84px);
  letter-spacing: 0.08em;
  color: var(--logo-dark);
  opacity: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 22px;
  width: min(92vw, 980px);
  /* Letters handle their own entrance now (see .letter below); this only
     does the final "settle" — a slight letter-spacing tighten — once every
     letter has assembled, as a finishing flourish. fill-mode "both" holds
     the wider 0% spacing during the delay too, so there's no sudden jump
     when the animation actually starts. */
  animation: preloaderLogoSettle .7s ease both;
  animation-delay: 2s;
}
/* min-width: 0 overrides the browser default (min-width: auto) that grid
   items get, which otherwise forces each column to be at least as wide as
   its own text — silently breaking the "equal 1fr" columns whenever
   ARCHITECTS (longer word) doesn't fit its fair share. This is what was
   actually pushing the bar off-center. */
.preloader-logo .word-dominion { text-align: right; white-space: nowrap; min-width: 0; }
.preloader-logo .word-architects { text-align: left; white-space: nowrap; min-width: 0; }
/* Each letter is wrapped in its own span by main.js and animates in on its
   own staggered delay (set inline per-letter) — starting soft/out-of-focus
   and sharpening into place as it fades in, like a camera racking focus.
   The word "assembles" letter by letter instead of the whole block fading
   in at once. */
.preloader-logo .letter {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  animation: letterAssemble .8s ease-out forwards;
}
.preloader-logo .bar {
  width: 3px;
  height: 0.6em;
  background: var(--color-accent);
  display: inline-block;
  opacity: 0;
  justify-self: center;
  transform: scaleY(0);
  transform-origin: center;
  animation: barGrow .5s cubic-bezier(.2,.8,.2,1) forwards;
  /* Starts only once BOTH words have fully assembled (last letter of
     ARCHITECTS finishes at ~1.95s) — the bar appears after the words are
     in place, instead of growing in while letters are still resolving. */
  animation-delay: 2s;
}
.preloader-logo .architects { color: var(--logo-light); }
@keyframes letterAssemble {
  0%   { opacity: 0; filter: blur(8px); }
  60%  { opacity: 1; filter: blur(1.5px); }
  100% { opacity: 1; filter: blur(0); }
}
@keyframes barGrow {
  0%   { opacity: 0; transform: scaleY(0); }
  100% { opacity: 1; transform: scaleY(1); }
}
@keyframes preloaderLogoSettle {
  0%   { letter-spacing: 0.14em; }
  100% { letter-spacing: 0.08em; }
}
/* Same fixed width as .preloader-logo, and centered the same way by the
   parent flex container — this guarantees the words' center point is
   pixel-identical to the logo's center (the bar), instead of relying on
   each element being centered independently based on its own content width. */
.preloader-words {
  position: relative;
  height: 22px;
  width: min(92vw, 980px);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
  opacity: 0;
  animation: preloaderWordsReveal .6s ease forwards;
  animation-delay: 2.8s;
}
.preloader-words span {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  opacity: 0;
  white-space: nowrap;
  /* Duration must equal (stagger delay) x (number of words) so the cycle
     loops seamlessly with no gap or overlap — 6 words x 1.6s = 9.6s. Base
     delay pushed back so words don't start until the logo has fully
     assembled and settled (including the bar growing in). */
  animation: preloaderWordCycle 9.6s ease infinite;
  animation-delay: 2.8s;
}
.preloader-words span:nth-child(2) { animation-delay: 4.4s; }
.preloader-words span:nth-child(3) { animation-delay: 6.0s; }
.preloader-words span:nth-child(4) { animation-delay: 7.6s; }
.preloader-words span:nth-child(5) { animation-delay: 9.2s; }
.preloader-words span:nth-child(6) { animation-delay: 10.8s; }
@keyframes preloaderWordsReveal {
  to { opacity: 1; }
}
@keyframes preloaderWordCycle {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  22%  { opacity: 1; }
  30%  { opacity: 0; }
  100% { opacity: 0; }
}
.preloader-hint {
  width: min(92vw, 980px);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
  opacity: 0;
  animation: preloaderHintIn 1s ease forwards;
  animation-delay: 4.6s;
}
@keyframes preloaderHintIn {
  0%   { opacity: 0; }
  50%  { opacity: 0.55; }
  100% { opacity: 0.55; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.eyebrow .rule {
  display: inline-block;
  width: 3px;
  height: 13px;
  background: var(--color-accent);
  margin-right: 10px;
  vertical-align: middle;
}

/* ---------- Header / Nav ---------- */
/* Header is transparent at the top of the page (floats directly over the
   hero/banner image) and becomes a solid white band once the page is
   scrolled. Height/padding stay constant in both states — only the
   background and shadow toggle. */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 32px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  box-shadow: none;
  transition: background-color .3s ease, box-shadow .3s ease;
}

.site-header.is-scrolled {
  background: #fff;
  box-shadow: 0 2px 14px rgba(15,14,10,0.10);
}

.logo { display: flex; align-items: center; }
.logo-img { height: 34px; width: auto; display: block; }

/* Text fallback logo (used on dark backgrounds, e.g. footer, where the
   white-background logo PNG can't sit) */
.logo-text {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--logo-dark);
}
.logo-text .bar { width: 2px; height: 15px; background: var(--color-accent); display: inline-block; }
.logo-text .architects { font-weight: 300; color: var(--logo-light); }
/* On the dark footer background the exact logo greys are too low-contrast,
   so this is the one place we lighten them while keeping the same weight/
   tracking and the same darker-vs-lighter relationship between the two words. */
.footer-grid .logo-text { color: rgba(255,255,255,0.92); }
.footer-grid .logo-text .architects { color: rgba(255,255,255,0.5); }

.nav-desktop ul {
  list-style: none;
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
}
.nav-desktop a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, color .25s ease;
}
.nav-desktop a:hover,
.nav-desktop a.is-active { border-color: var(--color-accent); color: var(--color-accent); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px; height: 20px;
  position: relative;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--color-ink);
}
.nav-toggle::before { top: 0; }
.nav-toggle span { top: 9px; }
.nav-toggle::after { top: 18px; }

.nav-mobile {
  position: fixed; inset: 0; z-index: 99;
  background: var(--color-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px;
  transform: translateY(-100%);
  transition: transform .4s ease;
}
.nav-mobile.is-open { transform: translateY(0); }
.nav-mobile a { font-family: var(--font-display); font-size: 32px; }

@media (max-width: 860px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  /* Fallback color while the image loads; not visible once it's in since
     the photo is now cover-fit edge to edge. */
  background: var(--color-ink);
}
.hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  /* home-hero.png is authored at 16:9 specifically for this hero, so
     cover fills edge-to-edge (no side bars) with only a sliver cropped on
     viewports that aren't exactly 16:9 — nowhere near the old crop amount
     from the previous 4:3 photo. Gentle zoom restored now that crop is
     minimal again. */
  animation: heroKenBurnsSubtle 24s ease-in-out infinite alternate;
  transform-origin: center center;
}
@keyframes heroKenBurnsSubtle {
  0%   { transform: scale(1); }
  100% { transform: scale(1.06); }
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,8,0.15) 0%, rgba(10,10,8,0.15) 40%, rgba(10,10,8,0.65) 100%);
}
.hero-inner { position: relative; z-index: 2; padding: 0 var(--pad) 72px; width: 100%; }
.hero-inner .eyebrow { color: rgba(255,255,255,0.92); }
.hero h1 {
  font-size: clamp(36px, 5.6vw, 78px);
  max-width: 16ch;
  margin-top: 18px;
}
.hero p.sub {
  margin-top: 20px;
  max-width: 46ch;
  font-size: 18px;
  color: rgba(255,255,255,0.88);
}

.page-banner {
  position: relative;
  height: 56vh;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}
.page-banner img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: kenBurns 8s ease-in-out infinite alternate;
  transform-origin: center center;
}

@keyframes kenBurns {
  0%   { transform: scale(1); }
  100% { transform: scale(1.25); }
}

.page-banner::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,8,0.1) 0%, rgba(10,10,8,0.55) 100%);
}
.page-banner-inner { position: relative; z-index: 2; padding: 0 var(--pad) 56px; }
.page-banner-inner .eyebrow { color: rgba(255,255,255,0.92); }
.page-banner h1 { font-size: clamp(32px, 4.4vw, 58px); margin-top: 16px; }

/* ---------- Sections ---------- */
section { padding: 110px 0; }
section.tight { padding: 70px 0; }
section.surface { background: var(--color-surface); }

.split {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 60px;
}
@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 24px; } }

.split p.lead {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.4;
  max-width: 30ch;
}
.split .body p { color: var(--color-muted); max-width: 58ch; font-size: 17px; }
.split .body p + p { margin-top: 18px; }

.rule-line { border: none; border-top: 1px solid var(--color-line); margin: 0; }

/* ---------- Service / feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-line);
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}
.feature-grid a, .feature-grid .cell {
  background: var(--color-bg);
  padding: 44px 28px;
  transition: background-color .3s ease;
}
.feature-grid a:hover { background: var(--color-surface); }
.feature-grid .num { font-size: 12px; color: var(--color-muted); letter-spacing: 0.1em; }
.feature-grid h3 { font-size: 22px; margin-top: 18px; }
.feature-grid p { color: var(--color-muted); margin-top: 10px; font-size: 15px; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- Section heading row ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
}
.section-head h2 { font-size: clamp(28px, 3.4vw, 46px); margin-top: 14px; max-width: 14ch; }
.section-head .link { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 1px solid var(--color-ink); padding-bottom: 3px; white-space: nowrap; }
.section-head .link:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* ---------- Project grid ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 32px;
}
@media (max-width: 980px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .project-grid { grid-template-columns: 1fr; } }

.project-card { cursor: default; }
.project-card .frame {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4 / 5;
  background: var(--color-surface);
}
.project-card .frame img {
  width: 100%; height: 100%;
  /* Back to cover — fills the placeholder edge-to-edge with no void strips.
     Centered so the building itself stays in the middle of the crop. */
  object-fit: cover;
  object-position: center;
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
  /* Deter casual saving: no native drag ghost, no text-style selection. */
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.project-grid .project-card:nth-child(1) { transition-delay: 0s; }
.project-grid .project-card:nth-child(2) { transition-delay: .08s; }
.project-grid .project-card:nth-child(3) { transition-delay: .16s; }
.project-grid .project-card:nth-child(4) { transition-delay: .24s; }
.project-grid .project-card:nth-child(5) { transition-delay: .32s; }
.project-grid .project-card:nth-child(6) { transition-delay: .40s; }
.project-grid .project-card:nth-child(7) { transition-delay: .48s; }
.project-grid .project-card:nth-child(8) { transition-delay: .56s; }
.project-grid .project-card:nth-child(9) { transition-delay: .64s; }

/* Hover: image scales up slightly within its frame, revealing a bit more
   detail — frame's overflow:hidden keeps it cropped to the same box. */
.project-card:hover .frame img { transform: scale(1.1); }
.project-card .tag {
  position: absolute; top: 16px; left: 16px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  background: rgba(255,255,255,0.92); color: var(--color-ink);
  padding: 6px 10px; border-radius: 2px;
}
.project-card h3 { font-size: 21px; margin-top: 18px; }
.project-card .meta { color: var(--color-muted); font-size: 14px; margin-top: 4px; }

/* ---------- Filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px 30px;
  margin-bottom: 56px;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  padding: 20px 0;
}
.filters button {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-muted);
  padding-bottom: 4px; border-bottom: 1px solid transparent;
}
.filters button.is-active { color: var(--color-ink); border-color: var(--color-accent); }

/* ---------- CTA band ---------- */
.cta-band {
  padding: 100px 0;
  text-align: center;
}
.cta-band h2 { font-size: clamp(30px, 5vw, 56px); max-width: 18ch; margin: 0 auto; }
.cta-band .btn { margin-top: 34px; }

.btn {
  display: inline-block;
  padding: 16px 34px;
  border: 1px solid var(--color-ink);
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.btn:hover { background: var(--color-ink); color: #fff; }
.btn.btn-light { border-color: rgba(255,255,255,0.6); color: #fff; }
.btn.btn-light:hover { background: #fff; color: var(--color-ink); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.stats .stat { border-top: 1px solid var(--color-line); padding-top: 20px; }
.stats .stat .n { font-family: var(--font-display); font-size: clamp(32px, 4vw, 52px); }
.stats .stat .l { color: var(--color-muted); font-size: 13px; margin-top: 6px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info h2 { font-size: clamp(30px, 4vw, 48px); max-width: 14ch; }
.contact-info .row { margin-top: 34px; }
.contact-info .row .k { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-muted); }
.contact-info .row .v { font-family: var(--font-display); font-size: 22px; margin-top: 6px; }
.contact-info .socials { margin-top: 40px; display: flex; gap: 12px; flex-wrap: wrap; }
.contact-info .socials a {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--color-ink);
  border-radius: 2px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-ink);
  transition: background-color .25s ease, color .25s ease;
}
.contact-info .socials a:hover { background: var(--color-ink); color: #fff; }

.form-field { margin-bottom: 26px; }
.form-field label { display: block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-muted); margin-bottom: 8px; }
.form-field input, .form-field textarea {
  width: 100%; border: none; border-bottom: 1px solid var(--color-line);
  background: transparent; padding: 10px 0; font-family: var(--font-sans);
  font-size: 16px; color: var(--color-ink);
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--color-accent); }
.form-field textarea { resize: vertical; min-height: 110px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-ink); color: rgba(255,255,255,0.75); padding: 90px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid .logo { color: #fff; margin-bottom: 14px; background: transparent; box-shadow: none; padding: 0; }
.footer-grid .logo .bar { background: var(--color-accent); }
.footer-grid p { max-width: 32ch; color: rgba(255,255,255,0.55); font-size: 14px; }
.footer-grid h4 { font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.9); margin-bottom: 18px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 12px; font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  margin-top: 70px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.12);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: rgba(255,255,255,0.45);
}

/* ---------- Reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
