/* =========================================================
   andrewbleckner.com — site styles
   Colors and fonts are set once here, at the top.
   ========================================================= */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader.woff") format("woff");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic.woff") format("woff");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1f1a1b;          /* main text */
  --ink-soft: #5b5254;     /* secondary text */
  --paper: #ffffff;        /* page background */
  --paper-2: #f4f1f1;      /* quiet bands */
  --rule: #e4dddd;         /* thin lines */
  --wine: #6a1c20;         /* links, buttons, play buttons */
  --wine-dark: #4e1215;
  --night: #22090b;        /* dark hero, matches the portrait backdrop */
  --night-text: #f3e8e5;
  --night-soft: #c9a49d;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;          /* 19px */
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--wine); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--wine-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid #c08a2e; outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); }
h3 { font-size: 1.6rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.5rem;
}
.site-name {
  font-family: var(--serif); font-size: 1.45rem; color: var(--ink);
  text-decoration: none; letter-spacing: -0.01em; white-space: nowrap;
}
.site-name:hover { color: var(--ink); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; }
.site-nav a {
  display: block; padding: 0.6rem 0.8rem; font-family: var(--sans); font-size: 0.95rem;
  color: var(--ink); text-decoration: none; border-radius: 6px;
}
.site-nav a:hover { background: var(--paper-2); }
.site-nav a[aria-current="page"] { color: var(--wine); box-shadow: inset 0 -2px 0 var(--wine); border-radius: 0; }

.nav-toggle {
  display: none; font: 500 0.95rem var(--sans); color: var(--ink);
  background: none; border: 1px solid var(--rule); border-radius: 6px;
  padding: 0.55rem 0.9rem; min-height: 44px; cursor: pointer;
}

/* dark header variant on the home page */
.site-header.on-dark { background: var(--night); border-bottom-color: rgba(255,255,255,0.08); }
.on-dark .site-name, .on-dark .site-name:hover, .on-dark .site-nav a { color: var(--night-text); }
.on-dark .site-nav a:hover { background: rgba(255,255,255,0.08); }
.on-dark .nav-toggle { color: var(--night-text); border-color: rgba(255,255,255,0.25); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-header .wrap { flex-wrap: wrap; }
  .site-nav { display: none; width: 100%; padding-bottom: 0.75rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 0.8rem 0.25rem; font-size: 1.05rem; }
  .site-nav a[aria-current="page"] { box-shadow: none; text-decoration: underline; }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.7rem 1.4rem; border-radius: 999px;
  font: 600 1rem var(--sans); text-decoration: none;
  background: var(--wine); color: #fff; border: 1px solid var(--wine);
}
.button:hover { background: var(--wine-dark); color: #fff; text-decoration: none; }
.button.quiet { background: transparent; color: var(--wine); }
.button.quiet:hover { background: var(--paper-2); color: var(--wine-dark); }

/* ---------- Home: hero ---------- */

.hero { background: var(--night); color: var(--night-text); overflow: hidden; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: end; gap: 0; min-height: min(78vh, 46rem);
}
.hero-text { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(3.4rem, 9vw, 7.25rem); line-height: 0.95; letter-spacing: -0.035em;
  font-weight: 350; font-variation-settings: "opsz" 72;
}
.hero h1 span { display: block; }
.hero .role {
  font: 500 1.05rem var(--sans); color: var(--night-soft); margin: 1.25rem 0 1.75rem;
}
.hero .lede { font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.45; max-width: 30rem; margin-bottom: 2rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero .button { background: var(--night-text); color: var(--night); border-color: var(--night-text); }
.hero .button:hover { background: #fff; color: var(--night); }
.hero .button.quiet { background: transparent; color: var(--night-text); border-color: rgba(243,232,229,0.45); }
.hero .button.quiet:hover { background: rgba(255,255,255,0.08); }

.hero-quote {
  margin: 2.75rem 0 0; padding: 0; max-width: 28rem;
  font-style: italic; font-size: 1.15rem; color: var(--night-soft); line-height: 1.5;
}
.hero-quote cite { font-style: normal; font-family: var(--sans); font-size: 0.9rem; display: block; margin-top: 0.35rem; }

.hero-photo { align-self: stretch; position: relative; margin-right: calc(-1 * (var(--gutter) + max(0px, (100vw - var(--wrap)) / 2))); }
.hero-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 38% 18%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22%);
          mask-image: linear-gradient(to right, transparent 0, #000 22%);
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { order: -1; height: 26rem; margin: 0 calc(-1 * var(--gutter)); }
  .hero-photo img {
    object-position: 50% 20%;
    -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  }
  .hero-text { padding-top: 0; margin-top: -2.5rem; }
}

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

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section.alt { background: var(--paper-2); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 2.25rem; }
.section-head p { margin: 0; color: var(--ink-soft); max-width: 34rem; }
.more-link { font: 600 1rem var(--sans); }

/* ---------- Works (used on Home and Music) ---------- */

.works { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.work {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0 1.75rem; padding: 2rem 0; border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}
.work-cover { width: 5.5rem; border: 1px solid var(--rule); box-shadow: 0 1px 0 var(--rule); }
.work-cover.blank { aspect-ratio: 116 / 180; background: var(--paper-2); }
.work h3 { font-size: clamp(1.5rem, 2.6vw, 1.85rem); }
.work-scoring { font-size: 1.1rem; color: var(--ink-soft); margin: 0.25rem 0 0.9rem; }
.work-facts { display: flex; flex-wrap: wrap; gap: 0.35rem 1.75rem; margin: 0 0 1rem; font: 0.95rem/1.4 var(--sans); }
.work-facts div { display: flex; gap: 0.4rem; }
.work-facts dt { color: var(--ink-soft); }
.work-facts dd { margin: 0; }
.work-note { max-width: 40rem; }
.work-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 1rem 0 0; font: 600 0.98rem var(--sans); }

@media (min-width: 900px) {
  .works.compact .work { grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; }
  .works.compact .player { margin: 0; }
}
@media (max-width: 520px) {
  .work { grid-template-columns: 4rem minmax(0, 1fr); gap: 0 1rem; }
  .work-cover { width: 4rem; }
  .work .player, .work-note, .work-links, .work-facts { grid-column: 1 / -1; }
}

/* ---------- Audio player (built by js/site.js from each <audio>) ---------- */

.player {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 0.9rem; margin: 0.5rem 0 0; max-width: 34rem;
  font: 0.9rem var(--sans); color: var(--ink-soft);
}
.player-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--wine); color: #fff; display: grid; place-items: center; padding: 0;
}
.player-btn:hover { background: var(--wine-dark); }
.player-btn svg { width: 18px; height: 18px; fill: currentColor; }
.player-bar {
  position: relative; height: 32px; cursor: pointer; display: flex; align-items: center;
}
.player-bar::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--rule); border-radius: 2px; }
.player-fill { position: absolute; left: 0; height: 3px; width: 0; background: var(--wine); border-radius: 2px; }
.player-time { font-variant-numeric: tabular-nums; min-width: 5.5rem; }
.player.is-playing .player-time { color: var(--ink); }
audio { width: 100%; max-width: 34rem; margin-top: 0.5rem; }   /* shown only if the script doesn't run */

