/* Ayosweedy — one page, dark, no external assets. */

:root {
    --bg: #0b0b0c;
    --bg-glow: #17171d;
    --fg: #f2f2f3;
    --muted: #9a9aa0;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #7c83ff;
    --letter: clamp(34px, 5.6vw, 58px); /* height of the letters in a wordmark */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(120% 80% at 50% -10%, var(--bg-glow) 0%, var(--bg) 62%) no-repeat var(--bg);
    color: var(--fg);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* the home page is one screen; pages below override it */
    overscroll-behavior: none;
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    padding: 12px 18px;
    background: var(--fg);
    color: var(--bg);
    border-radius: 0 0 10px 0;
    z-index: 10;
}
.skip:focus {
    left: 0;
}

/* ---------- header ---------- */

.head {
    flex: none;
    display: flex;
    justify-content: center;
    padding: clamp(28px, 6vh, 64px) 20px clamp(8px, 2vh, 20px);
}

.wordmark {
    position: relative;
    display: inline-block;
    margin: 0;
    line-height: 0;
    isolation: isolate;
}

.wordmark img {
    display: block;
    width: clamp(132px, 24vw, 240px);
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    /* Glow follows the letterforms, not a box behind them. */
    filter: drop-shadow(0 0 22px rgba(190, 205, 255, 0.18)) drop-shadow(0 3px 14px rgba(0, 0, 0, 0.7));
    animation:
        wag-in 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both,
        wag-breathe 6.5s ease-in-out 1.2s infinite;
}

/* Ambient halo behind the logo, breathing slowly. */
.wordmark::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 165%;
    height: 280%;
    transform: translate(-50%, -50%);
    background: radial-gradient(closest-side, rgba(170, 185, 255, 0.07), rgba(170, 185, 255, 0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: wag-halo 6.5s ease-in-out 1.2s infinite;
}

/* A specular sweep across the metal, masked by the logo itself. */
.wordmark::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        104deg,
        transparent 40%,
        rgba(255, 255, 255, 0.35) 47%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 0.35) 53%,
        transparent 60%
    );
    background-size: 260% 100%;
    mix-blend-mode: screen;
    background-repeat: no-repeat;
    background-position: 170% 0;
    -webkit-mask-image: image-set(url("/logos/wag1.avif") type("image/avif"), url("/logos/wag1.webp") type("image/webp"));
    mask-image: image-set(url("/logos/wag1.avif") type("image/avif"), url("/logos/wag1.webp") type("image/webp"));
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    pointer-events: none;
    animation: wag-shine 7s ease-in-out 1.6s infinite;
}

