/* sf6-beacon.css — Shared beacon button + modal styles
 * Default --seam: 20vw, desktop override to 35vw.
 * Pages may override --seam in their own :root. */

:root {
    --seam: 20vw;
}

@media (min-width: 1001px) {
    :root { --seam: 35vw; }
}

/* ========================================
   MOTES CANVAS
   ======================================== */

.sf6-motes-canvas {
    position: fixed;
    width: 120px;
    height: 120px;
    z-index: 9999;
    pointer-events: none;
    bottom: 2.5rem;
    right: var(--seam);
    transform: translate(50%, 50%) translateY(-30px);
}

/* ========================================
   PLUS BEACON — the rune at the seam
   ======================================== */

.sf6-plus {
    position: fixed;
    bottom: 2.5rem;
    right: var(--seam);
    transform: translateX(50%);
    z-index: 10000;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    background: none;
    border: none;
    padding: 0;
    outline: none;
    --beacon-hue: 220;
    color: hsla(var(--beacon-hue), 85%, 45%, 0.8);
    transition: color 300ms ease;
}

.sf6-plus-svg {
    display: block;
    animation: beacon-wobble 8s ease-in-out infinite, beacon-breathe 6s ease-in-out infinite;
    filter: drop-shadow(0 0 8px hsla(var(--beacon-hue), 80%, 50%, 0.5));
}

@keyframes beacon-wobble {
    0%, 100% { transform: rotate(0deg) translate(0, 0); }
    15% { transform: rotate(3deg) translate(1px, -1px); }
    30% { transform: rotate(-2deg) translate(-1px, 0.5px); }
    50% { transform: rotate(2.5deg) translate(0.5px, -1.5px); }
    65% { transform: rotate(-3.5deg) translate(-1.5px, 1px); }
    80% { transform: rotate(1.5deg) translate(1px, 0.5px); }
}

@keyframes beacon-breathe {
    0%, 100% { filter: drop-shadow(0 0 6px hsla(var(--beacon-hue), 80%, 50%, 0.4)); }
    50% { filter: drop-shadow(0 0 14px hsla(var(--beacon-hue), 80%, 55%, 0.7)); }
}

.sf6-plus-ring {
    transition: stroke-dashoffset 400ms ease;
}

