/* You Can Do It (even when you can't) - coming soon page
   Palette and type are taken from the cover artwork. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Charis SIL";
  src: url("fonts/charis-sil-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Charis SIL";
  src: url("fonts/charis-sil-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Charis SIL";
  src: url("fonts/charis-sil-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --denim: #445968;
  --denim-deep: #2f414e;
  --cream: #e9d6ad;
  --paper: #f3e7cb;
  --red: #cd2510;
  --mustard: #c4831c;
  --ink: #26333d;

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  /* Charter ships on Apple devices; Charis SIL (a Charter derivative) covers everything else */
  --text: Charter, "Bitstream Charter", "Charis SIL", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.3125rem);
  line-height: 1.62;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, .reel-track:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 4px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.wrap { width: min(100% - 3rem, 68rem); margin-inline: auto; }
.wrap.narrow { width: min(100% - 3rem, 40rem); }

h2 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 800;
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4.75rem);
  line-height: 0.92;
  letter-spacing: -0.005em;
  margin: 0 0 0.55em;
}

/* ---------- cloth: the cover's own book-cloth, held still while the page moves ---------- */
.cloth {
  position: relative;
  background-color: var(--denim);
  color: var(--cream);
  isolation: isolate;
  overflow: hidden;
}
.cloth::before {
  content: "";
  position: absolute; inset: -12% 0;
  z-index: -1;
  background: linear-gradient(rgba(62,83,98,.5), rgba(62,83,98,.5)), var(--denim) url("img/cloth.jpg") center / 640px auto;
  transform: translate3d(0, var(--drift, 0px), 0);
  will-change: transform;
}

/* ---------- hero ---------- */
.hero { min-height: 100svh; display: grid; align-items: center; padding: clamp(2rem, 5vw, 4.5rem) 0; }
.hero-inner {
  width: min(100% - 3rem, 76rem);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}
