:root {
  color-scheme: light;
  --paper: #fff8ea;
  --ink: #243042;
  --muted: #52606f;
  --accent: #b7372f;
  --leaf: #3f7f5f;
  --sky: #5f95c8;
  --gold: #d9a53f;
  --line: #e6d8bd;
  --panel: #fffdf7;
  font-family: "Atkinson Hyperlegible", "Trebuchet MS", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.55;
  text-align: center;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 4px;
  box-shadow: 0 0 0 7px rgba(217, 165, 63, 0.24);
  scroll-margin-top: 5rem;
}

/* Fallback for older TV/console browsers without :focus-visible. */
@supports not selector(:focus-visible) {
  a:focus,
  button:focus,
  [tabindex]:focus {
    outline: 4px solid var(--gold);
    outline-offset: 4px;
    box-shadow: 0 0 0 7px rgba(217, 165, 63, 0.24);
    scroll-margin-top: 5rem;
  }
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  transform: translateY(-150%);
  background: var(--ink);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  z-index: 2;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 248, 234, 0.96);
  border-bottom: 1px solid var(--line);
}

.site-nav {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-link {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-family: "Great Vibes", "Segoe Script", cursive;
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1;
  text-decoration: none;
}

.nav-action {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  background: var(--panel);
  text-decoration: none;
}

.nav-action:hover,
.nav-action:focus-visible {
  background: #ffffff;
  border-color: var(--accent);
}

main {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 1rem;
}

.hero {
  min-height: 78vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--line);
}

.hero-mascots {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 2rem);
  margin-bottom: 0.5rem;
}

.mascot {
  width: auto;
  height: clamp(8rem, 22vw, 13rem);
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(36, 48, 66, 0.12));
}

.mascot--fifi {
  transform: rotate(-3deg);
}

.mascot--seraphina {
  transform: rotate(3deg);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--leaf);
}

h1,
h2,
h3 {
  line-height: 1.12;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  color: var(--accent);
}

/* Fancy fairy-cursive treatment for the hero title. */
#hero-title {
  font-family: "Great Vibes", "Segoe Script", cursive;
  font-weight: 400;
  font-size: clamp(3.6rem, 14vw, 8rem);
  line-height: 1.05;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 1px rgba(255, 255, 255, 0.6), 0 6px 16px rgba(183, 55, 47, 0.16);
}

h2 {
  font-size: clamp(1.8rem, 5vw, 3rem);
}

h3 {
  font-size: 1.5rem;
}

.lede,
.subtitle,
.section-note {
  color: var(--muted);
  max-width: 42rem;
  margin-inline: auto;
}

.primary-action,
.ghost-action {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  font-weight: 700;
  text-decoration: none;
}

.primary-action {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
}

.ghost-action {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}

.primary-action:hover,
.primary-action:focus-visible,
.ghost-action:hover,
.ghost-action:focus-visible {
  background: #ffffff;
  color: var(--accent);
  border-color: var(--accent);
}

.section {
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  border-bottom: 1px solid var(--line);
}

.shelf {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.book-card {
  flex: 0 0 min(100%, 22rem);
  width: min(100%, 22rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.book-card--featured {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(183, 55, 47, 0.1);
}

.book-cover {
  border-radius: 10px;
  background: linear-gradient(160deg, #fffdf7, #fdeed2);
  border: 1px solid var(--line);
  padding: 1.25rem 1rem;
  display: grid;
  gap: 0.35rem;
  justify-items: center;
}

.book-cover .cover-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--leaf);
}

.book-cover .cover-title {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.book-cover .cover-letters {
  display: flex;
  gap: 0.35rem;
  font-size: 1.4rem;
  font-weight: 800;
}

.book-cover .cover-letters span:nth-child(1) { color: var(--accent); }
.book-cover .cover-letters span:nth-child(2) { color: var(--leaf); }
.book-cover .cover-letters span:nth-child(3) { color: var(--sky); }
.book-cover .cover-letters span:nth-child(4) { color: var(--gold); }

.book-cover .cover-flag {
  font-size: 0.85rem;
  color: var(--muted);
}

.book-card h3 {
  margin: 0;
}

.book-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.book-card .primary-action {
  margin-top: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  background: #f5ead5;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.book-card--soon {
  opacity: 0.92;
}

.book-card--soon .book-cover {
  background: #fbf3e2;
}

.site-footer {
  width: min(100%, 72rem);
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

@media (max-width: 40rem) {
  body {
    font-size: 1rem;
  }

  main {
    padding: 0.75rem;
  }

  .brand-link {
    font-size: 1.05rem;
  }
}

/* Touch, D-pad remotes, and TV-scale viewports need larger targets. */
@media (pointer: coarse), (pointer: none), (min-width: 80rem) {
  .nav-action,
  .primary-action,
  .ghost-action {
    min-height: 3.5rem;
    padding: 0.7rem 1.2rem;
  }
}

@media (min-width: 80rem) {
  main,
  .site-nav,
  .site-footer {
    width: min(100%, 86rem);
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}
