/* GEARFRY INDEX CARD */
.gearfry-box .flip-card {
    height: 328px; /* same as your current shared flip-card height */
}

.gearfry-box {
    overflow: hidden;
}

.gearfry-content,
.gearfry-back-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.gearfry-image-wrap {
    position: relative;

    flex: 0 0 auto;
    align-self: center;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    height: auto;
    max-width: 100%;

    padding: 0;
    overflow: visible;
}

.gearfry-image {
    display: block;

    width: auto;
    height: 240px;
    max-width: 100%;
    max-height: 240px;

    object-fit: contain;

    background: transparent;
    border: 1px solid rgba(245, 241, 230, 0.2);
    border-radius: 3px;
    cursor: pointer;

    filter: sepia(0.20) brightness(0.93) saturate(0.88);
    transition:
        filter 0.5s ease,
        box-shadow 0.5s ease;
}

.gearfry-image:hover {
    filter: sepia(0.07) brightness(0.97) saturate(0.94);
}

.gearfry-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding-top: 9px;
}

.gearfry-date {
    min-width: 52px;
    text-align: center;
    font-size: 11px;
    color: rgba(245, 241, 230, 0.75);
    letter-spacing: 0.4px;
    cursor: pointer;
}

.gearfry-date-btn {
    appearance: none;
    border: 1px solid rgba(255, 214, 102, 0.28);
    background: rgba(255, 214, 102, 0.06);
    color: #ffd666;
    font: inherit;
    font-size: 13px;
    line-height: 1;
    padding: 2px 8px;
    cursor: pointer;
    opacity: 0.82;
}

.gearfry-date-btn:hover {
    opacity: 0.95;
    background: rgba(255, 214, 102, 0.08);
    border-color: rgba(255, 214, 102, 0.28);
}

.gearfry-date-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* overlay */
.gearfry-inflate-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.gearfry-inflate-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* inflated image */
.gearfry-img.gearfry-inflated {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);

    max-width: 90vw;
    max-height: 90vh;

    width: auto;
    height: auto;

    z-index: 1001;

    background: #fff;
    box-shadow: 0 0 30px rgba(0,0,0,0.6);

    cursor: pointer;
}

/* =========================
   GEARFRY / INDEX INFLATED IMAGE
   same structure as Tea Time
   ========================= */

#image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 1000;
}

#inflated-image {
    position: fixed;
    z-index: 1001;
    display: none;
    cursor: pointer;
    transition: all 0.6s ease;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    background: #fff;
}

#close-hint {
    position: fixed;
    z-index: 1002;

    font-size: 18px;
    font-weight: 700;
    line-height: 1;

    color: rgba(255,255,255,0.65);
    text-shadow: 0 0 3px rgba(255,255,255,0.25);

    opacity: 0;
    pointer-events: auto;

    transition:
        opacity 0.4s ease,
        transform 0.6s ease,
        text-shadow 0.4s ease;

    transform-origin: center;
    cursor: pointer;
}

#close-hint:hover {
    text-shadow:
        0 0 6px rgba(255,255,255,0.6),
        0 0 12px rgba(255,214,102,0.35);
}

.gearfry-img.is-source-hidden {
    opacity: 0;
}

/* inflated navigation arrows */
.inflate-nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;

    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 26px;
    line-height: 1;
    color: rgba(255,255,255,0.72);

    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;

    cursor: pointer;
    opacity: 0;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.inflate-nav-arrow:hover {
    background: rgba(0,0,0,0.32);
    color: rgba(255,255,255,0.95);
}

.inflate-nav-arrow.active {
    opacity: 1;
    pointer-events: auto;
}

.inflate-nav-arrow.disabled {
    opacity: 0.2;
    pointer-events: none;
}

#inflate-prev {
    left: 24px;
}

#inflate-next {
    right: 24px;
}

#inflate-prev,
#inflate-next {
    left: auto;
    right: auto;
}

html,
body {
    overflow-x: hidden;
}

/* =========================
   GEARFRY VEIL (WRAP EFFECT)
   ========================= */

.gearfry-image-wrap {
    position: relative;
}

/* block hover + clicks underneath */
.gearfry-has-veil .gearfry-image {
    pointer-events: none;
}

/* veil layer */
.gearfry-veil {
    position: absolute;
    inset: 0;
    z-index: 5;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    overflow: hidden;
    border-radius: 3px;

    background:
        linear-gradient(135deg,
            rgba(255, 214, 102, 0.12),
            rgba(255, 244, 214, 0.18),
            rgba(255, 214, 102, 0.12)
        ),
        rgba(25, 18, 12, 0.85);

    box-shadow:
        inset 0 0 16px rgba(255, 214, 102, 0.12),
        0 0 10px rgba(0,0,0,0.25);

    transform: scale(1);
    transition:
        transform 0.45s ease,
        opacity 0.45s ease;
}

/* subtle texture */
.gearfry-veil::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        repeating-linear-gradient(
            -45deg,
            rgba(255,255,255,0.02) 0px,
            rgba(255,255,255,0.02) 6px,
            rgba(255,214,102,0.04) 6px,
            rgba(255,214,102,0.04) 12px
        );
}

