/* =========================================================
   Totopang — Brain Inc.
   Palette sampled from the show's key art + logo:
   sky blue, mushroom red, grass green, sunny yellow,
   peach pink, cherry red, warm cream, cocoa-brown ink.
   ========================================================= */

:root {
  --sky:        #58C4F2;
  --sky-light:  #DFF3FD;
  --sky-deep:   #2FA8E0;
  --red:        #E8382E;   /* mushroom cap */
  --red-deep:   #C82A22;
  --green:      #8DC63F;   /* grass / sprout */
  --green-deep: #6FA82E;
  --yellow:     #FFD24A;   /* sunny */
  --yellow-deep:#F5B921;
  --peach:      #F6A9A0;
  --cherry:     #E23B4E;
  --cream:      #FFF9F0;   /* page base */
  --white:      #FFFFFF;
  --ink:        #4A342B;   /* warm brown text */
  --ink-soft:   #7A6155;

  --radius:     26px;
  --radius-lg:  36px;
  --shadow:     0 14px 34px rgba(74, 52, 43, .12);
  --shadow-hover:0 22px 48px rgba(74, 52, 43, .20);
  --maxw:       1140px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
/* keep tap highlight subtle on touch devices */
* { -webkit-tap-highlight-color: rgba(232, 56, 46, .15); }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "Baloo 2", "Nunito", cursive;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  letter-spacing: .2px;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap.narrow { max-width: 820px; text-align: center; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  transition: background .3s ease, box-shadow .3s ease, padding .3s ease;
}
.site-header.scrolled {
  background: rgba(255, 249, 240, .92);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(74, 52, 43, .10);
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand img {
  height: clamp(72px, 9vw, 110px);
  width: auto;
  display: block;
  background: transparent;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.32));
  transition: transform .25s ease, height .3s ease;
}
.site-header.scrolled .brand img { height: clamp(58px, 6vw, 78px); }
.brand:hover img { transform: scale(1.05) rotate(-2deg); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 26px);
  font-family: "Baloo 2", sans-serif;
  font-weight: 600;
}
.nav a {
  text-decoration: none;
  color: var(--white);
  text-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: color .2s ease, transform .2s ease;
}
.site-header.scrolled .nav a {
  color: var(--ink);
  text-shadow: none;
}
.nav a:not(.nav-cta):hover { transform: translateY(-2px); color: var(--yellow-deep); }
.site-header.scrolled .nav a:not(.nav-cta):hover { color: var(--red); }

.nav-cta {
  background: var(--red);
  color: var(--white) !important;
  padding: 9px 20px;
  border-radius: 999px;
  text-shadow: none !important;
  box-shadow: 0 6px 16px rgba(232, 56, 46, .4);
  transition: transform .2s ease, box-shadow .2s ease;
}
.nav-cta:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 10px 22px rgba(232,56,46,.5); }

