/* ============================================
   ENARGEIA — About Page (The Rolodex)
   "who is this creature"
   ============================================ */

/* --- Lock page, no scrolling --- */
html:has(.about-page),
html:has(.about-page) body {
    overflow: hidden !important;
    height: 100vh;
    height: 100dvh;
}

.about-page {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;

    /* Tiled background — swap this image later */
    background-color: #050208;
    background-image: url('/assets/images/backgrounds/bgcolcandy.jpg');
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* Fallback pattern if tile image doesn't exist yet */
.about-page::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(196, 181, 253, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 126, 179, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(94, 234, 212, 0.02) 1px, transparent 1px);
    background-size: 40px 40px, 60px 60px, 80px 80px;
}

/* Everything above the pattern */
.about-page > * {
    position: relative;
    z-index: 1;
}

/* --- Nav --- */
.about-nav {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 50;
}

.return-link {
    font-family: 'imweird', cursive;
    font-size: 0.8rem;
    color: #8a8098;
    letter-spacing: 0.1em;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.return-link:hover {
    color: #c4b5fd;
    text-shadow: 0 0 8px rgba(196, 181, 253, 0.3);
}

/* --- Title --- */
.about-title {
    font-family: 'Horns', serif;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    letter-spacing: 0.25em;
    margin-bottom: 0.6rem;
    filter: drop-shadow(0 0 15px rgba(196, 181, 253, 0.2));
    flex-shrink: 0;
}

/* ============================================
   TEXT UTILITY CLASSES
   Use these anywhere on cards or elsewhere.
   ============================================ */

/* Rainbow gradient text */
.rainbow-text {
    background: linear-gradient(
        90deg,
        #ff7eb3, #c4b5fd, #5eead4, #fde68a,
        #c084fc, #ff7eb3
    );
    background-size: 300% 100%;
    animation: shimmer 6s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Floating characters — wrap each character in a span.float-char
   JS will do this automatically for elements with .float-text */
.float-text .float-char {
    display: inline-block;
    animation: char-float 3s ease-in-out infinite;
    animation-delay: var(--d, 0s);
}

@keyframes char-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ============================================
   THE ROLODEX
   ============================================ */

.rolodex {
    position: relative;
    width: clamp(340px, 55vw, 560px);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

/* --- Side Rails --- */
.rolodex-rail {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    z-index: 20;
    background: linear-gradient(
        180deg,
        #2a1f3a,
        #3a2f55 20%,
        #3a2f55 80%,
        #2a1f3a
    );
    border-radius: 3px;
}

.rolodex-rail-left { left: -12px; }
.rolodex-rail-right { right: -12px; }

/* --- Spindle Bars --- */
.rolodex-spindle {
    display: flex;
    align-items: center;
    width: calc(100% + 24px);
    margin-left: -12px;
    z-index: 25;
    position: relative;
}

.rolodex-spindle-top { margin-bottom: -1px; }
.rolodex-spindle-bottom { margin-top: -1px; }

.rolodex-bar {
    flex: 1;
    height: 8px;
    background: linear-gradient(180deg, #3a2f55, #2a1f3a);
}

.rolodex-spindle-bottom .rolodex-bar {
    background: linear-gradient(0deg, #3a2f55, #2a1f3a);
}

.rolodex-knob {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #4a3f65, #2a1f3a 70%);
    border: 1px solid rgba(196, 181, 253, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

/* --- Category Tabs --- */
.rolodex-tabs {
    display: flex;
    justify-content: center;
    gap: 2px;
    width: 100%;
    z-index: 15;
    margin-bottom: -1px;
}

.rolodex-tab {
    font-family: 'AMORIA';
    font-size: clamp(0.55rem, 1.2vw, 0.7rem);
    letter-spacing: 0.05em;
    padding: 0.2rem 0.45rem;
    border: 1px solid rgba(196, 181, 253, 0.12);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background: rgba(26, 18, 37, 0.8);
    color: #8a8098;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rolodex-tab:hover {
    color: #c4b5fd;
    background: rgba(42, 31, 58, 0.9);
}

.rolodex-tab.active {
    color: #f0e6ff;
    background: rgba(30, 22, 45, 0.98);
    border-color: rgba(196, 181, 253, 0.2);
    text-shadow: 0 0 6px rgba(196, 181, 253, 0.2);
}

.rolodex-tab[data-category="hello"] { border-top: 2px solid #ff7eb3; }
.rolodex-tab[data-category="site"] { border-top: 2px solid #c4b5fd; }
.rolodex-tab[data-category="music"] { border-top: 2px solid #5eead4; }
.rolodex-tab[data-category="games"] { border-top: 2px solid #fde68a; }
.rolodex-tab[data-category="movies"] { border-top: 2px solid #c084fc; }
.rolodex-tab[data-category="hobbies"] { border-top: 2px solid #fca5a5; }
.rolodex-tab[data-category="misc"] { border-top: 2px solid #818cf8; }

/* --- Card Viewport --- */
.rolodex-viewport {
    width: 100%;
    height: clamp(300px, 45vh, 420px);
    perspective: 800px;
    position: relative;
    overflow: hidden;
    background: rgba(18, 12, 28, 0.98);
    border: 1px solid rgba(196, 181, 253, 0.1);
    z-index: 10;
}

/* --- Card Stack --- */
.rolodex-card-stack {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

/* --- Cards --- */
.rolodex-card {
    position: absolute;
    inset: 0;
    transform-origin: top center;
    backface-visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1),
                opacity 0.4s ease;
    will-change: transform, opacity;
    /* Non-current cards fully hidden by default */
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.card-inner {
    width: 100%;
    height: 100%;
    padding: clamp(1rem, 3vw, 1.5rem);
    padding-left: calc(clamp(1rem, 3vw, 1.5rem)  + 4px);
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(30, 22, 45, 0.98);
}

.card-inner::-webkit-scrollbar { width: 4px; }
.card-inner::-webkit-scrollbar-track { background: transparent; }
.card-inner::-webkit-scrollbar-thumb { background: rgba(196, 181, 253, 0.2); border-radius: 2px; }

/* --- Card States --- */
.rolodex-card.current {
    transform: rotateX(0deg);
    opacity: 1;
    z-index: 10;
    pointer-events: auto;
}

.rolodex-card.flipped-up {
    transform: rotateX(-110deg);
    opacity: 0;
    z-index: 5;
}

.rolodex-card.below {
    transform: rotateX(15deg) translateZ(-10px);
    opacity: 0;
    z-index: 1;
}

/* Category accent stripe */
.rolodex-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    z-index: 5;
}

.rolodex-card[data-category="hello"]::before { background: #ff7eb3; }
.rolodex-card[data-category="site"]::before { background: #c4b5fd; }
.rolodex-card[data-category="music"]::before { background: #5eead4; }
.rolodex-card[data-category="games"]::before { background: #fde68a; }
.rolodex-card[data-category="movies"]::before { background: #c084fc; }
.rolodex-card[data-category="hobbies"]::before { background: #fca5a5; }
.rolodex-card[data-category="misc"]::before { background: #818cf8; }

/* ============================================
   CARD CONTENT LAYOUTS
   ============================================ */

.card-heading {
    font-family: 'ECTOBLST';
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: #f0e6ff;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
    text-shadow: 0 0 10px rgba(196, 181, 253, 0.15);
}

.card-divider {
    color: #c4b5fd;
    opacity: 0.4;
    font-size: 0.7rem;
    margin-bottom: 0.6rem;
    text-align: center;
}

.card-inner p {
    font-family: 'Euphorigenic', cursive;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    color: #c8bfdb;
    line-height: 1.7;
    margin-bottom: 0.5rem;
    max-width: 100%;
    word-wrap: normal;
}

.card-small {
    font-size: clamp(0.65rem, 1.2vw, 0.75rem) !important;
    color: #8a8098 !important;
    font-style: italic;
    opacity: 0.7;
}

/* --- Layout: Centered --- */
.card-layout-centered {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Layout: Two Columns --- */
.card-layout-columns { text-align: center; }

.card-columns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.card-list { text-align: left; }

.card-list li {
    font-family: 'imweird', cursive;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    color: #c8bfdb;
    line-height: 1.8;
    padding-left: 0.8rem;
    position: relative;
}

.card-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #c4b5fd;
    font-size: 0.5rem;
    top: 0.35em;
    opacity: 0.6;
}

.card-list-centered {
    text-align: center;
    display: inline-block;
}

/* --- Layout: Scattered --- */
.card-layout-scatter {
    position: relative;
    height: 100%;
}

.card-layout-scatter .card-heading { text-align: center; }

.card-scatter-items {
    position: relative;
    height: calc(100% - 3rem);
}

.scatter-item {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: rotate(var(--r));
    font-family: 'imweird', cursive;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    color: #c8bfdb;
    padding: 0.2rem 0.5rem;
    border: none;
    background: rgba(26, 15, 46, 0.5);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.scatter-item:hover {
    color: #f0e6ff;
    border-color: rgba(196, 181, 253, 0.3);
    text-shadow: 0 0 8px rgba(196, 181, 253, 0.2);
    transform: rotate(0deg) scale(1.05);
}

/* --- Layout: Icon Rows --- */
.card-icon-list {
    text-align: left;
    display: inline-block;
}

.card-icon-row {
    font-family: 'Euphorigenic', cursive;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    color: #c8bfdb;
    line-height: 2;
}

.card-icon {
    color: #c4b5fd;
    font-size: 0.6rem;
    margin-right: 0.3rem;
    opacity: 0.6;
}

/* --- Layout: Rolodex Card (like an actual contact card) --- */
.card-layout-rolodex {
    font-family: 'Courier New', monospace;
    font-size: clamp(0.75rem, 1.4vw, 0.85rem);
    color: #c8bfdb;
    line-height: 1.6;
    padding: 0.5rem;
    border: 1px dashed rgba(196, 181, 253, 0.15);
    height: 100%;
}

.card-layout-rolodex .rolodex-field {
    margin-bottom: 0.3rem;
}

.card-layout-rolodex .rolodex-label {
    color: #8a8098;
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    display: block;
}

.card-layout-rolodex .rolodex-value {
    color: #f0e6ff;
    font-family: 'MedievalSharp', cursive;
    font-size: clamp(0.85rem, 1.6vw, 1rem);
}

/* --- Layout: Jotted / Handwritten feel --- */
.card-layout-jotted {
    padding: 0.5rem;
    position: relative;
}

.card-layout-jotted::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1.6em,
        rgba(196, 181, 253, 0.06) 1.6em,
        rgba(196, 181, 253, 0.06) calc(1.6em + 1px)
    );
    pointer-events: none;
}

.card-layout-jotted p,
.card-layout-jotted li {
    line-height: 1.6em;
}

/* ============================================
   NAVIGATION
   ============================================ */

.rolodex-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.6rem;
    z-index: 10;
    flex-shrink: 0;
}

.rolodex-arrow {
    font-size: 1.2rem;
    color: #8a8098;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(196, 181, 253, 0.15);
    background: rgba(26, 18, 37, 0.6);
    border-radius: 3px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.rolodex-arrow:hover {
    color: #c4b5fd;
    border-color: rgba(196, 181, 253, 0.3);
    background: rgba(42, 31, 58, 0.8);
    text-shadow: 0 0 8px rgba(196, 181, 253, 0.3);
}

.rolodex-arrow:active { transform: scale(0.95); }

.rolodex-counter {
    font-family: 'Cannabis';
    font-size: 1.2rem;
    color: #8a8098;
    letter-spacing: 0.1em;
}

.rolodex-current { color: #c4b5fd; }

/* --- Responsive --- */
@media (max-width: 500px) {
    .rolodex { width: 95vw; }
    .rolodex-tabs { flex-wrap: wrap; }
    .rolodex-tab { font-size: 0.5rem; padding: 0.2rem 0.3rem; }
}

/* ============================================
   TAMANOTCHI
   ============================================ */

.tamanotchi {
    position: absolute;
    right: -300%;
    bottom: 24%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.tamanotchi a {
    display: block;
}

.tamanotchi img {
    width: clamp(100px, 12vw, 160px);
    height: auto;
    image-rendering: pixelated;
}

.tamanotchi-label {
    font-family: 'Pixel-LCD-7', cursive;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    color: #ff7eb3;
    letter-spacing: 0.15em;
    text-shadow: 0 0 10px rgba(255, 126, 179, 0.3);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.tamanotchi:hover .tamanotchi-label {
    opacity: 1;
}

@media (max-width: 900px) {
    .tamanotchi {
        position: relative;
        right: auto;
        bottom: auto;
        margin-top: 0.8rem;
    }

    .tamanotchi img {
        width: 60px;
    }
}