/* =========================================================================
   Christ Church Oak Brook · Roof Restoration
   ========================================================================= */

:root {
  --ink: #1A1814;
  --ink-soft: #4a463f;
  --ink-mute: #8a8478;
  --rule: #d9d2c4;
  --rule-soft: #ece5d6;
  --paper: #F2EDE3;
  --paper-2: #EAE3D2;
  --paper-3: #FBF8F1;
  --paper-dark: #1F1A14;

  --c-crane: #F2C744;
  --c-scaffolding: #3D6EAA;
  --c-dumpster: #3F7A50;
  --c-materials: #D9772C;

  --c-active: #C8651E;
  --c-complete: #3F7A50;

  --container: 1280px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

body.locked { overflow: hidden; }

img { display: block; max-width: 100%; }
button { font-family: inherit; }
a { color: var(--ink); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

/* =========================================================================
   Background streets watermark
   ========================================================================= */
.bg-streets {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  /* Place it bleeding off the right edge for a "press masthead" feel */
  top: 8vh;
  right: -22vw;
  width: 88vw;
  height: 88vw;
  max-width: 1200px;
  max-height: 1200px;
  background-image: url("assets/brand/client/christ-church/oak-brook-streets.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.10;
  /* Tint into the warm palette */
  filter: invert(0.85) sepia(0.3) saturate(0.6) hue-rotate(-10deg);
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.85) 40%,
    rgba(0,0,0,0.0) 78%
  );
          mask-image: radial-gradient(
    ellipse at center,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,0.85) 40%,
    rgba(0,0,0,0.0) 78%
  );
}

@media (max-width: 720px) {
  .bg-streets {
    top: 26vh;
    right: -40vw;
    width: 120vw;
    height: 120vw;
    opacity: 0.06;
  }
}

/* =========================================================================
   Access gate
   ========================================================================= */
.gate {
  position: fixed;
  inset: 0;
  background: var(--paper);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms ease, visibility 320ms ease;
}

.gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 40px 36px 32px 36px;
  box-shadow: 0 12px 40px -20px rgba(26, 24, 20, 0.25);
  position: relative;
  z-index: 1;
}

.gate-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 28px;
}

.gate-logo { height: 40px; width: auto; object-fit: contain; }
.gate-logo-cc { height: 36px; }
.gate-logo-ll { height: 32px; }

.gate-divider {
  width: 1px;
  height: 28px;
  background: var(--rule);
}

.gate-title {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.gate-help {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.gate-field { display: block; margin-bottom: 12px; }

.gate-field-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: 8px;
}

.gate-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-family: inherit;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.gate-input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--paper-3);
}

.gate-submit {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.gate-submit:hover { background: #2c2a23; }

.gate-error {
  margin: 14px 0 0 0;
  min-height: 18px;
  font-size: 13px;
  color: #B33024;
  line-height: 1.4;
}

.gate.is-shaking .gate-card {
  animation: gate-shake 0.36s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes gate-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.gate-footnote {
  margin: 28px 0 0 0;
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  text-align: center;
}

/* =========================================================================
   Fixed brand mark
   ========================================================================= */
.brand-fixed {
  position: fixed;
  top: 22px;
  left: 28px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 14px;
  background: rgba(242, 237, 227, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
  box-shadow: 0 4px 16px -10px rgba(26, 24, 20, 0.25);
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  outline: none;
}

.brand-img { display: block; object-fit: contain; }
.brand-img-cc { height: 28px; width: auto; }
.brand-img-ll { height: 24px; width: auto; }

.brand-divider { width: 1px; height: 22px; background: var(--rule); }

@media (max-width: 640px) {
  .brand-fixed { top: 14px; left: 14px; gap: 10px; padding: 8px 12px; }
  .brand-img-cc { height: 22px; }
  .brand-img-ll { height: 18px; }
}

/* =========================================================================
   Main
   ========================================================================= */
.main {
  padding-top: 110px;
  padding-bottom: 96px;
  position: relative;
  z-index: 1;
}

.page-head {
  margin: 0 0 28px 0;
  max-width: 720px;
}

.page-eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: 10px;
}

.page-title {
  margin: 0 0 10px 0;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.page-sub {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
}

@media (max-width: 640px) {
  .page-title { font-size: 28px; }
}

/* Today's status chip — auto-detected from real date vs project window */
.today-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 7px 14px 7px 12px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.today-chip[hidden] { display: none; }

.today-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-active);
  box-shadow: 0 0 0 3px rgba(200, 101, 30, 0.18);
}

/* =========================================================================
   Meta row — reference + date jump (above the photo)
   ========================================================================= */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px 0;
}

.reference-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 16px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
  font-family: inherit;
}

