/* Prototype only: Mochiy Pop One (OFL) for the sticker lettering. Self-host before shipping. */
@import url('https://fonts.googleapis.com/css2?family=Mochiy+Pop+One&display=swap');

/* --ink, --violet-light and --night come from tokens.css */
:root {
    --sidebar-outline: #2b2b2b;
    --sidebar-outline-width: 2px;
    --sidebar-surface: #0b0b0b;
    --sidebar-surface-raised: #151515;
    --sidebar-divider: #2b2b2b;
    --sidebar-control-divider: rgba(255, 255, 255, .1);
}

.site-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 16rem;
    pointer-events: auto;
    transition: width .35s cubic-bezier(.3, .5, .25, 1);
}

.site-sidebar-shell {
    --sidebar-edge-left: .95rem;
    --sidebar-edge-right: .95rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100svh;
    overflow: hidden;
    gap: 1.25rem;
    padding: 1.25rem var(--sidebar-edge-right) 1rem var(--sidebar-edge-left);
    border: 0 solid #3a2747;
    border-right-width: 0;
    background: var(--sidebar-surface);
    box-shadow: .75rem 0 2rem rgba(0, 0, 0, .22);
    pointer-events: auto;
    /* The mobile drawer is revealed by its width; keep the surface from
       fading through the page while that happens. */
    transition: none;
}

.site-sidebar-shell::before {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 3;
    width: var(--sidebar-outline-width);
    content: "";
    background: var(--sidebar-outline);
    opacity: 1;
    pointer-events: none;
    transition: background-color .55s ease;
}

.site-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .7rem;
    min-height: 2.5rem;
}

.site-sidebar-brand,
.site-sidebar-toggle,
.site-sidebar-link {
    -webkit-tap-highlight-color: transparent;
}

.site-sidebar-brand {
    display: inline-flex;
    position: relative;
    min-width: 0;
    align-items: center;
    gap: .55rem;
    color: var(--ink);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-decoration: none;
}

