/* ---------------------------------------------------------------------------
   occasional music — house style.

   Dark, neon, and a bit loud. Per-page overrides land after this file in an
   inline <style>, so anything a friend's page might want to restyle is driven
   by the custom properties below rather than hard-coded down in the rules.
--------------------------------------------------------------------------- */

:root {
    --bg: #0b0711;
    --bg-soft: #150d20;
    --ink: #f6f0fb;
    --muted: #a99ebc;

    --accent: #ff4d8d;      /* the one a page overrides to make itself its own */
    --accent-2: #7c5cff;
    --accent-3: #22e5c8;

    --card: rgba(255, 255, 255, .045);
    --card-hi: rgba(255, 255, 255, .075);
    --line: rgba(255, 255, 255, .11);
    --glow: 0 0 32px -6px var(--accent);

    --radius: 16px;
    --sans: "Avenir Next", "Segoe UI Variable", system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- the moving backdrop ------------------------------------------------ */

/* Three slow-drifting colour blobs. Fixed and behind everything, so scrolling
   feels like moving through the light rather than past it. */
.aurora {
    position: fixed;
    inset: -30vmax;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(38vmax 38vmax at 18% 22%, color-mix(in oklab, var(--accent) 55%, transparent), transparent 62%),
        radial-gradient(42vmax 42vmax at 82% 12%, color-mix(in oklab, var(--accent-2) 50%, transparent), transparent 60%),
        radial-gradient(36vmax 36vmax at 55% 88%, color-mix(in oklab, var(--accent-3) 38%, transparent), transparent 62%);
    filter: blur(28px) saturate(140%);
    opacity: .5;
    animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
    0%   { transform: translate3d(-3%, -2%, 0) scale(1);    }
    50%  { transform: translate3d(4%, 3%, 0)   scale(1.12); }
    100% { transform: translate3d(-2%, 5%, 0)  scale(1.04); }
}

/* Film grain over the gradients — stops the big flat washes from banding. */
.grain {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .16;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .9rem 1.5rem;
    background: color-mix(in oklab, var(--bg) 72%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    text-decoration: none;
    color: var(--ink);
}

.brand-glow {
    background: linear-gradient(92deg, var(--accent), var(--accent-2) 45%, var(--accent-3));
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: hue 7s linear infinite;
}

@keyframes hue {
    to { background-position: 220% 0; }
}

/* Four bars that bounce like a level meter. Pure CSS, no gif needed. */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 1.1em; }
.eq i {
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
    animation: bounce .9s ease-in-out infinite alternate;
}
.eq i:nth-child(1) { height: 40%; animation-delay: -.5s; }
.eq i:nth-child(2) { height: 90%; animation-delay: -.2s; background: var(--accent-2); }
.eq i:nth-child(3) { height: 60%; animation-delay: -.7s; background: var(--accent-3); }
.eq i:nth-child(4) { height: 80%; animation-delay: -.35s; }

@keyframes bounce {
    from { transform: scaleY(.35); }
    to   { transform: scaleY(1);   }
}

nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: .92rem;
}
nav a, .linkish {
    position: relative;
    color: var(--muted);
    text-decoration: none;
    transition: color .18s ease;
}
nav a:not(.button)::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1.5px;
    border-radius: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .22s ease;
}
nav a:not(.button):hover { color: var(--ink); }
nav a:not(.button):hover::after { transform: scaleX(1); transform-origin: left; }

.inline-form { display: inline-flex; }
.linkish { background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
.linkish:hover { color: var(--ink); }

/* --- layout ------------------------------------------------------------- */

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    padding: 2rem 0 3rem;
    font-size: .85rem;
}

h1, h2, h3 { letter-spacing: -.025em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
h2 {
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--muted);
    font-weight: 700;
    margin-top: 3rem;
}

a { color: var(--accent); }

code {
    font-family: var(--mono);
    font-size: .85em;
    padding: .1rem .4rem;
    border-radius: 6px;
    background: var(--card-hi);
    color: var(--accent-3);
}