.hero-cover img {
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 2.2rem 3.5rem -1.2rem rgba(18,28,36,.75), 0 .4rem .9rem rgba(18,28,36,.35);
}
.shout {
  margin: 0;
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 800;
  font-size: clamp(3.25rem, 1rem + 7.4vw, 7.75rem);
  line-height: 0.88;
  letter-spacing: -0.012em;
  color: var(--cream);
}
/* three tints of the cover's cream: as printed, sunk toward the mustard patch, then lifted */
.shout span:nth-child(2) { color: #cfa458; }
.shout span:nth-child(3) { color: #fff9ea; }
.setup { margin: 0 0 0.7em; max-width: 26em; font-size: 1.12em; line-height: 1.45; color: #fbf3df; }
.shout span { display: block; }
.byline {
  margin: 1.3em 0 0;
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 800;
  font-size: clamp(1.35rem, 1rem + 1.3vw, 2rem);
  line-height: 1.15;
  color: #fff;
}
.coauthors { display: block; font-weight: 600; font-size: 0.74em; margin-top: 0.3em; color: var(--cream); }
.soon { margin: 1.3em 0 0.8em; font-style: italic; font-size: 1.1em; color: #fbf3df; }

/* ---------- the red tag: the cover's torn label, used for the one action on the page ---------- */
.tag {
  display: inline-block;
  padding: 0.85em 1.5em 0.95em;
  background: var(--red);
  color: var(--paper);
  font-family: var(--text);
  font-style: italic;
  font-size: 1.08em;
  line-height: 1.2;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  rotate: -1.2deg;
  clip-path: polygon(0.6% 5%, 9% 1%, 22% 4%, 37% 0.5%, 52% 3.5%, 68% 1%, 83% 4%, 99.2% 2%, 100% 34%, 98.9% 66%, 99.6% 96%, 86% 99%, 71% 96.5%, 55% 99.5%, 39% 97%, 24% 99.5%, 10% 96.5%, 0.4% 98.5%, 1.1% 62%, 0% 30%);
  transition: rotate .18s ease, background-color .18s ease;
}
.tag:hover { rotate: 0deg; background: #b81f0c; }

/* ---------- seam: the thread that runs across the cover, stitching cloth to paper ---------- */
.seam { position: relative; height: 0; z-index: 3; }
.seam svg { position: absolute; left: 0; top: -10px; width: 100%; height: 20px; overflow: visible; }
.seam path { fill: none; stroke: #efe6d2; stroke-width: 3.5; stroke-linecap: round; filter: drop-shadow(0 2px 1.5px rgba(18,28,36,.45)); vector-effect: non-scaling-stroke; }
.patch {
  position: absolute; right: clamp(1.25rem, 7vw, 7rem); top: -2.6rem;
  width: clamp(2.6rem, 5vw, 4rem); aspect-ratio: 5 / 8;
  background:
    repeating-linear-gradient(0deg, rgba(60,30,0,.22) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255,230,160,.18) 0 1px, transparent 1px 3px),
    var(--mustard);
  box-shadow: 0 .35rem .6rem rgba(18,28,36,.35);
  rotate: 2deg;
}

/* ---------- the book ---------- */
.book { position: relative; padding: clamp(5rem, 11vw, 9.5rem) 0; }
.book p { margin: 0 0 1.1em; }
.book .lede { font-size: 1.28em; line-height: 1.45; }
.aside-tag {
  position: absolute; right: max(1.5rem, calc(50% - 36rem)); top: 34%;
  width: 11.5rem; padding: 1.5rem 1.2rem 1.8rem;
  background: var(--red); color: var(--paper);
  font-style: italic; font-size: 1.8rem; line-height: 1.2; text-align: center;
  rotate: 3deg;
  clip-path: polygon(2% 3%, 30% 0.5%, 62% 3%, 98% 1%, 100% 28%, 97.5% 60%, 99.5% 97%, 68% 99.5%, 36% 97%, 1% 99%, 2.5% 64%, 0% 32%);
}
@media (max-width: 75rem) { .aside-tag { display: none; } }

/* ---------- early praise ---------- */
.praise { padding: clamp(4.5rem, 9vw, 8rem) 0 clamp(3.5rem, 7vw, 6rem); }
.reel-track {
  list-style: none; margin: 0; padding: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.reel-track::-webkit-scrollbar { display: none; }
.reel-track li { flex: 0 0 100%; scroll-snap-align: start; padding-right: 8%; }
.reel blockquote { margin: 0; }
.reel blockquote p {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.5rem, 1rem + 2.3vw, 2.75rem);
  line-height: 1.3;
  max-width: 26em;
  text-wrap: pretty;
  color: #fbf3df;
}
.reel blockquote footer {
  margin-top: 1.5em;
  font-family: var(--display);
  font-stretch: 75%;
  font-size: 1.05em;
  line-height: 1.3;
}
.reel cite { display: block; font-style: normal; font-weight: 800; font-size: 1.25em; color: #fff; }
.reel blockquote footer span { font-weight: 600; }
.reel-nav { display: flex; align-items: center; gap: 1.1rem; margin-top: clamp(2rem, 4vw, 3.25rem); }
.reel-btn {
  width: 2.9rem; height: 2.9rem; padding: 0;
  display: grid; place-items: center;
  background: transparent; color: var(--cream);
  border: 2px solid currentColor; border-radius: 50%;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.reel-btn:hover { background: var(--cream); color: var(--denim-deep); }
.reel-btn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.reel-dots { display: flex; gap: .55rem; }
.reel-dots i { width: 1.6rem; height: 4px; background: rgba(233,214,173,.32); transition: background-color .2s ease; }
.reel-dots i.on { background: var(--cream); }

/* ---------- author ---------- */
.author { padding: clamp(5rem, 11vw, 9.5rem) 0; }
.author-grid { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5.5rem); align-items: start; }
.portrait { margin: 0; rotate: -1.5deg; }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; box-shadow: 0 1.6rem 2.6rem -1rem rgba(38,51,61,.55); }
.author.no-photo .portrait { display: none; }
.author.no-photo .author-grid { grid-template-columns: minmax(0, 40rem); justify-content: center; }
.bio p { margin: 0 0 1.1em; }
.bio .giving { margin-top: 1.8em; padding-top: 1.4em; border-top: 2px solid var(--mustard); }
.bio a { text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.bio a:hover { color: var(--red); }

/* ---------- close ---------- */
.close { padding: clamp(4.5rem, 9vw, 7.5rem) 0 clamp(3rem, 6vw, 4.5rem); }
.close-inner { text-align: center; }
.close-line {
  margin: 0 auto 0.75em;
  font-family: var(--display); font-stretch: 75%; font-weight: 800;
  font-size: clamp(2.25rem, 1.4rem + 3.8vw, 4.25rem); line-height: 0.95;
  max-width: 14em;
}
.buy, .contact { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 2.25rem; }
.buy { margin: 2.25rem 0 0; font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 1.3em; }
.contact { margin: clamp(3rem, 6vw, 4.5rem) 0 0; color: #fbf3df; }
.contact a, .buy a { text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.contact a:hover, .buy a:hover { color: #fff; }

/* ---------- sign-up form ---------- */
.notify { scroll-margin-top: 9rem; margin: clamp(1.75rem, 4vw, 2.75rem) auto 0; max-width: 54rem; }
.notify .fields { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 1rem; text-align: left; margin-bottom: 1.6rem; }
.notify label { display: block; font-family: var(--display); font-stretch: 75%; font-weight: 600; font-size: 1.05em; color: #fbf3df; }
.notify input[type="text"], .notify input[type="email"] {
  display: block; width: 100%; margin-top: 0.35rem; padding: 0.7em 0.8em;
  font: 400 1rem/1.3 var(--text);
  color: var(--ink); background: var(--paper);
  border: 2px solid transparent; border-radius: 0;
}
.notify input:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }
.notify .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.notify .fine { margin: 1.1rem 0 0; font-size: 0.88em; color: #fbf3df; }
.notify-status { margin: 0.6rem 0 0; min-height: 1.6em; color: #fff; }
.notify-status a { color: inherit; }
.notify.done .fields, .notify.done .tag, .notify.done .fine { display: none; }
.notify.done .notify-status { font-style: italic; font-size: 1.5em; line-height: 1.3; }
.notify.busy .tag { opacity: .6; pointer-events: none; }
.pledge { margin: clamp(2rem, 4vw, 3rem) auto 0; max-width: 34em; font-style: italic; color: #fbf3df; }

/* ---------- small screens ---------- */
@media (max-width: 52rem) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-cover img { max-width: min(68vw, 20rem); }
  .hero-text { text-align: center; }
  .author-grid { grid-template-columns: 1fr; }
  .notify .fields { grid-template-columns: 1fr; }
  .setup { margin-inline: auto; }
  .portrait { max-width: 22rem; }
  .reel-track li { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tag, .reel-btn, .reel-dots i { transition: none; }
}