.reference-btn:hover { background: var(--paper); border-color: var(--ink-mute); }

.reference-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.reference-label { font-size: 13px; color: var(--ink); font-weight: 500; }

.reference-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  transition: transform 240ms ease;
}

.reference-btn:hover .reference-arrow { transform: translateX(2px); }

/* Date jump */
.date-jump {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 4px 4px 4px 18px;
  height: 42px;
}

.date-jump-label {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding-right: 12px;
}

.date-jump-eyebrow {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.date-jump-input {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 0;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.date-jump-input::-webkit-calendar-picker-indicator {
  filter: opacity(0.6);
  cursor: pointer;
}

.date-jump-btn {
  height: 34px;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  align-self: center;
  transition: background-color 180ms ease;
}

.date-jump-btn:hover { background: #2c2a23; }

@media (max-width: 640px) {
  .meta-row { flex-direction: column; align-items: flex-start; }
  .date-jump { width: 100%; }
  .date-jump-input { flex: 1; }
}

/* =========================================================================
   Stage
   ========================================================================= */
.stage-wrap { margin: 0 0 32px 0; }

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2392 / 1792;
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(26, 24, 20, 0.06),
    0 14px 40px -20px rgba(26, 24, 20, 0.18);
  isolation: isolate;
}

.layer { position: absolute; inset: 0; width: 100%; height: 100%; }

.base-layer { object-fit: cover; z-index: 1; }

.photo-layer {
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transition: opacity 480ms ease;
  z-index: 2;
}
.photo-layer.is-visible { opacity: 1; }

#layer-scaffolding { z-index: 3; }
#layer-dumpster { z-index: 4; }
#layer-crane { z-index: 6; }
#layer-after { z-index: 9; }

.mask-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 480ms ease, background-color 480ms ease;
  z-index: 5;
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
}

.mask-layer.is-visible { opacity: 0.78; }

#layer-materials {
  -webkit-mask-image: url("assets/timeline-overlays/materials-path-overlay.png");
          mask-image: url("assets/timeline-overlays/materials-path-overlay.png");
  background-color: var(--c-materials);
  z-index: 7;
}

#layer-steeple {
  -webkit-mask-image: url("assets/timeline-overlays/steeple-overlay.png");
          mask-image: url("assets/timeline-overlays/steeple-overlay.png");
  background-color: var(--c-active);
  z-index: 8;
}

#layer-sanctuary-01 {
  -webkit-mask-image: url("assets/timeline-overlays/sanctuary-01-overlay.png");
          mask-image: url("assets/timeline-overlays/sanctuary-01-overlay.png");
  background-color: var(--c-active);
}
#layer-sanctuary-02 {
  -webkit-mask-image: url("assets/timeline-overlays/sanctuary-02-overlay.png");
          mask-image: url("assets/timeline-overlays/sanctuary-02-overlay.png");
  background-color: var(--c-active);
}
#layer-sanctuary-03 {
  -webkit-mask-image: url("assets/timeline-overlays/sanctuary-03-overlay.png");
          mask-image: url("assets/timeline-overlays/sanctuary-03-overlay.png");
  background-color: var(--c-active);
}
#layer-sanctuary-04 {
  -webkit-mask-image: url("assets/timeline-overlays/sanctuary-04-overlay.png");
          mask-image: url("assets/timeline-overlays/sanctuary-04-overlay.png");
  background-color: var(--c-active);
}

