/* ============================================================
   A is for Albers — Museum UI
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ── Body & canvas ── */
body {
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    background-color: #f4f4ec;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: Georgia, "Times New Roman", serif;
    cursor: pointer;
    color: #1a1510;
}

/* Grain overlay */
body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 10;
    opacity: 0.8;
}

canvas {
    display: block;
    touch-action: none;
}

/* ── Instructions hint ── */
#instructions {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(0, 0, 0, 0.25);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 9.5px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    z-index: 20;
    white-space: nowrap;
    transition: opacity 1.2s ease;
}

/* ── Museum panel ── */
#edition-ui {
    position: fixed;
    bottom: 36px;
    left: 36px;
    z-index: 30;
    width: 252px;

    /* Frosted museum card */
    background: rgba(250, 247, 241, 0.88);
    backdrop-filter: blur(32px) saturate(160%);
    -webkit-backdrop-filter: blur(32px) saturate(160%);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 4px 16px rgba(0, 0, 0, 0.06),
        0 20px 56px rgba(0, 0, 0, 0.07);

    display: flex;
    flex-direction: column;
    padding: 20px 22px 18px;
    cursor: default;

    /* Idle opacity transition */
    transition: opacity 0.8s ease;
    touch-action: manipulation;
}

/* Idle dim — restores on hover/focus */
#edition-ui[data-idle]              { opacity: 0.28; }
#edition-ui:hover,
#edition-ui:focus-within            { opacity: 1 !important; }

/* ── Plaque ── */
#plaque {
    display: grid;
    gap: 5px;
}

#eyebrow {
    margin: 0;
    font-size: 8.5px;
    letter-spacing: 0.30em;
    text-transform: uppercase;
    color: #9a8c7c;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

#title {
    margin: 0;
    font-size: 22px;
    line-height: 1.06;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: #1a1510;
}

#meta {
    margin: 0;
    margin-top: 2px;
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #9a8c7c;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

#seed-value {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    color: #6a5e52;
}

/* ── Actions area ── */
#ui-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 16px;
}

/* ── Buttons ── */
#refresh-variation,
#save-png {
    flex: 1;
    border: 1px solid transparent;
    padding: 11px 10px;
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-appearance: none;
    touch-action: manipulation;
    transition: background 0.15s ease, color 0.15s ease,
                border-color 0.15s ease, transform 0.15s ease;
}

/* Primary — solid dark */
#refresh-variation {
    background: #1a1510;
    color: #f5f0e4;
    border-color: #1a1510;
}
#refresh-variation:hover {
    background: #2e261c;
    border-color: #2e261c;
    transform: translateY(-1px);
}

/* Secondary — ghost */
#save-png {
    background: transparent;
    color: #1a1510;
    border-color: rgba(26, 21, 16, 0.26);
}
#save-png:hover {
    background: rgba(26, 21, 16, 0.05);
    border-color: rgba(26, 21, 16, 0.42);
    transform: translateY(-1px);
}

#refresh-variation:focus-visible,
#save-png:focus-visible {
    outline: 2px solid #1a1510;
    outline-offset: 2px;
}

/* ── Mobile ── */
@media (max-width: 720px) {
    #edition-ui {
        bottom: 24px;
        left: 20px;
        right: 20px;
        width: auto;
    }

    /* Move instructions above panel on mobile */
    #instructions {
        bottom: auto;
        top: 28px;
    }
}
