@font-face {
    font-family: 'Ari W9500';
    src: url('assets/fonts/ari-w9500.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ari W9500';
    src: url('assets/fonts/ari-w9500-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* extra variants below are only used for the randomized home link fonts
   (see ARI_FONT_VARIANTS in script.js) - the site default stays 'Ari W9500' */

@font-face {
    font-family: 'Ari W9500 Bold';
    src: url('assets/fonts/ari-w9500-bold.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Ari W9500 Condensed';
    src: url('assets/fonts/ari-w9500-condensed.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Ari W9500 Condensed Bold';
    src: url('assets/fonts/ari-w9500-condensed-bold.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Ari W9500 Display';
    src: url('assets/fonts/ari-w9500-display.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Ari W9500 Condensed Display';
    src: url('assets/fonts/ari-w9500-condensed-display.ttf') format('truetype');
    font-display: swap;
}

/* used only for the "buy me a coffee" wordmark next to the cafezinho chips,
   to echo the cursive script in BMC's own logo. */
@font-face {
    font-family: 'Dancing Script';
    src: url('assets/fonts/dancing-script-bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

:root {
    --bg: #000;
    --fg: #e8e8e8;
    --fg-dim: #9a9a9a;
    --muted: #888;
    --window-bar: #1c1c1c;
    --window-bar-fg: #d8d8d8;
    --window-border: #3a3a3a;
    --swatch-linho: #fffbf6;
    --swatch-noite: #191919;
    --swatch-flama: #ea5e2b;
    --titlebar-bg: var(--window-bar);
    --titlebar-fg: var(--window-bar-fg);
}

body.theme-flama {
    --titlebar-bg: var(--swatch-flama);
    --titlebar-fg: var(--swatch-noite);
}

body.theme-linho {
    --titlebar-bg: var(--swatch-linho);
    --titlebar-fg: var(--swatch-noite);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    background-image: url('assets/bg.gif');
    color: var(--fg);
    font-family: 'Ari W9500', ui-monospace, 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: inherit;
}

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

/* ---------- home: scattered stage ---------- */

.stage {
    position: relative;
    width: 850px;
    max-width: 100%;
    min-height: 900px;
    margin: 120px auto 0;
    padding: 40px 0;
}

.bg-sticker {
    position: absolute;
    z-index: -1;
    filter: brightness(0.55);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.scatter-link {
    position: absolute;
    text-decoration: none;
    letter-spacing: 0.02em;
    cursor: grab;
    z-index: 2;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 1;
    transition: opacity 0.3s ease, color 0.15s ease;
}

.scatter-link:hover {
    color: var(--fg-dim);
}

.scatter-link.dragging {
    cursor: grabbing;
}

.chat-status-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    vertical-align: middle;
}

/* ---------- window (avatar, chat) ---------- */

.window {
    position: absolute;
    width: 330px;
    border: 1px solid var(--window-border);
    background: var(--bg);
    z-index: 1;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
}

.window.dragging .window-titlebar {
    cursor: grabbing;
}

.window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    cursor: grab;
    background: var(--titlebar-bg);
    color: var(--titlebar-fg);
    border-bottom: 1px solid var(--window-border);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.window-title {
    font-size: 13px;
}

.window-minimize,
.modal-close {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 26px;
    height: 26px;
    padding: 0;
}

.window-minimize::before,
.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 11px;
    height: 2px;
    background: currentColor;
}

.window-minimize::before {
    transform: translate(-50%, -50%);
}

.window.minimized .window-minimize::before {
    width: 9px;
    height: 9px;
    background: none;
    border: 2px solid currentColor;
    transform: translate(-50%, -50%);
}

.modal-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.window-minimize:hover {
    color: #fff;
}

.modal-close:hover {
    color: #ff4d4d;
}

.window-body {
    padding: 0;
}

.window.minimized .window-body {
    display: none;
}

.dot-placeholder {
    background-color: #0a0a0a;
    background-image:
        radial-gradient(circle, #fff 1px, transparent 1.2px);
    background-size: 6px 6px;
    opacity: 0.5;
}

.avatar-gif {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
    object-position: left center;
}

/* ---------- color swatches ---------- */

.swatch {
    position: absolute;
    width: 26px;
    height: 31px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0;
    opacity: 1;
    transition: transform 0.15s ease, opacity 0.3s ease;
}

.swatch:hover {
    transform: scale(1.1);
}

.swatch::after {
    content: attr(data-label);
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    white-space: nowrap;
    background: var(--window-bar);
    border: 1px solid var(--window-border);
    padding: 2px 6px;
    color: var(--fg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.swatch:hover::after {
    opacity: 1;
}

.swatch.copied::after {
    content: 'copiado';
    opacity: 1;
}

/* ---------- now playing (last.fm) ---------- */

.now-playing {
    position: absolute;
    display: flex;
    gap: 8px;
    align-items: baseline;
    max-width: 320px;
    cursor: grab;
    z-index: 2;
    touch-action: none;
    user-select: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.now-playing.dragging {
    cursor: grabbing;
}

.now-playing-icon {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    flex-shrink: 0;
}

.eq-bar {
    width: 3px;
    height: 100%;
    background: var(--muted);
    transform-origin: bottom;
}

.eq-bar:nth-child(1) {
    transform: scaleY(0.5);
}

.eq-bar:nth-child(2) {
    transform: scaleY(0.9);
}

.eq-bar:nth-child(3) {
    transform: scaleY(0.35);
}

.now-playing.is-live .eq-bar {
    background: var(--fg);
    animation: eq-bounce 0.9s ease-in-out infinite;
}

.now-playing.is-live .eq-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.now-playing.is-live .eq-bar:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes eq-bounce {
    0%, 100% { transform: scaleY(0.25); }
    50% { transform: scaleY(1); }
}

.now-playing-track-wrap {
    display: inline-block;
    width: 180px;
    overflow: hidden;
    white-space: nowrap;
    text-transform: uppercase;
}

.now-playing-track {
    display: inline-block;
    white-space: nowrap;
}

.now-playing-track-wrap.marquee .now-playing-track {
    animation-name: marquee-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-duration: var(--marquee-duration, 8s);
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- content panel (revealed when a link is clicked) ---------- */

.content-panel {
    position: absolute;
    left: 0;
    width: 850px;
    max-width: 100%;
    padding-left: 380px;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    line-height: 1.9;
}

.content-panel.visible {
    opacity: 1;
}

.content-placeholder {
    color: var(--muted);
    font-style: italic;
    margin: 0;
}

.content-desc {
    max-width: 620px;
    color: var(--fg-dim);
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 24px;
}

.gallery-masonry {
    column-count: 3;
    column-gap: 14px;
    width: 100%;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 14px;
    border: 1px solid var(--window-border);
}

/* placed after .scatter-link/.swatch/.now-playing so it always wins the
   opacity cascade regardless of which of those classes an element also has */
.content-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ---------- chat: floating window (like the avatar window) ---------- */

.chat-window {
    width: 330px;
    z-index: 2;
}

.chat-window .window-body iframe {
    display: block;
    border: none;
}

/* ---------- bh: floating window with a Leaflet map (like the avatar window) ---------- */

.bh-window {
    width: 320px;
    z-index: 2;
}

.bh-map {
    width: 100%;
    height: 260px;
    background: #000;
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.7) !important;
    color: var(--muted) !important;
    font-size: 9px !important;
}

.leaflet-control-attribution a {
    color: var(--fg-dim) !important;
}

.leaflet-control-zoom a {
    background: var(--window-bar) !important;
    color: var(--fg) !important;
    border-color: var(--window-border) !important;
}

.leaflet-control-zoom a:hover {
    color: #fff !important;
}

/* ---------- shared: home menu items with an icon that only shows on hover ---------- */
/* used by cafezinho, webringue, login and fotografia (see .menu-item-widget
   in the markup). collapsed to zero width/no margin at rest, so the label
   text sits exactly where it would with no icon at all; hovering grows the
   icon back in, and the text eases over since width/margin transition. */

.menu-item-widget {
    display: inline-flex;
    align-items: center;
}

.menu-item-inner {
    text-decoration: none;
}

.scatter-link:hover .menu-item-inner {
    color: var(--fg-dim);
}

.menu-item-icon {
    display: block;
    width: 0;
    height: 16px;
    margin-right: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.2s ease, margin-right 0.2s ease, opacity 0.2s ease;
}

.scatter-link:hover .menu-item-icon {
    width: 16px;
    margin-right: 6px;
    opacity: 1;
}

/* ---------- cafezinho: home scatter-link with amount chips linking to
   buymeacoffee.com/outrolucas ---------- */

.cafezinho-chips:not([hidden]) {
    display: inline-flex;
}

.cafezinho-chips {
    align-items: center;
    gap: 9px;
    margin-left: 6px;
}

.cafezinho-brand {
    font-family: 'Dancing Script', cursive;
    font-size: 15px;
    color: #fd0;
}

.cafezinho-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    background: var(--window-bar);
    border: 1px solid var(--window-border);
    border-radius: 4px;
    color: var(--fg-dim);
    font-family: 'Ari W9500', ui-monospace, 'Courier New', monospace;
    font-size: 10px;
    text-decoration: none;
}

.cafezinho-chip:hover {
    color: #fff;
    border-color: var(--fg-dim);
}

/* ---------- webringue: home scatter-link with prev/next neighbor sites ---------- */

.webring-nav-group:not([hidden]) {
    display: inline-flex;
}

.webring-nav-group {
    gap: 6px;
    margin-left: 6px;
}

.webring-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--window-bar);
    border: 1px solid var(--window-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--fg-dim);
}

.webring-chip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
}

.webring-prev::before {
    transform: translate(-25%, -50%) rotate(-45deg);
}

.webring-next::before {
    transform: translate(-75%, -50%) rotate(135deg);
}

.webring-chip:hover {
    color: #fff;
    border-color: var(--fg-dim);
}

.webring-preview {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: auto;
    border: 1px solid var(--window-border);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    pointer-events: none;
    z-index: 30;
}

.webring-chip:hover .webring-preview {
    opacity: 1;
    visibility: visible;
}

/* ---------- vizinhança: neocities webring badges, revealed one at a time
   next to the color swatches, below the avatar window ---------- */

/* an unpositioned anchor at the stage's own origin (0,0) - each badge below
   is placed with its own left/top in stage coordinates, computed in JS,
   since the two rows start from different x positions (see
   layoutVizinhancaBadges in script.js). */
.vizinhanca-badges {
    position: absolute;
    left: 0;
    top: 0;
}

.vizinhanca-badge:not([hidden]) {
    display: block;
}

.vizinhanca-badge {
    position: absolute;
}

.vizinhanca-badge {
    line-height: 0;
}

.vizinhanca-badge img {
    display: block;
    image-rendering: pixelated;
}

/* ---------- álbum: floating window with a random photo from assets/photos ---------- */
/* width is auto so the window shrink-wraps to whatever size the photo ends
   up at (capped by .album-photo's max-width/max-height), keeping each
   photo's original aspect ratio instead of stretching/cropping it. */

.album-window {
    width: auto;
    max-width: 360px;
    z-index: 2;
}

.album-window .window-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-titlebar-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.album-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 26px;
    height: 26px;
    padding: 0;
}

.album-nav::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
}

.album-prev::before {
    transform: translate(-25%, -50%) rotate(-45deg);
}

.album-next::before {
    transform: translate(-75%, -50%) rotate(135deg);
}

.album-nav:hover {
    color: #fff;
}

.album-photo-wrap {
    position: relative;
    display: block;
    line-height: 0;
}

.album-photo {
    display: block;
    max-width: 320px;
    max-height: 320px;
    width: auto;
    height: auto;
    background: #000;
}

.album-footer:not([hidden]) {
    display: flex;
}

.album-footer {
    position: absolute;
    right: 8px;
    bottom: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.album-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--window-bar);
    border: 1px solid var(--window-border);
    border-radius: 4px;
    padding: 3px 6px;
    color: var(--fg-dim);
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

a.album-chip:hover {
    color: #fff;
    border-color: var(--fg-dim);
}

.album-chip-icon {
    display: inline-flex;
    flex-shrink: 0;
}

/* ---------- filmes: floating window (like the avatar window) ---------- */

.movies-window {
    width: 300px;
    z-index: 2;
}

.movies-poster {
    display: block;
    width: 100%;
    height: auto;
}

.movies-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}

.movies-stars {
    position: relative;
    font-size: 16px;
    line-height: 1;
    letter-spacing: 2px;
}

.movies-stars-bg,
.movies-stars-fg {
    white-space: nowrap;
}

.movies-stars-bg {
    color: var(--window-border);
}

.movies-stars-fg {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    width: 0%;
    color: #00e054;
}

.movies-heart {
    font-size: 16px;
    color: var(--window-border);
}

.movies-heart.liked {
    color: #ff8000;
}

.movies-footer {
    padding: 8px 12px 10px;
    border-top: 1px solid var(--window-border);
}

.letterboxd-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    white-space: nowrap;
    color: var(--muted);
    text-decoration: none;
}

.letterboxd-link:hover {
    color: var(--fg-dim);
}

.letterboxd-dots {
    display: inline-flex;
    align-items: center;
}

.letterboxd-dots .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.letterboxd-dots .dot + .dot {
    margin-left: -3px;
}

.dot-orange {
    background: #ff8000;
}

.dot-green {
    background: #00e054;
}

.dot-blue {
    background: #40bcf4;
}

/* ---------- last.fm details: floating window (like the avatar window) ---------- */

.lastfm-window {
    width: 300px;
    z-index: 2;
}

.lastfm-window-art {
    display: block;
    width: 100%;
    height: auto;
}

.lastfm-window-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--window-border);
}

.lastfm-scrobbles-link {
    display: block;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted);
    text-decoration: none;
}

.lastfm-scrobbles-link:hover {
    color: var(--fg-dim);
}

.lastfm-brand {
    color: #d1170e;
}

/* ---------- senha.exe: text input widget ---------- */

.password-form {
    display: flex;
    gap: 6px;
    padding: 12px;
}

.password-input {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border: 1px solid var(--window-border);
    color: var(--fg);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 8px;
}

.password-input:focus {
    outline: 1px solid var(--fg-dim);
}

.password-submit {
    border: 1px solid var(--window-border);
    padding: 6px 10px;
    font-size: 13px;
}

.password-submit:hover {
    color: #fff;
    border-color: var(--fg-dim);
}

.password-input.shake {
    color: var(--swatch-flama);
    border-color: var(--swatch-flama);
    animation: password-shake 0.4s ease;
}

@keyframes password-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.password-input.success {
    color: #00e054;
    border-color: #00e054;
    animation: password-flash 0.5s ease 2;
}

@keyframes password-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* ---------- simple sub-pages ---------- */

.page {
    position: relative;
    width: 850px;
    max-width: 100%;
    margin: 0 auto;
    padding: 60px 20px;
}

.back-link {
    display: inline-block;
    margin-bottom: 40px;
    text-decoration: none;
    color: var(--muted);
}

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

.page h1 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 10px;
}

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

/* ---------- small screens ---------- */

@media (max-width: 900px) {
    .stage {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        min-height: 0;
        padding: 24px 16px;
    }

    .stage > * {
        position: static !important;
    }

    .window {
        width: 100%;
        max-width: 330px;
    }
}
