/* =========================================================
   THE CHURCH KIDS — site styles
   Colors come from the record covers: cream paper, a near-black
   olive, and the brush-script red. Paper sections are where you
   read and play; dark sections are where the records hang.
   ========================================================= */

@font-face {
  font-family: "Have Heart Two";
  src: url("../fonts/have-heart-two.woff2") format("woff2"),
       url("../fonts/have-heart-two.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper:      #F7F0E3;
  --paper-deep: #EDE3D1;
  --ink:        #171A14;
  --ink-deep:   #0F110D;
  --red:        #C4321F;
  --red-deep:   #A5281A;
  --stone:      #6F6A5E;   /* secondary text on paper */
  --mist:       #A9AA9F;   /* secondary text on ink */
  --rule-on-paper: rgba(23, 26, 20, 0.16);
  --rule-on-ink:   rgba(247, 240, 227, 0.16);

  --script: "Have Heart Two", "Brush Script MT", cursive;
  --sans:   "Instrument Sans", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono:   "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 12px; padding: 8px 12px; background: var(--ink); color: var(--paper); z-index: 100; }
.skip:focus { left: 12px; }

.script { font-family: var(--script); font-weight: 400; line-height: 1; letter-spacing: 0.01em; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.dot { opacity: 0.45; margin: 0 0.45em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 14px;
}
.section-head { margin-bottom: 56px; }
.section-head h2 { font-size: clamp(32px, 4.2vw, 46px); font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; }
.section-head .lede { max-width: 560px; margin-top: 22px; font-size: 18px; line-height: 1.6; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  color: var(--ink);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-solid { background: rgba(247, 240, 227, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--rule-on-paper); }
.nav-mark { font-size: 26px; color: var(--red); padding-top: 4px; }
.nav-links { display: flex; align-items: center; font-size: 14px; letter-spacing: 0.01em; }
.nav-links a { padding: 6px 0; opacity: 0.8; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 1; }
.nav-links a + a::before { content: "·"; opacity: 0.45; margin: 0 14px; }

/* ---------- cover ---------- */
.cover {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 120px var(--gutter) 96px;
  background:
    radial-gradient(110% 70% at 50% 115%, rgba(196, 50, 31, 0.10), transparent 60%),
    radial-gradient(80% 50% at 50% -10%, rgba(23, 26, 20, 0.06), transparent 70%),
    var(--paper);
}
.wordmark {
  font-size: clamp(56px, 13.5vw, 190px);
  color: var(--red);
  margin: 0 0 28px;
  padding: 0.12em 0.08em;   /* room for the swashes */
  white-space: nowrap;
}
.wordmark-ink { display: inline-block; clip-path: inset(-30% 100% -30% 0); }
.cover-line { font-size: clamp(17px, 1.6vw, 20px); color: var(--stone); max-width: 34ch; }
.listen-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 36px; }
.cover-down {
  position: absolute; bottom: 28px; left: 0; right: 0; width: max-content; margin-inline: auto;
  color: var(--stone); padding: 8px; transition: color 0.2s;
}
.cover-down:hover { color: var(--ink); }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px 11px 14px;
  border: 1px solid rgba(23, 26, 20, 0.32);
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  color: var(--ink);
  background: transparent;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.pill svg { width: 19px; height: 19px; }
.pill:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-1px); }

/* "soon" links: visible but honest */
.is-soon { position: relative; opacity: 0.5; cursor: default; }
.is-soon:hover { transform: none; }
.pill.is-soon:hover { background: transparent; color: var(--ink); border-color: rgba(23, 26, 20, 0.32); }
.nudge { animation: nudge 0.45s var(--ease); }
@keyframes nudge { 0% { transform: translateX(0); } 30% { transform: translateX(-3px); } 60% { transform: translateX(3px); } 100% { transform: translateX(0); } }

/* page-load sequence: the wordmark writes itself, then the rest arrives */
.reveal { opacity: 0; transform: translateY(10px); }
html.ready .wordmark-ink { animation: write 1.5s var(--ease) 0.25s forwards; }
html.ready .reveal { animation: rise 0.8s var(--ease) forwards; }
html.ready #tagline     { animation-delay: 1.45s; }
html.ready #listen-row  { animation-delay: 1.7s; }
html.ready .cover-down  { animation-delay: 2.3s; }
@keyframes write { to { clip-path: inset(-30% -5% -30% 0); } }
@keyframes rise  { to { opacity: 1; transform: translateY(0); } }
/* safety net: whatever happens to the animations, the cover is readable after 3s */
html.settled .wordmark-ink { clip-path: none; animation: none; }
html.settled .reveal { opacity: 1; transform: none; animation: none; }

/* ---------- music: the records, hung on a dark wall ---------- */
.music { padding: 128px 0 140px; background: var(--ink); color: var(--paper); }
.music .eyebrow { color: var(--mist); }
.releases { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 48px 36px; }
.art {
  position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--ink-deep);
  box-shadow: 0 1px 0 rgba(247, 240, 227, 0.06) inset, 0 34px 60px -28px rgba(0, 0, 0, 0.85);
  transition: transform 0.4s var(--ease);
}
.release:hover .art { transform: translateY(-3px); }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art-blank { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(160deg, #22261E, var(--ink-deep)); }
.art-blank .script { font-size: 64px; color: var(--paper); opacity: 0.25; }
.badge {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--red); color: var(--paper);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.release-meta { padding-top: 18px; }
.release-kind { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mist); }
.release-title { font-size: 22px; font-weight: 500; margin: 6px 0 12px; letter-spacing: -0.01em; }
.release-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.release-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--mist); transition: color 0.2s; }
.release-link svg { width: 16px; height: 16px; }
.release-link:hover { color: var(--paper); }
.release-link.is-soon:hover { color: var(--mist); }
.release-soon { font-size: 14px; color: var(--mist); font-style: italic; }

