/* ==========================================================================
   Fractal - "Fractal Praise"   (https://gojes.us/Fractal/)
   Idea: a dormant fractal on black — and praise that sets infinity turning.
   Sections: 1 tokens  2 base  3 field  4 top/buttons  5 hero/stage
             6 about/beats/church  7 ending/foot  8 awake states  9 motion
             10 share + glow-frame
   ========================================================================== */

/* 1 ---- tokens ------------------------------------------------------------ */
:root {
  --void: #07060a;
  --ember-ink: #120e0c;
  --copper: #8a5a32;
  --amber: #d4893a;
  --gold: #f0c36a;
  --gold-hi: #ffe6a8;
  --cream: #f6efe4;
  --muted: #c9b8a4;
  --ink: #0e0904;

  --display: "Cinzel", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --gutter: clamp(1rem, 4.5vw, 2.5rem);
}

/* 2 ---- base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--void);
}
body {
  margin: 0;
  min-height: 100vh;
  font: 400 clamp(1.06rem, 1rem + .3vw, 1.2rem)/1.65 var(--serif);
  color: var(--cream);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
b, strong { font-weight: 600; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--gold); color: var(--ink); }

.skip {
  position: absolute; left: .75rem; top: -4rem; z-index: 100;
  padding: .7rem 1.1rem; border-radius: 4px; background: var(--gold); color: var(--ink);
  font: 700 .95rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; transition: top .2s;
}
.skip:focus { top: .75rem; }

.wrap { width: min(100% - 2 * var(--gutter), 70rem); margin-inline: auto; }
.wrap.narrow { width: min(100% - 2 * var(--gutter), 42rem); }

h1, h2, h3 { font-family: var(--display); margin: 0; font-weight: 700; letter-spacing: .04em; }
h2 {
  font-size: clamp(1.85rem, 1.1rem + 3.2vw, 3.1rem);
  line-height: 1.15;
  margin: .45rem 0 1rem;
  text-wrap: balance;
}
h3 { font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); line-height: 1.25; margin: .35rem 0 .55rem; }

.kicker {
  font-family: var(--display);
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 .35rem;
}
.lead { font-size: clamp(1.08rem, 1rem + .35vw, 1.28rem); line-height: 1.7; margin: 0 0 1rem; }
.lead.soft, .ref { color: var(--muted); }
.glow { color: var(--gold-hi); }

/* 3 ---- field (generated SVG) --------------------------------------------- */
.void {
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(212, 137, 58, .14), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(7, 6, 10, .95), transparent 55%),
    var(--void);
  pointer-events: none;
}
.field {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: .68;
  transform-origin: 50% 48%;
  transition: opacity 1.4s ease, filter 1.4s ease;
  filter: saturate(.9) brightness(.88);
}
.field .fp-petals path,
.field .fp-sats path {
  opacity: 1;
}
.field .fp-bands circle {
  transition: stroke .8s ease, opacity .8s ease;
}
.field .fp-heart { fill: var(--amber); opacity: .55; }
.field .fp-bloom { opacity: .4; transition: opacity 1.4s ease; }

