/* =============================================================
   EASTER EGGS (página sobre) — gatilhos no texto + dialogs em tela cheia.
   Cores pelos tokens de nav.css; movimento pelo GSAP (js/egg-*.js).
   ============================================================= */

/* --- Gatilhos: parecem texto sublinhado com um ícone discreto --- */
.egg-trigger {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline dotted;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s ease;
}

.egg-trigger:hover {
    text-decoration-style: solid;
}

.egg-trigger:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 3px;
    border-radius: 2px;
}

.egg-trigger svg {
    display: inline-block;
    width: 0.95em;
    height: 0.95em;
    margin-left: 0.25em;
    vertical-align: -0.12em;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.egg-trigger:hover svg {
    transform: rotate(180deg);
}

.egg-trigger[aria-busy="true"] {
    cursor: progress;
}

/* --- Dialog --- */
html.egg-open {
    overflow: hidden;
}

dialog.egg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--bg);
    color: var(--fg);
    overflow: hidden;
}

dialog.egg::backdrop {
    background: transparent;
}

.egg-inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px clamp(20px, 3vw, 40px) 24px;
}

.egg-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    z-index: 5;
}

.egg-title {
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    font-size: clamp(32px, 4vw, 56px);
    line-height: 1;
    letter-spacing: -0.015em;
    margin: 0 0 6px;
}

.egg-sub {
    font-size: 14px;
    opacity: 0.6;
    margin: 0;
}

.egg-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.egg-button {
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--fg);
    color: var(--bg);
    font: 600 14px/1 "DM Sans", sans-serif;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.egg-button:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.egg-close {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.egg-close:hover {
    background: var(--hover);
    transform: rotate(90deg);
}

.egg-close svg {
    width: 20px;
    height: 20px;
}

.egg-button:focus-visible,
.egg-close:focus-visible,
.globe-country:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 3px;
}

.egg-sample {
    position: absolute;
    left: clamp(20px, 3vw, 40px);
    bottom: 20px;
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--hover);
    font-size: 13px;
    white-space: nowrap;
    opacity: 0.8;
}

/* =============================================================
   COLEÇÃO DE DISCOS — marquee vertical no terço do meio, ficha nos de fora
   ============================================================= */
.egg-vinis {
    --w: min(26vw, 50vh, 400px); /* lado da capa */
    padding: 0;
}

.egg-vinis .egg-head {
    justify-content: flex-end;
    padding: 20px clamp(20px, 3vw, 40px) 0;
}

.egg-globo .egg-head {
    justify-content: flex-end;
}

/* Me surpreenda: embaixo, no centro; no celular entra no fluxo, sob a ficha. */
.vi-shuffle {
    position: absolute;
    left: 50%;
    bottom: clamp(20px, 4vh, 40px);
    transform: translateX(-50%);
    pointer-events: auto;
}

.vi-shuffle:hover {
    transform: translateX(-50%) translateY(-1px);
}

/* Selinho: bolinha com o texto girando, no canto da capa. */
.vm-seal {
    position: absolute;
    top: -9%;
    right: -9%;
    z-index: 2;
    width: max(27%, 62px);
    aspect-ratio: 1;
    pointer-events: none;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
}

.vm-seal svg {
    display: block;
    width: 100%;
    height: 100%;
    animation: seal-spin 16s linear infinite;
}

.vm-seal circle {
    fill: #111;
}

.vm-seal text {
    fill: #fff;
    font: 700 9.4px "DM Sans", sans-serif;
    letter-spacing: 0.04em;
}

.vm-seal i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20%;
    height: 20%;
    margin: -10% 0 0 -10%;
    background: #fff;
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.vm-seal--first circle {
    fill: #d9a441;
}

.vm-seal--first text {
    fill: #111;
}

.vm-seal--first i {
    background: #111;
}

@keyframes seal-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vm-seal svg {
        animation: none;
    }
}

/* A marquee ocupa a tela inteira (arrastar e rolar valem em qualquer ponto);
   as capas ficam centradas, ou seja, no terço do meio. */
.vm {
    position: absolute;
    inset: 0;
    z-index: 0;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
}

.vm.is-grabbing {
    cursor: grabbing;
}

.vm:focus,
.vm:focus-visible,
.vm-item:focus,
.vm-item:focus-visible {
    outline: none;
}

