/* Red Deer Bible Baptist Church: concept redesign.
   Theme tokens for scrollcraft.css plus the site's own markup. The engine files
   are untouched; everything bespoke lives here and in site.js. */

:root {
  /* paper ground, logo blue, navy night */
  --bone: #F4F1EA;
  --paper: #FBFAF6;
  --navy: #0F213B;
  --night: #0D1E36;
  --blue: #0B4A8C;          /* sampled from the logo */
  --sky: #A8CBF2;           /* the same hue, lifted for navy grounds */
  --grey: #6B7684;          /* the logo's "RED DEER" grey */

  --sc-canvas: var(--bone);
  --sc-surface: var(--paper);
  --sc-ink: var(--navy);
  --sc-ink-soft: #46566C;
  --sc-accent: var(--blue);
  --sc-accent-ink: #FFFFFF;
  --sc-shadow-color: 215 45% 12%;

  --sc-font-display: "Zilla Slab", Rockwell, Georgia, serif;
  --sc-font-text: "Outfit", "Segoe UI", system-ui, sans-serif;
  --sc-font-mono: "Outfit", system-ui, sans-serif;

  --r: 10px;
  --bar-h: 72px;
}

/* dark ground, used by hero exits, the doors, and footer bands.
   Restate color with the tokens (taste.md: computed colour is inherited). */
.ground-night {
  --sc-canvas: var(--night);
  --sc-ink: var(--bone);
  --sc-ink-soft: #AEBBCD;
  --sc-accent: var(--sky);
  --sc-accent-ink: var(--night);
  background: var(--night);
  color: var(--sc-ink);
}

body { background: var(--bone); }
.sc-display { font-weight: 600; letter-spacing: -0.02em; }
.sc-display--xl { font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5.6rem); line-height: 1.0; }
.sc-display--lg { font-size: clamp(2.2rem, 1.5rem + 3vw, 4.2rem); line-height: 1.02; }
.sc-display--md { font-size: clamp(1.8rem, 1.3rem + 2vw, 3rem); line-height: 1.05; }
.sc-body { color: var(--sc-ink-soft); }
.ground-night .sc-body { line-height: 1.68; letter-spacing: 0.005em; }
.kicker {
  font: 600 var(--sc-t-xs)/1 var(--sc-font-text);
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--grey); margin: 0;
}
.ground-night .kicker { color: #9FB0C6; }
.verse { font: italic 500 var(--sc-t-lg)/1.45 var(--sc-font-display); color: var(--sc-ink); margin: 0; max-width: 38ch; text-wrap: pretty; }
.verse cite { display: block; margin-top: var(--sc-2); font: 600 var(--sc-t-xs)/1 var(--sc-font-text); letter-spacing: 0.18em; text-transform: uppercase; font-style: normal; color: var(--sc-ink-soft); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em; white-space: nowrap;
  min-height: 48px; padding: 0 1.35rem; border-radius: var(--r);
  font: 600 var(--sc-t-sm)/1 var(--sc-font-text); letter-spacing: 0.01em; text-decoration: none;
  background: var(--sc-accent); color: var(--sc-accent-ink);
  box-shadow: var(--sc-e1), inset 0 1px 0 rgb(255 255 255 / 0.16);
  transition: transform 140ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out), box-shadow 160ms var(--sc-ease-out);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--ghost { background: transparent; color: var(--sc-ink); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--sc-ink) 55%, transparent); }
.btn svg { width: 1em; height: 1em; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: color-mix(in oklab, var(--sc-accent) 86%, var(--sc-ink)); box-shadow: var(--sc-e2), inset 0 1px 0 rgb(255 255 255 / 0.16); }
  .btn--ghost:hover { background: color-mix(in oklab, var(--sc-ink) 7%, transparent); }
  .ground-night .btn:not(.btn--ghost):hover { background: #C2DBF7; }
}
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.5; pointer-events: none; }
.link-arrow { font-weight: 600; color: var(--sc-accent); text-decoration: none; display: inline-flex; gap: 0.4em; align-items: center; }
.link-arrow::after { content: "\2192"; transition: transform 160ms var(--sc-ease-out); }
@media (hover: hover) and (pointer: fine) { .link-arrow:hover::after { transform: translateX(3px); } .link-arrow:hover { text-decoration: underline; } }
.ground-night .link-arrow { color: var(--sky); }

