/*
 * global.css
 * Shared design tokens for the Leon Misoulis portfolio.
 * Referenced by: index.html, project pages, and navbar.js (for project page injection)
 */

/* -------------------------------------------------------
   FONTS (loaded via <link> in index.html — defined here
   as a single source of truth for token fallbacks)
   ------------------------------------------------------- */

@font-face {
    font-family: 'Krylon';
    src: url('../assets/Krylon-Regular.ttf.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* --- 4-COLOR DARK FANTASY / MEDIEVAL AAA METALLIC & MINERAL PALETTE --- */
    /* 1. Primary Structural & Frame Borders (Aged Copper / Antique Bronze — matching Frame_Simple.svg) */
    --bronze: #936037;
    --bronze-mid: rgba(147, 96, 55, 0.5);
    --bronze-low: rgba(147, 96, 55, 0.25);

    /* 2. Section Dividers & Flourishes (Warm Antique Muted Gold / Brass) */
    --antique-gold: #d8b468;
    --antique-gold-mid: rgba(216, 180, 104, 0.5);
    --antique-gold-low: rgba(216, 180, 104, 0.2);

    /* 3. Typography Headings & Titles (Warm Bone / Weathered Parchment) */
    --title-color: #e6dfd5;
    --subtitle-color: #c8beaa;
    --text-color: #d0c9bc;

    /* 4. Interactive Highlights & Active States (Ember Flame & Oxblood) */
    --ember: #d47a48;
    --ember-low: rgba(212, 122, 72, 0.25);
    --oxblood: #a83d52;

    /* Semantic / Token Mappings (Removes neon yellow-gold hierarchy break across the site) */
    --gold: var(--antique-gold);
    --gold-low: var(--antique-gold-low);
    --gold-mid: var(--antique-gold-mid);
    --gold-bright: var(--title-color);
    /* Re-pointed from bright yellow #ffdf7e to Warm Bone #e6dfd5 */
    --bg-dark: #080808;
    --accent-green: #a3b899;

    /* Typography */
    --font-sigil: 'Cinzel Decorative', serif;
    --font-title: 'Krylon', serif;
    --font-nav: 'Cormorant Garamond', serif;
    --font-body: 'Bellefair', serif;
    --font-heading-sans: 'Bellefair', serif;
    --font-body-sans: 'Josefin Sans', sans-serif;
    --font-mono: 'Julius Sans One', sans-serif;
    --font-trirong: 'Trirong', serif;

    /* Base Theme Variables (Project Page Overrides) */
    --theme-title: #e6dfd1; /* Bone White */
    
    --theme-accent: #C87D48; /* Ember / Orange accent */
    --theme-accent-hover: #DC965F;
    --theme-accent-glow: rgba(200, 125, 72, 0.5);
    
    --theme-border-solid: #b87333; /* Copper/Bronze */
    --theme-bg-glow: radial-gradient(circle, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 1) 100%);

    /* Divider Gradient Stops */
    --theme-divider-1: rgba(140, 109, 61, 0.35); 
    --theme-divider-2: rgba(196, 159, 99, 0.75); 
    --theme-divider-3: rgba(90, 68, 40, 1);      
    
    /* Icon Gradient Stops */
    --theme-icon-1: #5A4428;
    --theme-icon-2: #8C6D3D;
    --theme-icon-3: #C49F63;
    
    /* Pre-computed Gradients */
    --theme-gradient-left: linear-gradient(to right, transparent 0%, var(--theme-divider-1) 30%, var(--theme-divider-2) 65%, var(--theme-divider-3) 100%);
    --theme-gradient-right: linear-gradient(to left, transparent 0%, var(--theme-divider-1) 30%, var(--theme-divider-2) 65%, var(--theme-divider-3) 100%);
    --theme-gradient-icon: linear-gradient(90deg, var(--theme-icon-1) 0%, var(--theme-icon-2) 25%, var(--theme-icon-3) 50%, var(--theme-icon-2) 75%, var(--theme-icon-1) 100%);
    --theme-gradient-rule: linear-gradient(90deg, rgba(196, 160, 91, 0.6) 0%, rgba(196, 160, 91, 0.15) 50%, transparent 100%);
    
    --theme-shadow-top: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
    --theme-glow-bottom: linear-gradient(to bottom, rgba(196, 159, 99, 0.15) 0%, rgba(196, 159, 99, 0) 100%);

    /* Engine Math */
    --spring-ease: cubic-bezier(0.34, 1.25, 0.64, 1);
    --smooth-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* -------------------------------------------------------
   BASE PAGE RULES (applied site-wide)
   ------------------------------------------------------- */

html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000;
    /* Ensure the browser canvas is black */
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000;
    touch-action: pan-y;
    color: var(--text-color);
    opacity: 0;
    /* Started hidden to prevent FOUC */
    transition: opacity 0.5s var(--smooth-ease);
}

