/* The Little Niijis — "Toy Shop Window" design (v5).
   Warm gallery light, arched shop window, plushies free on a wooden shelf,
   stories in a tray below (never over a face). Plush renders untouched. */

:root {
  --warm: #FBF8F1;
  --paper: #FFFFFF;
  --shelfwood: #EFE6D2;
  --ink: #181712;
  --mute: rgba(24, 23, 18, .55);
  --lime: #f0fb7b;
  --rust: #B4552D;
  --teal: #3E7C74;
  --denim: #4A5E82;
  --buck: #C9A36B;
  --thread: #6B4A2F;
  --night: #1D1B23;
  --night-ink: #F1EAD8;
  --soft: 0 14px 30px -18px rgba(107, 74, 47, .4);
  --disp: "Arial Rounded MT Bold", "Baloo 2", "Avenir Next", system-ui, sans-serif;
  --body: "Avenir Next", "Avenir", system-ui, sans-serif;
  /* legacy aliases used by privacy.html */
  --cream: #FBF8F1;
  --display: "Arial Rounded MT Bold", "Baloo 2", "Avenir Next", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }

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

body {
  background: var(--warm);
  color: var(--ink);
  font-family: var(--body);
  overflow-x: hidden;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 22px; }

h1, h2, h3, h4 { font-family: var(--disp); letter-spacing: -.02em; text-wrap: balance; }

/* ---------- header ---------- */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 8px;
  flex-wrap: wrap;
}
header.site .hright { display: flex; align-items: center; gap: 12px; }
header.site .badge {
  width: 58px; height: 58px; border-radius: 14px; overflow: hidden; box-shadow: var(--soft);
}
header.site .badge img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--body);
  font-weight: 800;
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 24px;
  transition: transform .15s ease;
  cursor: pointer;
}
.pill:hover { transform: scale(1.05); }
.pill:active { transform: scale(.96); }
.pill.lime { background: var(--lime); box-shadow: var(--soft); }
.pill.line { border: 2px solid var(--ink); }
.pill.white { background: var(--paper); box-shadow: var(--soft); }
.pill.quiet { background: var(--paper); box-shadow: var(--soft); }

/* ---------- hero: the shop window ---------- */
.hero {
  text-align: center;
  padding: 34px 0 0;
}
.hero h1 {
  font-size: clamp(34px, 5.6vw, 54px);
  line-height: 1.05;
}
.hero h1 em { font-style: normal; color: var(--rust); }
.hero p.tag {
  color: var(--mute);
  font-weight: 700;
  font-size: clamp(15.5px, 2.2vw, 18px);
  max-width: 500px;
  margin: 14px auto 0;
  line-height: 1.55;
}
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 24px; }
.hero img.wordmark-hero { width: min(620px, 88vw); height: auto; }

.window {
  margin: 34px auto 0;
  width: min(860px, 94%);
  border-radius: 320px 320px 28px 28px;
  overflow: hidden;
  border: 12px solid var(--paper);
  box-shadow: 0 34px 64px -28px rgba(107, 74, 47, .55);
  background: #F1EAD8;
}
.window img { width: 100%; display: block; }

.stats {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px;
}
.stat {
  background: var(--paper);
  border-radius: 999px;
  box-shadow: var(--soft);
  padding: 9px 18px;
  font-weight: 800;
  font-size: 13.5px;
}
.stat b { font-family: var(--disp); }