.sf6-plus-lines {
    transform-origin: 26px 26px;
    transition: transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sf6-plus:hover {
    color: hsla(220, 85%, 45%, 1);
}

.sf6-plus:hover .sf6-plus-svg {
    animation: beacon-wobble 4s ease-in-out infinite;
    filter: drop-shadow(0 0 18px hsla(220, 85%, 55%, 0.8));
    transform: scale(1.1);
}

.sf6-plus:hover .sf6-plus-ring {
    stroke-dashoffset: 0;
}

.sf6-plus.is-open {
    color: hsla(215, 70%, 50%, 0.6);
}

.sf6-plus.is-open .sf6-plus-svg {
    animation: beacon-wobble 12s ease-in-out infinite;
    filter: drop-shadow(0 0 4px hsla(215, 70%, 50%, 0.3));
    transform: scale(1);
}

.sf6-plus.is-open .sf6-plus-ring {
    stroke-dashoffset: 0;
}

.sf6-plus.is-open .sf6-plus-lines {
    transform: rotate(45deg);
}

/* Docked: X has migrated to the modal corner */
.sf6-plus.is-docked {
    color: hsla(215, 80%, 70%, 0.9);
    z-index: 10001;
}

.sf6-plus.is-docked .sf6-plus-svg {
    animation: none;
    filter: drop-shadow(0 0 6px hsla(215, 80%, 60%, 0.5));
}

.sf6-plus.is-docked:hover {
    color: hsla(0, 80%, 65%, 1);
}

.sf6-plus.is-docked:hover .sf6-plus-svg {
    filter: drop-shadow(0 0 12px hsla(0, 80%, 60%, 0.6));
    transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
    .sf6-plus-svg {
        animation: none !important;
        filter: drop-shadow(0 0 8px hsla(220, 80%, 50%, 0.5));
    }
    .sf6-motes-canvas { display: none; }
}

/* ========================================
   SCRIM
   ======================================== */

.sf6-scrim {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease-out;
}

.sf6-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   BEACON MODAL — the label + map
   ======================================== */

.sf6-modal {
    position: fixed;
    bottom: max(1rem, calc(2.5rem + 70px));
    right: max(1rem, calc(var(--seam) - 320px));
    width: 640px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
    border-radius: 16px;
    border: 1px solid rgba(100, 160, 220, 0.2);
    box-shadow:
        0 0 40px rgba(40, 80, 160, 0.2),
        0 0 80px rgba(30, 100, 180, 0.12),
        0 0 120px rgba(20, 60, 140, 0.08);

    /* Deep navy, more translucent to let page through */
    background:
        linear-gradient(
            135deg,
            rgba(40, 60, 140, 0.18) 0%,
            rgba(20, 80, 160, 0.14) 50%,
            rgba(30, 50, 120, 0.12) 100%
        ),
        rgba(8, 16, 40, 0.72);
    background-size: 300% 300%;
    animation: aurora-drift 12s ease-in-out infinite paused;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    /* Bloop: start hidden at scale 0, anchored to bottom-right */
    transform: scale(0);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 200ms ease-out;
}

@keyframes aurora-drift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.sf6-modal::-webkit-scrollbar { width: 4px; }
.sf6-modal::-webkit-scrollbar-track { background: transparent; }
.sf6-modal::-webkit-scrollbar-thumb { background: rgba(153, 204, 255, 0.2); border-radius: 2px; }

/* --- Two-column inner layout --- */

.sf6-modal-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 32px;
    font-family: "SF Mono", "Fira Code", Consolas, monospace;
}

/* --- Left column: The Label --- */

.sf6-modal-label {
    border-right: 1px solid rgba(153, 204, 255, 0.1);
    padding-right: 2rem;
}

.sf6-label-name {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #99ccff;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    text-decoration: none;
    transition: color 200ms ease;
}

.sf6-label-name:hover { color: #fff; }

.sf6-label-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Card label (populated from card.json) */

.sf6-label-type {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(153, 204, 255, 0.6);
    border: 1px solid rgba(153, 204, 255, 0.2);
    border-radius: 3px;
    padding: 2px 8px;
    margin-bottom: 12px;
}

.sf6-label-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 8px;
}

.sf6-label-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 16px;
}

.sf6-label-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 16px;
}