body.loaded {
    opacity: 1 !important;
}

/* Ensure Bellefair and headings remain at 400 Regular everywhere without synthetic browser bolding */
h1,
h2,
h3,
h4,
h5,
h6,
.section-kicker,
.spec-label,
.impact-card h3,
.narrative-text h3 {
    font-weight: 400 !important;
    font-synthesis: none;
    font-synthesis-weight: none;
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    touch-action: none;
    outline: none;
}

/* Stone grain texture overlay */
#bg-layer {
    position: absolute;
    inset: 0;
    background: url('../assets/textures/StoneTexture.webp') center/cover no-repeat;
    z-index: 2;
    opacity: 0.15;
    pointer-events: none;
}

#vignette {
    position: absolute;
    inset: 0;
    background: var(--theme-bg-glow);
    z-index: 3;
    pointer-events: none;
}

/* -------------------------------------------------------
   HEADER / NAVBAR  (shared between index.html and project pages)
   ------------------------------------------------------- */

header#master-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 5%;
    box-sizing: border-box;
    z-index: 2000;
    pointer-events: none;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: padding 0.4s var(--spring-ease), background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
    display: flex;
    justify-content: center;
}

header#master-header.scrolled {
    padding: 12px 5%;
    background: rgba(8, 8, 8, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

header#master-header .header-inner {
    width: 100%;
    max-width: 1600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

header#master-header a.logo-placeholder {
    font-family: var(--font-sigil);
    font-size: 1.8rem;
    color: var(--gold);
    text-decoration: none;
    filter: drop-shadow(0 0 5px var(--gold-low));
    transition: all 0.3s var(--smooth-ease);
    display: inline-block;
    outline: none;
    border: none;
    padding: 0;
    background: transparent;
    margin: 0;
    box-shadow: none;
}

header#master-header a.logo-placeholder:hover {
    color: var(--gold-bright);
    filter: drop-shadow(0 0 15px var(--gold));
    transform: scale(1.08);
}

header#master-header nav {
    display: flex;
    gap: 45px;
}

header#master-header nav a {
    font-family: var(--font-nav);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: rgba(194, 185, 167, 0.8);
    transition: color 0.4s ease;
    position: relative;
    outline: none;
    border: none;
    padding: 0;
    background: transparent;
    margin: 0;
    box-shadow: none;
}

header#master-header nav a::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gold-mid);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--smooth-ease);
    opacity: 0.6;
}

header#master-header nav a:hover {
    color: #fff;
}

header#master-header nav a:hover::before {
    transform: scaleX(1);
}

header#master-header nav a.active {
    color: var(--gold-bright);
}

header#master-header nav a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* --- RESPONSIVE HEADER --- */
@media (max-width: 768px) {
    header#master-header {
        padding: 15px 5%;
    }

    header#master-header.scrolled {
        padding: 10px 5%;
    }

    header#master-header .header-inner {
        flex-direction: column;
        gap: 12px;
    }

    header#master-header nav {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* -------------------------------------------------------
   CUSTOM CURSOR  (injected by components/cursor.js)
   ------------------------------------------------------- */

#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 9999;
}