@keyframes wag-in {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes wag-halo {
    0%,
    100% {
        opacity: 0.45;
    }
    50% {
        opacity: 1;
    }
}

/* The glow itself breathes: the letters brighten and fade, slowly. */
@keyframes wag-breathe {
    0%,
    100% {
        filter: drop-shadow(0 0 14px rgba(190, 205, 255, 0.1)) drop-shadow(0 3px 14px rgba(0, 0, 0, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 32px rgba(200, 212, 255, 0.3)) drop-shadow(0 3px 14px rgba(0, 0, 0, 0.7));
    }
}

@keyframes wag-shine {
    0% {
        background-position: 170% 0;
    }
    38%,
    100% {
        background-position: -70% 0;
    }
}

/* ---------- stage + floating wordmarks ---------- */

.stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The list always fills the stage, in both layouts: if its box changed when
   float.js takes over, that alone would be a layout shift. */
.marks {
    position: absolute;
    inset: 0;
    list-style: none;
    margin: 0;
    padding: 0 clamp(16px, 5vw, 48px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 4vw, 44px);
    width: 100%;
}

.mark-cell {
    display: flex;
}

.mark {
    display: block;
    /* Width follows the letter height: --ratio is the wordmark's width per line
       of letters, written into the markup by the build from the image itself. */
    width: calc(var(--letter) * var(--ratio) * var(--boost));
    max-width: min(76vw, 420px);
    --ratio: 3;
    --boost: 1;
    text-decoration: none;
    color: var(--fg);
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none; /* no iOS link-preview popover on a press */
    opacity: 0.86;
    transition: opacity 240ms ease, transform 140ms ease-out;
}

.mark--lg {
    --boost: 1.18;
}

.mark--xl {
    --boost: 1.5;
}

.mark img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    transition: filter 260ms ease;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.mark[data-logo="umbra"] img {
    filter: drop-shadow(0 0 9px rgba(242, 242, 243, 0.2));
    animation: umbra-breathe 5.8s ease-in-out infinite;
}

.mark[data-logo="umbra"]:hover img,
.mark[data-logo="umbra"]:focus-visible img,
.mark[data-logo="umbra"].is-held img {
    animation: umbra-hover 260ms ease-out forwards;
}

@keyframes umbra-breathe {
    0%, 100% { filter: drop-shadow(0 0 7px rgba(242, 242, 243, 0.14)); }
    50% { filter: drop-shadow(0 0 15px rgba(242, 242, 243, 0.3)); }
}

@keyframes umbra-hover {
    to { filter: drop-shadow(0 0 24px rgba(242, 242, 243, 0.42)); }
}

.mark-text {
    display: block;
    font-size: clamp(18px, 2.4vw, 28px);
    letter-spacing: -0.02em;
    text-align: center;
}

.mark:hover {
    opacity: 1;
}

.mark:hover img,
.mark:focus-visible img,
.mark.is-held img {
    filter: drop-shadow(0 0 20px rgba(205, 215, 255, 0.35));
}

.mark:active {
    transform: scale(0.98);
    transition-duration: 80ms;
}

.mark:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 10px;
    border-radius: 6px;
    opacity: 1;
}

/* Physics mode: float.js positions each wordmark itself. */
.physics .marks {
    display: block;
    padding: 0;
}

.physics .mark-cell {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
    transition: opacity 300ms ease;
}

/* While float.js works out the first positions the wordmarks are invisible:
   the switch from the static list to physics would otherwise be a visible jump. */
.marks-placing .mark-cell {
    opacity: 0;
    transition: none;
}

.physics .mark.is-held {
    opacity: 1;
}

/* ---------- footer ---------- */

.foot {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    align-items: center;
    justify-content: space-between;
    padding: 18px clamp(16px, 4vw, 40px) max(18px, env(safe-area-inset-bottom));
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.foot-links {
    display: flex;
    gap: 18px;
}

.foot a {
    color: var(--muted);
    text-decoration: none;
    padding: 4px 0;
}

.foot a:hover {
    color: var(--fg);
}

.foot a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

.copy {
    margin: 0;
}

/* ---------- text pages (privacy, terms, legal, license, 404) ---------- */

body.page {
    overflow: auto;
}

.doc {
    flex: 1 1 auto;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(32px, 7vh, 72px) clamp(20px, 5vw, 40px) 64px;
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: -0.003em;
}

.doc a {
    color: var(--fg);
    text-underline-offset: 3px;
}

.doc a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.doc h1 {
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0 0 8px;
}

.doc h2 {
    font-size: clamp(19px, 2.4vw, 23px);
    letter-spacing: -0.02em;
    margin: 40px 0 10px;
}

.doc .updated {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 32px;
}

.doc ul {
    padding-left: 20px;
}

.doc li {
    margin: 6px 0;
}

.doc .fill {
    color: #ffd166;
    background: rgba(255, 209, 102, 0.1);
    border-radius: 4px;
    padding: 0 4px;
}

.doc .back {
    display: inline-block;
    margin-bottom: 28px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.doc .back:hover {
    color: var(--fg);
}

.doc .note {
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

/* ---------- 404 ---------- */

.notfound {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 40px 20px;
}

.notfound h1 {
    font-size: clamp(32px, 6vw, 56px);
    letter-spacing: -0.03em;
    margin: 0 0 12px;
}

.notfound p {
    color: var(--muted);
    margin: 0 0 28px;
}

.notfound a {
    color: var(--fg);
    text-underline-offset: 4px;
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
    .mark[data-logo="umbra"] img { animation: none; }
    .bubble,
    .bubble:active {
        transition: none;
        transform: none;
    }
}

/* generated by tools/build.mjs — width per line of letters for each wordmark */
.mark[data-logo="loops"] { --ratio: 2.31; }
.mark[data-logo="beats"] { --ratio: 2.4; }
.mark[data-logo="multikit"] { --ratio: 2.86; }
.mark[data-logo="chord-theory"] { --ratio: 4.14; }
.mark[data-logo="grid-beat"] { --ratio: 3.05; }
.mark[data-logo="umbra"] { --ratio: 2.2; }
.mark[data-logo="salute-beat"] { --ratio: 3.38; }
.mark[data-logo="abuse-beat"] { --ratio: 3.3; }