/* Hide text nav on small screens (keep it clean) */
@media (max-width: 720px) {
  .nav a:not(.nav-cta) { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(120px, 16vh, 170px) 24px clamp(90px, 12vh, 140px);
  background: linear-gradient(180deg, #EAF8FE 0%, #C4EAFB 42%, #96D7F3 100%);
}
@keyframes kenburns {
  from { transform: scale(1) translateY(0); }
  to   { transform: scale(1.1) translateY(-1.5%); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
}
.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  color: var(--red);
  text-shadow: 0 3px 0 rgba(255,255,255,.75), 0 10px 22px rgba(47,168,224,.28);
}
.hero-sub {
  font-size: clamp(1.02rem, 2.2vw, 1.32rem);
  font-weight: 700;
  color: var(--ink);
  max-width: 620px;
  margin: 14px auto 28px;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Framed key-art showcase card */
.hero-art {
  margin: clamp(28px, 5vh, 48px) auto 0;
  width: min(880px, 92vw);
  aspect-ratio: 16 / 9;
  max-height: 56vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 6px solid #fff;
  box-shadow: 0 28px 60px rgba(30, 95, 140, .34);
  background: #cfeefb;
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: kenburns 24s ease-in-out infinite alternate;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 999px;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  border: 3px solid rgba(255,255,255,.55);
}
.btn:hover { transform: translateY(-3px) scale(1.03); }
.btn:active { transform: translateY(-1px) scale(1); }
.btn-red    { background: var(--red);    color: #fff; box-shadow: 0 10px 24px rgba(232,56,46,.45); }
.btn-red:hover { box-shadow: 0 16px 32px rgba(232,56,46,.55); }
.btn-yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 10px 24px rgba(245,185,33,.45); }
.btn-yellow:hover { box-shadow: 0 16px 32px rgba(245,185,33,.55); }
.btn-play { font-size: .85em; }

/* ---------- Clouds ---------- */
.cloud {
  position: absolute;
  z-index: -1;
  background: #fff;
  border-radius: 100px;
  opacity: .9;
  filter: blur(.3px);
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.cloud-2 { width: 90px;  height: 32px; top: 26%; right: 12%; animation: drift 28s ease-in-out infinite reverse; }
.cloud-3 { width: 70px;  height: 26px; top: 12%; right: 34%; animation: drift 34s ease-in-out infinite; }
.cloud-2::before { width: 42px; height: 42px; top: -20px; left: 14px; }
.cloud-2::after  { width: 32px; height: 32px; top: -12px; left: 46px; }
.cloud-3::before { width: 34px; height: 34px; top: -16px; left: 12px; }
.cloud-3::after  { width: 24px; height: 24px; top: -8px;  left: 38px; }
@keyframes drift {
  0%,100% { transform: translateX(0); }
  50%     { transform: translateX(30px); }
}

/* ---------- Floating animation ---------- */
.float { animation: float 5s ease-in-out infinite; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}

/* ---------- Section dividers ---------- */
.divider {
  position: absolute;
  bottom: -1px; left: 0;
  width: 100%;
  line-height: 0;
  pointer-events: none;
}
.divider svg { width: 100%; height: clamp(50px, 8vw, 110px); display: block; }
.divider-hero { z-index: 1; }

/* ---------- Generic sections ---------- */
.section {
  position: relative;
  padding: clamp(70px, 10vw, 120px) 0 clamp(90px, 12vw, 150px);
}
.section-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  text-align: center;
  color: var(--ink);
}
.section-title::after {
  content: "";
  display: block;
  width: 80px; height: 6px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green));
}
.section-title.light { color: #fff; }
.section-title.light::after { background: rgba(255,255,255,.85); }

.lead {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  max-width: 760px;
  margin: 22px auto 0;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
}
.lead.light { color: rgba(255,255,255,.92); }

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

/* ---------- Stat cards ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 26px;
  margin: 48px auto 0;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 38px 28px 34px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 3px solid #fff;
  transition: transform .3s ease, box-shadow .3s ease;
}
.stat-card:nth-child(1) { border-color: #ffd9d6; }
.stat-card:nth-child(2) { border-color: #cdeaff; }
.stat-card:nth-child(3) { border-color: #dcefc4; }
.stat-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.stat-emoji {
  font-size: 2.6rem;
  width: 78px; height: 78px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  background: var(--sky-light);
  border-radius: 50%;
}
.stat-card:nth-child(1) .stat-emoji { background: #ffe3e0; }
.stat-card:nth-child(2) .stat-emoji { background: #e6f4ff; }
.stat-card:nth-child(3) .stat-emoji { background: #ecf7dc; }
.stat-card h3 { font-size: 1.15rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 1.5px; }
.stat-big { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 1.55rem; color: var(--ink); margin: 6px 0 8px; }
.stat-note { margin: 0; color: var(--ink-soft); font-weight: 600; }

.fine-note {
  text-align: center;
  margin: 40px auto 0;
  font-weight: 700;
  color: var(--ink-soft);
  background: #fff;
  display: table;
  padding: 10px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* ---------- Characters ---------- */
.characters { background: var(--sky-light); }

/* All five cards always share one row: flex:1 with min-width:0 lets them shrink
   to fit the container together instead of wrapping. Everything is always
   visible (avatar, name, trait, full description) — no hover needed. */
.char-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(12px, 1.6vw, 22px);
  margin-top: 54px;
}
.char-card {
  flex: 1 1 0;
  min-width: 0;
  max-width: 224px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 16px 26px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .3s ease, box-shadow .3s ease;
}
.char-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }

/* Avatar: character fully contained inside a pastel circle (no overflow).
   Circle scales with card width (capped) so it never clips on narrow cards. */
.char-img {
  position: relative;
  width: 100%;
  max-width: 150px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}
.char-img::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--tint, #eaf3ff);
  box-shadow: inset 0 -10px 22px rgba(74, 52, 43, .06);
}
/* Every character is letterboxed inside the SAME fixed square (76% of the
   circle), centred. object-fit:contain guarantees each one fits fully inside
   the circle at a consistent scale — no spill-over, regardless of shape. */
