/* Paul Farah – paulfarah.com
   Palette and type are derived from the Half of What You Saw cover:
   weathered paper, charcoal, one rust-amber. */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("montserrat-500-latin.woff2") format("woff2");
}

:root {
  --paper: #e8e1d7;
  --ink: #2a2b2c;
  --muted: #6b6660;
  --accent: #8f5219;        /* link colour, passes AA on paper */
  --amber: #b2702c;         /* the rule under the title, as on the cover */
  --edge: rgba(42, 43, 44, 0.14);
  --vignette: rgba(70, 50, 30, 0.12);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.17 0 0 0 0 0.13 0 0 0 0 0.09 0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --display: "Montserrat", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;

  --measure: 42rem;
  --gutter: clamp(1.25rem, 6vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f2021;
    --ink: #e3dcd2;
    --muted: #9e978e;
    --accent: #d49a53;
    --amber: #c98a3d;
    --edge: rgba(227, 220, 210, 0.12);
    --vignette: rgba(0, 0, 0, 0.38);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.86 0 0 0 0 0.8 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Paper grain and the darkened edges of a weathered sheet. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(ellipse 80% 70% at 50% 45%, transparent 55%, var(--vignette) 100%),
    var(--grain);
  background-repeat: no-repeat, repeat;
  background-size: 100% 100%, 220px 220px;
  pointer-events: none;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: color 120ms ease, text-decoration-color 120ms ease, border-color 120ms ease;
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  text-decoration: none;
}

img { max-width: 100%; height: auto; display: block; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
}
.skip:focus { top: 1rem; z-index: 10; }

/* ---- Masthead ---- */

.masthead {
  padding: clamp(2rem, 7vw, 4rem) var(--gutter) 0;
  text-align: center;
}
.name {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1rem + 1.6vw, 1.75rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* balance the trailing tracking so the word centres */
  text-transform: uppercase;
  line-height: 1.2;
}
.masthead nav {
  margin-top: 1.1rem;
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 4vw, 2rem);
}
.masthead nav a {
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
}
.masthead nav a:hover { color: var(--accent); }

/* ---- Hero: the new record ---- */

.hero {
  padding: clamp(2.5rem, 9vw, 5rem) var(--gutter) clamp(3rem, 10vw, 6rem);
  text-align: center;
}
.hero-cover {
  width: min(84vw, 30rem);
  margin: 0 auto;
  box-shadow:
    0 0 0 1px var(--edge),
    0 24px 48px -28px rgba(0, 0, 0, 0.45);
}
.hero-title {
  margin: clamp(2rem, 6vw, 3rem) auto 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1rem, 0.8rem + 1.4vw, 1.5rem);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  line-height: 1.5;
  text-wrap: balance;
}
/* The single thin amber rule, like the one beneath the title on the cover. */
.hero-title::after {
  content: "";
  display: block;
  width: 7.5rem;
  height: 1px;
  margin: 0.9rem auto 0;
  background: var(--amber);
}
.hero-date {
  margin: 1.1rem 0 0;
  font-size: 1.0625rem;
  color: var(--muted);
}
.platforms {
  list-style: none;
  margin: clamp(1.5rem, 5vw, 2.25rem) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
}
.btn {
  display: inline-block;
  padding: 0.8em 1.25em 0.72em;
  border: 1px solid var(--edge);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  min-width: 8.5rem;
}
.btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
/* Buttons on an inner page (the 404 page) sit with the left-aligned text. */
.page .platforms { justify-content: flex-start; }
@media (max-width: 23em) {
  .platforms { flex-direction: column; align-items: stretch; }
  .btn { min-width: 0; }
}

/* ---- Sections ---- */