.site-sidebar-moon {
    position: relative;
    display: block;
    flex: 0 0 2.2rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 65%, rgba(39, 13, 59, .34) 0 5%, transparent 5.5%),
        radial-gradient(circle at 48% 23%, rgba(255, 255, 255, .17) 0 8%, transparent 8.7%),
        radial-gradient(circle at 25% 42%, rgba(51, 15, 75, .3) 0 12%, transparent 12.8%),
        linear-gradient(130deg, #d69aff 4%, #8530c6 45%, #40105f 100%);
    -webkit-mask: radial-gradient(circle at 65% 43%, transparent 0 49.5%, #000 50.2%);
    mask: radial-gradient(circle at 65% 43%, transparent 0 49.5%, #000 50.2%);
    filter: drop-shadow(0 0 1.5rem rgba(158, 69, 224, .3));
    opacity: 1;
    scale: 1;
    transition: opacity .45s ease, scale .45s cubic-bezier(.2,.8,.2,1), filter .55s ease;
}

.site-sidebar-moon::after {
    position: absolute;
    inset: 0;
    content: "";
    border-radius: 50%;
    background:
        radial-gradient(circle at 16% 49%, rgba(235, 209, 255, .38) 0 .06rem, transparent .09rem),
        radial-gradient(circle at 31% 76%, rgba(235, 209, 255, .38) 0 .035rem, transparent .06rem);
    opacity: 1;
    pointer-events: none;
}

.site-sidebar-sun {
    position: absolute;
    top: .1rem;
    left: .1rem;
    display: block;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #f3e8ff 0, #bd83e5 52%, #8751a4 100%);
    box-shadow: 0 0 .8rem rgba(111, 54, 150, .2);
    opacity: 0;
    scale: .72;
    transition: opacity .45s ease, scale .45s cubic-bezier(.2,.8,.2,1);
}

.site-sidebar-sun::before {
    position: absolute;
    inset: -.25rem;
    z-index: -1;
    content: "";
    border-radius: 50%;
    background: radial-gradient(circle, rgba(111, 54, 150, .2), transparent 70%);
    filter: blur(.25rem);
}

.site-sidebar-toggle {
    position: absolute;
    top: 1.25rem;
    right: auto;
    left: calc(100% - var(--sidebar-outline-width));
    z-index: 2;
    display: grid;
    width: 1.75rem;
    height: 3.25rem;
    padding: 0;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-radius: 0 .5rem .5rem 0;
    background: var(--sidebar-outline);
    color: var(--ink);
    cursor: pointer;
    pointer-events: auto;
    transition: border-color .25s ease, background-color .25s ease, color .25s ease;
}

.site-sidebar-toggle::before {
    position: absolute;
    inset: var(--sidebar-outline-width);
    content: "";
    border-radius: 0 calc(.5rem - var(--sidebar-outline-width)) calc(.5rem - var(--sidebar-outline-width)) 0;
    background: var(--sidebar-surface);
    pointer-events: none;
}

.site-sidebar-brand-label {
    overflow: hidden;
    max-width: 9rem;
    opacity: 1;
    white-space: nowrap;
    transition: max-width .34s cubic-bezier(.3, .5, .25, 1), opacity .2s ease;
}

.site-sidebar-toggle:hover,
.site-sidebar-toggle:focus-visible {
    background: var(--sidebar-outline);
    color: #fff;
    outline: none;
}

.site-sidebar-toggle:hover::before,
.site-sidebar-toggle:focus-visible::before {
    background: var(--sidebar-surface-raised);
}

.site-sidebar-toggle-icon {
    position: relative;
    z-index: 1;
    display: block;
    font-size: 1.25rem;
    line-height: 1;
    translate: -.04rem 0;
    rotate: 0deg;
    transition: rotate .35s cubic-bezier(.3, .5, .25, 1);
}

.site-sidebar-panel {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 0;
    opacity: 1;
    translate: 0 0;
    transition: opacity .25s ease, translate .38s cubic-bezier(.2, .8, .2, 1);
}

.site-sidebar-nav {
    display: grid;
    gap: 0;
}

.site-sidebar-scene {
    position: relative;
    display: block;
    flex: 0 0 2rem;
    height: 2rem;
    margin: 0 calc((var(--sidebar-edge-right) * -1) + var(--sidebar-outline-width)) 0 calc(var(--sidebar-edge-left) * -1);
    overflow: hidden;
    background: var(--sidebar-surface);
    pointer-events: none;
    transition: background-color .55s ease, opacity .25s ease;
}

.site-sidebar-scene-stars,
.site-sidebar-scene-clouds {
    position: absolute;
    inset: 0;
    display: block;
    transition: opacity .55s ease;
}

.site-sidebar-scene-clouds {
    opacity: 0;
}

.site-sidebar-scene-star {
    position: absolute;
    display: block;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1;
    opacity: 1;
    transition: color .55s ease, opacity .25s ease;
}

.site-sidebar-scene-star-a {
    top: 7px;
    left: 16%;
}

.site-sidebar-scene-star-b {
    top: 18px;
    left: 35%;
    font-size: .55rem;
}

.site-sidebar-scene-star-c {
    top: 6px;
    left: 53%;
    font-size: .68rem;
}

.site-sidebar-scene-star-d {
    top: 17px;
    left: 68%;
    font-size: .58rem;
}

.site-sidebar-scene-cloud {
    position: absolute;
    display: block;
    color: #a6a6a6;
    font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', sans-serif;
    font-size: 1.8rem;
    font-variant-emoji: text;
    font-weight: 400;
    line-height: 1;
    opacity: 1;
    transition: color .55s ease, opacity .25s ease;
}

.site-sidebar-scene-cloud-a {
    top: 11px;
    left: 18px;
    font-size: 1.1rem;
}

.site-sidebar-scene-cloud-b {
    top: 3px;
    left: 88px;
    font-size: .82rem;
}

.site-sidebar-scene-cloud-c {
    top: -1px;
    left: 144px;
    font-size: 1.65rem;
}

.site-sidebar-oneko {
    position: absolute;
    right: 1.5rem;
    bottom: -4px;
    display: block;
    width: 32px;
    height: 32px;
    background-image: url('../images/oneko.gif');
    background-position: -64px 0;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    pointer-events: auto;
    cursor: pointer;
    transform-origin: right bottom;
    opacity: 0;
    transition: opacity .55s ease;
}

.site-sidebar-oneko-sleeping {
    animation: site-sidebar-oneko-sleep 2.4s steps(1, end) infinite;
}

.site-sidebar-oneko-awake {
    background-position: -96px -96px;
}

@keyframes site-sidebar-oneko-sleep {
    0%, 49% {
        background-position: -64px 0;
    }

    50%, 100% {
        background-position: -64px -32px;
    }
}

.site-sidebar-oneko.is-petting {
    animation-name: site-sidebar-oneko-pet-cycle;
    animation-duration: .375s;
    animation-timing-function: steps(1, end);
    animation-iteration-count: var(--oneko-scratch-cycles, 4);
    animation-fill-mode: both;
}

@keyframes site-sidebar-oneko-pet-cycle {
    0%, 49% {
        background-position: -192px 0;
    }

    50%, 100% {
        background-position: -160px 0;
    }
}

.site-sidebar-oneko.is-daytime-yawning {
    animation: site-sidebar-oneko-daytime-yawn 1.6s steps(1, end) both;
}

@keyframes site-sidebar-oneko-daytime-yawn {
    0%, 18% {
        background-position: -96px -96px;
    }

    26%, 74% {
        background-position: -96px -64px;
    }

    82%, 100% {
        background-position: -96px -96px;
    }
}

.site-sidebar-oneko.is-daytime-side {
    animation: site-sidebar-oneko-daytime-side 1.4s steps(1, end) both;
}

@keyframes site-sidebar-oneko-daytime-side {
    0%, 14% {
        background-position: -96px -96px;
    }

    24%, 48% {
        background-position: -96px 0;
    }

    58%, 82% {
        background-position: -96px -32px;
    }

    92%, 100% {
        background-position: -96px -96px;
    }
}

.site-sidebar-oneko.is-night-yawning {
    animation: site-sidebar-oneko-night-yawn 1.6s steps(1, end) both;
}

@keyframes site-sidebar-oneko-night-yawn {
    0%, 18% {
        background-position: -96px -96px;
    }

    26%, 100% {
        background-position: -96px -64px;
    }
}

.site-sidebar-oneko.is-night-awake {
    background-position: -96px -96px;
    animation: none;
}

.site-sidebar-oneko-sleeping {
    opacity: 1;
}

body.is-light-mode .site-sidebar-oneko-sleeping {
    opacity: 0;
}

body.is-light-mode .site-sidebar-oneko-awake {
    opacity: 1;
}

body.is-light-mode .site-sidebar-scene-stars {
    opacity: 0;
}

body.is-light-mode .site-sidebar-scene-clouds {
    opacity: 1;
}

.site-sidebar-controls {
    display: grid;
    gap: 0;
    margin: 0 calc((var(--sidebar-edge-right) * -1) + var(--sidebar-outline-width)) 0 calc(var(--sidebar-edge-left) * -1);
    overflow: hidden;
    border-top: 1px solid var(--sidebar-divider);
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-divider);
    border-left: 0;
    border-radius: 0;
    background: var(--sidebar-surface-raised);
    transition: background-color .55s ease, border-color .55s ease;
}

.site-sidebar-control {
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .8rem;
    min-height: 3.4rem;
    padding: .6rem .7rem .6rem 1.25rem;
    border: 0;
    border-bottom: 1px solid var(--sidebar-control-divider);
    border-radius: 0;
    background: transparent;
    background-clip: padding-box;
    color: #fff;
    font: inherit;
    font-size: .74rem;
    letter-spacing: .06em;
    text-align: left;
    cursor: pointer;
    transition: border-color .55s ease, background-color .25s ease, color .25s ease;
}

.site-sidebar-control:last-child {
    border-bottom: 0;
}

.site-sidebar-control:hover,
.site-sidebar-control:focus-visible,
.site-sidebar-control[data-theme-toggle][aria-pressed="true"],
.site-sidebar-control[data-animation-toggle][aria-pressed="false"] {
    background: var(--sidebar-surface-raised);
    color: #fff;
    outline: none;
}

.site-sidebar-control-icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.35;
    color: #fff;
}