.vm-stage {
    position: absolute;
    inset: 0;
}

.vm-item {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: var(--w);
    height: var(--w);
    margin: calc(var(--w) / -2) 0 0 calc(var(--w) / -2);
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.12);
    cursor: inherit;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.vm-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    pointer-events: none;
}

.vm-generated {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
    height: 100%;
    padding: 8%;
    border-radius: 6px;
    background: #1a1a1a;
    color: #f2f2f2;
    text-align: left;
}

.vm-generated span {
    font-family: "Instrument Serif", serif;
    font-size: calc(var(--w) * 0.14);
    line-height: 0.95;
}

.vm-generated small {
    font-size: calc(var(--w) * 0.05);
    opacity: 0.7;
}

/* O vinil: fica atrás da capa do centro e desliza para fora quando a
   coleção para. */
.vdisc {
    position: absolute;
    left: 2%;
    top: 2%;
    z-index: -1; /* dentro da capa: atrás da imagem */
    width: 96%;
    height: 96%;
    border-radius: 50%;
    background:
        repeating-radial-gradient(circle at 50% 50%, transparent 0 2px, var(--groove, rgba(255, 255, 255, 0.045)) 2px 4px),
        var(--disc, #121212);
    box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(128, 128, 128, 0.28);
    opacity: 0;
    transform: translate3d(0, 0, 0);
    /* Recolhe rápido para dentro da capa e some só depois de entrar. */
    transition: transform 0.5s cubic-bezier(0.55, 0, 0.3, 1), opacity 0.12s ease 0.45s;
    pointer-events: none;
}

.vdisc.is-out {
    opacity: 1;
    transform: translate3d(35%, 0, 0);
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}

.vdisc-rotor {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: vdisc-spin 1.8s linear infinite;
    animation-play-state: paused;
}

.vdisc.is-out .vdisc-rotor {
    animation-play-state: running;
}

.vdisc-label {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34%;
    height: 34%;
    margin: -17% 0 0 -17%;
    border-radius: 50%;
    background: #333 center / cover no-repeat;
}

.vdisc-label::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7%;
    height: 7%;
    margin: -3.5% 0 0 -3.5%;
    border-radius: 50%;
    background: #0b0b0b;
}

/* Brilho fixo que não gira junto com o vinil. */
.vdisc-sheen {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 20deg, transparent 0 18%, rgba(255, 255, 255, 0.1) 25%, transparent 32% 68%, rgba(255, 255, 255, 0.08) 75%, transparent 82%);
}

@keyframes vdisc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Os terços de fora: ficha do disco do centro. */
.vi {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0 clamp(20px, 3vw, 48px);
    pointer-events: none;
}

.vi-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.vi-left {
    grid-column: 1;
    padding-right: clamp(0px, 2vw, 32px);
}

.vi-right {
    grid-column: 3;
    align-items: flex-end;
    text-align: right;
    padding-left: clamp(56px, 7vw, 120px); /* o vinil invade um pouco este terço */
}

.vi-artist {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    /* Cinza apagado pela cor (não por opacity: o GSAP anima a opacidade da ficha). */
    color: color-mix(in srgb, var(--fg) 42%, transparent);
}

.vi-album {
    margin: 0 0 18px;
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    font-size: clamp(40px, 5.6vw, 92px);
    line-height: 0.95;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.vi-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

.vi-meta i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
}

.vi-meta i[hidden] {
    display: none;
}

.vi-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin: 18px 0 0;
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.vi-tag[hidden] {
    display: none;
}

.vi-tag i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d9a441;
}

.vi-count {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 clamp(24px, 6vh, 56px);
    font-variant-numeric: tabular-nums;
}

.vi-count b {
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    font-size: clamp(56px, 7vw, 112px);
    line-height: 0.9;
    letter-spacing: -0.03em;
}

.vi-count span {
    font-size: 13px;
    opacity: 0.5;
}

.vi-fact,
.vi-rate {
    width: min(100%, 320px);
    padding: 14px 0;
    border-top: 1px solid var(--line);
    text-align: left;
}

.vi-fact-label {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.5;
}

.vi-fact-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    text-wrap: pretty;
}

.vi-rate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.vi-rate .vi-fact-label {
    margin: 0;
}

