:root {
  --bg: #faf9f6; --surface: #ffffff; --surface-2: #f3f1ec; --ink: #16282a; --body: #3a4a49; --muted: #68756f; --line: #e7e3dc;
  --accent: #0f766e; --accent-soft: #e2f1ee; --peach: #f2a08f; --peach-soft: #fde8e3; --warm: #c2410c;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --glass: rgba(255, 255, 255, .78);
  --top: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 520px at 8% -8%, #d3ede6 0, transparent 62%), radial-gradient(760px 520px at 100% 0, #fde4dd 0, transparent 58%), radial-gradient(700px 500px at 60% 110%, #e9f3ef 0, transparent 60%), var(--bg); background-attachment: fixed; }
body.locked { overflow: hidden; }
a { color: inherit; }
button { font: inherit; }
.nojs { padding: 20px; }
.logo { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: #fff; }

/* ---------- intro ---------- */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; padding: 24px;
  background: radial-gradient(800px 520px at 50% 38%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 70%), radial-gradient(900px 560px at 8% 0, #cfeae2 0, transparent 60%), radial-gradient(800px 560px at 100% 100%, #fcdcd3 0, transparent 60%), var(--bg);
  transition: opacity .8s ease, transform .8s ease, visibility .8s; --px: 0; --py: 0; }
.intro.gone { opacity: 0; transform: scale(1.04); visibility: hidden; pointer-events: none; }
.i-brand { position: absolute; left: clamp(16px, 3vw, 36px); top: 18px; display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.i-center { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 640px; }
.i-fig { position: relative; display: grid; place-items: end center; height: clamp(190px, 38vh, 360px); margin-bottom: 6px; transform: translate(calc(var(--px) * 10px), calc(var(--py) * 7px)); transition: transform .25s ease-out; }
.i-fig::before { content: ""; position: absolute; left: 50%; bottom: 4%; width: 118%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fff 0, #fde8e3 55%, rgba(253, 232, 227, 0) 72%); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateX(-50%) scale(1.05); } }
.i-fig .nami { 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); } }
.i-kick { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 14px 0 10px; }
.intro h1 { margin: 0 0 14px; font-size: clamp(40px, 7.4vw, 88px); line-height: .98; letter-spacing: -.045em; font-weight: 800; }
.intro h1 span { background: linear-gradient(100deg, var(--accent), #14a094 45%, #e57c68); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro p { margin: 0 0 26px; font-size: clamp(15px, 1.6vw, 18px); line-height: 1.55; color: var(--body); max-width: 520px; }
.cta { display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer; padding: 17px 30px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 750; font-size: 16.5px; letter-spacing: -.005em; box-shadow: 0 14px 34px rgba(22, 40, 42, .28); transition: transform .25s, box-shadow .25s; animation: pulse 2.6s ease-in-out infinite; }
.cta:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 20px 40px rgba(22, 40, 42, .32); }
@keyframes pulse { 0%, 100% { box-shadow: 0 14px 34px rgba(22, 40, 42, .28), 0 0 0 0 rgba(15, 118, 110, .35); } 50% { box-shadow: 0 14px 34px rgba(22, 40, 42, .28), 0 0 0 14px rgba(15, 118, 110, 0); } }
.i-note { margin-top: 16px; font-size: 13px; color: var(--muted); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.orbs { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; left: var(--x); top: var(--y); width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: rgba(255, 255, 255, .92); box-shadow: 0 12px 30px rgba(22, 40, 42, .12), 0 0 0 1px rgba(22, 40, 42, .05); pointer-events: auto;
  transform: translate(calc(var(--px) * var(--d) * 1px), calc(var(--py) * var(--d) * 1px)); transition: transform .3s ease-out; }
.orb > div { display: grid; place-items: center; width: 100%; height: 100%; animation: floaty var(--t, 6s) ease-in-out infinite; animation-delay: var(--dl, 0s); }
.orb img { width: 38px; height: 38px; border-radius: 8px; }
.orb span { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--body); white-space: nowrap; opacity: .0; transition: opacity .2s; }
.orb:hover span { opacity: 1; }
@keyframes floaty { 50% { transform: translateY(-5px); } }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 18px; padding: 0 clamp(14px, 2.2vw, 30px); backdrop-filter: blur(14px); background: rgba(250, 249, 246, .72); border-bottom: 1px solid rgba(231, 227, 220, .7); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.tabs { flex: 1; display: flex; justify-content: center; gap: 4px; min-width: 0; }
.tabs button { border: 0; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 700; padding: 9px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tabs button:hover { color: var(--ink); background: rgba(22, 40, 42, .05); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.toplink { font-size: 13.5px; font-weight: 650; color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.toplink:hover { background: rgba(22, 40, 42, .05); color: var(--ink); }

/* ---------- stage ---------- */
main { max-width: 1680px; margin: 0 auto; }
.stage { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 22px; padding: 18px clamp(14px, 2.2vw, 30px) 26px; height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); min-height: 640px; }
.guide { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.figure { position: relative; flex: 1 1 0; min-height: 150px; max-height: 330px; display: flex; justify-content: center; align-items: flex-end; }
.figure::before { content: ""; position: absolute; left: 50%; bottom: 0; height: 104%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 50% 42%, #fff 0, #fde8e3 58%, rgba(253, 232, 227, 0) 72%); }
.nami { position: relative; flex: none; aspect-ratio: 400 / 450; height: 100%; filter: drop-shadow(0 12px 16px rgba(28, 25, 23, .16)); transform-origin: 50% 100%; }
.nami img { display: block; width: 100%; height: 100%; }
.nami .mouth, .nami .lids { display: none; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nami.talk .mouth { display: block; }
.nami.blink .lids { display: block; }
.figure .nami { animation: breath 6s ease-in-out infinite; }
@keyframes breath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }
.bubble { position: relative; padding: 16px 20px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 16px 40px rgba(28, 25, 23, .09); font-size: 16px; line-height: 1.52; color: var(--ink); max-height: 36vh; overflow: auto; }
.bubble::before { content: ""; position: absolute; left: 50%; top: -7px; width: 14px; height: 14px; margin-left: -7px; background: #fff; transform: rotate(45deg); border-radius: 3px 0 0 0; opacity: .9; }
.bubble .part { display: block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.bubble b { font-weight: 700; color: var(--accent); }
.bubble.pop { animation: rise .45s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ctl { display: flex; align-items: center; gap: 8px; }
.ibtn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s, opacity .2s; }
.ibtn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(28, 25, 23, .12); border-color: #cfc9bd; }
.ibtn:disabled { opacity: .35; cursor: default; transform: none; box-shadow: none; }
.ibtn.play { width: 50px; height: 50px; background: var(--ink); color: #fff; border-color: var(--ink); }
.ibtn.play .i-play, .ibtn.play.paused .i-pause { display: none; }
.ibtn.play.paused .i-play { display: block; }
#voice .i-off, #voice.off .i-on { display: none; }
#voice.off .i-off { display: block; }
.prog { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 0 4px; }
.track { height: 6px; border-radius: 999px; background: rgba(22, 40, 42, .09); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #e57c68); transition: width .5s ease; }
.prog span { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

.panel { margin-top: auto; padding: 16px 18px 16px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 16px 40px rgba(28, 25, 23, .07); max-height: 34vh; overflow: auto; animation: rise .4s ease both; }
.panel[hidden] { display: none; }
.panel .kick { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.panel h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.02em; }
.panel p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; color: var(--body); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 3px 9px 3px 4px; border-radius: 999px; background: rgba(22, 40, 42, .05); color: var(--body); }
.chip img { width: 18px; height: 18px; border-radius: 4px; display: block; }
.panel details { margin-top: 10px; font-size: 13px; color: var(--body); }
.panel summary { cursor: pointer; font-weight: 700; color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.panel ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; }
.panel .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 700; font-size: 13.5px; padding: 9px 15px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.panel .go:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(28, 25, 23, .18); }

.board { position: relative; min-height: 0; border-radius: 28px; background: rgba(255, 255, 255, .66); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 24px 60px rgba(28, 25, 23, .09); overflow: hidden; background-image: radial-gradient(rgba(22, 40, 42, .09) 1px, transparent 1px); background-size: 24px 24px; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.legend { position: absolute; left: 18px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; font-weight: 650; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 26px; height: 0; border-top: 2.5px solid #6b7775; }
.legend i.l-ev { border-top: 2.5px dashed var(--peach); }

/* map pieces */
.node { cursor: pointer; transition: opacity .3s; outline: none; }
.node .box { fill: #fff; stroke: #d9d4c9; stroke-width: 1.6; transition: stroke .25s, fill .25s, filter .25s; }
.node:hover .box, .node:focus-visible .box { stroke: var(--ink); }
.node.sel .box { stroke: var(--accent); stroke-width: 2.4; }
.node.on .box { stroke: var(--accent); stroke-width: 3; fill: #f1faf8; filter: drop-shadow(0 8px 14px rgba(15, 118, 110, .22)); }
.node .t1 { font-size: 21px; font-weight: 750; fill: #16282a; letter-spacing: -.01em; }
.node .t2 { font-size: 15px; fill: #5f6d6a; }
.client .box { fill: #f6f4ee; }
.has-active .node:not(.on) { opacity: .58; }
.has-active .bus:not(.on) { opacity: .5; }
.bus rect { fill: #fff4ef; stroke: var(--peach); stroke-width: 2; }
.bus.on rect { fill: #fde8e3; stroke: #e57c68; stroke-width: 3; }
.bus text { font-size: 13px; font-weight: 800; letter-spacing: .14em; fill: #b4553f; }
.edge { fill: none; stroke: #c9c4b8; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transition: opacity .3s; }
.edge.ev { stroke: #f0c1b6; stroke-dasharray: 6 6; }
.has-active .edge:not(.act) { opacity: .5; }
.edge.act { stroke: #3b4a49; stroke-width: 3.4; opacity: 1; }
.edge.act.ev { stroke: #e57c68; stroke-dasharray: 8 7; animation: flow .9s linear infinite; }
.call { fill: none; stroke: #3b4a49; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; marker-end: url(#arr); opacity: 0; }
.call.act { opacity: 1; }
.dot { fill: var(--accent); }
.dot.ev { fill: #e57c68; }
@keyframes flow { to { stroke-dashoffset: -30; } }

/* ---------- lessons ---------- */
.lessons { max-width: 1240px; margin: 0 auto; padding: clamp(36px, 6vw, 72px) clamp(14px, 2.4vw, 32px) 10px; }
.lessons h2 { margin: 0 0 6px; font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -.03em; }
.lessons .sub { margin: 0 0 22px; font-size: 15.5px; line-height: 1.55; color: var(--body); max-width: 720px; }
.lessons .sub a { color: var(--accent); font-weight: 650; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.lcard { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 10px 28px rgba(28, 25, 23, .05); text-decoration: none; transition: transform .25s, box-shadow .25s; }
.lcard:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(28, 25, 23, .11); }
.lcard .n { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lcard h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.lcard p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--body); flex: 1; }
.lcard .pieces { display: flex; gap: 5px; margin-top: 6px; }
.lcard .pieces img { width: 22px; height: 22px; border-radius: 5px; }
.lcard .go { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.outro { max-width: 1240px; margin: 40px auto 0; padding: 22px clamp(14px, 2.4vw, 32px) 40px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--muted); }
.outro p { margin: 0 0 6px; }
.outro a { font-weight: 650; }

@media (prefers-reduced-motion: reduce) { .cta, .i-fig .nami, .i-fig::before, .orb > div, .figure .nami.talk, .edge.act.ev { animation: none; } }

/* ---------- smaller screens ---------- */
@media (max-height: 760px) and (min-width: 1001px) { .figure { max-height: 240px; } .bubble { font-size: 15px; } }
@media (max-width: 1000px) {
  .top { flex-wrap: wrap; height: auto; padding: 10px 14px; row-gap: 6px; }
  .tabs { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .toplink { margin-left: auto; }
  .stage { display: block; height: auto; min-height: 0; padding-top: 12px; }
  .guide { display: grid; grid-template-columns: 92px 1fr; grid-template-areas: "fig bub" "ctl ctl" "pan pan"; gap: 10px 12px; align-items: end; }
  .figure { grid-area: fig; flex: none; height: 104px; min-height: 0; max-height: none; }
  .bubble { grid-area: bub; max-height: none; font-size: 14.5px; padding: 12px 14px; }
  .bubble::before { left: -6px; top: auto; bottom: 18px; margin: 0; }
  .ctl { grid-area: ctl; }
  .panel { grid-area: pan; margin-top: 0; max-height: none; }
  .board { margin-top: 14px; height: auto; overflow-x: auto; scroll-behavior: smooth; }
  #map { position: relative; inset: auto; width: 1080px; height: auto; aspect-ratio: 1300 / 880; }
  .legend { position: sticky; left: 12px; }
  .orb { width: 48px; height: 48px; border-radius: 15px; } .orb img { width: 28px; height: 28px; } .orb span { display: none; }
}
@media (max-width: 560px) { .bname { display: none; } .tabs button { padding: 8px 11px; font-size: 13px; } .cta { padding: 15px 24px; } }