/* Caption (top-right — keeps the bottom-left clear for the color key) */
.stage-caption {
  position: absolute;
  z-index: 12;
  right: 22px;
  top: 22px;
  background: rgba(242, 237, 227, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 12px 16px 14px 16px;
  min-width: 220px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.caption-step {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.caption-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.caption-dates {
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

/* Feathered legend gradient — radial, anchored to the bottom-left */
.stage-legend-gradient {
  position: absolute;
  left: -10%;
  bottom: -22%;
  width: 70%;
  height: 92%;
  z-index: 10;
  pointer-events: none;
  background: radial-gradient(
    ellipse 58% 52% at 30% 70%,
    rgba(20, 17, 14, 0.78) 0%,
    rgba(20, 17, 14, 0.62) 22%,
    rgba(20, 17, 14, 0.36) 46%,
    rgba(20, 17, 14, 0.14) 68%,
    rgba(20, 17, 14, 0.04) 82%,
    rgba(20, 17, 14, 0.0) 95%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 58% 52% at 30% 70%,
    rgba(0,0,0,1) 30%,
    rgba(0,0,0,0.85) 55%,
    rgba(0,0,0,0.3) 80%,
    rgba(0,0,0,0) 100%
  );
          mask-image: radial-gradient(
    ellipse 58% 52% at 30% 70%,
    rgba(0,0,0,1) 30%,
    rgba(0,0,0,0.85) 55%,
    rgba(0,0,0,0.3) 80%,
    rgba(0,0,0,0) 100%
  );
}

.stage-legend {
  position: absolute;
  z-index: 11;
  left: 22px;
  bottom: 22px;
  padding: 14px 18px 16px 18px;
  color: #F5F0E5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}

.legend-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 240, 229, 0.65);
  font-weight: 500;
}

.legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: #F5F0E5;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

@media (max-width: 720px) {
  .stage-caption {
    right: 12px; top: 12px;
    padding: 10px 12px 12px 12px;
    min-width: 0; max-width: 60%;
  }
  .caption-title { font-size: 15px; }
  .caption-dates { font-size: 12px; }
  .stage-legend {
    left: 10px; bottom: 10px;
    padding: 10px 12px 12px 12px;
    min-width: 0;
  }
  .legend-row { font-size: 12px; }
  .stage-legend-gradient { left: -25%; bottom: -28%; width: 110%; height: 110%; }
}

/* =========================================================================
   Scrubber
   ========================================================================= */
.scrubber-wrap {
  margin: 0 0 32px 0;
  padding: 28px 0 0 0;
  border-top: 1px solid var(--rule);
}

.scrubber-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
}

.scrubber-now { display: flex; flex-direction: column; gap: 2px; }

.now-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.now-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.scrubber-controls { display: flex; gap: 8px; }

.ctrl {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--paper-3);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}
.ctrl:hover { background: var(--paper); border-color: var(--ink-mute); }
.ctrl:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.ctrl-play {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.ctrl-play:hover { background: #2c2a23; border-color: #2c2a23; }

.scrubber { position: relative; padding: 6px 0 12px 0; }

.scrubber-rail { position: relative; height: 38px; }

.scrubber-track {
  position: absolute;
  left: 0; right: 0;
  top: 18px;
  height: 2px;
  background: var(--rule);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}

.scrubber-progress {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--ink);
  border-radius: 2px;
  width: 0%;
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scrubber-input {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  width: 100%;
  height: 38px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  z-index: 3;
  cursor: pointer;
}

.scrubber-input::-webkit-slider-runnable-track { height: 38px; background: transparent; }
.scrubber-input::-moz-range-track { height: 38px; background: transparent; }

.scrubber-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 1.5px solid var(--ink);
  cursor: grab;
  box-shadow: 0 1px 6px rgba(26, 24, 20, 0.18);
  transition: transform 180ms ease;
  margin-top: 8px;
}
.scrubber-input:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.05); }

