/* HALCYON site additions on top of base.css (ported from the Shopify theme). */
@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-wdth.woff2") format("woff2-variations"), url("/static/fonts/archivo-wdth.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-wdth-italic.woff2") format("woff2-variations"), url("/static/fonts/archivo-wdth-italic.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap;
}

/* Basket drawer */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / 0.55); opacity: 0; visibility: hidden; transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s; }
.drawer-backdrop.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(440px, 100vw);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--bg-2); border-left: 1px solid var(--line-strong);
  transform: translateX(105%); transition: transform 0.4s var(--ease); visibility: hidden;
}
.drawer.is-open { transform: none; visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer__head .h3 { margin: 0; }
.drawer__body { overflow-y: auto; padding: 8px 20px; }
.drawer__foot { display: grid; gap: 14px; padding: 20px; border-top: 1px solid var(--line); padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.basket-lines { list-style: none; margin: 0; padding: 0; }
.basket-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.basket-line__title { font-weight: 500; }
.basket-line__sub { display: block; color: var(--text-3); font-size: var(--step--1); }
.basket-note { font-size: var(--step--1); color: var(--text-2); margin: 12px 0 0; }
.basket-empty { color: var(--text-2); padding: 24px 0; }
.basket-total { display: flex; justify-content: space-between; align-items: baseline; }
.basket-total strong { font-size: var(--step-2); font-weight: 300; font-stretch: 108%; }
.drawer .btn--primary { width: 100%; }
.drawer .btn--primary:disabled { opacity: 0.4; cursor: not-allowed; }

.consent { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: var(--step--1); line-height: 1.5; color: var(--text-2); cursor: pointer; }
.consent input { appearance: none; width: 20px; height: 20px; margin: 1px 0 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); display: grid; place-items: center; cursor: pointer; }
.consent input:checked { background: var(--accent); border-color: var(--accent); }
.consent input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.consent input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.consent a { color: var(--text); }

/* Track row add buttons */
.track__buy .btn.is-added { border-color: var(--text-3); color: var(--text-2); }

/* Simple pages: policies, library, messages */
.page { max-width: 72ch; margin: 0 auto; padding: calc(var(--header-h) + clamp(40px, 6vw, 80px)) var(--gutter) clamp(72px, 9vw, 120px); }
.page__title { margin: 0 0 clamp(24px, 4vw, 40px); font-size: var(--step-4); font-weight: 300; font-stretch: 108%; line-height: 1.02; letter-spacing: -0.02em; }
.page__body { color: var(--text-2); line-height: 1.65; }
.page__body h2 { margin: 2.2em 0 0.6em; font-size: var(--step-1); font-weight: 600; color: var(--text); }
.page__body p, .page__body ul { margin: 0 0 1em; }
.page__body ul { padding-left: 1.2em; }
.page__body li + li { margin-top: 0.4em; }
.page__body strong { color: var(--text); font-weight: 600; }
.page__body a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.files { list-style: none; margin: 24px 0; padding: 0; border-top: 1px solid var(--line); }
.file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.file__name { font-weight: 500; overflow-wrap: anywhere; }
.file__left { display: block; color: var(--text-3); font-size: var(--step--1); }
.file--featured .file__name { font-size: var(--step-1); }
.notice { padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg-2); color: var(--text-2); font-size: var(--step--1); }
.notice strong { color: var(--text); }

.free-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }

/* Utilities (inline styles are blocked by the CSP) */
.sentinel { position: absolute; top: 0; width: 1px; height: 1px; }
.sentinel--hero { top: 70%; }
.hero__media { --focal: 62% 50%; }
.flush { margin: 0; }
.small { font-size: var(--step--1); }
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin: 0; }

.page__body a.btn { text-decoration: none; color: var(--text); }

/* Free Chapter 1 form */
.free-form { display: grid; gap: 20px; max-width: 520px; margin-top: 28px; }
.free-form .btn { justify-self: start; }
.free-form .consent { margin-top: 12px; }

/* Hero: free Chapter 1 first, previews labelled as previews */
.free-flag {
  display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
  margin: 0 0 clamp(20px, 3vh, 32px); padding: 6px 14px 6px 6px;
  border: 1px solid rgb(238 85 70 / 0.6); border-radius: var(--radius);
  background: rgb(11 16 19 / 0.6); color: var(--text); text-decoration: none;
  font-size: var(--step-0); font-weight: 500; line-height: 1.35;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.free-flag:hover { border-color: var(--accent); background: rgb(11 16 19 / 0.8); }
.free-flag:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.free-flag__tag {
  flex: none; padding: 5px 10px; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent);
  font-size: 0.75rem; font-weight: 700; font-stretch: 115%; letter-spacing: 0.14em; text-transform: uppercase;
}
.hero-free .icon { width: 18px; height: 18px; }
.btn--ghost.hero-play .btn__glyph { background: var(--text); color: var(--bg); }
.hero__note { max-width: 52ch; color: var(--text-2); line-height: 1.5; }
.hero__note a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.hero__content > *:nth-child(5) { animation-delay: 0.32s; }
.hero__content > *:nth-child(6) { animation-delay: 0.4s; }
/* Book 1: buy here or listen on Spotify */
.bundle__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn--spotify .icon--spotify { width: 21px; height: 21px; flex: none; } /* Spotify's minimum icon size on screen */
@media (max-width: 520px) {
  .bundle__actions .btn { width: 100%; }
  .hero__actions .btn { width: 100%; }
  .free-flag { font-size: var(--step--1); }
}

/* Cookie banner (app/static/js/consent.js): non-blocking, Accept and Reject carry equal weight */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--bg-2); border-top: 1px solid var(--line-strong); box-shadow: 0 -12px 32px rgb(0 0 0 / 0.35); max-height: 85vh; overflow-y: auto; }
.cookie-banner[hidden] { display: none; }
html.has-cookie-banner body { padding-bottom: var(--cookie-banner-h, 0px); }
.cookie-banner__inner { display: grid; gap: 16px; padding-block: 20px; }
.cookie-banner__text { display: grid; gap: 10px; font-size: var(--step--1); line-height: 1.55; color: var(--text-2); }
.cookie-banner__text p { margin: 0; max-width: 72ch; }
.cookie-banner__text a { color: var(--text); }
.cookie-banner__title { font-weight: 700; color: var(--text); font-size: var(--step-0); }
.cookie-banner__choices { display: grid; gap: 10px; margin: 4px 0 0; padding: 0; border: 0; }
.cookie-banner__choices[hidden] { display: none; }
.cookie-banner__choices input:disabled { opacity: 0.6; cursor: not-allowed; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-banner__actions .btn { flex: 1 1 auto; }
.cookie-banner__actions .btn[hidden] { display: none; }
@media (min-width: 900px) {
  .cookie-banner__inner { grid-template-columns: 1fr auto; align-items: end; gap: 32px; }
  .cookie-banner__actions { flex-wrap: nowrap; }
}
.link-btn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.link-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.footer__links .link-btn { color: var(--text-2); text-decoration: none; text-align: left; }
.footer__links .link-btn:hover { color: var(--text); }
