/* WAYL site — built on the egenesio.com design system (Syne + DM Mono, hairlines, rows),
   with WAYL's violet as the accent. Mobile first: base styles are the phone layout. */

/* Fonts are hosted here (SIL Open Font License, see assets/fonts) so no third party sees visitors. */
@font-face { font-family: "Syne"; src: url("assets/fonts/syne-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("assets/fonts/dm-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("assets/fonts/dm-mono-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; }

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
    --bg: #0a0a0a;
    --bg-raise: #121214;
    --nav-bg: rgba(10, 10, 10, 0.88);
    --line: rgba(255, 255, 255, 0.08);
    --line-hi: rgba(255, 255, 255, 0.16);
    --text: #efefef;
    --mid: #8d8d96;
    --dim: #5c5c66;
    --accent: #a08bff;
    --accent-lo: rgba(160, 139, 255, 0.14);
    --live: #ff5c8a;
    --ok: #4ade80;
    --code-bg: #111114;
    --syne: "Syne", ui-sans-serif, system-ui, sans-serif;
    --mono: "DM Mono", ui-monospace, Menlo, Consolas, monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --pad: 1.5rem;
    --nav-h: 56px;
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #fafafa;
    --bg-raise: #f1f1f4;
    --nav-bg: rgba(250, 250, 250, 0.9);
    --line: rgba(0, 0, 0, 0.08);
    --line-hi: rgba(0, 0, 0, 0.16);
    --text: #17171a;
    --mid: #55555f;
    --dim: #8a8a94;
    --accent: #5b3df5;
    --accent-lo: rgba(91, 61, 245, 0.1);
    --live: #e0336a;
    --ok: #1f8a4c;
    --code-bg: #16161a;
    color-scheme: light;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: #0a0a0a; }
code {
    font-family: var(--mono);
    font-size: 0.88em;
    color: var(--text);
    background: var(--accent-lo);
    padding: 0.08em 0.4em;
    border-radius: 3px;
    overflow-wrap: anywhere;
}
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 0.6rem; z-index: 400; background: var(--bg); padding: 0.4rem 0.8rem; border: 1px solid var(--line-hi); }

/* ─── NAV ────────────────────────────────────────────────── */
.nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 200;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--pad);
    border-bottom: 1px solid transparent;
    transition: background 0.4s, border-color 0.4s;
}
.nav.scrolled, .nav.solid {
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: var(--line);
}
.nav__logo { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--syne); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; }
.nav__logo img { width: 24px; height: 24px; }
.nav__links { display: none; align-items: center; gap: 2rem; }
.nav__links a, .nav__links button {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--mid);
    background: none;
    border: 0;
    cursor: pointer;
    transition: color 0.25s;
}
.nav__links a:hover, .nav__links button:hover, .nav__links a[aria-current="page"] { color: var(--text); }

.nav__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-right: -8px;
    padding: 0 8px;
    background: none;
    border: 0;
    cursor: pointer;
}
.nav__burger span { display: block; height: 1px; background: var(--mid); transition: transform 0.3s var(--ease), opacity 0.3s, width 0.3s; }
.nav__burger span:nth-child(2) { width: 70%; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.drawer {
    position: fixed;
    inset: var(--nav-h) 0 0;
    z-index: 190;
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding: 1.5rem var(--pad) 2.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
.drawer.open { opacity: 1; visibility: visible; transform: none; }
.drawer a {
    font-family: var(--syne);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--dim);
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
    transition: color 0.2s;
}
.drawer a:hover, .drawer a[aria-current="page"] { color: var(--text); }
.drawer__theme {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 52px;
    padding: 0.8rem 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--line);
    font-family: var(--syne);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--mid);
    cursor: pointer;
}