.scrubber-input::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 1.5px solid var(--ink);
  cursor: grab;
  box-shadow: 0 1px 6px rgba(26, 24, 20, 0.18);
}

.scrubber-ticks {
  position: relative;
  list-style: none;
  margin: 16px 0 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  z-index: 4;
  pointer-events: none;
  min-height: 78px;
}

.tick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--ink-mute);
  pointer-events: auto;
  cursor: pointer;
  padding-top: 2px;
  z-index: 5;
}

.tick-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 1.5px solid var(--rule);
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.tick.is-past .tick-dot { background: var(--ink); border-color: var(--ink); }
.tick.is-current .tick-dot { background: var(--ink); border-color: var(--ink); transform: scale(1.25); }
.tick.is-current { color: var(--ink); }

.tick-num {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.tick-label {
  font-size: 11px;
  text-align: center;
  max-width: 88px;
  line-height: 1.3;
  color: var(--ink-mute);
}

.tick.is-current .tick-label,
.tick.is-past .tick-label { color: var(--ink-soft); }

@media (max-width: 720px) {
  .tick-label { display: none; }
  .scrubber-ticks { min-height: 44px; }
}

/* =========================================================================
   Detail card
   ========================================================================= */
.detail-wrap { margin: 12px 0 56px 0; }

.detail-card {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 24px 28px 28px 28px;
  max-width: 760px;
}

.detail-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }

.detail-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.detail-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.detail-summary {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 16px 0;
}

.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.detail-list .pill {
  flex-shrink: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  background: var(--ink-mute);
}

/* =========================================================================
   Section heads
   ========================================================================= */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.section-sub {
  margin: 4px 0 0 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* =========================================================================
   Partner marquee
   ========================================================================= */
.partners-wrap {
  margin: 0 0 56px 0;
  padding: 32px 0 0 0;
  border-top: 1px solid var(--rule);
}

.marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 8px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
}

.marquee-track {
  display: flex;
  gap: 28px;
  width: max-content;
  animation: marquee-scroll 38s linear infinite;
  will-change: transform;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.partner-tile {
  flex-shrink: 0;
  width: 220px;
  height: 130px;
  background: var(--paper-3);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 26px;
  position: relative;
  transition: border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.partner-tile.is-original-light {
  /* White-on-transparent logos (e.g. Bone Roofing) need a dark tile */
  background: var(--paper-dark);
  border-color: var(--paper-dark);
}

.partner-tile img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: opacity 240ms ease;
  opacity: 0.92;
}

.partner-tile:hover {
  border-color: var(--ink-mute);
  transform: translateY(-1px);
}
.partner-tile.is-original-light:hover {
  border-color: var(--paper-dark);
}
.partner-tile:hover img { opacity: 1; }

@media (max-width: 640px) {
  .partner-tile { width: 168px; height: 96px; padding: 16px 20px; }
  .marquee-track { gap: 16px; }
}

/* =========================================================================
   Notes
   ========================================================================= */
.notes-wrap { margin: 0 0 56px 0; padding-top: 32px; border-top: 1px solid var(--rule); }

.notes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

@media (max-width: 980px) { .notes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .notes-grid { grid-template-columns: 1fr; } }

.note-card {
  padding: 22px;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-md);
  background: var(--paper-3);
}

.note-title {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.note-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

/* =========================================================================
   Lightbox
   ========================================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 14, 0.92);
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 48px;
}

.lightbox[hidden] { display: none; }

.lightbox-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #F5F0E5;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 180ms ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.2); }

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.lightbox-img {
  max-width: min(1400px, 92vw);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}

.lightbox-caption {
  font-size: 12px;
  color: rgba(245, 240, 229, 0.65);
  letter-spacing: 0.04em;
  max-width: 720px;
  text-align: center;
}

/* =========================================================================
   Investment
   ========================================================================= */
.investment-wrap { margin: 0 0 16px 0; padding-top: 32px; border-top: 1px solid var(--rule); }

.investment-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: 620px;
}