#custom-cursor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.25, 0.64, 1);
    pointer-events: none;
}

/* --- NEW PROJECT GRID LAYOUT --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    gap: 30px;
    width: 100%;
    max-width: 1400px;
    margin: 20px auto 40px auto;
    pointer-events: auto;
}

/* --- RESPONSIVE PROJECT GRID (must come AFTER default declaration) --- */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-card {
        height: auto;
    }
}

@media (max-width: 480px) {
    .projects-grid {
        gap: 16px;
    }

    .card-details {
        padding: 12px 16px;
    }

    .card-details h3 {
        font-size: 1.1rem;
    }
}

.project-category {
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: opacity 0.4s var(--smooth-ease);
}

.project-discipline {
    color: #c0c0c0;
    font-size: calc(100% - 3px);
    white-space: nowrap;
    opacity: 0.85;
}

/* --- Subtle Sibling Dimming Effect --- */
.category-grid:hover .project-card:not(:hover) {
    opacity: 0.65;
}

.category-title {
    font-family: var(--font-title);
    color: #e8d090;
    font-size: 1.3rem;
    letter-spacing: 0.25em;
    margin: 0;
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid rgba(232, 208, 144, 0.3);
    padding-bottom: 10px;
    transition: all 0.4s var(--smooth-ease);
}

/* --- Subtle Category Label Glow on Hover --- */
.project-category:hover .category-title {
    color: #fff2c8;
    text-shadow: 0 0 14px rgba(232, 208, 144, 0.65);
    border-bottom-color: rgba(232, 208, 144, 0.7);
}

.category-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.project-card {
    background: rgba(17, 29, 20, 0.199);
    /* Dark forest green at 70% opacity as requested */
    border: 2px solid #6b533e;
    border-image: linear-gradient(135deg, #6b533e 0%, #4d3a2b 100%) 2;
    border-radius: 0;
    /* Sharp box corners as requested */
    overflow: hidden;
    transition: all 0.4s var(--spring-ease), border-image 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 100%;
}

.project-card:hover {
    transform: translateY(-8px);
    border-image: linear-gradient(135deg, #a86e38 0%, #f7d59b 40%, #a86e38 75%, #f7d59b 100%) 2;
    background: rgba(22, 40, 27, 0.85);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(168, 110, 56, 0.35);
}

/* --- Featured Project Card Modifier --- */
.project-card.featured-card {
    border-image: linear-gradient(135deg, #a86e38 0%, #d49a5b 50%, #7d5228 100%) 2;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(168, 110, 56, 0.2);
    position: relative;
}

.project-card.featured-card:hover {
    border-image: linear-gradient(135deg, #a86e38 0%, #f8dcab 40%, #a86e38 80%, #f8dcab 100%) 2;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(168, 110, 56, 0.4), inset 0 0 25px rgba(168, 110, 56, 0.25);
}



.card-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0a09;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 2px solid rgba(168, 110, 56, 0.35);
    transition: border-color 0.4s ease;
}

.project-card:hover .card-thumbnail {
    border-color: rgba(247, 213, 155, 0.7);
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--smooth-ease);
}

.project-card:hover .card-thumbnail img {
    transform: scale(1.05);
}

.card-details {
    padding: 16px 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-details h3 {
    font-family: var(--font-title);
    color: var(--gold);
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    font-weight: 400 !important;
}

.card-meta {
    font-family: var(--font-serif);
    color: #b87e56;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    margin: 0 0 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-weight: 500;
}

.card-meta span {
    border-right: 1px solid rgba(184, 126, 86, 0.4);
    padding-right: 12px;
}

.card-meta span:last-child {
    border-right: none;
    padding-right: 0;
}

.card-desc {
    font-family: var(--font-body-sans);
    color: #b8bec6;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
    margin-top: auto;
    letter-spacing: 0.03em;
    font-weight: 300;
}

/* Header Toggle Layout */
.section-header {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 30px auto;
}

.map-toggle-wrapper {
    position: absolute;
    right: 0;
    /* Aligns edge of the button with the end of the category line visually */
    bottom: -1px;
    /* Tweak vertically slightly */
    pointer-events: auto;
    z-index: 20;
    text-align: center;
}

.toggle-map-btn {
    background: transparent;
    border: none;
    padding: 5px 0;
    font-family: var(--font-nav);
    color: #e6d3a1;
    /* Slightly brighter gold */
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
    /* Soft glow */
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.4s var(--smooth-ease), transform 0.4s var(--spring-ease), text-shadow 0.4s var(--smooth-ease);
    position: relative;
}

.toggle-map-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold-bright);
    box-shadow: 0 0 5px rgba(230, 211, 161, 0.5);
    /* Glow on underline too */
    transition: width 0.4s var(--spring-ease);
}

.toggle-map-btn:hover {
    color: #fff;
    /* Brighter glow on hover */
    text-shadow: 0 0 15px rgba(255, 236, 179, 0.6);
    transform: translateY(-2px);
}

.toggle-map-btn:hover::after {
    width: 100%;
}

.toggle-map-btn.disabled-mobile {
    opacity: 0.5;
    pointer-events: none;
    color: rgba(168, 160, 144, 0.6);
}

.mobile-map-warning {
    display: none;
    font-family: var(--font-nav);
    color: #a8a090;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 8px;
}

@media (max-width: 1024px) {
    .map-toggle-wrapper {
        position: relative;
        right: auto;
        bottom: auto;
        margin-top: 30px;
    }

    .toggle-map-btn {
        pointer-events: none;
        opacity: 0.4;
    }

    .mobile-map-warning {
        display: block;
    }
}

.hidden-view {
    display: none !important;
}

body.hovering-map #custom-cursor::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.85) rotate(-40deg);
    background-image: url('../assets/textures/maphoverArrowcursor.svg');
}

