/* ============ Playful layer: transitions, wavy links, sound toggle, strings ============ */

/* smooth page-to-page transitions (Chrome, Edge, Safari 18+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } }

/* wavy underline that ripples on hover */
.wavy { position: relative; text-decoration: none; padding-bottom: 6px; background-image: var(--wave); background-repeat: repeat-x; background-position: 0 100%; background-size: 16px 6px; transition: background-position .6s linear, color .2s; }
.wavy:hover { background-position: 32px 100%; color: var(--accent); }
:root { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='6' viewBox='0 0 16 6'%3E%3Cpath d='M0 3 Q4 0 8 3 T16 3' fill='none' stroke='%23ff4a1c' stroke-width='1.4'/%3E%3C/svg%3E"); }
.top nav a.wavy { padding-bottom: 5px; background-size: 16px 6px; background-image: none; }
.top nav a.wavy:hover { background-image: var(--wave); }
.top nav a.wavy::after { display: none; }

/* sound toggle in the header */
.snd { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: border-color .2s, transform .3s var(--ease); }
.snd:hover { border-color: var(--ink-3); transform: scale(1.06); }
.snd svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.snd .w { transition: opacity .2s; }
.snd[aria-pressed="false"] .w { opacity: 0; }
.snd[aria-pressed="true"] .x { opacity: 0; }
@media (max-width: 560px) { .snd { width: 30px; height: 30px; } }

/* headline words rise in */
.rise-w { display: inline-block; opacity: 0; transform: translateY(.45em) rotate(2deg); filter: blur(6px); transition: opacity .7s var(--ease), transform .8s var(--ease), filter .7s var(--ease); }
.rise-on .rise-w { opacity: 1; transform: none; filter: none; }

/* the strings: an untangled harp you can play */
.strings-wrap { position: relative; margin-top: 30px; border-top: 1px solid var(--line); }
.strings-head { max-width: calc(var(--col) + 64px); margin: 0 auto; padding: 28px 32px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.strings-head p { font: 650 clamp(22px, 3vw, 30px)/1.1 var(--serif); letter-spacing: -.03em; }
.strings-head small { font: 400 12.5px var(--mono); color: var(--ink-3); }
.strings { display: block; width: 100%; height: 230px; touch-action: pan-y; cursor: crosshair; }
@media (max-width: 560px) { .strings-head { padding: 22px 16px 0; } .strings { height: 180px; } }
