/* L. Forrest — author site
   Palette taken from the High Water at Tower Beach cover (dusk over the sound)
   and a 1940s bakelite radio. The dial header is the one loud thing; the rest stays quiet. */

:root {
  --dusk: #f2d5ba;        /* page */
  --dusk-deep: #ebc6a4;   /* panels, rules */
  --bakelite: #3a2a1e;    /* dial band, buttons, footer */
  --bakelite-soft: #5a4433;
  --glow: #f3b457;        /* dial lamp, needle */
  --ink: #1f3640;         /* Gulf water at night: body text */
  --driftwood: #6b5442;   /* secondary text */

  --display: "Gloock", "Georgia", serif;
  --text: "Newsreader", "Georgia", serif;

  --measure: 34rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html { background: var(--dusk); }

body {
  margin: 0;
  background: var(--dusk);
  color: var(--ink);
  font-family: var(--text);
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

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

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

:focus-visible { outline: 3px solid var(--bakelite); outline-offset: 3px; border-radius: 2px; }
.dial :focus-visible, .site-footer :focus-visible { outline-color: var(--glow); }

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

/* ---------- The dial ---------- */

.dial {
  background: var(--bakelite);
  color: var(--dusk);
  padding: 1.1rem var(--gutter) 0;
}

.dial-top {
  max-width: 64rem; margin: 0 auto;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}

.brand {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  color: var(--dusk);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.dial-time {
  font-family: var(--display);
  color: var(--glow);
  font-size: 0.95rem;
  opacity: 0.85;
}

.dial-glass {
  position: relative;
  max-width: 64rem;
  margin: 1rem auto 0;
  padding-top: 1.9rem;              /* room for scale numerals */
  border-top: 1px solid var(--bakelite-soft);
  background:
    repeating-linear-gradient(to right,
      rgba(242, 213, 186, 0.45) 0 1px, transparent 1px 2.5%) top 1.15rem left / 100% 0.45rem no-repeat;
}

.scale {
  position: absolute; top: 0.1rem; left: 0; right: 0;
  display: grid; grid-template-columns: repeat(8, 1fr);
  font-family: var(--display);
  font-size: 0.72rem;
  color: rgba(242, 213, 186, 0.6);
  pointer-events: none;
}
.scale span { text-align: center; }

.stations ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
}

.stations a {
  display: block;
  padding: 0.7rem 0.25rem 1rem;
  text-align: center;
  color: var(--dusk);
  text-decoration: none;
  font-size: 0.98rem;
}
.stations a:hover { color: var(--glow); }
.stations a[aria-current="page"] { color: var(--glow); }

.needle {
  position: absolute;
  top: 0.2rem; height: 1.75rem;
  width: 2px;
  margin-left: -1px;
  background: var(--glow);
  box-shadow: 0 0 10px 2px rgba(243, 180, 87, 0.55);
  left: calc((var(--station, 0) + 0.5) * 20%);
  animation: tune 1.6s cubic-bezier(.2,.7,.2,1) 0.15s both;
  pointer-events: none;
}

@keyframes tune {
  0%   { left: 1%; opacity: 0.4; }
  55%  { left: calc((var(--station, 0) + 0.5) * 20% + 3%); opacity: 1; }
  100% { left: calc((var(--station, 0) + 0.5) * 20%); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .needle { animation: none; }
}

/* ---------- Page body ---------- */

main {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(3rem, 7vw, 6rem);
}

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.15rem); }

p { margin: 0 0 1em; max-width: var(--measure); }

.lede { font-size: 1.18em; line-height: 1.5; }
.quiet { color: var(--driftwood); }

/* Book hero: cover on the left, words on the right */
.book-hero {
  display: grid;
  grid-template-columns: minmax(12rem, 22rem) 1fr;
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: center;
}

.cover {
  border-radius: 2px;
  box-shadow:
    0 1px 0 rgba(58, 42, 30, 0.15),
    0 18px 40px -18px rgba(58, 42, 30, 0.55);
}

.series { font-style: italic; color: var(--driftwood); margin-bottom: 1.25rem; }

.release { margin-top: 1.5rem; }

.button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.8rem 1.35rem;
  background: var(--bakelite);
  color: var(--dusk);
  text-decoration: none;
  border-radius: 3px;
  font-size: 1rem;
}
.button:hover { background: var(--ink); text-decoration: none; }

.section { margin-top: clamp(3.5rem, 8vw, 6rem); }

.rule-top { border-top: 1px solid var(--dusk-deep); padding-top: clamp(2rem, 5vw, 3rem); }

.blurb p:first-child { font-family: var(--display); font-size: 1.3em; line-height: 1.3; max-width: 30rem; }

.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1.5rem;
  margin: 0;
  max-width: var(--measure);
}
.details dt { color: var(--driftwood); }
.details dd { margin: 0; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: start;
}

.photo figcaption { font-size: 0.9rem; color: var(--driftwood); margin-top: 0.6rem; }

.email-big {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.4rem);
  word-break: break-word;
}

.contact-list { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.contact-list li { padding: 1rem 0; border-top: 1px solid var(--dusk-deep); }
.contact-list li:last-child { border-bottom: 1px solid var(--dusk-deep); }
.contact-list strong { display: block; font-weight: 400; font-style: italic; color: var(--driftwood); }

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

.site-footer {
  background: var(--bakelite);
  color: var(--dusk);
  padding: 2rem var(--gutter);
  font-size: 0.95rem;
}
.site-footer .inner {
  max-width: 64rem; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between;
}
.site-footer a { color: var(--dusk); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

/* ---------- Small screens ---------- */

@media (max-width: 44rem) {
  .book-hero, .two-col { grid-template-columns: 1fr; }
  .book-hero .cover { max-width: 15rem; }
  .stations a { font-size: 0.82rem; padding-left: 0.1rem; padding-right: 0.1rem; }
  .scale { font-size: 0.62rem; }
  .dial-time { display: none; }
}