/* 4 ---- top bar + buttons ------------------------------------------------- */
.top {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
  padding: .35rem var(--gutter) 0;
}
.brand {
  display: inline-flex; align-items: center; margin-left: auto;
  text-decoration: none; color: var(--cream);
}
#btn-global-menu {
  font-size: 1.05rem;
  letter-spacing: .04em;
  min-width: 2.75rem;
  padding-left: .85rem;
  padding-right: .85rem;
}
.brand .mark {
  width: 1.65rem; height: 1.65rem; color: var(--amber); flex: none;
  transition: color .6s ease, transform .6s ease;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; padding: .65rem 1.15rem;
  border-radius: 999px; border: 1px solid transparent;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #e0a04a);
  color: var(--ink); text-decoration: none;
  font: 700 .92rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; box-shadow: 0 8px 28px rgba(212, 137, 58, .22);
}
.btn svg { width: 1.15rem; height: 1.15rem; }
.btn.ghost {
  background: transparent; color: var(--cream);
  border-color: rgba(240, 195, 106, .35);
  box-shadow: none;
}
.btn.ghost:hover, .btn.ghost:focus-visible { border-color: var(--gold); color: var(--gold-hi); }
/* 5 ---- hero / stage ------------------------------------------------------ */
/* Video is why people come: chrome stays thin so the stage can be generous. */
.hero {
  position: relative; z-index: 1;
  isolation: isolate; /* stacking context so .glow-frame rainbow stays behind the stage */
  padding: 0 var(--gutter) 1.6rem;
  text-align: center;
}
#title {
  font-size: clamp(1.55rem, .7rem + 3.2vw, 2.65rem);
  line-height: .95;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: .1rem 0 .2rem;
  filter: drop-shadow(0 0 .35em rgba(7, 6, 10, .85));
}
#title .w {
  display: inline-block;
  padding: 0 .06em .08em;
  /* vivid colour-cycle rainbow — keeps moving for well over the first minute */
  background-image: linear-gradient(
    90deg,
    #ff3d6e,
    #ff7a2e,
    #ffd23f,
    #3ee08f,
    #2ec7ff,
    #6b7bff,
    #d26bff,
    #ff3d6e,
    #ff7a2e,
    #ffd23f,
    #3ee08f,
    #2ec7ff,
    #ff3d6e
  );
  background-size: 400% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.sub {
  margin: 0 auto .45rem;
  max-width: 34rem;
  font-style: italic;
  font-size: clamp(.9rem, .82rem + .28vw, 1.05rem);
  color: var(--muted);
}

.stage-wrap {
  position: relative;
  /* As wide as looks great, but never taller than the first screen allows. */
  width: min(100%, calc((100vh - 9.5rem) * 16 / 9), calc((100dvh - 9.5rem) * 16 / 9));
  margin: 0 auto .7rem;
}
.stage {
  position: relative;
  border-radius: 14px;
  padding: 3px;
  border: 2px solid #c9a24a;
  background: #0a0806;
  box-shadow:
    0 0 0 1px rgba(240, 195, 106, .12),
    0 24px 60px rgba(0, 0, 0, .55),
    0 0 80px rgba(212, 137, 58, .08);
  transition: box-shadow 1s ease, border-color 1s ease;
}
.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 11px;
  overflow: hidden;
  background: #000;
}
.stream-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; background: #000; object-fit: contain;
}
.facade {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  padding: 0; margin: 0;
  display: block; cursor: pointer; text-decoration: none; color: inherit;
  background: transparent; z-index: 2;
}
.facade[hidden] { display: none !important; }
.facade img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: saturate(.9) brightness(.92);
  transition: filter .5s ease, transform .8s ease;
}
.facade:hover img, .facade:focus-visible img {
  filter: saturate(1) brightness(1);
  transform: scale(1.02);
}
.facade:focus-visible {
  outline: none;
}
.facade:focus-visible::after {
  content: "";
  position: absolute; inset: 0; z-index: 3;
  box-shadow: inset 0 0 0 3px var(--gold);
  pointer-events: none;
}

.play {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  pointer-events: none;
}
.play svg { width: clamp(4.2rem, 12vw, 5.6rem); height: auto; }
.pl-arc {
  fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round;
  transition: stroke-dashoffset .45s ease, stroke .45s ease;
}
.pl-l { stroke-dasharray: 132; stroke-dashoffset: 10; }
.pl-r { stroke-dasharray: 132; stroke-dashoffset: 10; }
.pl-ring {
  stroke: transparent; stroke-width: 3;
  transition: stroke .45s ease;
}
.facade:hover .pl-l, .facade:focus-visible .pl-l,
.facade:hover .pl-r, .facade:focus-visible .pl-r {
  stroke-dashoffset: 0;
  stroke: var(--gold-hi);
}
.facade:hover .pl-ring, .facade:focus-visible .pl-ring {
  stroke: rgba(240, 195, 106, .35);
}