.investment-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.investment-figure {
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.investment-note {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 22px 0;
  background: var(--paper);
  position: relative;
  z-index: 1;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-mute);
  gap: 16px;
}

@media (max-width: 640px) {
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* =========================================================================
   Mobile-first refinements
   Hard-optimize for phones (375–640px). Desktop remains the primary target.
   ========================================================================= */

/* Tablet ≤ 820 */
@media (max-width: 820px) {
  .container { padding: 0 18px; }

  .main {
    padding-top: 88px;
    padding-bottom: 64px;
  }

  .brand-fixed {
    top: 14px;
    left: 14px;
    gap: 10px;
    padding: 7px 12px 7px 11px;
  }
  .brand-img-cc { height: 22px; }
  .brand-img-ll { height: 18px; }
  .brand-divider { height: 18px; }

  .page-head { margin-bottom: 20px; }
  .page-title { font-size: 28px; line-height: 1.12; }
  .page-sub { font-size: 14px; }

  .meta-row {
    gap: 12px;
    flex-direction: column;
    align-items: stretch;
  }
  .reference-btn { width: 100%; justify-content: space-between; }
  .date-jump { width: 100%; }
  .date-jump-input { width: 100%; min-width: 0; flex: 1; }

  .stage-wrap { margin-bottom: 22px; }
  .stage { border-radius: 12px; }

  .scrubber-wrap { padding-top: 22px; margin-bottom: 22px; }
  .scrubber-head { margin-bottom: 16px; }
  .now-value { font-size: 17px; }
  .ctrl { width: 36px; height: 36px; }

  .detail-card { padding: 20px 22px 22px 22px; }
  .detail-title { font-size: 20px; }
  .detail-summary { font-size: 14px; }

  .section-head { margin-bottom: 18px; }
  .section-title { font-size: 20px; }
  .section-sub { font-size: 13px; }

  .partners-wrap,
  .notes-wrap,
  .investment-wrap { padding-top: 26px; margin-bottom: 36px; }

  .investment-figure { font-size: 24px; }
}

/* Phone ≤ 560 */
@media (max-width: 560px) {
  .container { padding: 0 16px; }

  .main { padding-top: 80px; padding-bottom: 48px; }

  /* Stage goes EDGE-TO-EDGE on phone and crops to a portrait frame
     centered on the church. The base image (img with object-fit:cover)
     handles its own cropping; mask overlays switch to mask-size:cover so
     they crop in lockstep with the base. */
  .stage-wrap {
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: 22px;
  }
  .stage {
    aspect-ratio: 4 / 5;
    border-radius: 0;
    box-shadow: none;
  }
  .stage .layer {
    object-position: 56% 48%;
  }
  .stage .mask-layer {
    -webkit-mask-size: cover;
            mask-size: cover;
    -webkit-mask-position: 56% 48%;
            mask-position: 56% 48%;
  }

  /* Compact brand pill — hide the LL icon, keep just Christ Church */
  .brand-fixed {
    top: 12px;
    left: 12px;
    gap: 8px;
    padding: 6px 10px 6px 10px;
  }
  .brand-img-cc { height: 20px; }
  .brand-img-ll { height: 16px; }
  .brand-divider { height: 16px; }

  .page-title { font-size: 24px; }
  .page-sub { font-size: 13.5px; }
  .page-eyebrow { font-size: 10px; letter-spacing: 0.16em; }

  /* Today chip stays useful but more compact */
  .today-chip {
    margin-top: 14px;
    padding: 6px 12px 6px 10px;
    font-size: 12px;
  }

  /* Meta row stays stacked; date jump shrinks */
  .reference-btn {
    padding: 9px 14px 9px 12px;
    gap: 10px;
  }
  .reference-label { font-size: 12.5px; }
  .reference-eyebrow { font-size: 9.5px; }

  .date-jump {
    height: 40px;
    padding: 3px 3px 3px 14px;
  }
  .date-jump-label { padding-right: 10px; }
  .date-jump-eyebrow { font-size: 9px; }
  .date-jump-input { font-size: 13px; }
  .date-jump-btn { height: 32px; padding: 0 14px; font-size: 12px; }

  /* Stage caption + legend — tightly packed at small widths */
  .stage-caption {
    right: 10px;
    top: 10px;
    max-width: 58%;
    padding: 8px 11px 10px 11px;
  }
  .caption-step { font-size: 9.5px; letter-spacing: 0.16em; }
  .caption-title { font-size: 13.5px; }
  .caption-dates { font-size: 11px; }

  .stage-legend {
    left: 8px;
    bottom: 8px;
    padding: 8px 10px 10px 10px;
    gap: 6px;
  }
  .legend-eyebrow { font-size: 9px; letter-spacing: 0.14em; }
  .legend-row { font-size: 10.5px; gap: 8px; }
  .swatch { width: 10px; height: 10px; }
  .stage-legend-gradient {
    left: -25%;
    bottom: -30%;
    width: 120%;
    height: 120%;
  }

  /* Scrubber on phone — hide labels, keep dots + numbers */
  .scrubber-wrap { padding-top: 18px; }
  .scrubber-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }
  .scrubber-controls { justify-content: flex-end; gap: 6px; }
  .ctrl { width: 38px; height: 38px; }
  .now-label { font-size: 10px; letter-spacing: 0.16em; }
  .now-value { font-size: 16px; }

  .scrubber-ticks {
    min-height: 36px;
    margin-top: 12px;
  }
  .tick { gap: 8px; }
  .tick-num { font-size: 9.5px; letter-spacing: 0.14em; }
  .tick-label { display: none; }

  /* Detail / notes / sections — bigger touch targets, tighter text */
  .detail-card {
    padding: 18px 18px 20px 18px;
    border-radius: 10px;
  }
  .detail-eyebrow { font-size: 10px; letter-spacing: 0.16em; }
  .detail-title { font-size: 18px; }
  .detail-summary { font-size: 13.5px; line-height: 1.55; }
  .detail-list li { font-size: 13px; }

  .section-title { font-size: 18px; }
  .section-sub { font-size: 12.5px; }

  .note-card { padding: 18px; }
  .note-title { font-size: 14px; }
  .note-body { font-size: 12.5px; line-height: 1.5; }

  .partner-tile {
    width: 148px;
    height: 84px;
    padding: 14px 18px;
    border-radius: 8px;
  }

  .investment-figure { font-size: 22px; }
  .investment-note { font-size: 12px; }

  .footer-row { font-size: 11px; }

  /* Lightbox padding on phone */
  .lightbox { padding: 20px; }
  .lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; }
  .lightbox-caption { font-size: 11.5px; }

  /* Gate */
  .gate-card { padding: 28px 22px 22px 22px; }
  .gate-title { font-size: 20px; }
  .gate-help { font-size: 13px; }
  .gate-input { height: 42px; font-size: 16px; }
  .gate-submit { height: 42px; }
}

/* Very small phone ≤ 380 — final squeeze */
@media (max-width: 380px) {
  .page-title { font-size: 22px; }
  .stage-caption { max-width: 56%; }
  .caption-title { font-size: 12.5px; }
  .stage-legend { gap: 4px; }
  .legend-row { font-size: 9.5px; }
  .swatch { width: 9px; height: 9px; }
  .partner-tile { width: 130px; height: 76px; padding: 12px 16px; }
}

/* Touch-friendly tweaks — slightly larger thumb + buttons on coarse pointers */
@media (pointer: coarse) {
  .scrubber-input::-webkit-slider-thumb {
    width: 26px; height: 26px; margin-top: 6px;
  }
  .scrubber-input::-moz-range-thumb { width: 26px; height: 26px; }
  .ctrl { width: 42px; height: 42px; }
  .tick { padding: 8px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
  .marquee-track { animation: none !important; }
}