/* ---------- resources: the pages ---------- */
.resources { position: relative; background: var(--paper); color: var(--ink); padding: 120px 0 128px; }
/* the ribbon marker, hanging from the top of the page */
.resources .section-head { position: relative; padding-left: 24px; }
.resources .section-head::before {
  content: ""; position: absolute; left: 0; top: -120px; width: 3px; height: 92px;
  background: var(--red);
}

.song-list { border-top: 1px solid var(--rule-on-paper); }
.song {
  display: grid; grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.6fr); gap: 16px 40px; align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule-on-paper);
}
.song h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.song-writers { margin-top: 4px; font-size: 14px; color: var(--stone); }
.song-meta { margin-top: 6px; font-size: 12.5px; letter-spacing: 0.03em; color: var(--stone); }
.song-files { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.song-dls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.song-empty { font-size: 13.5px; color: var(--stone); font-style: italic; }
.dl {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 13px;
  border: 1px solid rgba(23, 26, 20, 0.3);
  border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  color: var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.dl svg { width: 14px; height: 14px; margin-right: -3px; }
.dl:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dl.is-soon:hover { background: transparent; color: var(--ink); border-color: rgba(23, 26, 20, 0.3); }

/* the key picker: one chip per key the chart comes in */
.keys { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.keys-label { width: 100%; font-size: 13px; color: var(--stone); text-align: right; margin-bottom: 2px; }
.key {
  display: inline-grid; place-items: center;
  min-width: 36px; height: 32px; padding: 0 8px;
  border: 1px solid rgba(23, 26, 20, 0.3); border-radius: 999px;
  font-family: var(--mono); font-size: 13px; color: var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.key:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.key.is-home { border-color: var(--red); color: var(--red); font-weight: 500; }
.key.is-home:hover { background: var(--red); color: var(--paper); }
.song-empty { font-size: 13.5px; color: var(--stone); font-style: italic; }
.resources-note { margin-top: 36px; color: var(--stone); font-size: 15px; max-width: 56ch; }

/* ---------- back cover ---------- */
.back { background: var(--ink-deep); color: var(--paper); padding: 96px 0 32px; }
.back .eyebrow { color: var(--mist); }
.back-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; padding-bottom: 72px; }
.back-mark { font-size: 44px; color: var(--red); }
.back-line { margin-top: 18px; color: var(--mist); max-width: 36ch; }
.back-email { display: inline-block; font-size: 20px; font-weight: 500; color: var(--paper); border-bottom: 1px solid var(--rule-on-ink); padding-bottom: 2px; transition: border-color 0.2s; }
.back-email:hover { border-color: var(--paper); }
.socials { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 26px; }
.social { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: var(--mist); transition: color 0.2s; }
.social svg { width: 15px; height: 15px; }
.social:hover { color: var(--paper); }
.back-foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; border-top: 1px solid var(--rule-on-ink); font-family: var(--mono); font-size: 12px; color: var(--mist); }
.noscript { padding: 24px var(--gutter); text-align: center; color: var(--stone); }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav { padding: 14px var(--gutter); }
  .nav-mark { font-size: 22px; }
  .nav-links { font-size: 13px; }
  .nav-links a + a::before { margin: 0 10px; }
  .cover { padding-top: 96px; padding-bottom: 88px; }
  .wordmark { font-size: clamp(64px, 24vw, 110px); margin-bottom: 22px; }
  .listen-row { margin-top: 28px; }
  .pill { padding: 10px 15px 10px 12px; font-size: 14px; }
  .music { padding: 88px 0 96px; }
  .releases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; }
  .release-title { font-size: 18px; }
  .section-head { margin-bottom: 40px; }
  .resources { padding: 88px 0 96px; }
  .resources .section-head::before { top: -88px; height: 64px; }
  .resources .section-head { padding-left: 18px; }
  .song { padding: 22px 0; }
  .back { padding-top: 72px; }
  .back-grid { grid-template-columns: 1fr; gap: 40px; padding-bottom: 48px; }
  .back-mark { font-size: 36px; }
  .back-foot { flex-direction: column; gap: 6px; }
}
/* mid-size screens: the key row needs the full width, so it drops under the title */
@media (max-width: 1000px) {
  .song { grid-template-columns: 1fr; gap: 14px; }
  .song-files { align-items: flex-start; }
  .song-dls, .keys { justify-content: flex-start; }
  .keys-label { text-align: left; }
}
@media (max-width: 400px) {
  .releases { grid-template-columns: 1fr; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wordmark-ink { clip-path: none; }
  .reveal { opacity: 1; transform: none; }
  html.ready .wordmark-ink, html.ready .reveal { animation: none; }
  .pill, .dl, .art, .nudge { transition: none; animation: none; }
}