.gearfry-veil::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background:
        linear-gradient(
            115deg,
            transparent 0%,
            transparent 34%,
            rgba(255, 255, 255, 0.00) 40%,
            rgba(255, 255, 255, 0.14) 46%,
            rgba(255, 244, 214, 0.28) 50%,
            rgba(255, 255, 255, 0.14) 54%,
            rgba(255, 255, 255, 0.00) 60%,
            transparent 66%,
            transparent 100%
        ),
        linear-gradient(
            115deg,
            transparent 0%,
            transparent 32%,
            rgba(255,255,255,0.00) 44%,
            rgba(255,255,255,0.22) 49%,
            rgba(255,255,255,0.00) 54%,
            transparent 68%,
            transparent 100%
        );

    mix-blend-mode: screen;
    opacity: 0.34;

    -webkit-mask-image: linear-gradient(
        90deg,
        rgba(0,0,0,0.18) 0%,
        rgba(0,0,0,0.95) 30%,
        rgba(0,0,0,0.28) 52%,
        rgba(0,0,0,0.90) 74%,
        rgba(0,0,0,0.20) 100%
    );
    -webkit-mask-size: 200% 100%;
    -webkit-mask-position: 0% 0%;
    -webkit-mask-repeat: no-repeat;

    mask-image: linear-gradient(
        90deg,
        rgba(0,0,0,0.18) 0%,
        rgba(0,0,0,0.95) 30%,
        rgba(0,0,0,0.28) 52%,
        rgba(0,0,0,0.90) 74%,
        rgba(0,0,0,0.20) 100%
    );
    mask-size: 200% 100%;
    mask-position: 0% 0%;
    mask-repeat: no-repeat;

    animation: gearfry-wrap-gloss 5600ms ease-in-out infinite alternate;
    transition: opacity 220ms ease-out;
}

@keyframes gearfry-wrap-gloss {
    0% {
        -webkit-mask-position: 0% 0%;
        mask-position: 0% 0%;
        opacity: 0.22;
    }
    100% {
        -webkit-mask-position: 100% 0%;
        mask-position: 100% 0%;
        opacity: 0.42;
    }
}

/* ribbon cross */
.gearfry-veil-ribbon {
    position: absolute;
    background: linear-gradient(
        180deg,
        rgba(255, 214, 102, 0.95),
        rgba(215, 179, 93, 0.85)
    );
    box-shadow: 0 0 6px rgba(255,214,102,0.2);
}

.gearfry-veil-ribbon-v {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 10px;
    transform: translateX(-50%);
}

.gearfry-veil-ribbon-h {
    left: 0;
    right: 0;
    top: 50%;
    height: 10px;
    transform: translateY(-50%);
}


/* unwrap animation */
.gearfry-veil.is-unwrapping {
    transform: scale(0.9) rotate(2deg);
    opacity: 0;
}

/* =========================
   CONFETTI
   ========================= */

.gearfry-confetti {
    position: fixed;
    width: 7px;
    height: 7px;
    pointer-events: none;
    z-index: 6;

    border-radius: 1px;

    transform: translate(0,0) rotate(0deg);
    animation: gearfry-confetti-burst 1400ms cubic-bezier(0.2,0.8,0.2,1) forwards;
}

@keyframes gearfry-confetti-burst {
    0% {
        opacity: 1;
        transform: translate(0,0) scale(1) rotate(0deg);
    }

    70% {
        opacity: 1;
        transform: translate(var(--x), var(--y)) scale(0.9) rotate(var(--r));
    }

    85% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) scale(0.6) rotate(var(--r));
    }
}


.gearfry-veil-ribbon {
    transition:
        transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 240ms ease-out;
}

.gearfry-veil-ribbon-v {
    transform: translateX(-50%) scaleY(1);
}

.gearfry-veil-ribbon-h {
    transform: translateY(-50%) scaleX(1);
}

.gearfry-veil.is-unwrapping .gearfry-veil-ribbon-v {
    transform: translateX(-50%) scaleY(1.09) rotate(2.5deg);
    opacity: 0.25;
}

.gearfry-veil.is-unwrapping .gearfry-veil-ribbon-h {
    transform: translateY(-50%) scaleX(1.09) rotate(-2.5deg);
    opacity: 0.25;
}

/* =========================
   GEARFRY BACK CONTENT TUNING
   ========================= */

.gearfry-back-content {
    font-size: 12.5px;
    line-height: 1.55;
    padding: 10px 12px;
}

/* tighter rhythm like tokens */
.gearfry-back-content .index-token-back-text {
    margin-bottom: 8px;
}

/* opening line emphasis */
.gearfry-intro {
    font-size: 13px;
    color: #ffd666;
    letter-spacing: 0.3px;
}

/* "Think:" line gets a slightly different tone */
.gearfry-think {
    opacity: 0.85;
    font-style: italic;
}

/* signoff spacing */
.gearfry-signoff-text {
    margin-top: 10px;
}

/* =========================
   MINI SIGN-OFF (LAW PROFILE)
   ========================= */

.gearfry-signoff {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-top: 6px;
    margin-left: 4px;

    font-family: DejaVuSansMono, monospace;
    font-size: 0.75rem;
    color: #faf9f6;
    transform: translate(8px,6px);
}

/* reuse style but smaller */
.gearfry-signoff .profile-img {
    width: 18px;
    height: 18px;
    border: 1.5px solid #faf9f6;
    border-radius: 4px;
    object-fit: cover;
}

/* tilde */
.gearfry-signoff .sig-mark {
    color: #faf9f6;
    opacity: 0.85;
}

/* name */
.gearfry-signoff .name {
    font-weight: bold;
    color: #faf9f6;
    font-size: 0.8rem;
}

.gearfry-accent {
    color: rgba(255, 214, 102, 0.75); /* muted gilded tone */
}

.gearfry-more {
    margin: 10px 0 6px;
    font-size: 11px;
    text-align: center;
    font-style: italic;
    color: rgba(245, 241, 230, 0.7);
    transform: translate(-8px,2px);
}

.gearfry-more a {
    color: #ffd666;
    text-decoration: none;
    font-style: normal; /* keeps arrow crisp like Tokens */
}

.gearfry-more a:hover {
    text-decoration: underline;
}