/* tjcolman.com — palette and type taken from the A Light in the Dark series covers */
:root {
  --sand: #e0c1a4;        /* cover band */
  --cream: #faf4ec;       /* page */
  --linen: #f3e7da;       /* panels */
  --ink: #233543;         /* cover title navy */
  --ink-soft: #4a5a66;
  --rust: #af7158;        /* cover rule (decorative only) */
  --rust-text: #8a4f3a;   /* rust dark enough for text on cream */
  --line: #e3d3c2;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Source Serif 4", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --wrap: 68rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 1.0625rem/1.7 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rust-text); text-underline-offset: .18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--rust-text); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: var(--cream); padding: .5rem 1rem; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.1rem; padding-bottom: 1.1rem; flex-wrap: wrap; }
.brand { font: 600 1.05rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.site-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a { font: 500 .95rem/1 var(--sans); color: var(--ink-soft); text-decoration: none; padding: .35rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--rust); }

/* Home: the header floats over the hero with no background of its own; a navy shade at the top keeps it readable */
.site-header--over { position: absolute; top: 0; left: 0; right: 0; z-index: 5; border-bottom: 0; background: linear-gradient(180deg, rgba(23,35,45,.8) 0%, rgba(23,35,45,.72) 55%, rgba(23,35,45,0) 100%); }
.site-header--over .wrap { padding-bottom: 2.2rem; }
.site-header--over .brand { color: var(--cream); }
.site-header--over .site-nav a { color: #e9edf0; }
.site-header--over .site-nav a:hover, .site-header--over .site-nav a[aria-current="page"] { color: #fff; border-bottom-color: #f2d6c4; }
.site-header--over :focus-visible { outline-color: var(--cream); }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-style: italic; }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-style: italic; }
h3 { font-size: 1.6rem; font-style: italic; }
p { margin: 0 0 1.1em; }
.eyebrow { font: 600 .78rem/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--rust-text); margin-bottom: 1rem; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 38rem; }
.rule { width: 3rem; height: 2px; background: var(--rust); border: 0; margin: 1.5rem 0; }
.muted { color: var(--ink-soft); }
.small { font-size: .92rem; }

/* Sections */
section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
section + section { border-top: 1px solid var(--line); }
.panel { background: var(--linen); }

