/* Colloquial Kids — shared styles
   Visual system locked to cover-sampled palette + wireframes. */

:root {
  --ground: #d6dcc8;
  --teal: #5fa899;
  --teal-deep: #4a8f82;
  --type: #23221b;
  --gold: #cdad64;
  --gold-deep: #c19537;
  --terracotta: #8e4232;
  --cream: #f4f2e8;
  --muted: #6b6a5e;
  --white: #fbfaf5;
  --shadow: rgba(35, 34, 27, 0.12);
  --radius: 14px;
  --radius-lg: 22px;
  --max: 1100px;
  --nav-h: 72px;
  --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI", Georgia, "Palatino Linotype", serif;
  --transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--type);
  background: var(--ground);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--teal-deep);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--terracotta);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--type);
  color: var(--white);
  padding: 0.75rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}


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

/* ——— Header / Nav ——— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 2px solid rgba(35, 34, 27, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--type);
  flex-shrink: 0;
}

.brand:hover {
  color: var(--type);
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-wordmark {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--type);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--type);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--type);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--teal-deep);
  border-bottom-color: var(--gold);
}

.nav-links a[aria-current="page"] {
  color: var(--teal-deep);
  border-bottom-color: var(--gold-deep);
}

/* ——— Layout ——— */

main {
  flex: 1;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 2.75rem 0;
}

.section--tight {
  padding: 1.75rem 0;
}

.section--teal {
  background: var(--teal);
  color: var(--type);
}

.section--cream {
  background: var(--cream);
}

.section--muted {
  background: rgba(95, 168, 153, 0.18);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.85rem, 4vw, 2.55rem);
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.12rem;
  max-width: 42rem;
}

.muted {
  color: var(--muted);
}

.provisional {
  /* Draft copy — Editor will replace */
}

/* ——— Buttons ——— */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--type);
  color: var(--white);
  border-color: var(--type);
}

.btn--primary:hover {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  color: var(--type);
}

.btn--secondary {
  background: transparent;
  color: var(--type);
  border-color: var(--type);
}

.btn--secondary:hover {
  background: rgba(35, 34, 27, 0.06);
  color: var(--type);
}

.btn--ghost {
  background: var(--cream);
  color: var(--type);
  border-color: rgba(35, 34, 27, 0.2);
}

.btn--ghost:hover {
  border-color: var(--type);
  color: var(--type);
}

.btn--disabled,
.btn[aria-disabled="true"],
button.btn--disabled {
  background: var(--gold);
  color: var(--type);
  border-color: var(--gold-deep);
  cursor: default;
  pointer-events: none;
  opacity: 0.95;
}

.btn--disabled:hover,
button.btn--disabled:hover {
  transform: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--cream);
  color: var(--type);
  border: 1.5px solid rgba(35, 34, 27, 0.15);
}

.chip--status {
  background: var(--gold);
  border-color: var(--gold-deep);
}

.chip--dev {
  background: rgba(35, 34, 27, 0.08);
  border-color: rgba(35, 34, 27, 0.2);
}

.chip--live {
  background: var(--teal);
  border-color: var(--teal-deep);
  color: var(--white);
}