/* ------------------------------------------------------------------ the bar */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--bar-h);
  display: flex; align-items: center; gap: var(--sc-5);
  padding-inline: clamp(1rem, 3vw, 2.5rem);
  transition: background-color 220ms var(--sc-ease-out), box-shadow 220ms var(--sc-ease-out);
}
.bar.is-solid, .bar--solid { background: color-mix(in oklab, var(--paper) 96%, transparent); box-shadow: 0 1px 0 rgb(15 33 59 / 0.08), 0 6px 18px -12px rgb(15 33 59 / 0.35); }
.bar__logo { display: block; flex: none; }
.bar__logo img { height: 40px; width: auto; }
.bar__nav { display: flex; gap: clamp(0.9rem, 1.6vw, 1.6rem); margin-left: auto; }
.bar__nav a { font: 500 var(--sc-t-sm)/1 var(--sc-font-text); color: var(--navy); text-decoration: none; padding: 0.55rem 0; position: relative; }
.bar__nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.15rem; height: 1.5px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform 180ms var(--sc-ease-out); }
.bar__nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) { .bar__nav a:hover::after { transform: scaleX(1); } }
.bar .btn { min-height: 42px; }

/* live next-service chip (signature, part 1) */
.next {
  display: inline-flex; align-items: center; gap: 0.55rem; white-space: nowrap;
  font: 500 var(--sc-t-xs)/1.2 var(--sc-font-text); color: var(--navy); text-decoration: none;
  padding: 0.5rem 0.8rem 0.5rem 0.65rem; border-radius: var(--r);
  background: color-mix(in oklab, var(--blue) 7%, var(--paper)); box-shadow: inset 0 0 0 1px rgb(11 74 140 / 0.16);
}
.next__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; position: relative; }
.next.is-live .next__dot { background: #C0392B; }
.next.is-live .next__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid #C0392B; animation: ping 1.8s var(--sc-ease-out) infinite; }
@keyframes ping { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.next b { font-weight: 600; }
.next__when { color: var(--sc-ink-soft); }

.menu-btn { display: none; margin-left: auto; width: 46px; height: 46px; border: 0; border-radius: var(--r); background: transparent; color: var(--navy); cursor: pointer; }
.menu-btn svg { width: 24px; height: 24px; margin: auto; }

@media (max-width: 1320px) { .bar .next { display: none; } }
@media (max-width: 900px) {
  :root { --bar-h: 62px; }
  .bar__logo img { height: 32px; }
  .bar__nav, .bar > .btn { display: none; }
  .menu-btn { display: grid; }
  .bar.is-open { background: var(--paper); }
  .bar.is-open .bar__nav {
    display: flex; flex-direction: column; gap: 0; position: fixed; inset: var(--bar-h) 0 auto 0;
    background: var(--paper); padding: var(--sc-3) var(--sc-gutter) var(--sc-6); box-shadow: 0 18px 30px -18px rgb(15 33 59 / 0.4);
  }
  .bar.is-open .bar__nav a { font-size: var(--sc-t-lg); padding: 0.9rem 0; border-bottom: 1px solid rgb(15 33 59 / 0.08); }
  .bar.is-open .bar__nav a::after { display: none; }
}

/* phone dock: the next service and the one CTA stay in reach of a thumb */
.dock { display: none; }
@media (max-width: 900px) {
  .dock {
    display: flex; align-items: center; gap: var(--sc-3); justify-content: space-between;
    position: fixed; z-index: 59; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--paper);
    box-shadow: var(--sc-e3), inset 0 0 0 1px rgb(15 33 59 / 0.06);
    transform: translateY(140%); transition: transform 320ms var(--sc-ease-drawer);
  }
  .dock.is-shown { transform: none; }
  .dock .next { background: none; box-shadow: none; padding: 0; white-space: normal; }
  .dock .btn { min-height: 44px; padding: 0 1rem; }
}

/* ---------------------------------------------------------------- sections */
.sec { padding-block: clamp(4rem, 8vw, 7.5rem); position: relative; }
.sec--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.wrap { width: 100%; max-width: 76rem; margin-inline: auto; padding-inline: var(--sc-gutter); }

/* --------------------------------------------- inner-page hero (short, flow) */
.phero { position: relative; min-height: min(78svh, 760px); display: grid; align-items: end; overflow: clip; isolation: isolate; }
.phero__bed { position: absolute; inset: -60px 0; z-index: -2; }
.phero__bed img { width: 100%; height: 100%; object-fit: cover; max-width: none; }
.phero__shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgb(13 30 54 / 0.92) 0%, rgb(13 30 54 / 0.64) 30%, rgb(13 30 54 / 0.12) 62%, transparent 80%); }
.phero__copy { padding: calc(var(--bar-h) + 3rem) var(--sc-gutter) clamp(2.5rem, 7vh, 4.5rem); max-width: 76rem; width: 100%; margin-inline: auto; }
.phero__copy h1 { max-width: 16ch; }
.phero__copy .sc-body { margin-top: var(--sc-4); max-width: 48ch; }

