/* How it works — the explainer. Colours come from the section (--c1 / --c2). */
.how { display: grid; gap: 18px; }
.how-stage { position: relative; overflow: hidden; padding: clamp(20px, 3vw, 34px); border-radius: 26px; background: rgba(8, 8, 14, 0.6); border: 1px solid var(--glass-line, rgba(255, 255, 255, 0.12)); box-shadow: 0 30px 80px -40px #000; backdrop-filter: blur(14px); }
.how-bg { position: absolute; inset: 0; z-index: 0; opacity: 0.35; background: radial-gradient(60% 80% at 15% 20%, color-mix(in oklab, var(--c1) 40%, transparent), transparent 70%), radial-gradient(60% 80% at 90% 80%, color-mix(in oklab, var(--c2) 40%, transparent), transparent 70%); animation: howBg 9s ease-in-out infinite alternate; }
@keyframes howBg { to { transform: scale(1.12) rotate(2deg); } }
.how-nodes { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 64px 1fr 64px 1fr; align-items: stretch; }
@media (max-width: 860px) { .how-nodes { grid-template-columns: 1fr; gap: 6px; } .hn-wire { height: 36px; } }

.hn { position: relative; display: grid; align-content: start; gap: 12px; min-height: 236px; padding: 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.045); border: 1.5px solid rgba(255, 255, 255, 0.1); opacity: 0.3; transform: scale(0.97); transition: opacity 500ms, transform 500ms var(--ease-out), border-color 500ms, box-shadow 500ms; }
.hn-h { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.hn-h .mark { width: 16px; height: 16px; }
.hn-h em { margin-left: auto; padding: 1px 8px; border-radius: 6px; font-style: normal; font-size: 0.6rem; background: linear-gradient(100deg, #f472b6, #a855f7); color: #fff; }

/* a node is "on" from its own step onward; the current one glows */
.how[data-step="0"] .hn-sp, .how[data-step="1"] .hn-sp, .how[data-step="2"] .hn-sp,
.how[data-step="1"] .hn-ly, .how[data-step="2"] .hn-ly,
.how[data-step="2"] .hn-dc { opacity: 1; transform: none; }
.how[data-step="0"] .hn-sp { border-color: #1db954; box-shadow: 0 0 44px -12px #1db954; }
.how[data-step="1"] .hn-ly { border-color: var(--c1); box-shadow: 0 0 44px -12px var(--c1); }
.how[data-step="2"] .hn-dc { border-color: #7983f5; box-shadow: 0 0 44px -12px #5865f2; }

/* wires and the travelling pulse */
.hn-wire { position: relative; display: grid; place-items: center; }
.hn-wire::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.hn-wire::after { content: ""; position: absolute; left: 0; top: 50%; height: 2px; width: 0; border-radius: 2px; background: linear-gradient(90deg, var(--c1), var(--c2)); transition: width 700ms var(--ease-out); }
.how[data-step="1"] .w1::after, .how[data-step="2"] .w1::after, .how[data-step="2"] .w2::after { width: 100%; }
.hp { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 16px 3px var(--c1); opacity: 0; }
.how.replay[data-step="1"] .w1 .hp { animation: howPulse 900ms 100ms ease-in-out; }
.how.replay[data-step="2"] .w2 .hp { animation: howPulse 900ms 100ms ease-in-out; }
@keyframes howPulse { 0% { opacity: 0; left: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; left: calc(100% - 12px); } }

/* step 1: the player */
.hn-song { display: flex; align-items: center; gap: 12px; }
.hn-art { flex: none; width: 54px; height: 54px; border-radius: 12px; background: #333 url(img/album-amber.jpg) center / cover; box-shadow: 0 10px 22px -10px #000; }
.hn-song b { display: block; font-size: 0.98rem; } .hn-song small { color: rgba(255, 255, 255, 0.6); font-size: 0.8rem; }
.hn-eq { display: flex; align-items: flex-end; gap: 4px; height: 44px; }
.hn-eq i { flex: 1; border-radius: 3px; background: #1db954; height: 30%; animation: howEq 900ms ease-in-out infinite alternate; }
.hn-eq i:nth-child(1) { animation-delay: 0s; } .hn-eq i:nth-child(2) { animation-delay: 0.12s; } .hn-eq i:nth-child(3) { animation-delay: 0.24s; } .hn-eq i:nth-child(4) { animation-delay: 0.08s; } .hn-eq i:nth-child(5) { animation-delay: 0.3s; } .hn-eq i:nth-child(6) { animation-delay: 0.18s; } .hn-eq i:nth-child(7) { animation-delay: 0.36s; } .hn-eq i:nth-child(8) { animation-delay: 0.05s; } .hn-eq i:nth-child(9) { animation-delay: 0.22s; } .hn-eq i:nth-child(10) { animation-delay: 0.14s; }
@keyframes howEq { to { height: 100%; } }
.hn-clock { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: rgba(255, 255, 255, 0.6); }
.hn-clock b { color: #1db954; font-variant-numeric: tabular-nums; }
.hn-clock u { flex: 1; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; text-decoration: none; }
.hn-clock u s { display: block; height: 100%; width: 22%; background: #1db954; animation: howBarGrow 60s linear infinite; }
@keyframes howBarGrow { to { width: 100%; } }

/* step 2: the timed lyric */
.hn-lines { display: grid; gap: 8px; }
.hn-lines p { margin: 0; font-size: 0.86rem; color: rgba(255, 255, 255, 0.35); line-height: 1.35; }
.hn-lines p.now { font-size: 1.08rem; font-weight: 800; color: #fff; }
.hn-lines p.now span { display: inline-block; color: rgba(255, 255, 255, 0.3); }
.how.replay[data-step="1"] .hn-lines p.now span, .how.replay[data-step="2"] .hn-lines p.now span { animation: howWord 600ms calc(var(--i) * 280ms + 350ms) ease-out forwards; }
.how:not(.replay) .hn-lines p.now span { color: #fff; }
@keyframes howWord { to { color: #fff; text-shadow: 0 0 14px var(--c1); } }
.hn-find { display: inline-flex; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 700; color: var(--c1); }
.hn-find i { width: 8px; height: 8px; border-radius: 50%; background: var(--c1); animation: tpPulse 1.1s infinite; }

/* step 3: Discord */
.hn-prof { display: flex; align-items: center; gap: 10px; }
.hn-av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, #8ee7e1, #fcd3e8 55%, #b39bff); position: relative; }
.hn-av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #23a55a; border: 3px solid #1b1c20; }
.hn-prof b { font-size: 0.95rem; }
.hn-bubble { display: inline-block; max-width: 100%; padding: 8px 12px; border-radius: 14px 14px 14px 3px; font-size: 0.84rem; background: #1e1f22; border: 1px solid #2b2d31; }
.hn-bubble span { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; max-width: 0; }
.how.replay[data-step="2"] .hn-bubble span { animation: howType 1.8s 700ms steps(30) forwards; }
.how:not(.replay) .hn-bubble span { max-width: 100%; }
@keyframes howType { to { max-width: 17em; } }
.hn-act { padding: 10px; border-radius: 12px; background: #1a1b1e; border: 1px solid #26282c; }
.hn-act small { display: block; margin-bottom: 7px; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; color: #b5bac1; }
.hn-act div { display: flex; align-items: center; gap: 9px; font-size: 0.8rem; } .hn-act em { display: block; font-style: normal; color: #b5bac1; font-size: 0.72rem; }
.hn-act i { flex: none; width: 36px; height: 36px; border-radius: 6px; background: #333 url(img/album-amber.jpg) center / cover; }

/* the chapter cards */
.how-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0; }
@media (max-width: 760px) { .how-steps { grid-template-columns: 1fr; } }
.how-step { all: unset; box-sizing: border-box; position: relative; display: block; overflow: hidden; cursor: pointer; padding: 18px 18px 22px; border-radius: 20px; background: var(--glass, rgba(255, 255, 255, 0.055)); border: 1px solid var(--glass-line, rgba(255, 255, 255, 0.12)); transition: transform 300ms var(--ease-out), border-color 300ms, background 300ms; }
.how-step:hover { transform: translateY(-4px); }
.how-step:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; }
.how-step .step-n { margin-bottom: 8px; opacity: 0.55; transition: opacity 300ms, transform 400ms var(--ease-spring); }
.how-step h3 { margin: 0 0 4px; font-size: 1.08rem; letter-spacing: -0.015em; }
.how-step p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
.how-step.active { border-color: color-mix(in oklab, var(--c1) 60%, transparent); background: color-mix(in oklab, var(--c1) 8%, rgba(255, 255, 255, 0.04)); }
.how-step.active .step-n { opacity: 1; transform: scale(1.18); }
.how-step.done .step-n { opacity: 0.9; }
.hs-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.06); }
.hs-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.how-step.done .hs-bar i { width: 100%; animation: none !important; }
@keyframes howFill { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .how-bg, .hn-eq i, .hn-clock u s, .hn-find i { animation: none !important; } }

/* ---- tidier layout: each step is one column (picture on top, words below) ---- */
.how-stage { padding: clamp(18px, 2.6vw, 30px); }
.how-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr) 56px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 0; row-gap: 16px; }
.how-grid > .hn-sp { grid-column: 1; grid-row: 1; } .how-grid > .w1 { grid-column: 2; grid-row: 1; } .how-grid > .hn-ly { grid-column: 3; grid-row: 1; } .how-grid > .w2 { grid-column: 4; grid-row: 1; } .how-grid > .hn-dc { grid-column: 5; grid-row: 1; }
.how-grid > .s1 { grid-column: 1; grid-row: 2; } .how-grid > .s2 { grid-column: 3; grid-row: 2; } .how-grid > .s3 { grid-column: 5; grid-row: 2; }
.how-grid .hn { min-height: 262px; opacity: 0.45; }
.how-step { background: transparent; border-color: transparent; padding: 14px 8px 20px; }
.how-step .step-n { margin-bottom: 8px; }
.how-step p { font-size: 0.88rem; }
.how-step.s1.active { border-color: #1db954; background: rgba(29, 185, 84, 0.08); }
.how-step.s2.active { border-color: var(--c1); background: color-mix(in oklab, var(--c1) 8%, transparent); }
.how-step.s3.active { border-color: #7983f5; background: rgba(88, 101, 242, 0.1); }
.how-step.s1 .hs-bar i { background: #1db954; } .how-step.s3 .hs-bar i { background: linear-gradient(90deg, #5865f2, #a56bff); }
.how-step .step-n { background: rgba(255, 255, 255, 0.16); color: #fff; }
.how-step.s1.active .step-n, .how-step.s1.done .step-n { background: #1db954; color: #04140a; }
.how-step.s2.active .step-n, .how-step.s2.done .step-n { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #04141a; }
.how-step.s3.active .step-n, .how-step.s3.done .step-n { background: linear-gradient(135deg, #5865f2, #a56bff); color: #fff; }

/* thicker wires with a chevron at the end */
.how-grid .hn-wire { align-self: start; height: 262px; }
.how-grid .hn-wire::before, .how-grid .hn-wire::after { height: 3px; }
.wchev { position: absolute; right: -2px; top: 50%; translate: 0 -54%; font-size: 1.7rem; line-height: 1; font-weight: 900; color: rgba(255, 255, 255, 0.22); transition: color 400ms; }
.how[data-step="1"] .w1 .wchev, .how[data-step="2"] .w1 .wchev, .how[data-step="2"] .w2 .wchev { color: var(--c1); }

/* the player picture: taller, thinner equaliser bars */
.hn-eq { height: 64px; gap: 5px; }
.hn-eq i { border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #4fe38a, #1db954); }
.hn-song { padding-bottom: 2px; }
.hn-ly .hn-lines { align-content: center; min-height: 150px; }
.hn-dc .hn-act { margin-top: auto; }

@media (max-width: 860px) {
  .how-grid { grid-template-columns: 1fr; row-gap: 10px; }
  .how-grid > * { grid-column: 1 !important; grid-row: auto !important; }
  .how-grid > .hn-sp { order: 1; } .how-grid > .s1 { order: 2; } .how-grid > .hn-ly { order: 4; } .how-grid > .s2 { order: 5; } .how-grid > .hn-dc { order: 7; } .how-grid > .s3 { order: 8; }
  .how-grid > .hn-wire { order: 3; height: 30px; } .how-grid > .w2 { order: 6; }
  .how-grid .hn { min-height: 0; }
  .wchev { display: none; }
}

/* ---- the arrows between the steps: one clean line, a head, and light flowing along it ---- */
.how-grid { grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr) 76px minmax(0, 1fr); }
.how-grid .hn-wire::before, .how-grid .hn-wire::after { display: none; }
.how-grid .hn-wire { display: grid; place-items: center; }
.warrow { width: 68px; height: 34px; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wa-base, .wa-head { stroke: rgba(255, 255, 255, 0.2); stroke-width: 3; transition: stroke 500ms; }
.wa-flow { stroke: url(#none); stroke: var(--c1); stroke-width: 3; stroke-dasharray: 6 10; opacity: 0; transition: opacity 500ms; }
.how[data-step="1"] .w1 .wa-flow, .how[data-step="2"] .w1 .wa-flow, .how[data-step="2"] .w2 .wa-flow { opacity: 1; animation: waFlow 700ms linear infinite; }
.how[data-step="1"] .w1 .wa-head, .how[data-step="2"] .w1 .wa-head, .how[data-step="2"] .w2 .wa-head { stroke: var(--c1); filter: drop-shadow(0 0 6px var(--c1)); }
.how[data-step="1"] .w1 .wa-base, .how[data-step="2"] .w1 .wa-base, .how[data-step="2"] .w2 .wa-base { stroke: color-mix(in oklab, var(--c1) 35%, transparent); }
.how[data-step="2"] .w2 .wa-flow { stroke: #8a95ff; }
.how[data-step="2"] .w2 .wa-head { stroke: #8a95ff; filter: drop-shadow(0 0 6px #5865f2); }
.how[data-step="2"] .w2 .wa-base { stroke: rgba(121, 131, 245, 0.35); }
.how.replay[data-step="1"] .w1 .warrow, .how.replay[data-step="2"] .w2 .warrow { animation: waPop 700ms var(--ease-spring); }
@keyframes waFlow { to { stroke-dashoffset: -16; } }
@keyframes waPop { 0% { transform: scale(0.7); } 60% { transform: scale(1.18); } 100% { transform: none; } }
.hp { display: none; }
@media (max-width: 860px) { .warrow { transform: rotate(90deg); height: 30px; } .how-grid > .hn-wire { height: 56px; } }
@media (max-width: 860px) { .how-grid { grid-template-columns: minmax(0, 1fr); } .how-grid > .hn-wire { height: 56px; } }
.hn-eq { justify-content: flex-start; } .hn-eq i { flex: 0 0 8px; max-width: 8px; }
@media (min-width: 861px) { .hn-eq { justify-content: space-between; } .hn-eq i { flex: 1; max-width: none; } }

/* a normal-looking equaliser: lots of thin bars that bounce independently */
.hn-eq { height: 46px; gap: 3px; justify-content: space-between; align-items: flex-end; padding: 0 2px; }
.hn-eq i { flex: 1 1 0; min-width: 0; max-width: 5px; height: 100%; border-radius: 3px; background: linear-gradient(180deg, #7dffb0, #1db954 70%, #0e7a37); transform-origin: bottom; transform: scaleY(var(--m, 0.4)); animation: eqBounce var(--t, 700ms) var(--d, 0s) ease-in-out infinite alternate; }
@keyframes eqBounce { to { transform: scaleY(1); } }
@media (max-width: 860px), (min-width: 861px) { .hn-eq i { flex: 1 1 0; max-width: 5px; } }
@media (prefers-reduced-motion: reduce) { .hn-eq i { animation: none; } }