.site-sidebar-control-icon-stack {
    position: relative;
    display: block;
    width: 1.25rem;
    height: 1.25rem;
}

.site-sidebar-control-icon-stack .site-sidebar-control-icon {
    position: absolute;
    inset: 0;
    opacity: 0;
    scale: .72;
    transition: opacity .35s ease, scale .35s cubic-bezier(.3, .5, .25, 1);
}

.site-sidebar-control-icon-stack .site-sidebar-control-icon-moon,
.site-sidebar-control-icon-stack .site-sidebar-control-icon-motion-on {
    opacity: 1;
    scale: 1;
}

.site-sidebar-control[data-theme-toggle].is-light .site-sidebar-control-icon-moon,
.site-sidebar-control[data-animation-toggle].is-disabled .site-sidebar-control-icon-motion-on {
    opacity: 0;
    scale: .72;
}

.site-sidebar-control[data-theme-toggle].is-light .site-sidebar-control-icon-sun,
.site-sidebar-control[data-animation-toggle].is-disabled .site-sidebar-control-icon-motion-off {
    opacity: 1;
    scale: 1;
}

.site-sidebar-control-label {
    min-width: 0;
    display: block;
    max-width: 12rem;
    overflow: hidden;
    opacity: 1;
    color: var(--ink);
    white-space: nowrap;
    transition: max-width .34s cubic-bezier(.3, .5, .25, 1), opacity .2s ease;
}

