/* ─── Archive Page ─────────────────────────────────────────────────────────── */

@font-face {
    font-family: 'ArbelG';
    src: url('../fonts/ui/ArbelG-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

a { pointer-events: auto; }

/* ─── Custom cursor ──────────────────────────────────────────────────────── */
#custom-cursor {
    position: fixed;
    width: 1.25vw;
    height: 1.25vw;
    border-radius: 50%;
    background-color: transparent;
    border: 1.5px solid #000;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    top: -100px;
    left: -100px;
    transition: border-color 0.2s ease;
}

#custom-cursor.snapped {
    transition: border-color 0.2s ease,
                width  0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                height 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                left   0.3s  cubic-bezier(0.25, 0.46, 0.45, 0.94),
                top    0.3s  cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ─── Page base ──────────────────────────────────────────────────────────── */
html {
    background-color: #fcfbf7;
}

body {
    font-family: 'ArbelG', 'Helvetica Neue', Arial, sans-serif;
    background-color: #fcfbf7;
    width: 100vw;
    min-height: 75vw; /* row 2 bottom: ~69.14vw + padding */
    position: relative;
    overflow-x: hidden;
}

/* ─── Top row (fixed) ────────────────────────────────────────────────────── */

/* Logo icon: matches playground — left: calc(6.32vw - 17px), top: 3vh, 34×34px */
.logo-icon {
    position: fixed;
    left: calc(6.32vw - 17px);
    top: 3vh;
    width: 34px;
    height: 34px;
    z-index: 200;
}

/* Theme toggle – 24px gap to the left of the nav dot, matches playground spacing */
.theme-toggle {
    position: fixed;
    right: calc(2.64vw + 18px + 24px);
    top: 3vh;
    width: 18px;
    height: 18px;
    color: #000;
    z-index: 200;
    cursor: none;
}

/* Nav dot */
.dot {
    position: fixed;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: block;
    text-decoration: none;
    background-color: #000;
    z-index: 200;
}

.dot-top-right {
    right: 2.64vw;
    top: 3vh;
    pointer-events: auto;
}

/* ─── Archive title SVG ──────────────────────────────────────────────────── */
/* x=165, original y=268 moved up to y≈130; w=721.91 h=197 → ÷14.4 */
.archive-title {
    position: absolute;
    left: 15.56vw;   /* aligned with card start */
    top: 6.03vw;     /* ~130px — raised from original 268px */
    width: 50.13vw;  /* 721.91 / 14.4 */
    height: 13.68vw; /* 197 / 14.4 */
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
/* card size: 289×289 → 20.07vw × 20.07vw */

.archive-card {
    position: absolute;
    width: 20.07vw;  /* 289 / 14.4 */
    height: 20.07vw; /* 289 / 14.4 */
    overflow: hidden;
}

/* Card positions – row 1 */
.archive-card-1 { left: 15.56vw; top: 27vw; } /* x=224 */
.archive-card-2 { left: 39.93vw; top: 27vw; } /* x=575 */
.archive-card-3 { left: 64.31vw; top: 27vw; } /* x=926 */

/* Card positions – row 2 (27 + 20.07 + 2vw gap) */
.archive-card-4 { left: 15.56vw; top: 49.07vw; }
.archive-card-5 { left: 39.93vw; top: 49.07vw; }
.archive-card-6 { left: 64.31vw; top: 49.07vw; }

/* Card background images */
.archive-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    transition: opacity 0.3s ease;
}

.archive-card-img-full  { opacity: 0; }

.archive-card:hover .archive-card-img-full  { opacity: 1; }
.archive-card:hover .archive-card-img-empty { opacity: 0; }

/* Text flips to light on hover */
.archive-card:hover .archive-card-text { color: #fcfbf7; }

/* ─── Ball (circle) ──────────────────────────────────────────────────────── */
/* ball absolute positions in page coords → converted to relative within card */
/* Ball offset from card: x+13, y+13 (237-224=13, 453-440=13) */
/* 13/14.4 = 0.903vw from card origin */
.archive-ball {
    position: absolute;
    left: 0.903vw;   /* 13 / 14.4 */
    top: 0.903vw;    /* 13 / 14.4 */
    width: 1.25vw;   /* 18 / 14.4 */
    height: 1.25vw;  /* 18 / 14.4 */
    border-radius: 50%;
    background-color: #000;
    pointer-events: none;
}

/* ─── Card text ──────────────────────────────────────────────────────────── */
.archive-card-text {
    position: absolute;
    left: 1.04vw;    /* ~15px */
    top: 4.7vw;      /* lower within card, below ball/notch area */
    width: calc(100% - 2.08vw);
    max-height: calc(100% - 4.7vw); /* clip at card bottom edge */
    overflow: hidden;
    font-family: 'ArbelG', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.972vw; /* 14px at 1440px */
    line-height: 1.2;
    color: #000;
    white-space: pre-wrap;
    word-break: break-word;
    pointer-events: none;
    user-select: none;
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── Negative theme ─────────────────────────────────────────────────────── */
body.negative {
    background-color: #050505;
}

body.negative .theme-toggle      { color: #fcfbf7; }
body.negative .dot                { background-color: #fcfbf7; }
body.negative #custom-cursor      { border-color: #fcfbf7; }
body.negative .archive-title      { filter: invert(1); }
body.negative .archive-card-img   { filter: invert(1); }
body.negative .archive-ball       { background-color: #fcfbf7; }
body.negative .archive-card-text  { color: #fcfbf7; }

/* Hover in negative: full card is inverted (white), text flips to dark */
body.negative .archive-card:hover .archive-card-text { color: #050505; }

/* ─── Blue / brown theme ─────────────────────────────────────────────────── */
body.blue-theme {
    background-color: #423028;
}

body.blue-theme .theme-toggle      { color: #B6E6FF; }
body.blue-theme .dot                { background-color: #B6E6FF; }
body.blue-theme #custom-cursor      { border-color: #B6E6FF; }
body.blue-theme .archive-ball       { background-color: #B6E6FF; }
body.blue-theme .archive-card-text  { color: #B6E6FF; }

/* Blue theme: archive-blue.svg is already blue — no filter needed */
body.blue-theme .archive-title      { filter: none; }
/* Blue theme: card images use blue variant via JS — no filter needed */
body.blue-theme .archive-card-img   { filter: none; }

/* Hover in blue theme: full blue card, text flips to brown */
body.blue-theme .archive-card:hover .archive-card-text { color: #423028; }