.chip {
  position: absolute; right: .75rem; bottom: .75rem; z-index: 2;
  padding: .35rem .55rem; border-radius: 6px;
  background: rgba(7, 6, 10, .72); color: var(--cream);
  font: 600 .78rem/1 var(--display); letter-spacing: .08em;
  pointer-events: none;
}

.actions {
  display: flex; flex-wrap: wrap; gap: .65rem; justify-content: center;
  align-items: center;
  margin: 0;
}

/* 6 ---- about / beats / church -------------------------------------------- */
.about, .beats, .church, .ending {
  position: relative; z-index: 1;
  padding: 2.8rem 0;
}
.about { text-align: center; }
.beats { text-align: center; }
.beats .wrap { width: min(100% - 2 * var(--gutter), 64rem); }

.tri {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: left;
}
.tri li {
  position: relative;
  padding: .35rem 0 .35rem 1.15rem;
  border-left: 1px solid rgba(212, 137, 58, .45);
  background: none;
  border-radius: 0;
  box-shadow: none;
}
.tri .n {
  display: block;
  font-family: var(--display);
  font-size: .75rem;
  letter-spacing: .2em;
  color: var(--amber);
  margin-bottom: .35rem;
}
.tri p { margin: 0; color: var(--muted); font-size: .98rem; }
@media (max-width: 800px) {
  .tri { grid-template-columns: 1fr; }
}

.church { text-align: center; }
.stream {
  margin: 1.4rem 0 1.2rem;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(138, 90, 50, .4);
  background: rgba(18, 14, 12, .65);
  padding: .35rem .9rem .9rem;
}
.stream summary {
  cursor: pointer;
  min-height: 44px;
  display: flex; align-items: center;
  font-family: var(--display);
  font-size: .95rem;
  letter-spacing: .04em;
  color: var(--gold);
  list-style: none;
}
.stream summary::-webkit-details-marker { display: none; }
.stream summary::before {
  content: "+";
  display: inline-grid; place-items: center;
  width: 1.4rem; height: 1.4rem; margin-right: .55rem;
  border-radius: 50%;
  border: 1px solid rgba(240, 195, 106, .45);
  font-size: .9rem;
}
.stream[open] summary::before { content: "–"; }
.local-video {
  margin-top: .75rem;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.local-video video { width: 100%; height: 100%; display: block; }

.downloads h3 {
  font-size: 1rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: .7rem;
}
.file-row {
  display: flex; flex-wrap: wrap; gap: .65rem; justify-content: center;
  margin: 0;
}
.file {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: .55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(240, 195, 106, .4);
  text-decoration: none;
  font: 600 .85rem/1 var(--display); letter-spacing: .06em;
  color: var(--gold-hi);
  background: rgba(18, 14, 12, .55);
}
.file:hover, .file:focus-visible {
  border-color: var(--gold);
  background: rgba(212, 137, 58, .15);
}

/* 7 ---- ending / footer --------------------------------------------------- */
.ending { text-align: center; padding-bottom: 1.5rem; }
.ending .rose {
  width: min(7.5rem, 34vw);
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  opacity: .75;
  filter: drop-shadow(0 0 18px rgba(240, 195, 106, .25));
}
.ending .ref {
  font-style: italic;
  margin: -.3rem 0 1.2rem;
}

.foot {
  position: relative; z-index: 1;
  padding: 2.5rem var(--gutter) 3rem;
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(7, 6, 10, .88) 35%, var(--void));
}
.foot-text p { margin: 0 0 1rem; color: var(--muted); font-size: .95rem; }
.foot nav {
  display: flex; flex-wrap: wrap; gap: .55rem 1.1rem; justify-content: center;
}
.foot a {
  color: var(--gold);
  text-decoration: none;
  font-family: var(--display);
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  min-height: 44px;
  display: inline-flex; align-items: center;
}
.foot a:hover, .foot a:focus-visible { color: var(--gold-hi); text-decoration: underline; }