.theme-icon { display: inline-flex; width: 16px; height: 16px; }
.theme-icon svg { width: 100%; height: 100%; }
.icon-sun, [data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.section { padding: 4rem var(--pad); border-bottom: 1px solid var(--line); }
.tag { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 1.6rem; }
.h2 {
    font-family: var(--syne);
    font-weight: 700;
    font-size: clamp(2rem, 8vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    max-width: 14ch;
    margin-bottom: 1.2rem;
}
.lede { color: var(--mid); max-width: 52ch; }
.lede + .lede { margin-top: 0.9rem; }
.lede strong, .row__text strong { color: var(--text); font-weight: 400; }

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: calc(var(--nav-h) + 2rem) var(--pad) 2.5rem;
    border-bottom: 1px solid var(--line);
}
.hero__q {
    font-family: var(--syne);
    font-weight: 700;
    font-size: clamp(3rem, 15vw, 9rem);
    line-height: 0.9;
    letter-spacing: -0.045em;
    margin-bottom: 1.6rem;
}
.hero__q span { display: block; }
.hero__q .dimmed { color: var(--dim); }

/* the scrobble line: WAYL's answer to the question */
.answer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.25rem 0.8rem;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.8rem;
    max-width: 640px;
}
.eq { display: flex; gap: 3px; align-items: flex-end; width: 16px; height: 16px; }
.eq i { width: 3px; height: 6px; background: var(--live); border-radius: 1px; animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.35s; }
.eq i:nth-child(3) { animation-delay: -0.7s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.answer__track {
    font-family: var(--syne);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.answer__meta { grid-column: 2; font-size: 0.78rem; color: var(--mid); }
.answer__meta b { color: var(--ok); font-weight: 400; }
.answer.swap .answer__track, .answer.swap .answer__meta { animation: swap 0.5s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero__desc { color: var(--mid); max-width: 46ch; margin-bottom: 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; align-items: center; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0 1.4rem;
    border-radius: 999px;
    background: var(--accent);
    color: #0a0a0a;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: transform 0.25s var(--ease), background 0.25s;
}
[data-theme="light"] .btn { color: #fff; }
.btn:hover { transform: translateY(-2px); }
.link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    font-size: 0.85rem;
    color: var(--mid);
    transition: color 0.25s;
}
.link .ico { color: var(--accent); transition: transform 0.25s var(--ease); display: inline-block; }
.link:hover { color: var(--text); }
.link:hover .ico { transform: translate(2px, -2px); }
.link--down:hover .ico { transform: translateY(2px); }

/* ─── ROWS (features, friend playlist, faq) ───────────────── */
.rows { border-top: 1px solid var(--line); margin-top: 2.5rem; }
.row {
    display: grid;
    gap: 0.35rem;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--line);
}
.row__title { font-family: var(--syne); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.row__text { color: var(--mid); font-size: 0.88rem; max-width: 60ch; }

/* ─── STEPS (a real sequence, so numbered) ─────────────────── */
.steps { counter-reset: step; margin-top: 2.5rem; border-top: 1px solid var(--line); }
.steps > li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr);
    gap: 0 0.6rem;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--line);
}
.steps > li::before {
    content: counter(step);
    font-family: var(--syne);
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1.1;
    color: var(--accent);
}

/* ─── SHARING ─────────────────────────────────────────────── */
.status { display: inline-block; font-size: 0.72rem; color: var(--live); border: 1px solid currentColor; border-radius: 999px; padding: 0.1rem 0.7rem; margin-bottom: 1.6rem; }
.share__list { margin-top: 2.5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-raise); }
.share__head { padding: 1.1rem 1.1rem 0.9rem; border-bottom: 1px solid var(--line); }
.share__head b { display: block; font-family: var(--syne); font-size: 1.1rem; }
.share__head span { font-size: 0.78rem; color: var(--mid); }
.share__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--line);
}
.share__row:last-child { border-bottom: 0; }
.share__row b { display: block; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share__row small { color: var(--mid); font-size: 0.75rem; }
.owned { font-size: 0.75rem; color: var(--ok); }
.missing { font-size: 0.75rem; color: var(--dim); }

/* ─── FAQ ─────────────────────────────────────────────────── */
.faq { margin-top: 2.5rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 56px;
    padding: 1rem 0;
    font-family: var(--syne);
    font-weight: 700;
    font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-weight: 300; color: var(--accent); font-size: 1.2rem; transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--mid); font-size: 0.88rem; padding-bottom: 1.3rem; max-width: 62ch; }