.messages { list-style: none; padding: .5rem 1.5rem 0; margin: 0; font-size: .9rem; }
.messages li {
    padding: .6rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
    margin-bottom: .4rem;
}
.messages .success { border-color: color-mix(in oklab, var(--accent-3) 45%, transparent); }
.messages .error { border-color: #ff6b6b; }

/* --- buttons ------------------------------------------------------------ */

.button, button[type="submit"]:not(.linkish) {
    display: inline-block;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    color: #fff;
    border: 0;
    padding: .65rem 1.35rem;
    border-radius: 999px;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--glow);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.button:hover, button[type="submit"]:not(.linkish):hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 0 40px -4px var(--accent);
}
.button:active, button[type="submit"]:not(.linkish):active { transform: translateY(0); }
.button-sm { padding: .35rem .9rem; font-size: .88rem; }

.button-ghost {
    background: var(--card-hi);
    color: var(--ink);
    box-shadow: none;
    border: 1px solid var(--line);
}
.button-ghost:hover { box-shadow: none; border-color: var(--accent); }

/* --- hero / page header ------------------------------------------------- */

.hero h1 {
    background: linear-gradient(100deg, var(--ink), var(--accent) 60%, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: .5rem;
}
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 42ch; }

.profile-hero {
    position: relative;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 2rem;
    border-radius: calc(var(--radius) + 8px);
    border: 1px solid var(--line);
    background: var(--card);
    overflow: hidden;
}

/* A page's banner (a GIF, usually) sits behind the name, dimmed enough to read
   over. Set as an inline style on the element so it can be per-page. */
.profile-hero.has-banner { min-height: 260px; align-items: flex-end; }
.profile-hero .banner {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
}
.profile-hero .banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg) 4%, color-mix(in oklab, var(--bg) 45%, transparent) 55%, transparent);
}
.profile-hero > * { position: relative; z-index: 1; }
.profile-hero h1 { margin: 0 0 .3rem; }

.avatar {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: var(--glow);
}

.bio { color: var(--muted); margin: 0 0 .6rem; }
.owner-tools { font-size: .88rem; margin: 0; }
.owner-tools a { color: var(--accent-3); text-decoration: none; }
.owner-tools a:hover { text-decoration: underline; }

.pages-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.pages-head h1 { margin: 0; }

/* --- page lists --------------------------------------------------------- */