body.hovering-map.hovering-map-marker #custom-cursor::before {
    transform: translate(-50%, -50%) scale(0.85) rotate(0deg);
    background-image: url('../assets/textures/maphoverHandcursor.svg');
}

/* -------------------------------------------------------------------------- */
/*                                SECT 07: MINIGAME UX EFFECTS                 */
/* -------------------------------------------------------------------------- */

/* 1. The Lure (Text Treatment) */
.secret-trigger {
    display: inline-block;
    cursor: pointer;
    position: relative;
    font-weight: 600;
    color: #e0f0ff;
    transition: all 0.3s ease;
    animation: secret-pulse 4s infinite alternate;
}

@keyframes secret-pulse {
    0% {
        text-shadow: 0 0 2px rgba(138, 180, 248, 0.2);
    }

    100% {
        text-shadow: 0 0 10px rgba(138, 180, 248, 0.6), 0 0 20px rgba(138, 180, 248, 0.3);
    }
}

.secret-trigger:hover {
    color: #8ab4f8;
    animation: none;
    text-shadow: 0 0 15px rgba(138, 180, 248, 0.8), 0 0 30px rgba(138, 180, 248, 0.5);
}

.secret-trigger:active {
    transform: translateY(2px);
}

/* 2. Error Feedback (Failed Hold) */
.secret-trigger.error-shake {
    animation: error-shake 0.4s var(--spring-ease);
    color: #ff4a4a !important;
    text-shadow: 0 0 15px rgba(255, 74, 74, 0.6) !important;
}

@keyframes error-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

/* 3. The Custom Cursor States (Cursor.js override) */

body.secret-charging .secret-trigger {
    color: #8ab4f8;
    text-shadow: 0 0 20px rgba(138, 180, 248, 1);
}

/* SVG Charging Ring attached to Cursor */
#custom-cursor .charge-ring-svg {
    position: absolute;
    /* Center it squarely on the invisible 0x0 cursor dot */
    top: 0;
    left: 0;
    transform: translate(-50%, -50%) rotate(-90deg);
    width: 50px;
    height: 50px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

body.secret-charging #custom-cursor .charge-ring-svg {
    opacity: 1;
}

