:root {
  --cream: #fff8ee;
  --blush: #e8b7a7;
  --terracotta: #a64b34;
  --canal-blue: #2f6676;
  --canal-ink: #173f4a;
  --paper: #f8ecd9;
  --sand: #efd6bb;
  --ink: #2d211b;
  --muted-ink: #6f5548;
  --raven: #181315;
  --white: #fffdf8;
  --shadow: 0 24px 60px rgba(72, 42, 31, 0.16);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(232, 183, 167, 0.42), transparent 28rem),
    linear-gradient(135deg, rgba(255, 248, 238, 0.97), rgba(239, 214, 187, 0.72)),
    var(--cream);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(166, 75, 52, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166, 75, 52, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

a {
  color: var(--canal-ink);
  text-decoration-color: rgba(47, 102, 118, 0.42);
  text-underline-offset: 0.18em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
.wordmark {
  font-family: var(--serif);
}

.skip-link {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.65rem 0.9rem;
  color: var(--white);
  background: var(--raven);
  border-radius: 6px;
  transform: translateY(-180%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  outline: 3px solid var(--canal-blue);
  outline-offset: 3px;
  transform: translateY(0);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.15rem 0;
}

.wordmark {
  color: var(--raven);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

nav a {
  padding: 0.45rem 0.7rem;
  color: var(--muted-ink);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}

nav a:hover,
nav a:focus {
  color: var(--canal-ink);
  background: rgba(47, 102, 118, 0.12);
  outline: none;
}

.hero {
  display: grid;
  align-content: center;
  width: min(1120px, calc(100% - 2rem));
  min-height: clamp(24rem, 54vh, 34rem);
  margin: 0 auto 2rem;
  padding: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
  color: var(--raven);
  background:
    linear-gradient(120deg, rgba(255, 248, 238, 0.93), rgba(232, 183, 167, 0.42)),
    var(--paper);
  border: 1px solid rgba(47, 102, 118, 0.24);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero h1 {
  max-width: 11ch;
  margin-bottom: 1rem;
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero p:not(.eyebrow) {
  max-width: 42rem;
  margin-bottom: 1.5rem;
  color: var(--muted-ink);
  font-size: clamp(1.05rem, 2.3vw, 1.35rem);
}

.eyebrow {
  margin-bottom: 0.8rem;
  color: var(--terracotta);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 2.9rem;
  padding: 0.75rem 1.05rem;
  color: var(--white);
  background: var(--terracotta);
  border: 2px solid var(--terracotta);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(166, 75, 52, 0.24);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
  text-align: center;
}

.button:hover,
.button:focus {
  background: var(--canal-ink);
  border-color: var(--canal-ink);
  outline: 3px solid rgba(47, 102, 118, 0.35);
  outline-offset: 3px;
}

.button--secondary {
  color: var(--canal-ink);
  background: var(--white);
  border-color: rgba(47, 102, 118, 0.44);
  box-shadow: none;
}

.button--secondary:hover,
.button--secondary:focus {
  color: var(--white);
}

.introduction,
.books,
.author {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 4.5rem;
}

.introduction {
  max-width: 760px;
  padding: 0 1rem;
  text-align: center;
}

.story-postcards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.8rem, 2vw, 1.4rem);
  width: min(1120px, calc(100% - 2rem));
  margin: -1.5rem auto 4.5rem;
  padding: 0 clamp(0.25rem, 2vw, 1.25rem);
}

.story-postcard {
  margin: 0;
  padding: 0.55rem 0.55rem 1.35rem;
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(166, 75, 52, 0.2);
  border-radius: 4px;
  box-shadow: 0 16px 32px rgba(72, 42, 31, 0.14);
}

.story-postcard img,
.author-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.story-postcard--left {
  transform: rotate(-1.2deg);
}

.story-postcard--center {
  transform: translateY(-0.5rem);
}

.story-postcard--right {
  transform: rotate(1.2deg);
}

.introduction h2,
.section-heading h2,
.author h2 {
  margin-bottom: 0.85rem;
  color: var(--raven);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.books {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: rgba(255, 253, 248, 0.52);
  border: 1px solid rgba(47, 102, 118, 0.16);
  border-radius: 8px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.book-card {
  display: grid;
  grid-template-columns: minmax(9rem, 0.78fr) minmax(0, 1fr);
  min-height: 100%;
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(166, 75, 52, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(72, 42, 31, 0.1);
}

.book-cover-frame {
  display: grid;
  min-height: 24rem;
  padding: 0.75rem;
  background:
    radial-gradient(circle at 50% 23%, rgba(255, 248, 238, 0.17), transparent 5rem),
    linear-gradient(145deg, #1f3136, #7b3427 54%, #a64b34);
  place-items: center;
}

.book-cover {
  display: block;
  width: 100%;
  height: auto;
  max-height: 32rem;
  object-fit: contain;
  box-shadow: 0 12px 24px rgba(24, 19, 21, 0.3);
}

.book-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: clamp(1.15rem, 3vw, 1.75rem);
}

.book-card__body h3 {
  margin-bottom: 0.75rem;
  color: var(--raven);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.05;
}

.book-card__body p:not(.book-number) {
  color: var(--muted-ink);
}

.book-card__body .button {
  margin-top: auto;
}

.book-number {
  margin-bottom: 0.55rem;
  color: var(--terracotta);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.author {
  display: grid;
  grid-template-columns: minmax(18rem, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  background: rgba(255, 248, 238, 0.72);
  border: 1px solid rgba(47, 102, 118, 0.16);
  border-radius: 8px;
}

.author-photo {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(72, 42, 31, 0.14);
}

.author-photo img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.author-copy p:not(.eyebrow) {
  color: var(--muted-ink);
}

.button--youtube {
  margin-top: 0.35rem;
  background: var(--canal-ink);
  border-color: var(--canal-ink);
}

.button--youtube:hover,
.button--youtube:focus {
  background: var(--terracotta);
  border-color: var(--terracotta);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.15rem;
  padding: 2rem 1rem;
  color: var(--cream);
  background: var(--raven);
  font-size: 0.95rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #b8dce5;
  font-weight: 800;
}

.site-footer a:hover,
.site-footer a:focus {
  color: var(--cream);
  outline: 2px solid #b8dce5;
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  body {
    font-size: 16px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 26rem;
    padding: 1.5rem 1.25rem;
    border-radius: 8px;
  }

  .hero h1 {
    font-size: clamp(3rem, 17vw, 4.8rem);
    max-width: 100%;
  }

  .button {
    max-width: 100%;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  .book-card {
    grid-template-columns: 1fr;
  }

  .story-postcards {
    grid-template-columns: 1fr;
    margin-top: 0;
  }

  .story-postcard--left,
  .story-postcard--center,
  .story-postcard--right {
    transform: none;
  }

  .book-cover-frame {
    min-height: 0;
  }

  .author {
    grid-template-columns: 1fr;
  }
}