.page-list { list-style: none; padding: 0; margin: 1rem 0; }
.page-list li {
    display: flex;
    align-items: baseline;
    gap: .7rem;
    flex-wrap: wrap;
    padding: .85rem 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.page-list li:hover {
    background: var(--card);
    border-color: var(--line);
    transform: translateX(4px);
}
.page-list li > a:first-child {
    font-weight: 650;
    font-size: 1.05rem;
    color: var(--ink);
    text-decoration: none;
}
.page-list li > a:first-child:hover { color: var(--accent); }
.page-list .ago { color: var(--muted); font-size: .78rem; margin-left: auto; }
.page-list .edit { font-size: .82rem; color: var(--accent-3); text-decoration: none; }

/* --- songs -------------------------------------------------------------- */

.song {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 1.25rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 1rem 0;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.song:hover {
    transform: translateY(-3px);
    border-color: color-mix(in oklab, var(--accent) 55%, transparent);
    background: var(--card-hi);
}

.song .cover {
    grid-row: 1 / span 4;
    width: 92px;
    height: 92px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--line);
}
.song.no-cover { grid-template-columns: 1fr; }

.song-head {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
.song.no-cover .song-head,
.song.no-cover .occasion,
.song.no-cover .song-body,
.song.no-cover audio { grid-column: 1; }

.song-head h3 { margin: 0; font-size: 1.15rem; }
.song .occasion { grid-column: 2; font-size: .82rem; color: var(--muted); margin: .2rem 0 0; }
.song .song-body { grid-column: 2; margin: .5rem 0 0; color: color-mix(in oklab, var(--ink) 80%, transparent); }

.song audio {
    grid-column: 2;
    width: 100%;
    margin-top: .85rem;
    border-radius: 999px;
    accent-color: var(--accent);
    color-scheme: dark;
}

.badge {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    background: color-mix(in oklab, var(--accent) 22%, transparent);
    border: 1px solid color-mix(in oklab, var(--accent) 50%, transparent);
    color: var(--accent);
    padding: .15rem .55rem;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

.download {
    font-size: .85rem;
    white-space: nowrap;
    color: var(--accent-3);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .2rem .75rem;
    transition: border-color .18s ease, color .18s ease;
}
.download:hover { border-color: var(--accent-3); color: var(--ink); }

.empty { color: var(--muted); font-style: italic; }

/* --- comments ----------------------------------------------------------- */

.comment {
    border-left: 2px solid color-mix(in oklab, var(--accent) 45%, transparent);
    padding: .4rem 0 .4rem 1rem;
    margin: 1rem 0;
}
.comment-meta { font-size: .78rem; color: var(--muted); margin: 0 0 .25rem; }
.comment-meta strong { color: var(--ink); font-weight: 650; }
.comment-meta .ago { margin-left: .5rem; }
.comment-meta .delete { margin-left: .5rem; color: var(--muted); }
.comment-meta .delete:hover { color: #ff6b6b; }
.comment p:last-child { margin: 0; }

/* --- grids -------------------------------------------------------------- */

.profile-grid, .photo-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.1rem;
}

.profile-card { text-align: center; }
.profile-card a {
    display: block;
    padding: 1.25rem .75rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.profile-card a:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--glow);
}
.profile-card img {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: .6rem;
    border: 1px solid var(--line);
}

.photo-grid figure { margin: 0; overflow: hidden; border-radius: var(--radius); }
.photo-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: transform .35s ease, filter .35s ease;
}
.photo-grid figure:hover img { transform: scale(1.07); filter: saturate(1.25); }
figcaption { font-size: .78rem; color: var(--muted); padding: .4rem .2rem; }

/* --- forms -------------------------------------------------------------- */

.stacked-form { margin: 1.25rem 0; }
.stacked-form p { display: flex; flex-direction: column; margin: 1rem 0; }
.stacked-form label { font-size: .82rem; color: var(--muted); margin-bottom: .35rem; }
.stacked-form input, .stacked-form textarea, .stacked-form select {
    padding: .7rem .9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    color-scheme: dark;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.stacked-form input:focus, .stacked-form textarea:focus, .stacked-form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}
.stacked-form textarea.code { font-family: var(--mono); font-size: .85rem; line-height: 1.5; }
.stacked-form .helptext { font-size: .76rem; color: var(--muted); margin-top: .3rem; }
.stacked-form ul.errorlist {
    list-style: none;
    padding: 0;
    margin: .3rem 0 0;
    color: #ff8a8a;
    font-size: .8rem;
}

/* --- page assets (the per-page images/GIFs) ----------------------------- */

.asset-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .6rem; }
.asset-list li {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
}
.asset-list img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-soft);
}
.asset-list code { margin-left: auto; user-select: all; }
.asset-list .linkish { color: var(--muted); font-size: .82rem; }
.asset-list .linkish:hover { color: #ff6b6b; }

/* --- motion --------------------------------------------------------------
   Everything above is decoration; none of it should move for someone who has
   asked their system not to animate. */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

@media (max-width: 560px) {
    .container { padding: 1.5rem 1rem 3rem; }
    .profile-hero { padding: 1.25rem; }
    .song { grid-template-columns: 1fr; }
    .song .cover { grid-row: auto; width: 100%; height: 160px; margin-bottom: .75rem; }
    .song-head, .song .occasion, .song .song-body, .song audio { grid-column: 1; }
}