/* 8 ---- awake / playing states -------------------------------------------- */
html.is-awake .field {
  opacity: .78;
  filter: saturate(1) brightness(.95);
}
html.is-awake .field .fp-bloom { opacity: .85; }
html.is-awake .field .fp-petals path,
html.is-awake .field .fp-sats path {
  opacity: 1;
  filter: saturate(1.25) brightness(1.15);
}
html.is-awake .field .fp-bands circle {
  stroke: var(--gold);
  opacity: .28;
}
html.is-awake .field .fp-heart { fill: var(--gold-hi); opacity: .95; }
html.is-awake .brand .mark { color: var(--gold); transform: rotate(18deg); }
html.is-awake .stage {
  border-color: #f0c36a;
  box-shadow:
    0 0 0 1px rgba(255, 230, 168, .28),
    0 28px 70px rgba(0, 0, 0, .55),
    0 0 100px rgba(240, 195, 106, .22);
}
html.is-playing .field {
  opacity: .92;
  filter: saturate(1.08) brightness(1.05);
}

/* 9 ---- motion + reduce --------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes breath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.012); }
}
@keyframes turn {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1.04); }
}
@keyframes playpulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: .92; }
}

.js .rv { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.js .rv.in { opacity: 1; transform: none; }

#title .w {
  animation:
    rise .8s ease both,
    rainbow-cycle 60s linear infinite;
  animation-delay: calc(var(--i) * .12s), .6s;
}
.play svg { animation: playpulse 3.6s ease-in-out infinite; }
.field { animation: breath 14s ease-in-out infinite; }
html.is-awake .field { animation: breath 10s ease-in-out infinite; }
html.is-playing .field { animation: turn 120s linear infinite; }

@keyframes rainbow-cycle {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* 10 ---- glow-frame (pulsating rainbow border; Scripts/Web_Styles) -------- */
@property --glow-spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.glow-frame { --glow-reach: 7px; --glow-blur: 10px; --glow-radius: 20px; }
.glow-frame::before {
  content: "";
  position: absolute;
  inset: calc(var(--glow-reach) * -1);
  z-index: -1;
  border-radius: var(--glow-radius);
  pointer-events: none;
  background: conic-gradient(from var(--glow-spin), #ff4d5e, #ffad3b, #fff35c, #5cff86, #4ddcff, #6b7bff, #d26bff, #ff4d5e);
  filter: blur(var(--glow-blur));
  animation: glow-spin 2.8s linear infinite, glow-pulse 1.25s ease-in-out infinite alternate;
}
@keyframes glow-spin  { to { --glow-spin: 360deg; } }
@keyframes glow-pulse { from { opacity: .55; } to { opacity: 1; } }

/* Share widget theming (do not edit share.css; override --share-* here) */
.share {
  --share-bg: #120e0c;
  --share-text: #f6efe4;
  --share-muted: #c9b8a4;
  --share-primary: #d4893a;
  --share-primary-ink: #0e0904;
  --share-border: rgba(240, 195, 106, .35);
  --share-radius: 12px;
  --share-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.actions .share { display: inline-flex; }
.share .share-icon {
  width: 1.05rem; height: 1.05rem;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; }
  .field { transform: none !important; }
  /* end states still visible */
  html.is-awake .field { opacity: .78; filter: saturate(1) brightness(.95); }
  .glow-frame::before { opacity: .85; }
  #title .w { background-position: 35% 50%; }
}

@media (forced-colors: active) {
  .field, .void { display: none; }
  .btn, .file, .stage { border: 2px solid CanvasText; }
  .glow-frame::before { display: none; }
}

@media print {
  .field, .void, .play, .glow-frame::before { display: none !important; }
  body { color: #000; background: #fff; }
  a { color: #000; }
}