main > section:not(.hero) {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4rem) var(--gutter);
  scroll-margin-top: 1.5rem;
}
.section-title {
  margin: 0 0 clamp(1.5rem, 5vw, 2.25rem);
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Albums, newest first. */
.albums {
  list-style: none;
  margin: 0;
  padding: 0;
}
.album {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem 0;
  border-top: 1px solid var(--edge);
}
.album:last-child { border-bottom: 1px solid var(--edge); }
.album img {
  width: 100%;
  aspect-ratio: 1 / 1;
  box-shadow: 0 0 0 1px var(--edge);
}
.album-body { min-width: 0; padding-top: 0.15rem; }
.album-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.5;
}
.album-year {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.album-links {
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.album-links a {
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.15em;
}
.album-links a:hover { border-bottom-color: currentColor; }

@media (min-width: 36em) {
  .album {
    grid-template-columns: 9rem 1fr;
    gap: 2rem;
    padding: 2rem 0;
  }
  .album-title { font-size: 0.95rem; }
}

.bio {
  margin: 0;
  max-width: 36rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.6;
}

.contact {
  margin: 0;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3rem);
}

/* ---- Colophon ---- */

.colophon {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 3rem) var(--gutter) clamp(2.5rem, 8vw, 4rem);
}
.colophon p {
  margin: 0;
  font-family: var(--display);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---- Lyrics pages (generated by build.py) ---- */

.masthead .name a {
  color: inherit;
  text-decoration: none;
}
.masthead .name a:hover { color: var(--accent); }
.masthead nav a[aria-current="page"] { color: var(--ink); }

.page {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 4.5rem) var(--gutter) clamp(1.5rem, 5vw, 2.5rem);
}
.eyebrow {
  margin: 0 0 1.1rem;
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.15em;
}
.eyebrow a:hover { color: var(--accent); border-bottom-color: currentColor; }
.page-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.1rem, 0.9rem + 1.6vw, 1.75rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1.45;
  text-wrap: balance;
}
.page-title::after {
  content: "";
  display: block;
  width: 5rem;
  height: 1px;
  margin: 0.9rem 0 0;
  background: var(--amber);
}
.page-meta {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* The lyric itself: one paragraph per stanza, <br> between sung lines,
   so the breaks hold exactly as written even before the stylesheet loads. */
.lyrics {
  margin: clamp(2rem, 6vw, 3rem) 0 0;
  max-width: 36rem;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  line-height: 1.75;
  overflow-wrap: break-word;
}
.lyrics p { margin: 0 0 1.4em; }
.lyrics p:last-child { margin-bottom: 0; }

/* Track lists on the lyrics index and album pages. */
.tracks {
  margin: 0;
  padding: 0 0 0 2.25rem;
}
.tracks li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--edge);
}
.tracks li:last-child { border-bottom: 1px solid var(--edge); }
.tracks li::marker {
  font-family: var(--display);
  font-size: 0.7rem;
  color: var(--muted);
}
.tracks a {
  color: var(--ink);
  text-decoration: none;
}
.tracks a:hover { color: var(--accent); }

/* Lyrics index: album cover, title and year, linking to the album page. */
.albums-lyrics { margin-top: clamp(1.5rem, 5vw, 2.25rem); }
.albums-lyrics .album { align-items: center; }
.albums-lyrics .album-cover { display: block; }
.albums-lyrics .album-title a {
  color: inherit;
  text-decoration: none;
}
.albums-lyrics .album-title a:hover { color: var(--accent); }

/* Album page header. */
.album-head {
  display: grid;
  gap: 1.5rem;
  margin: 0 0 clamp(1.5rem, 5vw, 2.25rem);
}
.album-head-cover {
  width: min(60vw, 14rem);
  box-shadow: 0 0 0 1px var(--edge), 0 18px 36px -24px rgba(0, 0, 0, 0.45);
}
@media (min-width: 36em) {
  .album-head {
    grid-template-columns: 11rem 1fr;
    gap: 2rem;
    align-items: end;
  }
  .album-head-cover { width: 100%; }
}

/* Previous / album / next on song pages. */
.pager {
  margin-top: clamp(2.5rem, 8vw, 4rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--edge);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem 1.5rem;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.6;
}
.pager a {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.pager a:hover { color: var(--accent); }
.pager .pager-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.pager .prev { grid-column: 1; }
.pager .up { grid-column: 2; text-align: center; }
.pager .next { grid-column: 3; text-align: right; }
@media (max-width: 36em) {
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .next { grid-column: 2; }
  .pager .up { grid-column: 1 / -1; grid-row: 2; }
}