.chip--setting {
  background: var(--white);
  font-weight: 600;
  font-size: 0.88rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

/* ——— Double-outline speech bubble ———
   Two concentric rounded shapes with visible gap;
   triangular tail on outer outline only. */

.speech-bubble {
  position: relative;
  display: inline-block;
  padding: 12px;
  background: transparent;
  border: 3px solid var(--type);
  border-radius: 30px;
  max-width: 100%;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2.5px solid var(--type);
  border-radius: 22px;
  pointer-events: none;
  z-index: 2;
}

/* Outer-only triangular tail */
.speech-bubble::after {
  content: "";
  position: absolute;
  left: 30px;
  bottom: -16px;
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 16px solid var(--type);
  z-index: 1;
}

.speech-bubble-inner {
  position: relative;
  z-index: 1;
  border-radius: 20px;
  overflow: hidden;
  background: var(--cream);
}

.speech-bubble-inner img {
  width: 100%;
  display: block;
  border-radius: 20px;
}

/* Mask the inner-outline area of the tail so only the outer outline has a tip */
.speech-bubble-tail-gap {
  position: absolute;
  left: 33px;
  bottom: -9px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid var(--cream);
  z-index: 3;
  pointer-events: none;
}

.hero--teal .speech-bubble-tail-gap {
  border-top-color: var(--teal);
}

/* ——— Home hero ——— */

.hero {
  padding: 2.5rem 0 3rem;
}

.hero--teal {
  background: var(--teal);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(220px, 380px) 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-copy h1 {
  margin-bottom: 0.85rem;
}

.hero-copy .promise {
  font-size: 1.08rem;
  max-width: 36rem;
}

.hero-visual {
  justify-self: center;
  width: 100%;
  max-width: 340px;
}

.hero-visual .speech-bubble {
  width: 100%;
}

/* Book page hero: cover left, copy right */
.book-hero-grid {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 2.25rem;
  align-items: start;
}

.book-cover-wrap {
  width: 100%;
}

.book-cover-wrap img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 28px var(--shadow);
}

.book-cover-wrap.framed {
  /* uses speech-bubble */
}

.book-cover-wrap.framed .speech-bubble {
  width: 100%;
}

.book-cover-wrap.framed .speech-bubble-tail-gap {
  border-top-color: var(--ground);
}

.page-hero {
  padding: 2.25rem 0 1.5rem;
}

.page-hero .badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

/* ——— Audience band ——— */

.audience-band {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.audience-band .sep {
  display: none;
}

.audience-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.audience-pill {
  background: var(--type);
  color: var(--white);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
}

.audience-note {
  width: 100%;
  margin: 0.75rem 0 0;
  font-size: 0.98rem;
  color: var(--muted);
}

/* ——— Series / book cards ——— */

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

.book-card {
  background: var(--cream);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(35, 34, 27, 0.1);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--type);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.book-card:hover {
  border-color: var(--teal-deep);
  box-shadow: 0 6px 20px var(--shadow);
  transform: translateY(-2px);
  color: var(--type);
}

.book-card__media {
  aspect-ratio: 3 / 4;
  background: var(--teal);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, var(--teal) 0%, var(--teal-deep) 55%, #3d7a70 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  color: var(--white);
  gap: 0.5rem;
}

.book-card__placeholder .ph-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.book-card__placeholder .ph-sub {
  font-size: 0.85rem;
  opacity: 0.9;
}

.book-card__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.book-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

.book-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.book-card__link {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--teal-deep);
}

.book-card:hover .book-card__link {
  color: var(--type);
}

.book-card--soon,
.book-card--soon:hover {
  cursor: default;
  transform: none;
  box-shadow: none;
  border-color: rgba(35, 34, 27, 0.1);
}

.section-foot {
  margin-top: 0.5rem;
}

.section-foot a {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
}

.section-foot a:hover {
  border-bottom-color: var(--gold-deep);
}

/* ——— Carousel ——— */

.carousel {
  position: relative;
  margin: 1.5rem 0 0.5rem;
}

.carousel-viewport {
  overflow: hidden;
  margin: 0 -0.25rem;
  padding: 0.25rem;
}

.carousel-track {
  display: flex;
  gap: 1.15rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.35rem 0.15rem 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.carousel-track::-webkit-scrollbar {
  height: 6px;
}

.carousel-track::-webkit-scrollbar-thumb {
  background: rgba(35, 34, 27, 0.25);
  border-radius: 3px;
}

.carousel-track .book-card {
  flex: 0 0 min(280px, 85vw);
  scroll-snap-align: start;
  max-width: 300px;
}

@media (min-width: 768px) {
  .carousel-track .book-card {
    flex: 0 0 calc(50% - 0.6rem);
    max-width: none;
  }
}

@media (min-width: 1000px) {
  .carousel-track .book-card {
    flex: 0 0 calc(33.333% - 0.8rem);
  }
}

.carousel-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--type);
  background: var(--cream);
  color: var(--type);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.carousel-btn:hover {
  background: var(--gold);
}

.carousel-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    scroll-behavior: auto;
  }
}

/* ——— Content lists / steps ——— */

.bullet-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.bullet-list li {
  margin-bottom: 0.45rem;
}

.steps {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
  counter-reset: step;
}

@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  border: 2px solid rgba(35, 34, 27, 0.08);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--type);
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
}

.step h3 {
  margin-bottom: 0.4rem;
}

.step p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
}

.roadmap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.roadmap li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  background: var(--cream);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  border: 2px solid rgba(35, 34, 27, 0.08);
}

.auth-note {
  background: rgba(205, 173, 100, 0.22);
  border-left: 4px solid var(--gold-deep);
  padding: 1rem 1.15rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-size: 0.98rem;
}

.auth-note p {
  margin: 0;
}

.series-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
  margin-top: 0.5rem;
}

.series-strip .mini-card {
  flex: 1 1 200px;
  max-width: 260px;
  background: var(--cream);
  border-radius: var(--radius);
  padding: 1rem;
  border: 2px solid rgba(35, 34, 27, 0.1);
  text-decoration: none;
  color: var(--type);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color var(--transition);
}

.series-strip .mini-card:hover {
  border-color: var(--teal-deep);
  color: var(--type);
}

.series-strip .mini-card--soon,
.series-strip .mini-card--soon:hover {
  cursor: default;
  border-color: rgba(35, 34, 27, 0.1);
}

.series-strip .mini-card .mini-ph {
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--teal), var(--teal-deep));
  margin-bottom: 0.35rem;
}

.placeholder-hero-visual {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--teal) 0%, var(--teal-deep) 55%, #3d7a70 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
  padding: 1.5rem;
  box-shadow: 0 8px 28px var(--shadow);
}

.placeholder-hero-visual .ph-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.placeholder-hero-visual .ph-sub {
  margin-top: 0.5rem;
  opacity: 0.9;
  font-size: 0.9rem;
}

.bridge-link {
  margin-top: 1.5rem;
}

.bridge-link a {
  font-weight: 700;
}

/* ——— Footer ——— */

.site-footer {
  background: var(--type);
  color: var(--cream);
  padding: 1.25rem 0;
  margin-top: auto;
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cream);
  text-decoration: underline;
}

/* ——— Mobile nav ——— */

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1.25rem 1rem;
    border-bottom: 2px solid rgba(35, 34, 27, 0.08);
    box-shadow: 0 8px 20px var(--shadow);
    gap: 0;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid rgba(35, 34, 27, 0.08);
  }

  .nav-links a {
    display: block;
    padding: 0.85rem 0.25rem;
    white-space: normal;
  }

  .brand-wordmark {
    height: 22px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .hero-grid,
  .book-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-visual {
    max-width: 280px;
    order: -1;
  }

  .book-cover-wrap {
    max-width: 260px;
    margin: 0 auto;
  }

  .series-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}

@media (max-width: 480px) {
  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .btn-row .chip {
    align-self: flex-start;
  }
}