/* ---------- Home: Children's March feature ---------- */

.feature { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.feature img { width: 100%; }
.feature h2 { margin-bottom: 1rem; }
.feature .meta { font: 0.95rem var(--sans); color: var(--ink-soft); }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } }

/* ---------- Home: short about ---------- */

.about-short { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.about-short h2 { margin-bottom: 1rem; }
.publishers { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.publishers li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); font-size: 1.25rem; }
.publishers li span { display: block; font: 0.9rem var(--sans); color: var(--ink-soft); }
@media (max-width: 760px) { .about-short { grid-template-columns: 1fr; } }

/* ---------- Inner page heading ---------- */

.page-head { padding: clamp(3rem, 7vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.page-head h1 { font-size: clamp(2.8rem, 6vw, 4.5rem); letter-spacing: -0.03em; font-variation-settings: "opsz" 72; }
.page-head p { font-size: 1.3rem; color: var(--ink-soft); max-width: 40rem; margin: 1rem 0 0; }
.jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.75rem; }
.jump a {
  font: 600 0.95rem var(--sans); text-decoration: none; padding: 0.55rem 1rem;
  border: 1px solid var(--rule); border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.jump a:hover { border-color: var(--wine); }

.group { padding: 2.5rem 0 3rem; }
.group > h2 { margin-bottom: 1.5rem; scroll-margin-top: 1rem; }

/* ---------- Footer ---------- */

.site-footer { background: var(--night); color: var(--night-soft); padding: 3rem 0; font: 0.95rem var(--sans); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer a { color: var(--night-text); }
.site-footer .name { font: 1.3rem var(--serif); color: var(--night-text); margin: 0 0 0.25rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.work h3 .aka { color: var(--ink-soft); }

/* ---------- Text pages (About, The Children's March, Contact) ---------- */

.prose { max-width: 40rem; }
.prose h2 { font-size: clamp(1.75rem, 3vw, 2.2rem); margin: 2.75rem 0 1rem; }
.prose h2:first-child { margin-top: 0; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; padding-bottom: clamp(3rem, 7vw, 5rem); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.side-photo img { width: 100%; }
.side-photo figcaption { font: 0.9rem var(--sans); color: var(--ink-soft); margin-top: 0.6rem; }

.plain-list { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--rule); }
.plain-list li { padding: 0.65rem 0; border-bottom: 1px solid var(--rule); }

.note-box { background: var(--paper-2); padding: 1.5rem 1.75rem; margin: 2rem 0; }
.note-box h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.note-box p:last-child { margin-bottom: 0; }

.banner-image { width: 100%; margin-bottom: 2.5rem; }

.video { margin: 0 0 2.75rem; }
.video h2 { margin-bottom: 0.4rem; }
.video p { color: var(--ink-soft); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--night); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.email-big { font-size: clamp(1.4rem, 3.5vw, 2rem); overflow-wrap: anywhere; }

/* ---------- Sample-pages viewer (built by js/site.js) ---------- */

.pdf-viewer {
  width: min(64rem, 94vw); height: 92vh; max-height: none; max-width: none;
  padding: 0; border: 0; border-radius: 6px; background: var(--paper);
  box-shadow: 0 24px 80px rgba(20, 4, 6, 0.45);
  display: none; flex-direction: column; overflow: hidden;
}
.pdf-viewer[open] { display: flex; }
.pdf-viewer::backdrop { background: rgba(34, 9, 11, 0.72); }
.pdf-viewer-bar {
  display: flex; align-items: center; gap: 1.25rem; padding: 0.6rem 0.75rem 0.6rem 1.25rem;
  border-bottom: 1px solid var(--rule); font-family: var(--sans);
}
.pdf-viewer-title { margin: 0; flex: 1; font: 1.2rem var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-viewer-open { font: 600 0.95rem var(--sans); white-space: nowrap; }
.pdf-viewer-close {
  font: 600 0.95rem var(--sans); min-height: 44px; padding: 0 1.2rem; border-radius: 999px;
  border: 1px solid var(--wine); background: var(--wine); color: #fff; cursor: pointer;
}
.pdf-viewer-close:hover { background: var(--wine-dark); }
.pdf-viewer-frame { flex: 1; width: 100%; border: 0; background: #525659; }
html.viewer-open { overflow: hidden; }