.vi-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.vi-dots span {
    width: 9px;
    height: 9px;
    border: 1px solid currentColor;
    border-radius: 50%;
    opacity: 0.35;
}

.vi-dots span.on {
    background: currentColor;
    opacity: 1;
}

/* Celular: três faixas empilhadas — ficha em cima, marquee no meio, ficha embaixo. */
@media (max-width: 899px) {
    .egg-vinis {
        --w: min(60vw, 30vh);
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .vi-shuffle {
        position: static;
        order: 4;
        align-self: center;
        margin-top: 10px;
        transform: none;
    }

    .vi-shuffle:hover {
        transform: translateY(-1px);
    }

    .vm {
        position: relative;
        inset: auto;
        flex: 1;
        min-height: 0;
        margin-top: 4px;
        -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
        mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
    }

    .vi {
        display: contents;
    }

    .vi-col {
        justify-content: flex-start;
        padding: 0 20px;
    }

    /* O X fica no canto e a ficha começa na mesma altura que ele. */
    .egg-vinis .egg-head {
        position: absolute;
        top: 0;
        right: 0;
        padding: 20px;
    }

    .vi-left {
        order: 1;
        padding: 24px 84px 0 20px;
    }

    .vm {
        order: 2;
    }

    .vi-right {
        order: 3;
        align-items: stretch;
        text-align: left;
    }

    .vi-album {
        font-size: clamp(34px, 10vw, 52px);
        margin-bottom: 10px;
    }

    .vi-artist {
        margin-bottom: 8px;
    }

    .vi-count {
        margin-bottom: 8px;
    }

    .vi-count b {
        font-size: 40px;
    }

    .vi-fact,
    .vi-rate {
        width: 100%;
        padding: 10px 0;
    }

    .vi-fact-label {
        margin-bottom: 4px;
    }

    .vi-fact-text {
        font-size: 13.5px;
        line-height: 1.45;
    }
}

/* =============================================================
   GLOBO
   ============================================================= */
.globe-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
    align-items: center;
    gap: clamp(16px, 4vw, 64px);
}

.globe-wrap {
    position: relative;
    width: min(100%, 72vh, 680px);
    aspect-ratio: 1;
    justify-self: center;
}

.globe-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

.globe-canvas.is-grabbing {
    cursor: grabbing;
}

/* Rótulo preso ao marcador (anchor positioning). Some atrás do globo pela
   variável de visibilidade que o cobe publica. */
.globe-label {
    display: none;
}

@supports (position-anchor: --a) {
    .globe-label {
        display: block;
        position: absolute;
        bottom: anchor(top);
        left: anchor(center);
        translate: -50% -6px;
        padding: 4px 9px;
        border-radius: 999px;
        background: var(--bubble-bg-light);
        border: 1px solid var(--bubble-border-light);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    /* Só o país ativo mostra o rótulo (a Europa junta é apertada demais). */
    .globe-label:not(.is-on) {
        display: none;
    }
}

.globe-panel {
    align-self: center;
    max-height: 100%;
    overflow: auto;
}

.globe-stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 8px 28px;
    margin: 0 0 24px;
}

.globe-stats dt {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.55;
    margin-bottom: 4px;
}

.globe-stats dd {
    margin: 0;
    font-family: "Instrument Serif", serif;
    font-size: clamp(30px, 3vw, 44px);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.globe-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.globe-country {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: 16px/1.2 "DM Sans", sans-serif;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.globe-country:hover,
.globe-country.is-active {
    background: var(--hover);
}

.globe-flag {
    font-size: 22px;
    line-height: 1;
}

.globe-info {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.globe-cities {
    font-size: 12.5px;
    line-height: 1.35;
    opacity: 0.55;
}

.globe-km {
    font-size: 13px;
    opacity: 0.55;
    font-variant-numeric: tabular-nums;
}

/* --- Celular --- */
@media (max-width: 768px) {
    .egg-head .egg-button {
        padding: 10px 14px;
        font-size: 13px;
    }

    .globe-layout {
        grid-template-columns: 1fr;
        align-content: start;
        overflow: auto;
    }

    .globe-wrap {
        width: min(100%, 52vh);
    }

    .globe-stats dd {
        font-size: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .egg-trigger svg,
    .egg-close,
    .egg-button {
        transition: none;
    }
}
