/* ================================
   Ludovic Trottier, author site
   Colors and type follow the cover of Unspendable:
   slate desk, navy type, crimson marker, teal pen.
   ================================ */

:root {
  --desk: #e2e6ec;
  --desk-deep: #cfd5de;
  --paper: #f9f7ef;
  --navy: #233444;
  --navy-deep: #1a2733;
  --ink: #263038;
  --ink-soft: #4d5a65;
  --ink-faint: #75818b;
  --crimson: #c5223d;
  --crimson-deep: #9f1a31;
  --teal: #2f8179;
  --white: #eff5f8;
  --rule: #c3cad3;
  --shadow: rgba(20, 27, 32, 0.18);

  --font-title: "Anton", Impact, "Arial Narrow", sans-serif;
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  background: var(--desk);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--crimson-deep); text-decoration: none; }
a:hover { color: var(--crimson); text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--navy);
}
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header ----------
   The header keeps a fixed height. Only colors and the shadow change on
   scroll: changing its padding would move the page and flip the state back. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(226, 230, 236, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.site-header.is-scrolled {
  border-color: var(--rule);
  box-shadow: 0 2px 12px var(--shadow);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy);
}
.brand:hover { color: var(--crimson); text-decoration: none; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.8rem;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 3px;
  border-radius: 2px;
  background: var(--crimson);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-links a:hover { color: var(--navy); text-decoration: none; }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--navy); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 1.6rem;
  color: var(--navy);
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--desk);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem 1.5rem 1rem;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { padding: 0.6rem 0; }
}

/* ---------- Sections ---------- */
section { padding: 4rem 0; }
.section-tight { padding-top: 2.5rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}

.rule-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.rule-title::before,
.rule-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--navy);
  opacity: 0.85;
}

/* ---------- The title label, as on the cover ---------- */
.label {
  display: inline-flex;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--white);
  box-shadow: 10px 12px 0 rgba(36, 44, 48, 0.22);
}
.label span { padding: 0.18em 0.2em 0.16em; }
.label .un { background: var(--crimson); padding-right: 0.12em; }
.label .rest { background: var(--navy); padding-left: 0.12em; }

.subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--navy);
  margin: 1.4rem 0 0;
}
.marked {
  text-decoration: underline;
  text-decoration-color: var(--crimson);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.3em;
}

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 4rem; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 3.5rem;
  align-items: center;
}
.cover {
  border-radius: 3px;
  box-shadow: 14px 18px 30px var(--shadow);
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-top: 1.6rem;
  max-width: 34em;
}
@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-grid .cover { max-width: 260px; margin: 0 auto; }
}

/* ---------- Buttons ---------- */
.button-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
.btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--crimson); color: var(--white); }
.btn-ghost { border: 2px solid var(--navy); color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--white); }

/* ---------- Paper panels, like the sheets on the desk ---------- */
.paper {
  background: var(--paper);
  border: 1px solid #b6b4a5;
  box-shadow: 12px 14px 0 rgba(36, 44, 48, 0.14);
  padding: 2.2rem 2.4rem;
  position: relative;
}
.paper.bracket { padding-left: 3.2rem; }
.paper.bracket::before {
  content: "";
  position: absolute;
  left: 1.4rem;
  top: 2.2rem;
  bottom: 2.2rem;
  width: 10px;
  border: 3px solid var(--crimson);
  border-right: 0;
}

.wide-image { box-shadow: 0 6px 24px var(--shadow); }

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
  margin-top: 1.5rem;
}
.story-grid img { margin-bottom: 1rem; }
.story-grid h3 { margin-bottom: 0.3em; }
@media (max-width: 760px) {
  .story-grid { grid-template-columns: 1fr; }
  .story-grid img { max-width: 260px; }
}

/* ---------- Formats ---------- */
.formats {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.formats th, .formats td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.formats th {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.formats td a { margin-right: 0.9rem; white-space: nowrap; }

/* ---------- Parts of the book ---------- */
.parts { counter-reset: part; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.parts li {
  counter-increment: part;
  padding: 1rem 0 1rem 3.4rem;
  position: relative;
  border-bottom: 1px solid var(--rule);
}
.parts li::before {
  content: counter(part, upper-roman);
  position: absolute;
  left: 0;
  top: 0.9rem;
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--crimson);
}
.parts strong { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; color: var(--navy); }

/* ---------- Author ---------- */
.author-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}
.author-photo {
  border-radius: 3px;
  box-shadow: 12px 14px 0 rgba(36, 44, 48, 0.14);
}
@media (max-width: 720px) {
  .author-layout { grid-template-columns: 1fr; }
  .author-photo { max-width: 240px; }
}

.email {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--navy);
  word-break: break-all;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

.text-center { text-align: center; }
.small { font-size: 0.92rem; color: var(--ink-faint); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--ink-faint);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.footer-links { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; }
.footer-links a { color: var(--ink-faint); }

/* The <h1> wraps the title label; it carries no heading look of its own. */
.visually-plain { margin: 0; font-size: inherit; line-height: 1; }

/* ---------- Contact form ---------- */
.contact-form { max-width: 600px; margin-top: 2rem; }
.form-group { margin-bottom: 1.4rem; }
.contact-form label {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #b6b4a5;
  border-radius: 3px;
  padding: 0.7rem 0.9rem;
}
.contact-form textarea { min-height: 180px; resize: vertical; }
.contact-form .small { margin: 0.5rem 0 0; }
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus { outline: 3px solid var(--teal); outline-offset: 1px; }
.contact-form .btn { border: 0; cursor: pointer; }
.hidden-field { display: none; }
/* Netlify replaces the empty div with Google's widget, which sizes itself. */
.recaptcha-field { margin-bottom: 1.4rem; }
.form-status { margin-top: 1rem; font-weight: 700; }
.form-status.success { color: var(--teal); }
.form-status.error { color: var(--crimson-deep); }