.char-img img {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: auto;
  width: 76%;
  height: 76%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 10px 12px rgba(74, 52, 43, .20));
  transition: transform .35s ease;
}
.char-card:hover .char-img img { transform: scale(1.05); }

/* pastel circle tints matching each character's palette */
.char-hero   { --tint: radial-gradient(circle at 50% 40%, #fff 0%, #ffd7d3 100%); }
.char-carrot { --tint: radial-gradient(circle at 50% 40%, #fff 0%, #ffe4c6 100%); }
.char-sprout { --tint: radial-gradient(circle at 50% 40%, #fff 0%, #e2f4cc 100%); }
.char-cherry { --tint: radial-gradient(circle at 50% 40%, #fff 0%, #ffd7dc 100%); }
.char-peach  { --tint: radial-gradient(circle at 50% 40%, #fff 0%, #ffe0da 100%); }

.char-card h3 {
  font-size: clamp(1.05rem, 1.3vw, 1.28rem);
  color: var(--red-deep);
  margin-bottom: 8px;
}
.char-desc { margin: 0; }
.char-desc p {
  margin: 0;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: .9rem;
  line-height: 1.5;
  text-wrap: pretty;
}

/* Small screens: horizontal snap-scroll keeps all five in a single row */
@media (max-width: 720px) {
  .char-grid {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding: 4px 4px 16px;
    margin-left: -4px;
    margin-right: -4px;
  }
  .char-card {
    flex: 0 0 68%;
    max-width: 68%;
    scroll-snap-align: center;
  }
  .char-img { max-width: 170px; }
  .char-desc p { font-size: .95rem; }
}

/* ---------- Watch ---------- */
.watch { background: var(--cream); }
.yt-facade {
  position: relative;
  max-width: 900px;
  margin: 46px auto 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 5px solid #fff;
  transition: transform .3s ease, box-shadow .3s ease;
}
.yt-facade:hover, .yt-facade:focus-visible { transform: translateY(-6px); box-shadow: var(--shadow-hover); outline: none; }
.yt-thumb {
  position: absolute; inset: 0;
  background: url("assets/keyart-watch.jpg") center/cover no-repeat;
}
.yt-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.35));
}
.yt-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.yt-play svg { width: 92px; height: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); transition: transform .25s ease; }
.yt-play-bg { fill: var(--red); }
.yt-facade:hover .yt-play svg { transform: scale(1.12); }
.yt-tag {
  position: absolute;
  bottom: 16px; left: 16px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .9rem;
}
.yt-facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watch-note { text-align: center; margin: 26px auto 0; font-weight: 700; color: var(--ink-soft); }

/* ---------- Company ---------- */
.company { background: var(--sky-light); }
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 34px;
}
.badge {
  background: #fff;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 2px solid #fff;
}
.badge::before { content: "✓ "; color: var(--green-deep); font-weight: 800; }

/* ---------- Contact ---------- */
.contact {
  background: linear-gradient(160deg, var(--sky) 0%, var(--sky-deep) 100%);
  color: #fff;
  text-align: center;
  padding-bottom: 56px;
}
.email {
  display: inline-block;
  margin: 30px auto 0;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 4.5vw, 2.6rem);
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,.14);
  padding: 14px 34px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.5);
  transition: transform .2s ease, background .2s ease;
  word-break: break-word;
}
.email:hover { transform: translateY(-3px) scale(1.03); background: rgba(255,255,255,.24); }
.copyright {
  margin: 46px auto 0;
  max-width: 720px;
  font-size: .88rem;
  color: rgba(255,255,255,.85);
  font-weight: 600;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
  transition-delay: var(--d, 0s);
}
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- Mobile polish ---------- */
@media (max-width: 720px) {
  html { scroll-padding-top: 78px; }
  /* comfortable tap targets */
  .nav-cta { padding: 11px 20px; }
  .btn { padding: 14px 26px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  /* trimmer header so it doesn't dominate small screens */
  .brand img { height: 52px; }
  .site-header.scrolled .brand img { height: 46px; }
  .site-header { padding: 10px 16px; }
  /* hero: tighten spacing, let buttons be easy to tap */
  .hero { padding-top: 92px; }
  .hero-buttons { gap: 12px; width: 100%; }
  .btn { flex: 1 1 auto; justify-content: center; }
  .section-title::after { margin-top: 12px; }
  .badge { padding: 10px 18px; font-size: .95rem; }
}
@media (max-width: 400px) {
  .email { font-size: 1.28rem; padding: 12px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