/* ─── CLOSING ─────────────────────────────────────────────── */
.closing .h2 { max-width: 12ch; }

footer {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 2rem var(--pad) 2.5rem;
    font-size: 0.75rem;
    color: var(--dim);
}
footer nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
footer a { color: var(--mid); min-height: 32px; display: inline-flex; align-items: center; }
footer a:hover { color: var(--text); }

/* ─── SETUP GUIDE ─────────────────────────────────────────── */
.guide-hero { padding: calc(var(--nav-h) + 3rem) var(--pad) 2.5rem; border-bottom: 1px solid var(--line); }
.guide-hero h1 {
    font-family: var(--syne);
    font-weight: 700;
    font-size: clamp(2.8rem, 13vw, 6.5rem);
    line-height: 0.92;
    letter-spacing: -0.04em;
    margin-bottom: 1.4rem;
}
.toc { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.9rem var(--pad); border-bottom: 1px solid var(--line); position: sticky; top: var(--nav-h); z-index: 50; background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc a {
    flex: none;
    font-size: 0.75rem;
    color: var(--mid);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.toc a:hover { color: var(--text); border-color: var(--line-hi); }
.toc a.active { color: var(--text); border-color: var(--accent); background: var(--accent-lo); }

.step { padding: 3rem var(--pad); border-bottom: 1px solid var(--line); }
.step__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 1rem; align-items: baseline; margin-bottom: 1.2rem; }
.step__n { font-family: var(--syne); font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--accent); }
.step__head h2 { font-family: var(--syne); font-weight: 700; font-size: clamp(1.6rem, 6vw, 2.4rem); line-height: 1.05; letter-spacing: -0.025em; }
.step__body { max-width: 680px; }
.step__body > p, .step__body li { color: var(--mid); font-size: 0.9rem; }
.step__body > p + p { margin-top: 0.8rem; }
.step__body strong { color: var(--text); font-weight: 400; }
.step__body a:not(.link) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.bullets { margin: 0.8rem 0; display: grid; gap: 0.55rem; }
.bullets li { position: relative; padding-left: 1.2rem; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
ol.bullets { counter-reset: sub; }
ol.bullets li { counter-increment: sub; padding-left: 1.6rem; }
ol.bullets li::before { content: counter(sub); width: auto; height: auto; background: none; top: 0; color: var(--accent); }
.note { margin: 1.2rem 0; padding: 1rem 1.1rem; border-left: 2px solid var(--accent); background: var(--accent-lo); font-size: 0.86rem; color: var(--mid); border-radius: 0 4px 4px 0; }
.note strong { color: var(--text); font-weight: 400; }

/* code blocks */
.code { position: relative; margin: 1rem 0; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; color: #e8e8ee; }
.code pre { overflow-x: auto; padding: 1rem 1.1rem; padding-right: 4.8rem; font: 0.84rem/1.65 var(--mono); -webkit-overflow-scrolling: touch; }
.code code { background: none; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.code .c { color: #7a7a88; }
.copy {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    min-height: 34px;
    padding: 0 0.8rem;
    font-size: 0.72rem;
    color: #b8b8c4;
    background: #1f1f25;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: -10px 0 12px var(--code-bg);
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.copy:hover { background: #2a2a32; color: #fff; }
.copy.done { color: #4ade80; }

/* .env builder */
.builder { margin: 1.4rem 0 0; border-top: 1px solid var(--line); }
.field { display: grid; gap: 0.35rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.field label { font-size: 0.82rem; color: var(--text); }
.field input {
    width: 100%;
    min-height: 44px;
    font: 0.95rem var(--mono);
    color: var(--text);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line-hi);
    border-radius: 0;
    padding: 0.4rem 0;
}
.field input:focus { outline: none; border-bottom-color: var(--accent); }
.field small, .toggle small { font-size: 0.76rem; color: var(--dim); }
.warn { font-size: 0.78rem; color: var(--live); }
.toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 1rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
.toggle span { font-size: 0.82rem; }
.toggle small { grid-column: 1; }
.toggle input {
    grid-row: 1 / span 2;
    grid-column: 2;
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid var(--line-hi);
    background: var(--bg-raise);
    position: relative;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s;
}
.toggle input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--mid);
    transition: transform 0.25s var(--ease), background 0.25s;
}
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); background: #fff; }
.mail[hidden] { display: none; }
.builder-out { margin-top: 1.6rem; }
.builder-out p { font-size: 0.82rem; color: var(--mid); }

/* tabs */
.tabs__list { display: flex; gap: 1.6rem; border-bottom: 1px solid var(--line); margin: 1.2rem 0 0.4rem; }
.tabs__list button {
    min-height: 44px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: var(--syne);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--dim);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.tabs__list button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs__panel { padding-top: 0.8rem; }
.tabs__panel[hidden] { display: none; }
.tabs__panel > p { color: var(--mid); font-size: 0.9rem; margin-top: 0.8rem; }

/* ─── ENTRANCE (hero only: one orchestrated moment) ─────────── */
.in-1, .in-2, .in-3 { opacity: 0; animation: up 0.9s var(--ease) forwards; }
.in-1 { animation-delay: 0.1s; }
.in-2 { animation-delay: 0.35s; }
.in-3 { animation-delay: 0.6s; }
@keyframes up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .in-1, .in-2, .in-3 { animation: none; opacity: 1; }
    .eq i { animation: none; height: 10px; }
    .answer.swap .answer__track, .answer.swap .answer__meta { animation: none; }
}

/* ─── TABLET+ (≥ 768px) ────────────────────────────────────── */
@media (min-width: 768px) {
    :root { --pad: 3rem; }
    .nav__burger, .drawer { display: none; }
    .nav__links { display: flex; }
    .section { padding: 6rem var(--pad); }
    .hero { padding-bottom: 4rem; justify-content: center; }
    .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; align-items: start; }
    .split .rows, .split .share__list, .split .faq, .split .steps { margin-top: 0; }
    .row { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 2rem; align-items: baseline; padding: 1.6rem 0; }
    footer { flex-direction: row; justify-content: space-between; align-items: center; }
    .guide-hero { padding-top: calc(var(--nav-h) + 5rem); }
    .guide { display: grid; grid-template-columns: 200px minmax(0, 1fr); }
    .toc {
        flex-direction: column;
        gap: 0.2rem;
        position: sticky;
        top: var(--nav-h);
        align-self: start;
        max-height: calc(100vh - var(--nav-h));
        padding: 3rem 0 3rem var(--pad);
        border-bottom: 0;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .toc a { border: 0; border-radius: 0; padding: 0.4rem 0 0.4rem 0.9rem; border-left: 1px solid var(--line); background: none; }
    .toc a.active { background: none; border-left-color: var(--accent); }
    .steps-wrap { border-left: 1px solid var(--line); }
    .step { padding: 4rem var(--pad); }
    .field.half { display: grid; }
    .field-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 2rem; }
}

/* ─── LARGE (≥ 1200px) ─────────────────────────────────────── */
@media (min-width: 1200px) {
    :root { --pad: 5rem; }
    .section { padding: 7rem var(--pad); }
    .guide { grid-template-columns: 240px minmax(0, 1fr); }
}