/* Hero: the portrait fills the whole section; a navy shade behind the text keeps it readable */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; min-height: clamp(34rem, 80vh, 60rem); padding: 7rem 0 4rem; background: var(--ink); color: var(--cream); }
.hero-bg { position: absolute; top: 0; left: 0; width: 126%; max-width: none; height: 100%; object-fit: cover; object-position: 50% 30%; }
/* Very wide screens: size the photo to the hero height, pin it right, and fade its left edge into the navy */
@media (min-width: 1600px) { .hero-bg { left: auto; right: 0; width: auto; height: 100%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%); mask-image: linear-gradient(90deg, transparent, #000 30%); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23,35,45,.88) 0%, rgba(23,35,45,.8) 46%, rgba(23,35,45,.3) 58%, rgba(23,35,45,0) 70%); pointer-events: none; }
.hero-text { position: relative; z-index: 1; width: 100%; }
.hero-text > div { max-width: 26rem; }
.hero h1 { text-wrap: balance; }
.hero .eyebrow { color: #f2d6c4; }
.hero .lede { color: #e9edf0; }
.hero .btn-primary { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.hero .btn-primary:hover { background: #fff; color: var(--ink); }
.hero .btn-ghost { color: var(--cream); border-color: var(--cream); }
.hero .btn-ghost:hover { background: var(--cream); color: var(--ink); }
.hero :focus-visible { outline-color: var(--cream); }
.cover { border-radius: 3px; box-shadow: 0 1px 2px rgba(35,53,67,.12), 0 18px 40px -12px rgba(35,53,67,.35); background: var(--sand); aspect-ratio: 5 / 8; object-fit: cover; width: 100%; height: auto; }

/* Buttons */
.btn { display: inline-block; font: 600 .95rem/1 var(--sans); letter-spacing: .03em; padding: .95rem 1.5rem; border-radius: 2px; text-decoration: none; border: 1px solid var(--ink); }
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: #18262f; color: var(--cream); }
.btn-ghost { color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--cream); }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* Book grid */
.books { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-top: 2.5rem; }
.book-card { text-decoration: none; color: inherit; }
.book-card h3 { font-size: 1.35rem; margin: 1rem 0 .25rem; }
.book-card p { font: .9rem/1.4 var(--sans); color: var(--ink-soft); margin: 0; }
.book-card:hover .cover { transform: translateY(-3px); }
.book-card .cover { transition: transform .2s ease; }

/* Book detail rows */
.book-row { display: grid; grid-template-columns: 15rem 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; padding: 3rem 0; }
.book-row + .book-row { border-top: 1px solid var(--line); }
.book-row .meta { font: .85rem/1.5 var(--sans); color: var(--ink-soft); letter-spacing: .02em; }
.status { display: inline-block; font: 600 .72rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--rust-text); border: 1px solid var(--rust); padding: .4rem .6rem; border-radius: 2px; margin-bottom: 1rem; }
.note { font: .88rem/1.5 var(--sans); color: var(--ink-soft); border-left: 2px solid var(--rust); padding-left: .9rem; margin-top: 1.4rem; }

/* Themes */
.themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 3rem; margin-top: 2rem; }
.themes h3 { font-size: 1.45rem; margin-bottom: .35rem; }
.themes p { color: var(--ink-soft); margin: 0; }

/* About: portrait beside the bio */
.about-grid { display: grid; grid-template-columns: 18rem 1fr; gap: clamp(2rem, 6vw, 4.5rem); align-items: start; }
.portrait { margin: 0; position: sticky; top: 1.5rem; }
.portrait .cover { aspect-ratio: 4 / 5; }
.portrait figcaption { font: .78rem/1.4 var(--sans); color: var(--ink-soft); margin-top: .6rem; }

/* Prose pages */
.prose { max-width: 40rem; }
blockquote { font: italic 1.6rem/1.35 var(--display); margin: 2rem 0; padding: 0; color: var(--ink); }

/* Help lines and footer: one dark block at the foot of every page */
.help { background: var(--ink); color: #e9edf0; font: .92rem/1.6 var(--sans); padding: 2.4rem 0 1.4rem; }
.help a { color: #f2d6c4; }
.help strong { color: #fff; }
.site-footer { background: var(--ink); font: .88rem/1.6 var(--sans); color: #b9c3cb; padding: 0 0 2.6rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid rgba(233,237,240,.16); padding-top: 1.3rem; }

/* Below 1240px the face would sit behind the text: photo on top at full width, fading into the navy; text on the navy below it */
@media (max-width: 1240px) {
  /* The photo runs up behind the floating header; its box grows by the header height so the hat stays below the links */
  .hero { --hdr: 3.6rem; display: block; min-height: 0; padding: 0 0 2.75rem; }
  .hero-bg { position: relative; width: 100%; height: calc(clamp(17rem, 92vw, 30rem) + var(--hdr)); object-position: 50% 22%; }
  .hero::after { inset: 0 0 auto 0; height: calc(clamp(17rem, 92vw, 30rem) + var(--hdr)); background: linear-gradient(180deg, rgba(35,53,67,0) 55%, #233543 100%); }
  .site-header--over .wrap { padding-bottom: 1.6rem; }
  .hero-text { margin-top: -2.5rem; }
  .hero-text > div { max-width: 38rem; }
}
@media (max-width: 860px) {
  .books { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .book-row { grid-template-columns: 1fr; }
  .book-row img { max-width: 13rem; }
  .themes { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { position: static; max-width: 15rem; }
}
@media (max-width: 560px) {
  .site-header--over .wrap { flex-wrap: nowrap; gap: .75rem; padding-top: .95rem; }
  .site-header--over .brand { font-size: .82rem; letter-spacing: .16em; white-space: nowrap; }
  .site-header--over .site-nav { gap: .85rem; flex-wrap: nowrap; }
  .site-header--over .site-nav a { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