#custom-cursor .charge-ring-svg circle {
    fill: none;
    stroke: #8ab4f8;
    stroke-width: 3;
    stroke-dasharray: 100;
    /* Controlled by JS */
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.1s linear;
    filter: drop-shadow(0 0 4px rgba(138, 180, 248, 0.8));
}

body.secret-error #custom-cursor .charge-ring-svg circle {
    stroke: #ff4a4a;
    filter: drop-shadow(0 0 4px rgba(255, 74, 74, 0.8));
    transition: stroke 0.1s ease;
}

/* =======================================================
   REUSABLE STERLING SILVER SECTION DIVIDER COMPONENT
   Self-contained: auto-populated by navbar.js, zero manual alignment
   ======================================================= */

.section-divider-ornament,
.divider-component,
.section-divider,
.portfolio-divider {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    height: 36px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5;
    pointer-events: none;
}

/* Align divider directly on the hero bottom boundary */
.project-hero+.section-divider-ornament,
.project-hero+.divider-component,
.project-hero+.section-divider,
.project-hero+.portfolio-divider {
    margin-top: -18px !important;
}

/* Left & Right: Thin lines expanding from the asset's endpoints until the edges of the page */
.section-divider-ornament .divider-line-left,
.divider-component .divider-line-left,
.section-divider .divider-line-left,
.portfolio-divider .divider-line-left,
.section-divider-ornament .divider-line-right,
.divider-component .divider-line-right,
.section-divider .divider-line-right,
.portfolio-divider .divider-line-right {
    flex: 1 1 auto;
    height: 2px;
    position: relative;
    z-index: 1;
}

.section-divider-ornament .divider-line-left,
.divider-component .divider-line-left,
.section-divider .divider-line-left,
.portfolio-divider .divider-line-left {
    background: var(--theme-gradient-left);
}

.section-divider-ornament .divider-line-right,
.divider-component .divider-line-right,
.section-divider .divider-line-right,
.portfolio-divider .divider-line-right {
    background: var(--theme-gradient-right);
}

/* Middle: Divider1.svg asset in Antique Bronze / Muted Warm Gold (rich, metallic, warm without washing out) */
.section-divider-ornament .divider-icon,
.divider-component .divider-icon,
.section-divider .divider-icon,
.portfolio-divider .divider-icon {
    flex: 0 0 auto;
    width: min(520px, 50vw);
    height: 18px;
    background: var(--theme-gradient-icon);
    -webkit-mask-image: url('../assets/UI_Components/Divider1.svg');
    mask-image: url('../assets/UI_Components/Divider1.svg');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    margin: 0 -18px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Top: Dark shadow going vertically from 45% opacity to 0% opacity */
.section-divider-ornament::before,
.divider-component::before,
.section-divider::before,
.portfolio-divider::before {
    content: '';
    position: absolute;
    bottom: 50%;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--theme-shadow-top);
    pointer-events: none;
    z-index: -1;
}

/* Bottom: Warm Antique Bronze glow going vertically from 35% opacity to 0% opacity */
.section-divider-ornament::after,
.divider-component::after,
.section-divider::after,
.portfolio-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--theme-glow-bottom);
    pointer-events: none;
    z-index: -1;
}

/* ==========================================================================
   ORNATE CARD COMPONENT (.ornate-card, .me-card, .role-card)
   Reusable Medieval/Dark Fantasy Card styled like Narrative Boxes in Slash Jump,
   with large bold ornate corners (60px) and seamless connecting straight edges.
   ========================================================================== */
.ornate-card,
.me-card,
.role-card {
    position: relative;
    background: rgba(27, 17, 12, 0.5);
    border-radius: 40px;
    box-sizing: border-box;
    border: none !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.75);
    transition: transform 0.4s var(--smooth-ease), background-color 0.4s var(--smooth-ease), box-shadow 0.4s var(--smooth-ease), filter 0.4s var(--smooth-ease);
    pointer-events: auto;
    z-index: 1;
}

