/* Nami as a guide: face overlays, the play badge, reading highlight, start button. Loaded after each lesson's styles.css. */
.fwrap { position: relative; display: block; width: 100%; height: 100%; transform-origin: 50% 100%; animation: breath 6s ease-in-out infinite; }
@keyframes breath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }
/* a calm entrance, no bounce */
.qchar.pop { animation: calmin .4s ease both !important; } @keyframes calmin { from { opacity: 0; } to { opacity: 1; } }
.i-art img, .qchar img { animation: none !important; }
.fwrap > img { display: block; width: 100%; height: 100%; }
.nface { position: absolute; z-index: 2; pointer-events: none; }
.nface.inset { inset: 0; }
.nface svg { display: none; position: absolute; inset: 0; width: 100%; height: 100%; }
.nface.talk .mouth { display: block; }
.nface.blink .lids { display: block; }
#nami, #iNami { cursor: pointer; }

/* the badge: play and pause, with a ring that fills as she speaks */
.nbadge { --s: 36px; position: absolute; z-index: 5; width: var(--s); height: var(--s); display: grid; place-items: center; pointer-events: auto; }
.fwrap .nbadge { --s: 46px; right: -6px; bottom: 16px; }
.nbadge .ring { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); pointer-events: none; }
.nbadge .ring circle { stroke: rgba(22, 40, 42, .12); }
.nbadge .ring .fill { stroke: var(--accent); transition: stroke-dashoffset .2s linear; }
.nb-btn { position: relative; display: grid; place-items: center; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: rgba(22, 40, 42, .94); color: #fff; cursor: pointer; box-shadow: 0 8px 18px rgba(22, 40, 42, .28); transition: transform .2s, background .2s; }
.nb-btn:hover { transform: scale(1.08); background: #0f766e; }
.nb-btn:focus-visible { outline: 3px solid rgba(15, 118, 110, .45); outline-offset: 3px; }
.nb-tip { position: absolute; left: calc(100% + 9px); top: 50%; transform: translateY(-50%) translateX(-4px); padding: 5px 11px; border-radius: 999px; background: rgba(22, 40, 42, .92); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.nbadge:hover .nb-tip, .nbadge:focus-within .nb-tip { opacity: 1; transform: translateY(-50%); }
.nbadge[data-state="locked"] .nb-tip { opacity: 1; transform: translateY(-50%); background: var(--accent); }
.fwrap .nbadge .nb-tip { left: 50%; right: auto; top: auto; bottom: calc(100% + 10px); transform: translateX(-50%) translateY(4px); }
.fwrap .nbadge:hover .nb-tip, .fwrap .nbadge:focus-within .nb-tip, .fwrap .nbadge[data-state="locked"] .nb-tip { transform: translateX(-50%); }
.nbadge[data-state="locked"] .nb-btn { background: var(--accent); animation: nbpulse 2s ease-in-out infinite; }
@keyframes nbpulse { 0%, 100% { box-shadow: 0 8px 18px rgba(22, 40, 42, .28), 0 0 0 0 rgba(15, 118, 110, .45); } 50% { box-shadow: 0 8px 18px rgba(22, 40, 42, .28), 0 0 0 11px rgba(15, 118, 110, 0); } }
.nbadge.wiggle .nb-btn { animation: nbwig .5s ease 3; }
@keyframes nbwig { 25% { transform: rotate(-14deg) scale(1.1); } 75% { transform: rotate(14deg) scale(1.1); } }
.nami-toast { position: absolute; z-index: 6; padding: 7px 13px; border-radius: 999px; background: rgba(22, 40, 42, .93); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; pointer-events: none; }
.nami-toast.on { opacity: 1; transform: none; }

/* header voice button */
.nvoice { position: relative; display: inline-grid; place-items: center; }
.nvoice i { position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(-45deg); opacity: 0; }
.nvoice.off { color: var(--muted); }
.nvoice.off i { opacity: 1; }

/* reading along */
.reading .kw { opacity: .4; transition: opacity .2s, color .2s; }
.reading .kw.said { opacity: 1; }
.reading .kw.now { opacity: 1; color: var(--accent); }
.next-chip { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
.next-chip:hover { transform: translateX(2px); border-color: var(--accent); box-shadow: 0 6px 14px rgba(15, 118, 110, .15); }
.reading .next-chip { opacity: .0; }

/* what next, at the end of the story */
.next-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding-left: 4px; animation: rise .5s ease both; }
.next-row span { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }

/* the start button under the first line */
.nami-cta { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 15px 26px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-weight: 750; font-size: 16px; cursor: pointer; box-shadow: 0 14px 30px rgba(22, 40, 42, .26); transition: transform .25s, box-shadow .25s, background .25s; animation: ctapulse 2.8s ease-in-out infinite; }
.nami-cta:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 20px 38px rgba(22, 40, 42, .3); }
.nami-cta.on { background: var(--accent); animation: none; }
.nami-cta .ic-pause { display: none; } .nami-cta.on .ic-pause { display: inline-flex; } .nami-cta.on .ic-play { display: none; }
.nami-cta span { display: inline-flex; }
@keyframes ctapulse { 0%, 100% { box-shadow: 0 14px 30px rgba(22, 40, 42, .26), 0 0 0 0 rgba(15, 118, 110, .35); } 50% { box-shadow: 0 14px 30px rgba(22, 40, 42, .26), 0 0 0 12px rgba(15, 118, 110, 0); } }
.nami-cta-note { margin-top: 10px; padding-left: 4px; font-size: 13px; color: var(--muted); max-width: 440px; line-height: 1.45; }

@media (max-width: 860px) {
  .nbadge { --s: 30px; }
  .fwrap .nbadge { --s: 40px; }
  .nami-cta { margin-top: 16px; padding: 13px 22px; font-size: 15px; }
  .nami-cta-note { margin-left: auto; margin-right: auto; font-size: 12px; }
  .nb-tip { display: none; }
  .nbadge[data-state="locked"] .nb-tip { display: block; left: auto; right: 0; top: auto; bottom: calc(100% + 6px); transform: none; }
}
@media (prefers-reduced-motion: reduce) { .nami-cta, .nbadge[data-state="locked"] .nb-btn, .fwrap { animation: none !important; } }

/* life in the diagram while she talks */
#dia .livedot { fill: #0f766e; stroke: #fff; stroke-width: 2; }
#dia .n.flash .in { animation: nflash .95s cubic-bezier(.2, .9, .3, 1); }
@keyframes nflash { 0% { transform: scale(1); filter: none; } 28% { transform: scale(1.34); filter: drop-shadow(0 0 12px rgba(15, 118, 110, .85)); } 100% { transform: scale(1); filter: none; } }

/* phones: keep every header button on screen */
@media (max-width: 560px) {
  .bar { gap: 8px; }
  .bar .brand { font-size: 0; gap: 0; }
  .bar .brand .logo { font-size: 14px; }
  .bar .jump { gap: 5px; margin-left: auto; }
  .bar .jump button { padding: 6px 10px; font-size: 12px; }
  .bar .jump .round { padding: 0; }
  .bar .count { display: none; }
}

/* the written-out story at the bottom of each page: for search engines, screen readers and people who prefer to read */
.seo-transcript { max-width: 760px; margin: 0 auto; padding: 40px 20px 72px; color: var(--ink, #1c1917); font: 16px/1.65 system-ui, -apple-system, 'Segoe UI', sans-serif; }
.seo-transcript summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.seo-transcript h2 { font-size: 22px; margin: 18px 0 8px; }
.seo-transcript h3 { font-size: 17px; margin: 22px 0 6px; }
.seo-transcript ol { padding-left: 22px; } .seo-transcript li { margin: 8px 0; }
.seo-transcript a { color: var(--accent, #0f766e); }

/* the "Hear Nami" hint sits above the badge, never over the words */
.say .nbadge .nb-tip, .say .nbadge[data-state="locked"] .nb-tip { left: 50%; right: auto; top: auto; bottom: calc(100% + 8px); transform: translateX(-50%); }
.say .nbadge:hover .nb-tip { transform: translateX(-50%); }

/* the speed button sits beside the voice button */
.bar .nspeed { width: auto; min-width: 46px; height: 34px; padding: 0 12px; display: inline-grid; place-items: center; border: 1px solid var(--line, #e7e3dc); background: #fff; color: var(--ink, #16282a); cursor: pointer; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .bar .jump .nspeed { padding: 0 9px; min-width: 40px; font-size: 12px; } }
