/* Emma and the Rainbow Class — calm, simple, no external requests */

@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-ext-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-ext-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --pink: #e8336d;        /* "Emma" wordmark */
  --pink-soft: #fff1f5;
  --cream: #fff9f1;
  --purple: #8f6fd8;      /* the rug */
  --purple-soft: #f3eefc;
  --ink: #4a2c3a;         /* text */
  --ink-soft: #7a5f6b;
  --line: #f2dde5;
  --radius: 22px;
  --shadow: 0 6px 24px rgba(74, 44, 58, .08);
  --max: 1100px;
}

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

body {
  margin: 0;
  font-family: "Fredoka", "Trebuchet MS", system-ui, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 18px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--pink); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
p { margin: 0 0 1em; }

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

/* Header — stays at the top while scrolling */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 249, 241, .94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--max); margin: 0 auto; padding: 10px 20px;
}
.mainnav { display: flex; gap: 6px; }
.mainnav a {
  color: var(--ink); text-decoration: none; font-weight: 600;
  padding: 6px 14px; border-radius: 999px;
}
.mainnav a:hover { background: var(--pink-soft); color: var(--pink); }
section, .hero { scroll-margin-top: 70px; }

.ticks { list-style: none; padding: 0; margin: 0 0 1.2em; }
.ticks li { position: relative; padding-left: 30px; margin-bottom: .45em; }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 7px;
  border-left: 3px solid var(--pink); border-bottom: 3px solid var(--pink); transform: rotate(-45deg);
}
.brand-small { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.brand-small img { width: 34px; height: 34px; }
.lang select {
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink);
  border: 2px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 30px 5px 14px; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.lang select:focus { outline: 2px solid var(--pink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hero */
.hero { background: var(--pink-soft); padding: 20px 0 56px; text-align: center; }
.wordmark { margin: 0 0 .2em; }
.wordmark .emma {
  display: block; color: var(--pink); font-weight: 700;
  font-size: clamp(3.4rem, 9vw, 6rem); line-height: 1;
  letter-spacing: -.01em;
}
.wordmark .rest { display: block; font-size: clamp(1.5rem, 3.6vw, 2.4rem); color: var(--ink); font-weight: 600; }
.tagline { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink-soft); max-width: 640px; margin: .6em auto 1.6em; }

/* App download line (above the banner) */
.store-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 12px; margin: 0 auto 22px; }
.store-label { font-weight: 600; color: var(--ink); margin-right: 4px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; border-radius: 12px;
  padding: 7px 16px 7px 12px; line-height: 1.1; text-align: left; text-decoration: none;
}
.store-btn svg { width: 22px; height: 22px; flex: none; }
.store-btn small { display: block; font-size: .7rem; opacity: .75; font-weight: 400; }
.store-btn b { display: block; font-size: 1.02rem; font-weight: 600; }
.store-btn[aria-disabled="true"] { opacity: .78; cursor: default; }
a.store-btn:hover { background: var(--pink); }
.hero-img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; height: auto; }

/* Version B: plain, compact title area */
.hero-b { padding: 36px 0 40px; background: var(--pink-soft); }
.hero-b .wordmark .emma { font-size: clamp(2.6rem, 6vw, 4.2rem); }
.hero-b .wordmark .rest { font-size: clamp(1.2rem, 2.6vw, 1.8rem); }
.hero-b .tagline { margin-bottom: 0; font-size: clamp(1rem, 1.8vw, 1.15rem); }
.about-img { margin-top: 32px; }
.app-buttons { margin: 4px 0 22px; }

/* Sections */
section { padding: 64px 0; }
section.alt { background: #fff; }
.section-head { text-align: center; max-width: 700px; margin: 0 auto 36px; }
.section-head p { color: var(--ink-soft); }

.badge {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--purple); background: var(--purple-soft);
  border-radius: 999px; padding: 3px 12px; margin-bottom: 12px;
}

/* Parents: three points */
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.point { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
section.alt .point { background: var(--cream); box-shadow: none; }
.point h3 { font-size: 1.25rem; color: var(--pink); }
.point p { margin: 0; color: var(--ink-soft); }

/* Split blocks */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }
.split.reverse .split-img { order: 2; }

/* Episodes */
.episodes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ep { position: relative; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.ep img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.ep .soon {
  position: absolute; top: 10px; left: 10px; font-size: .75rem; font-weight: 600;
  background: rgba(255,255,255,.92); color: var(--purple); border-radius: 999px; padding: 2px 10px;
}
a.ep { display: block; }

/* Buttons */
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-width: 180px; padding: 10px 20px; border-radius: 14px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; line-height: 1.25;
}
.btn small { font-weight: 400; font-size: .75rem; opacity: .8; }
.btn.disabled { background: #cbbfc5; cursor: default; }
.center { text-align: center; }
.center .buttons { justify-content: center; }

/* Footer */
footer { background: var(--pink-soft); padding: 40px 0; font-size: .95rem; color: var(--ink-soft); }
.foot { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot a { color: var(--ink); }

/* Plain text pages */
.page { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; }
.page h1 { font-size: 2rem; }
.page h2 { font-size: 1.3rem; margin-top: 1.6em; }
.note { background: var(--purple-soft); border-radius: 14px; padding: 12px 16px; font-size: .95rem; }

/* Language visibility for longer page texts */
[data-lang-block] { display: none; }
[data-lang-block="en"] { display: block; } /* shown until the script picks the language */

/* Mobile */
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; }
  .mainnav { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; gap: 0 2px; }
  .mainnav a { padding: 3px 9px; font-size: .92rem; white-space: nowrap; }
  section, .hero { scroll-margin-top: 130px; }
  body { font-size: 17px; }
  .points, .episodes { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: 24px; }
  .split.reverse .split-img { order: 0; }
  .split.reverse.app-first .split-img { order: 2; }
  .hero-b { padding: 28px 0 32px; }
  section { padding: 48px 0; }
}
@media (max-width: 520px) {
  .store-label { flex-basis: 100%; text-align: center; margin: 0; }
  .store-btn { padding: 6px 12px 6px 10px; gap: 8px; }
  .store-btn b { font-size: .95rem; }
  .points, .episodes { grid-template-columns: 1fr; }
  .brand-small span { display: none; }
}

/* Japanese and Korean: slightly more line spacing, no word breaks inside words */
html[lang="ja"] body, html[lang="ko"] body { line-height: 1.75; }
html[lang="ko"] body { word-break: keep-all; }

/* Language practice: "hello" bubbles over the rainbow picture */
.lang-visual { position: relative; }
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; background: #fff; color: var(--ink);
  font-weight: 600; font-size: clamp(.58rem, 1.25vw, .9rem); line-height: 1.2;
  padding: .3em .75em; border-radius: 999px; white-space: nowrap;
  border: 2px solid currentColor; box-shadow: 0 3px 10px rgba(74, 44, 58, .12);
}
.bubble::after {
  content: ""; position: absolute; left: 1.1em; bottom: -.42em; width: .6em; height: .6em;
  background: #fff; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.bubble.c1 { color: #e04f5f; } .bubble.c2 { color: #ef8a2e; } .bubble.c3 { color: #d9a400; }
.bubble.c4 { color: #3f9f5a; } .bubble.c5 { color: #3a86d1; } .bubble.c6 { color: #6c5fc7; }
.bubble.c7 { color: #b04fb0; }
.howto { font-size: .92rem; color: var(--ink-soft); background: var(--purple-soft); border-radius: 12px; padding: 8px 14px; }
