/* css/styles.css */
:root {
  /* Materials palette: sandstone, lapis, granite, ochre */
  --sand: #E9DCC3;
  --sand-deep: #DCC8A4;
  --granite: #231E19;
  --umber: #5C4F42;
  --lapis: #1E3A72;
  --lapis-night: #0E1B3A;
  --ochre: #C08A3E;
  --sun: #F3E7CF;
  --rule: rgba(35, 30, 25, 0.22);

  --font-head: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --font-body: 'Newsreader', Georgia, serif;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --max-width: 1240px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--granite);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 0.95;
  margin: 0 0 var(--space-2);
}
h1, h2 { text-transform: uppercase; letter-spacing: 0.01em; }
h1 { font-size: clamp(3rem, 8vw, 6.5rem); }
h2 { font-size: clamp(2.25rem, 5vw, 4rem); }
h3 { font-size: clamp(1.4rem, 2vw, 1.75rem); font-weight: 700; line-height: 1.1; }
h4 { font-weight: 700; letter-spacing: 0.04em; }
p { margin: 0 0 var(--space-2); color: var(--umber); max-width: 68ch; }
a { color: var(--lapis); text-underline-offset: 0.18em; }

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--sun);
  color: var(--granite);
  padding: var(--space-1) var(--space-2);
  z-index: 200;
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 3px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* Header — night lapis bar, shared by every page */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Solid, not translucent+blurred: backdrop-filter makes this element a
     containing block for position:fixed descendants (the mobile nav-links
     overlay lives inside .site-header), which breaks its viewport-fixed
     full-screen sizing. Keep this background fully opaque. */
  background: var(--lapis-night);
  color: var(--sun);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  transition: padding 250ms ease;
}
.site-header.is-condensed .container {
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--sun);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.brand svg { width: 30px; height: 30px; fill: var(--ochre); }
.brand-name { font-size: 1.35rem; }

.nav { display: flex; align-items: center; }
.nav-links {
  display: flex;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--sun);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  padding: var(--space-1);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ochre); }
.nav-links a[aria-current="page"] { border-bottom-color: var(--ochre); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(243, 231, 207, 0.4);
  color: var(--sun);
  width: 44px;
  height: 44px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 101; }
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    background: var(--lapis-night);
    padding: var(--space-6) var(--space-3);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease, transform 250ms ease;
  }
  .nav-links.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-links a { font-size: 2.5rem; text-transform: uppercase; }
  body.nav-open { overflow: hidden; }
}

/* Buttons */
.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-3);
  border: 2px solid var(--lapis);
  color: var(--lapis);
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  background: transparent;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.btn:hover { background: var(--lapis); color: var(--sun); }
.btn-primary { background: var(--lapis); color: var(--sun); }
.btn-primary:hover { background: var(--lapis-night); border-color: var(--lapis-night); }
/* Variants for dark (lapis-night) surfaces */
.btn-light { background: var(--sun); border-color: var(--sun); color: var(--granite); }
.btn-light:hover { background: var(--ochre); border-color: var(--ochre); color: var(--granite); }
.btn-ghost { border-color: var(--sun); color: var(--sun); }
.btn-ghost:hover { background: var(--sun); color: var(--granite); }

/* Sections */
.section { padding: var(--space-6) 0; }
.section-panel { background: var(--sand-deep); }
.section-night { background: var(--lapis-night); color: var(--sun); }
.section-night p { color: rgba(243, 231, 207, 0.82); }
.section-header { max-width: 720px; margin-bottom: var(--space-4); }
.lede { font-size: 1.3rem; max-width: 46ch; }
.split-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.split-head h2 { margin: 0; }

/* ─── The gate: scroll through the Karnak doorway (homepage hero) ───
   Static fallback (no JS / reduced motion): photo above, text below.
   With .gate-live (set by main.js) the stage pins and the frame scales
   about the doorway's centre until you've walked through it. */
.gate {
  background:
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(192, 138, 62, 0.45), transparent 70%),
    linear-gradient(180deg, var(--lapis-night) 0%, #172d5c 55%, #2c3567 100%);
  color: var(--sun);
}
.gate-stage { display: flex; flex-direction: column; }
.gate-frame { order: -1; width: 100%; height: auto; }
.gate-content { padding: var(--space-5) var(--space-3); max-width: 760px; margin: 0 auto; }
.gate-content h1 { color: var(--sun); }
.gate-content p { color: rgba(243, 231, 207, 0.88); font-size: 1.2rem; }
.gate-cue { display: none; }