.site-sidebar-theme-label {
    display: grid;
}

.site-sidebar-theme-label > span {
    grid-area: 1 / 1;
    transition: opacity .28s ease, color .55s ease;
}

.site-sidebar-theme-label-light {
    opacity: 0;
}

.site-sidebar-control[data-theme-toggle].is-light .site-sidebar-theme-label-dark {
    opacity: 0;
}

.site-sidebar-control[data-theme-toggle].is-light .site-sidebar-theme-label-light {
    opacity: 1;
}

.site-sidebar-switch {
    position: relative;
    display: block;
    width: 1.8rem;
    height: .95rem;
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .76);
    transition: background-color .25s ease, border-color .55s ease, color .25s ease;
}

.site-sidebar-switch::after {
    position: absolute;
    top: .13rem;
    left: .13rem;
    width: .55rem;
    height: .55rem;
    content: "";
    border-radius: 50%;
    background: currentColor;
    transition: background-color .25s ease, translate .25s cubic-bezier(.2, .8, .2, 1);
}

.site-sidebar-control[aria-pressed="true"] .site-sidebar-switch {
    border-color: var(--violet-light);
    background: var(--violet-light);
    color: #fff;
}

.site-sidebar-control[aria-pressed="true"] .site-sidebar-switch::after {
    translate: .82rem 0;
}

/* the music switch's icon: four equaliser bars standing on a baseline; their heights
   follow the track (home-night.js sets --b1..--b4 on the button) */
.site-sidebar-control[hidden] {
    display: none;
}

.site-sidebar-control-icon-stack .site-sidebar-sound-eq {
    opacity: 1;
    scale: 1;
}

.site-sidebar-sound-eq rect {
    fill: currentColor;
    stroke: none;
    transform-box: fill-box;
    transform-origin: 50% 100%;
    scale: 1 var(--h, .22);
}

.site-sidebar-sound.is-on .site-sidebar-sound-eq rect:nth-child(1) { --h: calc(.22 + var(--b1, 0) * .78); }
.site-sidebar-sound.is-on .site-sidebar-sound-eq rect:nth-child(2) { --h: calc(.22 + var(--b2, 0) * .78); }
.site-sidebar-sound.is-on .site-sidebar-sound-eq rect:nth-child(3) { --h: calc(.22 + var(--b3, 0) * .78); }
.site-sidebar-sound.is-on .site-sidebar-sound-eq rect:nth-child(4) { --h: calc(.22 + var(--b4, 0) * .78); }

.site-sidebar-link {
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    align-items: center;
    gap: .8rem;
    min-height: 3rem;
    margin-left: calc(var(--sidebar-edge-left) * -1);
    margin-right: calc((var(--sidebar-edge-right) * -1) + var(--sidebar-outline-width));
    padding: .6rem .7rem .6rem 1.25rem;
    border: 0 solid var(--sidebar-divider);
    border-bottom-width: 1px;
    border-radius: 0;
    background-clip: padding-box;
    color: #fff;
    font-size: .78rem;
    letter-spacing: .08em;
    text-decoration: none;
    transition: border-color .25s ease, background-color .25s ease, color .25s ease, translate .25s ease;
}

.site-sidebar-link:first-child {
    border-top-width: 1px;
}

.site-sidebar-nav-icon {
    display: block;
    flex: 0 0 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.35;
    color: #fff;
    transition: color .25s ease, translate .25s ease;
}

.site-sidebar-link-label {
    min-width: 0;
    display: block;
    max-width: 12rem;
    overflow: hidden;
    opacity: 1;
    white-space: nowrap;
    transition: max-width .34s cubic-bezier(.3, .5, .25, 1), opacity .2s ease;
}

