/* brightermorn.studio. Colours from the channel banner: night #242f4f, cream #f7ebd3, gold #f2c66d (README). */
:root {
  --night: #242f4f;
  --night-2: #2c385c;
  --night-3: #35426b;
  --cream: #f7ebd3;
  --cream-dim: #d9cdb6;
  --paper: #fbf4e6;
  --ink: #1f2843;
  --ink-dim: #4f5873;
  --gold: #f2c66d;
  --gold-deep: #9a6a12;
  --coral: #b84c39;
  --teal: #2f6a64;
  --violet: #5f4a86;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--night); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--cream);
  font: 18px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-underline-offset: 0.18em; }
a:hover { color: var(--cream); }
h1, h2, h3, h4 { text-wrap: balance; font-weight: 600; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

/* The banner with the name over its sky */
.hero { position: relative; }
.hero .dawn { width: 100%; }
.hero-text {
  position: absolute; inset: 0 0 auto 0;
  padding: clamp(1rem, 3.2vw, 2.6rem) clamp(1.25rem, 4vw, 3.5rem) 0;
  text-shadow: 0 1px 12px rgba(20, 26, 46, 0.65);
}
.hero h1 { margin: 0; font-size: clamp(1.9rem, 5vw, 3.8rem); line-height: 1.05; letter-spacing: 0.005em; }
.hero-text p { margin: 0.5rem 0 0; max-width: 36rem; font-size: clamp(0.95rem, 1.6vw, 1.2rem); color: var(--cream); }
.signin {
  position: absolute; top: clamp(1rem, 2.4vw, 1.8rem); right: clamp(1.25rem, 3vw, 2.6rem);
  font: 500 0.85rem/1 var(--sans); color: var(--cream); text-shadow: 0 1px 8px rgba(20, 26, 46, 0.7);
}
.signin[hidden] { display: none; }
@media (max-width: 700px) {
  .hero-text { position: static; padding: 1.4rem 1.25rem 0; text-shadow: none; }
}

/* The four lines of work */
.lines {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem 2.4rem;
  margin: 0 auto; max-width: 70rem; padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(242, 198, 109, 0.45);
  font: 600 0.8rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
}
.lines a { color: var(--cream); text-decoration: none; padding: 0.3rem 0; }
.lines a:hover { color: var(--gold); }

main { max-width: 70rem; margin: 0 auto; padding: 0 clamp(1.25rem, 3vw, 2rem); }
.line > h2 {
  display: flex; align-items: center; gap: 1.2rem;
  margin: 3rem 0 1.4rem; font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.1;
}
.line > h2::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: 0.35; }

