/* style.css — Praise Concert · The Common Ground Worship Collective */

/* ============ DESIGN TOKENS ============ */
:root,
[data-theme='light'] {
  --color-bg: #fbf5ec;
  --color-surface: #fffdf8;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f3e8d3;
  --color-surface-offset-2: #ebdbbe;
  --color-surface-dynamic: #e2cca0;
  --color-divider: #e5d7bc;
  --color-border: #d6c4a0;

  --color-text: #241a10;
  --color-text-muted: #7c6a52;
  --color-text-faint: #b7a484;
  --color-text-inverse: #fbf5ec;

  --color-primary: #b14a0a;
  --color-primary-hover: #8f3b08;
  --color-primary-active: #6e2d06;
  --color-primary-highlight: #f0d8be;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-sm: 0 1px 2px oklch(0.25 0.04 45 / 0.08);
  --shadow-md: 0 8px 24px oklch(0.25 0.04 45 / 0.12);
  --shadow-lg: 0 20px 48px oklch(0.25 0.04 45 / 0.18);

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;

  /* Hero foreground always sits on the photo — near-white regardless of theme */
  --color-hero-fg: #fffaf2;
  --color-hero-fg-muted: rgba(255, 250, 242, 0.78);

  color-scheme: light;
}

[data-theme='dark'] {
  --color-bg: #140f0a;
  --color-surface: #1b140d;
  --color-surface-2: #221a11;
  --color-surface-offset: #251c12;
  --color-surface-offset-2: #2d2216;
  --color-surface-dynamic: #3b2c1b;
  --color-divider: #332617;
  --color-border: #4a3826;

  --color-text: #f1e6d6;
  --color-text-muted: #b29d80;
  --color-text-faint: #7c6a54;
  --color-text-inverse: #1b140d;

  --color-primary: #f0954b;
  --color-primary-hover: #f5ac6e;
  --color-primary-active: #f8c08d;
  --color-primary-highlight: #3d2b1a;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.35);
  --shadow-md: 0 8px 24px oklch(0 0 0 / 0.45);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.55);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #140f0a;
    --color-surface: #1b140d;
    --color-surface-2: #221a11;
    --color-surface-offset: #251c12;
    --color-surface-offset-2: #2d2216;
    --color-surface-dynamic: #3b2c1b;
    --color-divider: #332617;
    --color-border: #4a3826;
    --color-text: #f1e6d6;
    --color-text-muted: #b29d80;
    --color-text-faint: #7c6a54;
    --color-text-inverse: #1b140d;
    --color-primary: #f0954b;
    --color-primary-hover: #f5ac6e;
    --color-primary-active: #f8c08d;
    --color-primary-highlight: #3d2b1a;
    color-scheme: dark;
  }
}

:root {
  --bar-h: 4.5rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
}

/* ============ BASE PAGE LOCK (no scroll) ============ */
html,
body {
  height: 100%;
  overscroll-behavior: none;
}
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
  background: var(--color-bg);
}

/* ============ HEADER BAR ============ */
.bar {
  flex: 0 0 auto;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  z-index: 20;
}
.bar-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-text);
  text-decoration: none;
}
.brand svg {
  width: 30px;
  height: 30px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.9rem, 1.4vw + 0.6rem, 1.05rem);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.bar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--color-surface-offset);
}
.theme-toggle svg {
  width: 17px;
  height: 17px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.btn-sm {
  padding: 0.55rem 1.05rem;
  font-size: 0.8rem;
}
.btn-lg {
  padding: clamp(0.75rem, 1.4vh, 0.95rem) clamp(1.3rem, 2.4vw, 1.75rem);
  font-size: clamp(0.85rem, 1.6vh, 0.95rem);
}
.btn-primary {
  background: var(--color-primary);
  color: #fff8ee;
  box-shadow: 0 8px 20px oklch(0.35 0.12 40 / 0.28);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px oklch(0.35 0.12 40 / 0.34);
}
.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-hero-fg);
  border: 1.5px solid rgba(255, 250, 242, 0.4);
  backdrop-filter: blur(6px);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 250, 242, 0.7);
}
.bar-actions .btn-primary {
  color: #fff8ee;
}