.site-sidebar-link:hover,
.site-sidebar-link:focus-visible,
.site-sidebar-link.is-active {
    background: var(--sidebar-surface-raised);
    color: #fff;
    outline: none;
    padding-left: 1.25rem;
}

.site-sidebar-link.is-active {
    border-bottom-color: var(--violet-light);
}

.site-sidebar-link:hover .site-sidebar-nav-icon,
.site-sidebar-link:focus-visible .site-sidebar-nav-icon,
.site-sidebar-link.is-active .site-sidebar-nav-icon {
    color: #fff;
    translate: 0;
}

.site-sidebar.is-collapsed {
    width: 3.75rem;
}

.site-sidebar.is-collapsed .site-sidebar-shell {
    --sidebar-edge-right: .55rem;
    gap: 1.25rem;
    padding: 1.25rem var(--sidebar-edge-right) 1rem var(--sidebar-edge-left);
}

.site-sidebar.is-collapsed .site-sidebar-header {
    justify-content: flex-start;
}

.site-sidebar.is-collapsed .site-sidebar-brand-label {
    flex: 0 0 0;
    width: auto;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
}

.site-sidebar.is-collapsed .site-sidebar-toggle-icon {
    rotate: 180deg;
}

.site-sidebar.is-collapsed .site-sidebar-panel {
    flex: 1;
    gap: 0;
    padding-top: 0;
    opacity: 1;
    translate: 0;
    pointer-events: auto;
}

.site-sidebar.is-collapsed .site-sidebar-link-label {
    flex: 0 0 0;
    width: auto;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
}

.site-sidebar.is-collapsed .site-sidebar-control-label {
    flex: 0 0 0;
    width: auto;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
}

.site-sidebar.is-collapsed .site-sidebar-control {
    padding: .8rem .3rem .8rem 1.25rem;
}

.site-sidebar.is-collapsed .site-sidebar-link {
    padding: .8rem .3rem .8rem 1.25rem;
}

.site-sidebar.is-collapsed .site-sidebar-link:hover,
.site-sidebar.is-collapsed .site-sidebar-link:focus-visible {
    padding-left: 1.25rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 761px) {
    body {
        padding-left: 0;
    }
}