/* ---------- sections ---------- */
section { padding: 60px 0 8px; }
section h2 { font-size: clamp(24px, 3.6vw, 34px); text-align: center; }
section p.sub {
  color: var(--mute);
  font-weight: 600;
  text-align: center;
  margin-top: 8px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

/* ---------- the portraits ---------- */
.portraits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 22px 18px;
  margin: 36px auto 0;
  max-width: 940px;
}
.friend {
  background: none; border: none; padding: 0; font: inherit;
  cursor: pointer;
  text-align: center;
  /* scroll entrance: revealed by JS */
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition:
    opacity .6s cubic-bezier(.2,.7,.2,1),
    transform .6s cubic-bezier(.2,.7,.2,1),
    filter .6s cubic-bezier(.2,.7,.2,1);
}
.friend.in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.friend .portrait {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 26%;
  overflow: hidden;
  background: #F1EAD8;
  box-shadow: var(--soft);
  transition: transform .35s cubic-bezier(.3,1.4,.4,1), box-shadow .35s ease;
}
.friend .portrait img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .28s ease, transform .5s cubic-bezier(.2,.7,.2,1);
}
.friend .portrait img.joy { opacity: 0; }
.friend:hover .portrait,
.friend.active .portrait {
  transform: scale(1.045);
  box-shadow: 0 22px 44px -20px rgba(107, 74, 47, .55);
}
.friend:hover .portrait img.joy,
.friend.active .portrait img.joy { opacity: 1; }
.friend:hover .portrait img.calm,
.friend.active .portrait img.calm { opacity: 0; }
.friend.active .portrait::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  border: 3px solid var(--lime);
  box-shadow: inset 0 0 0 2px rgba(24,23,18,.15);
}
.friend b { display: block; font-family: var(--disp); font-size: 14.5px; margin-top: 11px; }
.friend span.nation { color: var(--mute); font-weight: 700; font-size: 11.5px; }
.friend:focus-visible .portrait { outline: 3px solid var(--teal); outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .friend { opacity: 1; transform: none; filter: none; transition: none; }
  .friend .portrait, .friend .portrait img { transition: none; }
}

/* ---------- learning tints ---------- */
.tintrow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 30px;
}
.tint {
  border-radius: 22px;
  padding: 22px;
  color: #fff;
  box-shadow: var(--soft);
}
.tint h3 { font-size: 18px; }
.tint p { font-size: 13.5px; font-weight: 600; opacity: .88; margin-top: 6px; line-height: 1.5; }

/* ---------- app cards ---------- */
.appcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 30px;
}
.appcard {
  background: var(--paper);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--soft);
}
.appcard .bar { width: 42px; height: 8px; border-radius: 99px; margin-bottom: 12px; }
.appcard h3 { font-size: 18px; }
.appcard p { color: var(--mute); font-weight: 600; font-size: 13.5px; margin-top: 6px; line-height: 1.5; }

/* ---------- bedtime ---------- */
.night-band {
  background: var(--night);
  color: var(--night-ink);
  border-radius: 28px;
  padding: 42px 28px 46px;
  margin-top: 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.night-band h2 { color: var(--night-ink); }
.night-band p {
  color: rgba(241, 234, 216, .7);
  font-weight: 600;
  margin-top: 10px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}
.star { position: absolute; background: var(--night-ink); border-radius: 999px; opacity: .7; }
.sleepy-wrap { margin: 26px auto 0; width: 170px; }
.sleepy-wrap img.breathe {
  width: 100%; height: auto; display: block;
  animation: breathe 8s ease-in-out infinite;
  filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .5));
}
@keyframes breathe { 0%, 100% { transform: scale(.95); } 50% { transform: scale(1.05); } }

/* ---------- footer ---------- */
footer {
  margin-top: 60px;
  padding: 30px 0 50px;
  text-align: center;
  color: var(--mute);
  font-weight: 600;
  font-size: 14px;
}
footer a { color: var(--thread); font-weight: 800; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
footer img.badge { width: 44px; border-radius: 12px; margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  .sleepy-wrap img.breathe { animation: none; }
}

/* ---------- privacy page (unchanged classes) ---------- */
.doc { max-width: 720px; margin: 0 auto; padding: 10px 22px 60px; }
.doc h1 { font-size: 34px; margin-top: 26px; }
.doc h2 { font-size: 21px; margin-top: 34px; text-align: left; }
.doc p, .doc li { color: rgba(24, 23, 18, .78); font-weight: 500; line-height: 1.7; margin-top: 12px; font-size: 16px; }
.doc ul { padding-left: 22px; }
.doc .updated { color: var(--mute); font-size: 14px; font-weight: 600; margin-top: 6px; }

a:focus-visible, .pill:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

@media (max-width: 760px) {
  .window { border-width: 8px; border-radius: 200px 200px 20px 20px; }
}