.gate-live .gate { height: 260vh; height: 260svh; }
.gate-live .gate-stage {
  display: block;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.gate-live .gate-frame {
  position: absolute;
  max-width: none;
  z-index: 2;
  will-change: transform, opacity;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
}
.gate-live .gate-content {
  position: absolute;
  z-index: 1;
  padding: 0;
  margin: 0;
  max-width: none;
  text-align: center;
}
.gate-live .gate-content h1 { font-size: var(--gate-fs, 3rem); margin-bottom: var(--space-3); }
.gate-live .gate-more {
  opacity: var(--more, 0);
  transform: translateY(calc((1 - var(--more, 0)) * 16px));
}
.gate-live .gate-more p { margin-inline: auto; }
.gate-live .gate-more .btn-row { justify-content: center; }
.gate-live .gate-cue {
  display: block;
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: var(--space-5);
  margin: 0 auto;
  text-align: center;
  color: var(--sun);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  opacity: var(--cue, 1);
}
.gate-cue::after {
  content: '';
  display: block;
  width: 2px;
  height: 28px;
  margin: 6px auto 0;
  background: currentColor;
  animation: cue 1.8s var(--ease-out) infinite;
  transform-origin: top;
}
@keyframes cue {
  0% { transform: scaleY(0); }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* Feature list (services) — icon + text, no boxes */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4) var(--space-3);
}
.card { border-top: 2px solid var(--granite); padding-top: var(--space-2); }
.card > svg { width: 36px; height: 36px; fill: var(--lapis); margin-bottom: var(--space-2); }
.card h3 { margin-bottom: var(--space-1); }

/* Image cards (projects, about) — picture first, caption under */
.card:has(.card-media),
.card:has(.team-photo) { border-top: 0; padding-top: 0; }
.card-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--sand-deep);
  margin-bottom: var(--space-2);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.team-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  margin-bottom: var(--space-2);
  filter: sepia(0.25) saturate(0.9);
}

/* Colonnade — featured projects as tall columns that widen on hover/focus */
.colonnade {
  display: flex;
  gap: 10px;
  height: min(72vh, 620px);
}
.column {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: var(--sun);
  text-decoration: none;
  background: var(--granite);
  transition: flex-grow 600ms var(--ease-out);
}
.column img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-out);
}
.column::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(14, 27, 58, 0.88));
}
.column-caption {
  position: absolute;
  z-index: 1;
  left: var(--space-2);
  right: var(--space-2);
  bottom: var(--space-2);
}
.column-caption strong {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1;
  text-transform: uppercase;
}
.column-caption span { font-size: 0.95rem; opacity: 0.85; }
.column:hover, .column:focus-visible { flex-grow: 2.6; }
.column:hover img, .column:focus-visible img { transform: scale(1.03); }
.column:focus-visible { outline-offset: -3px; }
@media (max-width: 720px) {
  .colonnade { flex-direction: column; height: auto; }
  .column { flex: none; height: 200px; }
  .column:hover, .column:focus-visible { flex-grow: 0; }
}

/* Filter chips */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}
.filter-chip {
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 2px solid var(--granite);
  background: transparent;
  color: var(--granite);
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}
.filter-chip:hover { background: var(--sand-deep); }
.filter-chip[aria-pressed="true"] { background: var(--granite); color: var(--sun); }

/* Footer */
.site-footer {
  background: var(--granite);
  padding: var(--space-5) 0;
  color: rgba(243, 231, 207, 0.75);
  font-size: 1rem;
}
.site-footer p { color: inherit; }
.site-footer .brand { color: var(--sun); }
.site-footer a { color: var(--sun); }
.site-footer a:hover { color: var(--ochre); }
.site-footer h4 { color: var(--sun) !important; font-size: 1.1rem !important; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: start;
  gap: 0 var(--space-4);
}
.footer-links p { margin: 0 0 var(--space-1); }

address { font-style: normal; color: inherit; margin: 0 0 var(--space-2); }
.social-links { display: flex; gap: var(--space-1); }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(243, 231, 207, 0.3);
  transition: border-color 200ms ease, color 200ms ease;
}
.social-links a:hover { border-color: var(--ochre); }
.social-links svg { fill: currentColor; }