/* ============ STAGE ============ */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.stage-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #17110b;
}
.stage-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenburns 22s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes kenburns {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-1%, -1%, 0); }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  mix-blend-mode: screen;
  opacity: 0.55;
  pointer-events: none;
}
.orb-a {
  width: 38vmax;
  height: 38vmax;
  top: -14vmax;
  left: -10vmax;
  background: radial-gradient(circle, oklch(0.68 0.16 55 / 0.65), transparent 70%);
  animation: driftA 26s ease-in-out infinite alternate;
}
.orb-b {
  width: 30vmax;
  height: 30vmax;
  bottom: -12vmax;
  right: -8vmax;
  background: radial-gradient(circle, oklch(0.6 0.17 40 / 0.55), transparent 70%);
  animation: driftB 32s ease-in-out infinite alternate;
}
.orb-c {
  width: 22vmax;
  height: 22vmax;
  top: 30%;
  right: 12%;
  background: radial-gradient(circle, oklch(0.75 0.13 70 / 0.45), transparent 70%);
  animation: driftC 20s ease-in-out infinite alternate;
}
@keyframes driftA {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(6vmax, 4vmax) scale(1.15); }
}
@keyframes driftB {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-5vmax, -6vmax) scale(1.1); }
}
@keyframes driftC {
  from { transform: translate(0, 0) scale(1); opacity: 0.3; }
  to { transform: translate(-4vmax, 3vmax) scale(1.2); opacity: 0.55; }
}

.stage-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, oklch(0.1 0.03 40 / 0.35) 0%, oklch(0.08 0.03 40 / 0.55) 55%, oklch(0.06 0.02 40 / 0.82) 100%),
    radial-gradient(120% 90% at 50% 100%, oklch(0.05 0.02 40 / 0.6), transparent 60%);
}

/* ============ STAGE CONTENT ============ */
.stage-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(760px, 90vw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(0.55rem, 1.7vh, 1.15rem);
  color: var(--color-hero-fg);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: clamp(0.68rem, 1.3vh + 0.3vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-hero-fg-muted);
}

.stage-title {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 0.92;
  color: var(--color-hero-fg);
}
.stage-title .line {
  display: block;
  overflow: hidden;
}
.stage-title .line span {
  display: block;
  font-size: clamp(2.75rem, 6vw + 5vh, 7rem);
}

.stage-tagline {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.9rem, 1vw + 1.2vh, 1.15rem);
  color: var(--color-hero-fg-muted);
  max-width: 46ch;
}

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 1.5vw, 1.25rem);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(0.78rem, 0.9vh + 0.5vw, 0.95rem);
  color: var(--color-hero-fg);
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary-active, var(--color-primary));
  opacity: 0.9;
  flex-shrink: 0;
}

.stage-countdown {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.4vw, 1rem);
}
.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(2.6rem, 5vw, 3.4rem);
  padding: clamp(0.4rem, 1vh, 0.6rem) clamp(0.35rem, 1vw, 0.6rem);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}
.cd-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 1.4vw + 1.6vh, 1.9rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.cd-label {
  font-size: clamp(0.55rem, 0.9vw, 0.65rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-hero-fg-muted);
  margin-top: 0.15rem;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 1.5vw, 0.9rem);
  margin-top: clamp(0.15rem, 0.6vh, 0.4rem);
}

.stage-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(0.75rem, 2vh, 1.25rem);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-inline: 1rem;
  font-size: clamp(0.65rem, 1.1vh + 0.2vw, 0.78rem);
  color: var(--color-hero-fg-muted);
  text-align: center;
}
.stage-footer a {
  color: var(--color-hero-fg-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.stage-footer a:hover {
  color: var(--color-hero-fg);
}
.stage-footer span::after {
  content: '·';
  margin-left: 0.5rem;
  opacity: 0.6;
}

/* ============ REVEAL-ON-LOAD ANIMATION ============ */
.reveal-item {
  opacity: 0;
  transform: translateY(14px);
}
.stage-title .line span {
  transform: translateY(100%);
}
body.is-ready .reveal-item {
  animation: revealUp 0.85s var(--ease-out) forwards;
}
body.is-ready .stage-title .line span {
  animation: revealTitle 0.9s var(--ease-out) forwards;
}
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes revealTitle {
  to { opacity: 1; transform: translateY(0); }
}

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: oklch(0.1 0.02 40 / 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 220ms var(--ease-out);
}
.modal-backdrop.is-open {
  opacity: 1;
}
.modal {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: min(420px, 88vw);
  max-height: 82dvh;
  overflow-y: auto;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
.modal.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.modal .eyebrow { color: var(--color-primary); }
.modal h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 600;
}
.modal-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.modal-row svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.modal .btn-primary {
  margin-top: 0.35rem;
}
.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}
.modal-close:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}
.modal-close svg {
  width: 18px;
  height: 18px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  :root { --bar-h: 3.9rem; }
  .brand-text { display: none; }
  .stage-content { gap: clamp(0.45rem, 1.6vh, 0.85rem); }
  .stage-meta { gap: 0.5rem 0.9rem; }
}

@media (max-height: 720px) {
  .stage-tagline { display: none; }
}

@media (max-height: 560px) {
  .stage-countdown { display: none; }
  .stage-title .line span { font-size: clamp(2.25rem, 5vw + 3.5vh, 4.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .stage-img,
  .orb {
    animation: none !important;
  }
}