/* ---------------------------------------------------- threshold (page ends) */
.threshold { background: var(--night); color: var(--bone); position: relative; overflow: clip; }
.threshold::before { content: ""; position: absolute; inset: auto -10% -60% -10%; height: 120%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 100%, rgb(255 214 150 / 0.16), transparent 70%); }
.threshold__in { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sc-7); align-items: end; position: relative; }
.threshold__next { font: 600 var(--sc-t-2xl)/1.05 var(--sc-font-display); margin: var(--sc-3) 0 0; letter-spacing: -0.02em; }
.threshold__when { color: #C9D4E3; margin: var(--sc-2) 0 0; font-size: var(--sc-t-lg); }
.threshold__side { display: grid; gap: var(--sc-4); justify-items: start; }
.threshold address { font-style: normal; color: #C9D4E3; line-height: 1.6; }
.threshold address a { color: var(--bone); }
.threshold .btns { display: flex; flex-wrap: wrap; gap: var(--sc-3); }
@media (max-width: 860px) { .threshold__in { grid-template-columns: 1fr; gap: var(--sc-6); } }

/* ------------------------------------------------------------------ footer */
.foot { background: #0A1729; color: #AEBBCD; font-size: var(--sc-t-sm); }
.foot__in { display: flex; flex-wrap: wrap; gap: var(--sc-5) var(--sc-7); justify-content: space-between; align-items: center; padding-block: var(--sc-6); }
.foot img { height: 34px; width: auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--sc-2) var(--sc-5); }
.foot a { color: #DCE4EE; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot small { display: block; width: 100%; color: #7F8EA3; border-top: 1px solid rgb(255 255 255 / 0.08); padding-top: var(--sc-4); }
@media (max-width: 900px) { .foot { padding-bottom: 84px; } }

/* -------------------------------------------------------------- week strip */
.week { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid rgb(15 33 59 / 0.14); }
.day { padding: var(--sc-4) var(--sc-3) var(--sc-5); border-right: 1px solid rgb(15 33 59 / 0.08); min-height: 11rem; position: relative; }
.day:last-child { border-right: 0; }
.day__name { font: 600 var(--sc-t-xs)/1 var(--sc-font-text); letter-spacing: 0.2em; text-transform: uppercase; color: var(--grey); }
.day.is-today .day__name { color: var(--blue); }
.day.is-today::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--blue); }
.ev { margin-top: var(--sc-3); padding: 0.55rem 0.6rem; border-radius: 8px; transition: background-color 200ms var(--sc-ease-out); }
.ev time { display: block; font: 600 var(--sc-t-base)/1.1 var(--sc-font-display); color: var(--navy); font-variant-numeric: tabular-nums; }
.ev span { display: block; font-size: var(--sc-t-xs); line-height: 1.35; color: var(--sc-ink-soft); margin-top: 2px; }
.ev.is-next { background: var(--blue); box-shadow: var(--sc-e2); }
.ev.is-next time, .ev.is-next span { color: #fff; }
.ev.is-next::after { content: attr(data-label); display: block; margin-top: 6px; font: 600 10px/1 var(--sc-font-text); letter-spacing: 0.18em; text-transform: uppercase; color: #CFE2F8; }
.day--quiet .day__name { opacity: 0.55; }
@media (max-width: 860px) {
  .week { grid-template-columns: 1fr; border-top: 0; }
  .day { min-height: 0; display: grid; grid-template-columns: 6.6rem 1fr; gap: var(--sc-3); border-right: 0; border-top: 1px solid rgb(15 33 59 / 0.1); padding: var(--sc-3) 0; }
  .day--quiet { display: none; }
  .day__evs { display: grid; gap: var(--sc-2); }
  .day .ev { margin: 0; }
  .day__name { padding-top: 0.7rem; }
}

/* -------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .next.is-live .next__dot::after { animation: none; }
  .dock { transition: none; }
}
[hidden] { display: none !important; }