/* Music: the newest series, then one row per series */
.lead { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; }
.lead h3 { margin: 0.1rem 0 0.6rem; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; }
.lead-text p { margin: 0 0 0.9rem; color: var(--cream-dim); }
.kicker { font: 600 0.75rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold) !important; }
.links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; align-items: baseline; }
button.text { background: none; border: 0; padding: 0; color: var(--gold); cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
button.text:hover { color: var(--cream); }
@media (max-width: 760px) { .lead { grid-template-columns: 1fr; } }

.play { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #11172a; cursor: pointer; border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 9; }
.play img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease, filter 0.3s; }
.play:hover img, .play:focus-visible img { transform: scale(1.025); filter: brightness(0.88); }
.play .icon {
  position: absolute; left: 50%; top: 50%; width: 3.6rem; height: 3.6rem; margin: -1.8rem 0 0 -1.8rem;
  border-radius: 50%; background: rgba(20, 26, 46, 0.72); border: 1.5px solid rgba(247, 235, 211, 0.85);
  opacity: 0; transition: opacity 0.2s;
}
.play .icon::after {
  content: ""; position: absolute; left: 1.42rem; top: 1.12rem;
  border-style: solid; border-width: 0.68rem 0 0.68rem 1.1rem; border-color: transparent transparent transparent var(--cream);
}
.play:hover .icon, .play:focus-visible .icon, .lead .play .icon { opacity: 1; }
.lead .play .icon { transform: scale(1.3); }
.play:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.series { margin-top: 3rem; scroll-margin-top: 4rem; }
.series header { display: flex; align-items: baseline; gap: 0.8rem; border-bottom: 1px solid rgba(247, 235, 211, 0.18); padding-bottom: 0.45rem; }
.series h3 { margin: 0; font-size: 1.45rem; }
.series .count { font: 500 0.8rem/1 var(--sans); color: var(--cream-dim); letter-spacing: 0.04em; }
.series .about { margin: 0.6rem 0 0; max-width: 44rem; color: var(--cream-dim); font-size: 1rem; }
.works { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: 1.6rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.work h4 { margin: 0.6rem 0 0.1rem; font-size: 1.05rem; line-height: 1.3; }
.work p { margin: 0; font: 0.82rem/1.4 var(--sans); color: var(--cream-dim); }
.elsewhere { margin: 2.6rem 0 0; color: var(--cream-dim); font-size: 1rem; }

/* Comics, books and films, on the dawn's cream */
.dawn-band { height: 11rem; margin-top: 4rem; background: linear-gradient(180deg, var(--night) 0%, #5d5470 30%, #c98f7c 62%, #f0cfa6 84%, var(--paper) 100%); }
/* The cards' first row rises 3.5rem into the dawn band: the grid is pulled up and its top 3.5rem left clear.
   (A negative margin on each card overlapped the cards above it once they stack on a phone.) */
.others {
  margin-top: -3.5rem; background: linear-gradient(180deg, transparent 3.5rem, var(--paper) 3.5rem); color: var(--ink);
  padding: 0 max(clamp(1.25rem, 3vw, 2rem), calc((100% - 66rem) / 2)) 3rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem; align-items: stretch;
}
.others .line {
  background: #fffaf0; border: 1px solid #e6d6b8;
  border-radius: 6px; padding: 1.3rem 1.4rem 1.4rem; scroll-margin-top: 5rem;
}
.others .line > h2 { margin: 0 0 0.4rem; font-size: 1.55rem; color: var(--ink); }
.others .line > h2 { display: block; color: var(--accent); }
.others .line > h2::after { content: ""; display: block; width: 2.2rem; height: 2px; margin-top: 0.55rem; background: var(--accent); opacity: 1; }
.others p { margin: 0 0 0.8rem; font-size: 1rem; color: var(--ink-dim); }
.others a { color: var(--gold-deep); }
.comics { --accent: var(--coral); }
.books { --accent: var(--teal); }
.films { --accent: var(--violet); }
.plain { list-style: none; margin: 0 0 0.9rem; padding: 0; }
.plain li { margin: 0.55rem 0 0; font-size: 1rem; }
.plain li span { display: block; color: var(--ink-dim); font-size: 0.92rem; }
.soon {
  display: inline-block; font: 600 0.7rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim); border: 1px solid #cdbb98; border-radius: 3px; padding: 0.32rem 0.45rem;
}
.others .works { grid-template-columns: 1fr; margin-top: 1.2rem; }
.others .works:empty { display: none; }
.others .work h4 { color: var(--ink); }
.others .work p { color: var(--ink-dim); }

footer { text-align: center; color: #6c6a74; font: 0.85rem/1.4 var(--sans); padding: 1.5rem 0 2.5rem; background: var(--paper); }

/* Signed in: the studio's view, with the unpublished work marked */
.studio-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap;
  padding: 0.55rem clamp(1.25rem, 3vw, 2rem); background: var(--night-2); border-bottom: 1px solid var(--gold);
  font: 0.85rem/1.3 var(--sans); color: var(--cream);
}
.studio-bar[hidden] { display: none; }
.studio-bar .who { font-weight: 600; margin-right: auto; }
.studio-bar .email { font-weight: 400; color: var(--cream-dim); margin-left: 0.6rem; }
.studio-bar .switch { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.studio-bar input { accent-color: var(--gold); width: 1rem; height: 1rem; }
.studio-note { max-width: 70rem; margin: 1.2rem auto 0; padding: 0 clamp(1.25rem, 3vw, 2rem); color: var(--cream-dim); font-size: 1rem; }
.studio-note[hidden] { display: none; }
.tag {
  display: inline-block; margin-top: 0.4rem; font: 600 0.74rem/1 var(--sans); letter-spacing: 0.02em;
  color: var(--gold); border: 1px solid var(--gold); border-radius: 3px; padding: 0.3rem 0.4rem;
}
.others .tag { color: var(--gold-deep); border-color: #c99a3a; }
.public-only .private, .public-only #studio-note { display: none !important; }
.cover { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; align-items: start; text-decoration: none; color: inherit; }
.cover img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 3px; box-shadow: 0 2px 10px rgba(31, 40, 67, 0.25); }
.cover:hover h4 { text-decoration: underline; text-underline-offset: 0.18em; }
.cover .open { display: inline-block; margin-top: 0.6rem; font: 600 0.85rem/1 var(--sans); color: var(--gold-deep); }
.film-card .play { margin-bottom: 0.2rem; }

/* The player */
dialog#player {
  width: min(92vw, 70rem); max-height: 94vh; padding: 0; border: 0; border-radius: 8px;
  background: #0f1424; color: var(--cream); overflow: auto;
}
dialog#player::backdrop { background: rgba(10, 13, 24, 0.82); }
#player .frame { aspect-ratio: 16 / 9; background: #000; }
#player .frame iframe, #player .frame video { width: 100%; height: 100%; border: 0; display: block; }
#player .caption { padding: 0.9rem 1.2rem 1.1rem; padding-right: 6rem; }
#player .caption h3 { margin: 0 0 0.3rem; font-size: 1.3rem; }
#player .caption p { margin: 0; color: var(--cream-dim); font-size: 0.98rem; }
#player .close {
  position: absolute; right: 1rem; bottom: 1rem; background: none; border: 1px solid rgba(247, 235, 211, 0.4);
  border-radius: 4px; padding: 0.35rem 0.7rem; font: 600 0.8rem/1 var(--sans); cursor: pointer;
}
#player form { margin: 0; }

/* The comic reader and the book */
.reader-bar {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem clamp(1rem, 3vw, 2rem); background: var(--night-2); border-bottom: 1px solid rgba(242, 198, 109, 0.5);
  font: 0.88rem/1.3 var(--sans);
}
.reader-bar .tag { margin: 0; }
body.reader { background: #171d30; }
.reader-main { max-width: 56rem; margin: 0 auto; padding: 2rem 1rem 5rem; text-align: center; }
.reader-main h1 { margin: 0.5rem 0 0.4rem; font-size: clamp(2.2rem, 5vw, 3.2rem); }
.logline { max-width: 36rem; margin: 0 auto; color: var(--cream-dim); }
.hint { font: 0.82rem/1.4 var(--sans); color: #9aa0b8; }
.page { margin: 2rem 0 0; scroll-margin-top: 3rem; }
.page img { margin: 0 auto; box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45); }
.page figcaption { font: 0.75rem/1 var(--sans); color: #8d93aa; margin-top: 0.5rem; }

body.book { background: var(--paper); color: var(--ink); }
body.book .reader-bar a { color: var(--gold); }
.book-main { max-width: 38rem; margin: 0 auto; padding: 3rem 1.25rem 6rem; font-size: 1.12rem; line-height: 1.7; }
.book-main h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 3.4rem); line-height: 1.1; text-align: center; }
.byline { text-align: center; font: 0.85rem/1.4 var(--sans); color: var(--ink-dim); }
.epigraph { margin: 2.4rem 0; text-align: center; font-style: italic; }
.epigraph cite { display: block; margin-top: 0.4rem; font: normal 0.82rem/1.4 var(--sans); color: var(--ink-dim); }
.disclosure { font: 0.85rem/1.5 var(--sans); color: var(--ink-dim); border-left: 3px solid var(--teal); padding-left: 0.8rem; }
.toc { margin: 2.5rem 0 3rem; }
.toc h2 { font-size: 1.1rem; letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--sans); color: var(--ink-dim); }
.toc ol { list-style: none; padding: 0; margin: 0; columns: 2 16rem; column-gap: 2rem; }
.toc li { break-inside: avoid; margin: 0.2rem 0; font-size: 1rem; }
.toc li.part { margin-top: 0.9rem; font: 600 0.75rem/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.book-main h2.part { margin: 4.5rem 0 0; text-align: center; font: 600 0.85rem/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); }
.chapter h3 { margin: 3.2rem 0 1.4rem; text-align: center; font-size: 1.9rem; line-height: 1.2; }
.chapter { scroll-margin-top: 3.5rem; }
.chapter p { margin: 0 0 1.05rem; text-indent: 1.4em; }
.chapter h3 + p { text-indent: 0; }
.chapter blockquote { margin: 1.2rem 1.6rem; font-style: italic; }
.chapter figure { margin: 2rem -2rem; }
.chapter figcaption { margin-top: 0.5rem; text-align: center; font: italic 0.9rem/1.45 var(--serif); color: var(--ink-dim); }
@media (max-width: 640px) { .chapter figure { margin: 2rem 0; } }
.others .line { display: flex; flex-direction: column; }
.others .line .soon { align-self: flex-start; margin-top: auto; }
/* Signed in, the unpublished work follows the tag: keep the tag under the text and the work under it. */
.others .line:has(.private-slot:not(:empty)) .soon { margin-top: 0; }
.page img { width: auto; max-height: calc(100vh - 4.5rem); }
p, li, figcaption { text-wrap: pretty; }

/* signed-in only: a link to a work's page (pages.py) */
.work .page-link { display: inline-block; margin-top: 0.3rem; font: 500 0.78rem var(--sans); color: var(--gold); }

/* work pages from the home page: the title links to the song's page, the series name to the series page */
.work h4 a, .series h3 a, .lead h3 a { color: inherit; text-decoration: none; }
.work h4 a:hover, .series h3 a:hover, .lead h3 a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.series .about .series-link, .lead .links a { color: var(--gold); font: 500 0.9rem var(--sans); margin-left: 0.3rem; }
.lead .links a { display: block; margin: 0.5rem 0 0; }
body.public-only .private-line { display: none; }
/* Films: the published film, picture beside its text */
.films .works .film-card:not(.private) { display: grid; grid-template-columns: minmax(0, 24rem) 1fr; column-gap: 1.4rem; align-content: start; }
.films .film-card:not(.private) > .play { grid-row: 1 / span 4; }
.films .film-card:not(.private) > :not(.play) { grid-column: 2; }
.films .film-card:not(.private) h4 { margin-top: 0; font-size: 1.3rem; }
.films .film-card:not(.private) p { font-size: 0.95rem; }
.others .page-link { color: var(--gold-deep); }
@media (max-width: 700px) {
  .films .works .film-card:not(.private) { display: block; }
}

/* The consent bar (stats.js): shown in Europe until the visitor says yes or no */
.consent-bar {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 50;
  width: min(44rem, calc(100% - 2rem)); display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: 0.9rem 1.1rem; border-radius: 10px; background: var(--night-2); color: var(--cream);
  box-shadow: 0 6px 28px rgba(10, 14, 28, 0.45); font: 0.95rem/1.45 var(--sans);
}
.consent-bar p { margin: 0; flex: 1 1 20rem; }
.consent-buttons { display: flex; gap: 0.6rem; }
.consent-buttons button {
  min-width: 4.5rem; padding: 0.45rem 1rem; border-radius: 6px; cursor: pointer; font-weight: 600;
  border: 1px solid var(--gold); background: transparent; color: var(--cream);
}
.consent-buttons button[data-yes] { background: var(--gold); color: var(--night); }
.consent-buttons button:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
footer a { color: inherit; }
.privacy a { color: #7a5309; }
.privacy a:hover { color: var(--ink); }
.privacy button { margin-left: 0.3rem; padding: 0.25rem 0.8rem; border: 1px solid var(--gold-deep); border-radius: 6px;
  background: transparent; color: var(--ink); font: 600 0.88rem/1.4 var(--sans); cursor: pointer; }