@media (max-width: 760px) {
    .site-sidebar {
        width: min(17rem, calc(100vw - 2.25rem));
    }

    .site-sidebar.is-collapsed {
        width: 0;
    }

    .site-sidebar.is-collapsed .site-sidebar-shell {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

}

@media (prefers-reduced-motion: reduce) {
    .site-sidebar,
        .site-sidebar-panel,
        .site-sidebar-scene,
        .site-sidebar-scene-stars,
        .site-sidebar-scene-clouds,
        .site-sidebar-scene-star,
        .site-sidebar-scene-cloud,
        .site-sidebar-oneko,
        .site-sidebar-oneko-sleeping,
        .site-sidebar-controls,
    .site-sidebar-control,
    .site-sidebar-switch,
    .site-sidebar-switch::after,
    .site-sidebar-toggle-icon,
        .site-sidebar-link {
        transition: none;
    }

    .site-sidebar-oneko-sleeping {
        animation: none;
    }
}

body.is-light-mode .site-sidebar-moon {
    opacity: 0;
    scale: .72;
}

body.is-light-mode .site-sidebar-moon::after {
    opacity: 0;
}

body.is-light-mode .site-sidebar-sun {
    opacity: 1;
    scale: 1;
}

/* ==========================================================================
   Stylized pass (draft): the home poster's language on the shared sidebar.
   Heavy wide type (Archivo), the current page as a white tag, a sparkle cursor
   that springs to what you point at.
   ========================================================================== */

.site-sidebar {
    --sidebar-type: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
    --sidebar-spring: cubic-bezier(.34, 1.56, .64, 1);
}

.site-sidebar-brand {
    font-family: var(--sidebar-type);
    font-size: 1.05rem;
    font-weight: 900;
    font-stretch: 125%;
    letter-spacing: .01em;
}

.site-sidebar-scene {
    background: transparent;
}

/* switches: no grey slab or rules */
.site-sidebar-controls {
    border-top: 0;
    border-bottom: 0;
    background: transparent;
}

.site-sidebar-control {
    min-height: 2.9rem;
    border-bottom: 0;
    font-family: var(--sidebar-type);
    font-size: .76rem;
    font-weight: 700;
    font-stretch: 112%;
    letter-spacing: .01em;
}

.site-sidebar-control:hover,
.site-sidebar-control:focus-visible,
.site-sidebar-control[data-theme-toggle][aria-pressed="true"],
.site-sidebar-control[data-animation-toggle][aria-pressed="false"] {
    background: transparent;
}

.site-sidebar-control:hover .site-sidebar-control-label,
.site-sidebar-control:focus-visible .site-sidebar-control-label {
    color: var(--violet-light);
}

/* page links: heavy type, no rules or row highlights */
.site-sidebar-nav {
    position: relative;
}

.site-sidebar-link,
.site-sidebar-link:first-child {
    min-height: 2.65rem;
    border-width: 0;
    font-family: var(--sidebar-type);
    font-size: .92rem;
    font-weight: 800;
    font-stretch: 115%;
    letter-spacing: 0;
}

.site-sidebar-link:hover,
.site-sidebar-link:focus-visible,
.site-sidebar-link.is-active {
    background: transparent;
}

.site-sidebar-nav-icon,
.site-sidebar-control-icon {
    stroke-width: 1.7;
}

/* (scoped under .site-sidebar so it beats theme.css's slower colour fade, which would
   leave the white tag blank for a moment after each page change) */
.site-sidebar .site-sidebar-link-label {
    justify-self: start;
    margin-left: -.4rem;
    padding: .14rem .4rem .12rem;
    transition: max-width .34s cubic-bezier(.3, .5, .25, 1), opacity .2s ease, color .2s ease, background-color .2s ease;
}

.site-sidebar-link:hover .site-sidebar-link-label,
.site-sidebar-link:focus-visible .site-sidebar-link-label {
    color: var(--violet-light);
}

/* the current page: a white tag, like the poster's DISCORD / X tags */
.site-sidebar-link.is-active .site-sidebar-link-label {
    background: var(--ink);
    color: var(--night);
}

.site-sidebar.is-collapsed .site-sidebar-link-label {
    margin-left: 0;
    padding: 0;
}

/* the sparkle cursor (sidebar.js sets --cursor-y to the middle of the link it points at) */
.site-sidebar-cursor {
    position: absolute;
    top: 0;
    left: calc(var(--sidebar-edge-left) * -1 + .28rem);
    z-index: 2;
    width: .78rem;
    height: .78rem;
    fill: var(--ink);
    opacity: 0;
    scale: .3;
    translate: 0 calc(var(--cursor-y, 0px) - .39rem);
    pointer-events: none;
}

.site-sidebar-cursor.is-shown {
    opacity: 1;
    scale: 1;
}

.site-sidebar-cursor.is-ready {
    transition: translate .45s var(--sidebar-spring), scale .35s var(--sidebar-spring), opacity .2s ease;
}

body.animations-disabled .site-sidebar-cursor {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .site-sidebar-cursor.is-ready {
        transition: none;
    }
}

/* ==========================================================================
   No panel: the sidebar has no surface of its own. Its logo, pages, cat and
   switches sit straight on each page's own backdrop (every page runs its
   background to the screen's left edge and only indents its content), with a
   soft fade behind them so the words stay readable over busy art.
   Bubbly tilted lettering for the pages; the current page on the white tag.

   Layers, bottom to top:
     .site-sidebar::before   the fade (a solid drawer on phones)
     the shell's contents
   ========================================================================== */

.site-sidebar {
    --st-pink: #ff5fd8;
    --st-violet: #b45dfd;
    --st-deep: #3a0f6b;
    --st-body: #0e0a14;
    --st-fade: 8, 6, 11;
    --st-text: #fff;
    --st-type: "Mochiy Pop One", "Archivo", "Arial Black", sans-serif;
}

body.is-light-mode .site-sidebar {
    --st-body: #f7f1fc;
    --st-fade: 247, 241, 252;
    --st-text: #24123a;
}

/* ---- the fade: solid behind the whole sidebar, dropping off quickly just past its edge, so
   the icons sit inside the dark band without the band looking thick ---- */
.site-sidebar::before {
    position: absolute;
    inset: 0 -1rem 0 0;
    z-index: 0;
    content: "";
    pointer-events: none;
    background: linear-gradient(90deg, rgba(var(--st-fade), .72) 0, rgba(var(--st-fade), .72) calc(100% - 1rem), rgba(var(--st-fade), .28) calc(100% - .55rem), rgba(var(--st-fade), .08) calc(100% - .25rem), rgba(var(--st-fade), 0) 100%);
}

.site-sidebar::after,
.site-sidebar .site-sidebar-shell::before {
    display: none;
}

/* the shell carries the content; no surface or edge line of its own.
   A soft shadow under the words keeps them off whatever art is behind. */
.site-sidebar .site-sidebar-shell,
body.is-light-mode .site-sidebar .site-sidebar-shell {
    gap: 1.1rem;
    /* the left edge is shared with the collapsed rail (icons centred in its 3.75rem), so the
       logo, icons and switches stay put while the sidebar opens and closes */
    padding: 1.45rem 1.4rem 1.55rem 1.025rem;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    text-shadow: 0 1px 0 rgba(var(--st-fade), .6), 0 0 .6rem rgba(var(--st-fade), .55);
}

/* ---- logo: the old moon and wordmark, just room for the corner button ---- */
.site-sidebar-header {
    min-height: 3rem;
}

/* the moon is centred on the page icons' column (the middle of the collapsed rail), open or closed */
.site-sidebar .site-sidebar-moon {
    margin-left: -.25rem;
}

/* ---- the collapse button: a small dark chip inside the sidebar's right edge ---- */
.site-sidebar .site-sidebar-toggle {
    top: 1.55rem;
    left: calc(100% - 2.1rem);
    right: auto;
    z-index: 3;
    width: 1.7rem;
    height: 2.4rem;
    border: 0;
    border-radius: .55rem;
    background: rgba(var(--st-fade), .55);
    color: var(--st-text);
    box-shadow: none;
    transition: left .35s cubic-bezier(.3, .5, .25, 1), translate .3s var(--sidebar-spring), color .2s ease, background-color .2s ease;
}

.site-sidebar .site-sidebar-toggle::before {
    display: none;
}

.site-sidebar .site-sidebar-toggle:hover,
.site-sidebar .site-sidebar-toggle:focus-visible {
    background: rgba(var(--st-fade), .8);
    color: var(--st-pink);
    translate: .18rem 0;
}

.site-sidebar .site-sidebar-toggle-icon {
    font-family: var(--sidebar-type);
    font-size: 1.2rem;
    font-weight: 900;
    translate: -.1rem -.05rem;
}

/* ---- pages: tilted lettered words ---- */
.site-sidebar-panel {
    gap: 0;
}

.site-sidebar .site-sidebar-nav { order: 1; gap: .15rem; margin-top: .35rem; }
.site-sidebar .site-sidebar-scene { order: 2; margin: auto 0 0; width: auto; }
.site-sidebar .site-sidebar-controls { order: 3; }

.site-sidebar-link:nth-of-type(1) { --i: 1; --tilt: -2.5deg; }
.site-sidebar-link:nth-of-type(2) { --i: 2; --tilt: 1.8deg; }
.site-sidebar-link:nth-of-type(3) { --i: 3; --tilt: -1.4deg; }
.site-sidebar-link:nth-of-type(4) { --i: 4; --tilt: 2.4deg; }
.site-sidebar-link:nth-of-type(5) { --i: 5; --tilt: -2deg; }
.site-sidebar-link:nth-of-type(6) { --i: 6; --tilt: 1.2deg; }

.site-sidebar .site-sidebar-link,
.site-sidebar .site-sidebar-link:first-child {
    position: relative;
    justify-self: start;
    grid-template-columns: 1.2rem minmax(0, 1fr);
    gap: .6rem;
    min-height: 2.75rem;
    margin: 0;
    padding: .3rem .3rem .3rem .25rem;
    background: transparent;
    color: var(--st-text);
    font-family: var(--st-type);
    font-size: 1.02rem;
    font-weight: 400;
    font-stretch: normal;
}

.site-sidebar .site-sidebar-link:hover,
.site-sidebar .site-sidebar-link:focus-visible,
.site-sidebar .site-sidebar-link.is-active {
    padding-left: .25rem;
    background: transparent;
}

.site-sidebar .site-sidebar-nav-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--st-violet);
    stroke-width: 2.2;
}

