/* BrightKidz: a warm publisher showcase. All artwork and fonts stay local.
   Product inks distinguish Library from Wrenfield; legal documents retain a
   quiet reading layout. The OS controls dark mode and reduced motion. */
:root {
  --paper: #f4f2ec; --panel: #fffdf8; --ink: #232622; --muted: #5b6058;
  --rule: #d6d8d0; --accent: #28734f; --accent-hi: #205c40; --on-accent: #fff;
  --s1: #12676f; --s2: #5b3fa8; --s3: #1d7533;
  --s4: #935824; --s5: #b8324c; --s6: #3a5794;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.65; }
a { color: var(--accent-hi); text-underline-offset: .2em; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 20; background: var(--ink); color: var(--paper); padding: .8rem; }
.skip-link:focus { left: .5rem; top: .5rem; }
.top { max-width: 80rem; margin: auto; padding: 1.2rem clamp(1.1rem, 4vw, 3rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--rule); }
.wordmark { display: inline-flex; align-items: center; font-size: 1.4rem; letter-spacing: -.06em; font-weight: 750; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark img { margin-right: .6rem; width: 36px; }
.wordmark em { font-style: normal; color: var(--accent-hi); }
.top nav { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem 1.4rem; }
.top nav a { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; font-size: .9rem; font-weight: 650; color: var(--ink); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--accent-hi); text-decoration: underline; }
.nav-product img { width: 26px; height: 26px; }
.nav-product span { color: var(--muted); }
main { max-width: 80rem; margin: auto; padding: 0 clamp(1.1rem, 4vw, 3rem); }
p { margin: 0 0 1.2rem; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 5.6vw, 4.7rem); font-weight: 720; margin: 0 0 1.3rem; }
h2 { font-size: clamp(1.9rem, 3vw, 2.65rem); font-weight: 680; margin: 0 0 1.2rem; }
h3 { font-size: 1.1rem; letter-spacing: -.02em; }
.eyebrow { font-size: .75rem; font-weight: 750; text-transform: uppercase; letter-spacing: .13em; color: var(--accent-hi); margin: 0 0 1rem; }
.intro { padding: 2.5rem 0 2rem; text-align: center; }
.intro h1 em { font-family: Georgia, serif; font-weight: 500; color: var(--accent-hi); }
.intro-copy { max-width: 42rem; margin: auto; color: var(--muted); font-size: 1.1rem; }
.intro-actions { justify-content: center; margin-bottom: 0 !important; }
.library-lockup { gap: .55rem; text-decoration: none; color: var(--ink); }
.library-lockup img { width: 40px; height: 40px; }
.library-lockup span { font-size: 1rem; font-weight: 750; line-height: 1.15; letter-spacing: -.025em; }
.library-lockup strong { display: block; color: var(--accent-hi); font-size: .9rem; font-weight: 650; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.product { display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--rule); border-radius: 1.2rem; }
.product-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; padding: 1.25rem 1.5rem; min-height: 5rem; }
.product-top > a { display: flex; align-items: center; min-height: 44px; }
.product-logo { width: 210px; }
.wrenfield-logo { width: 175px; }
.tag { font-size: .7rem; font-weight: 650; color: var(--muted); background: var(--paper); padding: .35rem .65rem; border-radius: 2rem; white-space: nowrap; }
.library-picture, .wrenfield-picture { height: 19.5rem; margin: 0 .75rem; border-radius: .65rem; overflow: hidden; }
.wrenfield-picture { display: block; background: #efe1bc; }
.wrenfield-picture img { width: 100%; height: 100%; object-fit: cover; object-position: center 56%; }
.library-picture { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: .45rem; background: #f4efe4; padding: .55rem; }
.discovery { display: flex; flex-direction: column; justify-content: center; padding: 1rem .9rem; border-radius: .35rem; color: #f4efe4; overflow: hidden; }
.discovery > span:first-child { font-family: Georgia, serif; font-size: 1.8rem; line-height: 1; }
.discovery img { width: 100%; margin: .7rem 0 .4rem; }
.discovery-caption { font-size: .7rem; line-height: 1.4; }
.discovery-space { grid-row: span 2; background: #5b3fa8; }
.discovery-space img { margin: 2rem 0; }
.discovery-nature { background: #1d7533; }
.discovery-science { background: #12676f; }
.product-copy { padding: 1.65rem 1.75rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.product-copy h2 { font-size: clamp(1.9rem, 3vw, 2.4rem); min-height: 2.3em; }
.product-copy > p:not(.eyebrow) { color: var(--muted); font-size: .97rem; }
.product-copy .product-facts { font-size: .8rem !important; color: var(--ink) !important; font-weight: 600; margin-top: auto; padding-top: .5rem; }
.cta, .store { display: inline-flex; justify-content: center; align-items: center; gap: .8rem; min-height: 48px; padding: .8rem 1.15rem; border-radius: .45rem; font-size: .9rem; font-weight: 650; line-height: 1.4; text-align: center; text-decoration: none; }
.cta { background: var(--accent); color: var(--on-accent); border: 1px solid transparent; }
.cta:hover { background: var(--accent-hi); }
.store { border: 1px solid var(--rule); color: var(--ink); }
.store:hover { border-color: var(--accent); background: var(--panel); }
.wrenfield-product .cta { background: #814724; color: #fff; }
.wrenfield-product .cta:hover { background: #65361b; }
.quick-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .15rem 1rem; margin-top: .8rem; }
.quick-links a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font-size: .8rem; font-weight: 650; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; padding: 5.5rem 0; border-bottom: 1px solid var(--rule); }
.feature > div > p:not(.eyebrow) { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.5rem 0; }
.small-note { font-size: .8rem; line-height: 1.6; margin-top: 1.5rem; }
.subject-shelf { display: grid; gap: .65rem; }
.subject-shelf a { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: .75rem; padding: 1.4rem 1.5rem; border: 1px solid var(--rule); border-radius: .65rem; background: var(--panel); text-decoration: none; color: var(--ink); }
.subject-shelf a:hover { border-color: var(--accent); }
.subject-number { grid-column: 1 / -1; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
.subject-shelf strong { font-size: 1.5rem; line-height: 1.1; letter-spacing: -.025em; }
.subject-shelf a > span:last-child { font-size: .75rem; color: var(--accent-hi); }
.story-photos { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 1rem; padding: 2rem 1rem; background: #e5e9dd; border-radius: 1rem; }
.story-screen { border: 6px solid #fffdf8; border-radius: .7rem; transform: rotate(-4deg); box-shadow: 0 12px 25px #23262222; }
.clubhouse-scene { border: 6px solid #fffdf8; border-radius: .4rem; transform: rotate(5deg); box-shadow: 0 12px 25px #23262222; }
.story-title { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.story-title h3 { margin: 0 0 .6rem; }
.story-title p { font-size: .9rem; color: var(--muted); margin-bottom: .5rem; }
.story-title a { display: inline-flex; align-items: center; min-height: 44px; gap: .7rem; font-size: .9rem; font-weight: 650; }
.principles { padding: 5rem 0; }
.principle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin: 2.5rem 0 1rem; }
.principle-grid div > span { color: var(--accent-hi); font-size: .8rem; font-weight: 700; }
.principle-grid p { font-size: .9rem; color: var(--muted); }
.principles > a { display: inline-flex; align-items: center; min-height: 44px; gap: .7rem; font-size: .9rem; font-weight: 650; }
.closing { padding: 3.5rem 1.5rem; text-align: center; border-radius: 1rem; background: #e5e9dd; }
.closing .actions { justify-content: center; margin-bottom: 0; }
.document { max-width: 48rem; padding-top: 3rem; }
.document h1 { font-size: clamp(2rem, 5vw, 3rem); }
.document h2 { font-size: 1.4rem; margin-top: 2.5rem; }
.document .panel { background: var(--panel); border: 1px solid var(--rule); border-radius: .5rem; padding: 1.5rem; margin: 1.5rem 0; }
.document .panel h3 { margin-top: 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--rule); padding: .6rem; text-align: left; vertical-align: top; }
.foot { margin-top: 5rem; border-top: 1px solid var(--rule); background: var(--panel); }
.foot .inner { max-width: 80rem; margin: auto; padding: 2rem clamp(1.1rem, 4vw, 3rem); font-size: .8rem; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin-bottom: .6rem; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; }
.foot p { max-width: 50rem; margin-bottom: .4rem; }
.foot .pub { color: var(--ink); font-weight: 650; }
.inks { display: flex; height: 3px; }
.inks span { flex: 1; }
@media (max-width: 799px) {
  .top { flex-wrap: wrap; justify-content: center; padding-block: .8rem; gap: .4rem; }
  .top nav { justify-content: center; width: 100%; gap: 1.2rem; }
  .top nav a { font-size: .8rem; }
  .intro { padding: 2rem 0; }
  .intro h1 { font-size: clamp(2.3rem, 8vw, 3.3rem); }
  .intro-copy { font-size: 1rem; }
  .product-grid, .feature { grid-template-columns: 1fr; }
  .product-grid { gap: 1.5rem; }
  .product-copy h2 { min-height: 0; }
  .feature { padding: 3.5rem 0; gap: 2rem; }
  .library-picture, .wrenfield-picture { height: 18rem; }
  .story-photos { max-width: 35rem; }
  .principles { padding: 3.5rem 0; }
  .principle-grid { grid-template-columns: 1fr; gap: 1rem; margin-top: 1.5rem; }
  .principle-grid h3 { margin: .4rem 0 .7rem; }
}
@media (max-width: 380px) {
  .product-top, .product-copy { padding-inline: 1rem; }
  .product-logo { width: 175px; }
  .wrenfield-logo { width: 150px; }
  .discovery { padding-inline: .55rem; }
  .discovery > span:first-child { font-size: 1.4rem; }
  .subject-shelf a { grid-template-columns: 1fr; }
  .subject-shelf a > span:last-child { margin-top: .6rem; }
}
/* Narrow product columns need more room for captions inside the collage. */
@media (max-width: 1050px) {
  .library-picture, .wrenfield-picture { height: 23rem; }
  .discovery > span:first-child { font-size: 1.4rem; }
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #141714; --panel: #1c201c; --ink: #edf1ec; --muted: #b0b9ae; --rule: #3b4438; --accent: #83cba1; --accent-hi: #a3ddba; --on-accent: #141714; color-scheme: dark; }
  .closing, .story-photos { background: #253022; }
  .product-logo { background: #fffdf8; border-radius: .25rem; padding: .35rem; }
  .wrenfield-product .cta { background: #efc194; color: #2e1c0c; }
  .wrenfield-product .cta:hover { background: #ffdbb6; }
}
@media (prefers-contrast: more) {
  :root { --paper: #fff; --panel: #fff; --ink: #000; --muted: #000; --rule: #000; --accent: #0b4a30; --accent-hi: #0b4a30; --on-accent: #fff; }
}
@media (prefers-reduced-motion: no-preference) {
  .cta, .store, .subject-shelf a { transition: background-color .15s, border-color .15s; }
}

/* Official Google Play badge: locally served with its original clear space. */
.google-play-link { display: inline-flex; align-items: center; align-self: center; flex: 0 0 auto; width: 180px; max-width: 100%; min-height: 44px; }
.google-play-link img { display: block; width: 100%; height: auto; }

.store-availability, .store-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; margin: .75rem 0; }
.store-availability > p { flex: 1 1 10rem; margin: 0; line-height: 1.4; }
.store-actions > a { align-self: center; }
.product-copy .store-availability { margin-top: auto; padding-top: .5rem; }
.store-availability .product-facts { margin: 0; padding: 0; }