/* Top & Bottom seamless connecting lines (stop before corners) */
.ornate-card::before,
.me-card::before,
.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 10px;
    right: 10px;
    border-top: 2px solid rgba(200, 125, 72, 0.55);
    border-bottom: 2px solid rgba(200, 125, 72, 0.55);
    pointer-events: none;
    z-index: 2;
    transition: border-color 0.35s var(--smooth-ease);
}

/* Left & Right seamless connecting lines (stop before corners) */
.ornate-card::after,
.me-card::after,
.role-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 40px;
    bottom: 40px;
    border-left: 2px solid rgba(200, 125, 72, 0.55);
    border-right: 2px solid rgba(200, 125, 72, 0.55);
    pointer-events: none;
    z-index: 2;
    transition: border-color 0.35s var(--smooth-ease);
}

/* Large Ornate Corners (70px x 70px) */
.ornate-card .ornate-corner,
.me-card .ornate-corner,
.role-card .ornate-corner {
    position: absolute;
    width: 70px;
    height: 70px;
    background-color: rgba(200, 125, 72, 0.65);
    -webkit-mask-image: url('../assets/UI_Components/Border_Corner2.svg');
    mask-image: url('../assets/UI_Components/Border_Corner2.svg');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    pointer-events: none;
    z-index: 5;
    transition: background-color 0.35s var(--smooth-ease), filter 0.35s var(--smooth-ease);
}

.ornate-card .corner-tl,
.me-card .corner-tl,
.role-card .corner-tl {
    top: -15.5px;
    left: -13.2px;
    transform: scaleX(-1);
}

.ornate-card .corner-tr,
.me-card .corner-tr,
.role-card .corner-tr {
    top: -15.5px;
    right: -13.2px;
    transform: none;
}

.ornate-card .corner-bl,
.me-card .corner-bl,
.role-card .corner-bl {
    bottom: -15.5px;
    left: -13.2px;
    transform: scale(-1, -1);
}

.ornate-card .corner-br,
.me-card .corner-br,
.role-card .corner-br {
    bottom: -15.5px;
    right: -13.2px;
    transform: scaleY(-1);
}

/* Hover Glow States */
.ornate-card:hover,
.me-card:hover,
.role-card:hover {
    transform: translateY(-6px);
    background-color: rgba(42, 20, 12, 0.60);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.85);
}

.ornate-card:hover::before,
.me-card:hover::before,
.role-card:hover::before,
.ornate-card:hover::after,
.me-card:hover::after,
.role-card:hover::after {
    border-color: rgba(235, 160, 105, 0.95);
    filter: drop-shadow(0 0 4px rgba(235, 160, 105, 0.5));
}

.ornate-card:hover .ornate-corner,
.me-card:hover .ornate-corner,
.role-card:hover .ornate-corner {
    background-color: rgba(235, 160, 105, 0.95);
    filter: drop-shadow(0 0 6px rgba(235, 160, 105, 0.65));
}

/* --- FOOTER & CREDITS MODAL --- */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
}

.credits-link {
    background: none;
    border: none;
    color: #8f8a7c;
    font-family: var(--font-nav);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(143, 138, 124, 0.4);
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.credits-link:hover {
    color: var(--theme-accent);
    text-decoration-color: var(--theme-accent);
}

.credits-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.credits-modal.show {
    display: flex;
    opacity: 1;
}

.credits-modal-content {
    background: #151515;
    border: 1px solid var(--theme-border-solid);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.credits-modal.show .credits-modal-content {
    transform: translateY(0);
}

.credits-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #a8a090;
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.credits-close:hover {
    color: var(--theme-accent);
}

.credits-title {
    font-family: var(--font-header);
    color: var(--theme-title);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.credits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.credits-list li {
    font-family: var(--font-body);
    color: #a8a090;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(196, 160, 91, 0.1);
}

.credits-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.credits-list strong {
    color: #d0c9bc;
}

.credits-list a {
    color: var(--theme-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.credits-list a:hover {
    color: var(--theme-accent-hover);
    text-decoration: underline;
}