.site-sidebar .site-sidebar-link .site-sidebar-link-label {
    justify-self: start;
    margin-left: 0;
    padding: .12rem .4rem .14rem;
    color: inherit;
    rotate: var(--tilt);
    /* the words grow out / tuck away with the sidebar's width */
    transition: max-width .34s cubic-bezier(.3, .5, .25, 1), opacity .2s ease, padding .34s cubic-bezier(.3, .5, .25, 1), color .2s ease, background-color .2s ease;
}

/* hover / focus: the word turns violet and gives a small bounce (the sparkle cursor springs to it) */
.site-sidebar .site-sidebar-link:hover .site-sidebar-link-label,
.site-sidebar .site-sidebar-link:focus-visible .site-sidebar-link-label {
    color: var(--violet-light);
    animation: st-boing .45s var(--sidebar-spring);
}

@keyframes st-boing {
    35% { scale: 1.1; }
}

/* the current page: the plain white tag, as before */
.site-sidebar .site-sidebar-link.is-active .site-sidebar-link-label {
    background: var(--ink);
    color: var(--night);
}

/* ---- the switches: plain rows under one thin violet line; the cat sits on the line ---- */
.site-sidebar .site-sidebar-scene {
    background: transparent;
}

.site-sidebar .site-sidebar-controls {
    margin: 0;
    padding: .35rem 0 0;
    overflow: visible;
    border: 0;
    border-top: 1px solid rgba(180, 93, 253, .45);
    text-shadow: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.site-sidebar .site-sidebar-control {
    min-height: 2.5rem;
    padding: .45rem 0 .45rem .25rem;
    color: var(--st-text);
}

/* ---- collapsed: a narrow rail, icons only. Same spacing as open (only the words tuck away),
   so nothing jumps; the chip slides to just outside the rail, clear of the moon ---- */
.site-sidebar.is-collapsed .site-sidebar-toggle {
    left: calc(100% + .1rem);
}

.site-sidebar.is-collapsed .site-sidebar-shell {
    gap: 1.1rem;
    padding: 1.45rem .85rem 1.55rem 1.025rem;
}

.site-sidebar.is-collapsed .site-sidebar-link,
.site-sidebar.is-collapsed .site-sidebar-link:hover,
.site-sidebar.is-collapsed .site-sidebar-link:focus-visible,
.site-sidebar.is-collapsed .site-sidebar-link.is-active {
    padding: .3rem .3rem .3rem .25rem;
}

/* the night scene spans the whole rail, with the cat in its middle (not hanging off the edge);
   both slide with the sidebar when it opens / closes */
.site-sidebar .site-sidebar-scene {
    transition: margin .35s cubic-bezier(.3, .5, .25, 1), background-color .55s ease, opacity .25s ease;
}

.site-sidebar .site-sidebar-oneko {
    transition: right .35s cubic-bezier(.3, .5, .25, 1), opacity .55s ease;
}

.site-sidebar.is-collapsed .site-sidebar-scene {
    margin-inline: -1.025rem -.85rem;
}

.site-sidebar.is-collapsed .site-sidebar-oneko {
    right: calc(50% - 16px);
}

.site-sidebar.is-collapsed .site-sidebar-link .site-sidebar-link-label {
    padding-inline: 0;
}

.site-sidebar.is-collapsed .site-sidebar-link.is-active .site-sidebar-nav-icon {
    color: var(--ink);
}

.site-sidebar.is-collapsed .site-sidebar-controls {
    margin: 0;
    overflow: hidden;
    rotate: 0deg;
}

.site-sidebar.is-collapsed .site-sidebar-control {
    padding: .45rem 0 .45rem .25rem;
}

body.animations-disabled .site-sidebar .site-sidebar-link-label {
    animation: none !important;
}

body.animations-disabled .site-sidebar .site-sidebar-toggle {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .site-sidebar .site-sidebar-link-label {
        animation: none !important;
    }
}

/* phones: the drawer slides over the page, so it gets a solid surface; closed, it has no width */
@media (max-width: 760px) {
    .site-sidebar::before {
        inset: 0;
        background: var(--st-body);
    }

    .site-sidebar.is-collapsed::before {
        display: none;
    }
}

/* restoring the saved sidebar state on load snaps (see sidebar.js setExpanded) */
body.sidebar-instant,
body.sidebar-instant *,
body.sidebar-instant *::before,
body.sidebar-instant *::after {
    transition: none !important;
}