.sf6-label-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.sf6-label-ingredient {
    font-size: 10px;
    color: rgba(180, 220, 255, 0.8);
    background: rgba(153, 204, 255, 0.08);
    border: 1px solid rgba(153, 204, 255, 0.15);
    border-radius: 4px;
    padding: 3px 8px;
    transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.sf6-label-ingredient:hover {
    background: rgba(153, 204, 255, 0.18);
    border-color: rgba(153, 204, 255, 0.35);
    box-shadow: 0 0 8px rgba(153, 204, 255, 0.15);
}

.sf6-label-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sf6-label-tag {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
}

.sf6-label-tag::before {
    content: '#';
    opacity: 0.5;
}

/* --- Right column: The Map --- */

.sf6-modal-map {
    padding-top: 4px;
}

/* --- Shared styles --- */

.sf6-sep {
    height: 1px;
    background: linear-gradient(90deg, rgba(153, 204, 255, 0.15), rgba(100, 200, 160, 0.15), rgba(153, 204, 255, 0.05));
    background-size: 200% 100%;
    margin: 24px 0;
}

.sf6-modal.is-open .sf6-sep {
    animation: shimmer-line 1.5s ease-out 0.3s 1;
}

@keyframes shimmer-line {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.sf6-section-header {
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(153, 204, 255, 0.5);
    margin-bottom: 14px;
}

.sf6-socials {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.sf6-social-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(153, 204, 255, 0.1);
    border: 1px solid rgba(153, 204, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
    position: relative;
    text-decoration: none;
}

.sf6-social-icon:hover {
    background: rgba(200, 80, 80, 0.12);
    border-color: rgba(200, 80, 80, 0.3);
    box-shadow: 0 0 10px rgba(200, 80, 80, 0.15);
}

.sf6-social-icon svg { width: 13px; height: 13px; fill: #99ccff; opacity: 0.7; }
.sf6-social-icon:hover svg { fill: hsla(0, 80%, 75%, 1); opacity: 1; }

.sf6-social-icon::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    letter-spacing: 0.5px;
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    padding: 3px 7px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
}

.sf6-social-icon:hover::after { opacity: 1; }

.sf6-explore-links { list-style: none; }
.sf6-explore-links li { margin-bottom: 0; }

.sf6-explore-links a {
    display: block;
    padding: 4px 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-radius: 6px;
    transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.sf6-explore-links a:hover {
    color: hsla(0, 80%, 75%, 1);
    background: rgba(200, 80, 80, 0.08);
    box-shadow: inset 0 0 20px rgba(200, 80, 80, 0.06), 0 0 12px rgba(200, 80, 80, 0.08);
}

/* Electric flash on hover — nav links */
@keyframes electric-flash {
    0%   { box-shadow: inset 0 0 30px rgba(200, 80, 80, 0.2), 0 0 20px rgba(200, 80, 80, 0.12); }
    100% { box-shadow: inset 0 0 20px rgba(200, 80, 80, 0.06), 0 0 12px rgba(200, 80, 80, 0.08); }
}

.sf6-explore-links a:hover {
    animation: electric-flash 300ms ease-out;
}

.sf6-feed-item { margin-bottom: 16px; }

.sf6-feed-label {
    font-size: 9px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(153, 204, 255, 0.4);
    margin-bottom: 6px;
}

.sf6-feed-track { font-size: 14px; color: #99ccff; }
.sf6-feed-artist { font-size: 12px; color: rgba(255, 255, 255, 0.45); }

/* Glow border on modal open */
@keyframes border-glow {
    0%   { border-color: rgba(80, 120, 220, 0.4); box-shadow: 0 0 30px rgba(80, 120, 220, 0.12); }
    33%  { border-color: rgba(60, 140, 200, 0.35); box-shadow: 0 0 30px rgba(60, 140, 200, 0.1); }
    66%  { border-color: rgba(80, 160, 220, 0.3); box-shadow: 0 0 30px rgba(80, 160, 220, 0.08); }
    100% { border-color: rgba(100, 160, 220, 0.2); box-shadow: none; }
}

.sf6-modal.is-open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
    animation: aurora-drift 12s ease-in-out infinite,
               border-glow 3s ease-out 1;
    box-shadow:
        0 0 60px rgba(40, 80, 160, 0.25),
        0 0 100px rgba(30, 100, 180, 0.15),
        0 0 160px rgba(20, 60, 140, 0.1);
}

/* ========================================
   RESPONSIVE — beacon + modal
   ======================================== */

@media (max-width: 700px) {
    .sf6-plus {
        bottom: 1.5rem;
    }

    .sf6-plus:hover { transform: translateX(50%) scale(1.08); }
    .sf6-plus.is-open { transform: translateX(50%); }

    .sf6-motes-canvas {
        bottom: 1.5rem;
    }

    .sf6-modal {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-height: calc(100vh - 2rem);
    }

    .sf6-modal-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 24px;
    }

    .sf6-modal-label {
        border-right: none;
        border-bottom: 1px solid rgba(153, 204, 255, 0.1);
        padding-right: 0;
        padding-bottom: 1.5rem;
    }
}
