/* =========================================
   1. PRELOAD & FONTS
========================================= */
.preload, 
.preload * {
    transition: none !important;
}

@font-face {
    font-family: 'bootstrap-icons';
    src: url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/fonts/bootstrap-icons.woff2?2820a38c237c5643a6d9627702e5c8e3') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter.woff2') format('woff2');
    font-display: swap;
    size-adjust: 100%;
    ascent-override: 90%;
    descent-override: 10%;
    line-gap-override: 0%;
}

/* =========================================
   2. HTML & BODY (LOAD PRIORITY)
========================================= */
html {
    min-height: 100vh;
    padding: 0;
    margin: 0;
    scroll-behavior: auto;
    scroll-padding-top: 100px;
    scrollbar-width: none;
    color: rgb(255, 255, 255);
}

html::-webkit-scrollbar {
    display: none;
}

html.light-theme-init {
    margin: 0;
    opacity: 1;
    background: linear-gradient(135deg, #ebebeb, #d6d6d6);
    background-attachment: fixed; 
    background-size: cover;
    color: #000;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0 5%;
    background-color: transparent !important;
    font-family: 'Inter', Arial, sans-serif;
}

body.preload {
    opacity: 0;
    visibility: hidden;
}

/* =========================================
   3. LAYERS & Z-INDEX 
========================================= */
canvas {
    position: fixed;
    top: 0; 
    left: 0;
    z-index: -1;
    width: 100vw; 
    height: 100vh;
    pointer-events: none;
    filter: blur(0.5px) brightness(1.1);
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    transition: filter 1s ease;
}

.strellatto_layer {
    position: fixed;
    top: 0; 
    left: 0;
    z-index: -2;
    width: 100%; 
    height: 100%;
    background-color: rgb(0, 0, 0);
    pointer-events: none;
}

body:not(.light-theme) .strellatto_layer {
    background-color: #000;
}

body.light-theme .strellatto_layer {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.afs {
    z-index: -3;
    pointer-events: none;
}

/* =========================================
   4. GENERAL STYLES
========================================= */
::selection {
    background-color: #ffffff;
    color: #000000;
}

.light-theme ::selection {
    background-color: #ffff00;
    color: rgb(0, 0, 0);
    text-shadow: none;
    animation: 2s;
}

#home:target, 
body:not(:has(:target)) #home {
    display: block;
}

b {
    font-weight: 900;
}

.light-theme b {
    color: #000000;
}

h2 {
    font-family: 'Lexend';
    font-size: 20px;
    font-weight: 200;
}

.light-theme h2 {
    color: #000000;
}

p {
    line-height: 1.6;
    word-spacing: 0.2em;
}

img {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

a img {
    pointer-events: auto;
}

.c {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgb(255, 255, 255);
    text-align: center;
}

.light-theme .c {
    color: rgb(60, 60, 60);
}

.cont {
    display: flex;
    gap: 1.3vw;
}

/* Gemini Link */
.link-gemini {
    color: rgb(212, 0, 255);
    font-weight: 700;
    text-decoration: underline;
}

.light-theme .link-gemini {
    color: rgb(212, 0, 255);
}

.link-gemini span {
    display: inline-block;
    color: white;
    text-decoration: none;
}

.light-theme .link-gemini span {
    color: black;
}

/* Watermark */
.watermark {
    position: fixed;
    z-index: 9999;
    bottom: 20%;
    right: 10px;
    padding: 10px 5px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 12px;
    background: transparent;
    color: rgba(255, 255, 255, 0.71);
    font: 200 12px 'Michroma', sans-serif;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.light-theme .watermark {
    border: 0.8px solid rgba(20, 20, 20, 0.268);
    color: rgba(0, 0, 0, 0.418);
}

/* =========================================
   5. HEADER
========================================= */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 10px 0 30px;
    margin: 0 0 10px;
    border: 1px solid rgba(55, 55, 55, 0.4);
    border-radius: 0 0 10px 10px;
    background: rgba(29, 29, 29, 0.8);
    box-shadow: inset 0px 0px 10px rgba(15, 15, 15, 0.479), inset 0px 0px 20px rgba(0, 0, 0, 0.411);
    backdrop-filter: blur(15px) saturate(20%);
    -webkit-backdrop-filter: blur(15px) saturate(20%);
    font-family: "Michroma", sans-serif;
    user-select: none;
    will-change: transform;
}

.light-theme header {
    border: 1px solid rgba(255, 255, 255, 0);
    background: #e9e9e9;
    box-shadow: 5px 5px 10px rgba(81, 81, 81, 0.256), -5px -5px 10px #ffffff;
}

header a {
    text-decoration: none;
    color: inherit;
}

header a h1 {
    font-family: "Michroma";
    font-size: 150%;
    transition: color 0.3s ease-in-out, text-shadow 0.3s ease-in-out;
}

.light-theme header a h1 {
    color: #131313b8;
}

header a h1:hover {
    color: #ffffff;
    text-shadow: 0 0 10px #ffffff40, 0 0 15px #4d4d4d6e;
    cursor: pointer;
}

.light-theme header a h1:hover {
    color: #000000;
    text-shadow: 0 0 10px #5f5f5f58, 0 0 15px #4d4d4d6e;
    cursor: pointer;
}

header button, 
header i {
    border: 0;
    background-color: transparent;
    color: #ffff69;
    font-size: 15px;
    transition: transform 0.7s ease-in-out, text-shadow 0.3s ease-in-out;
}

.light-theme header i {
    display: inline-block;
    color: rgb(193, 106, 0);
    text-shadow: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

header button:hover {
    color: #ffd900;
    text-shadow: 0 0 20px #fdff7c, 0 0 30px #fcff53;
    cursor: pointer;
}

.light-theme header button i:hover {
    transform: rotate(30deg) scale(1.2);
    text-shadow: none;
    transition: transform 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

nav {
    padding: 1dvw;
}

nav a {
    padding: 0 1dvw;
    color: rgba(187, 187, 187, 0.73);
    font: 500 16px 'Epilogue', sans-serif;
    text-align: center;
    text-decoration: none;
    transition: color 0.3s ease;
}

.light-theme nav a {
    color: #4a4a4a;
}

nav a:hover {
    color: #fff;
    text-shadow: 0 0 10px #fff, 0 0 10px #a8bfff, 0 0 20px #fff, 0 0 50px #fff;
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

.light-theme nav a:hover {
    color: rgb(0, 0, 0);
    text-shadow: none;
}

nav a.active {
    color: rgb(255, 255, 255);
    font-weight: 800;
    text-shadow: 0 0 10px #ffffff;
}

.light-theme nav a.active {
    color: rgba(0, 0, 0, 0.841);
}

/* =========================================
   6. MAIN / SECTIONS
========================================= */
.content {
    flex: 1;
    width: 90%;
    max-width: 1200px;
    padding: 0 2rem;
    margin: 0 auto;
}

section {
    display: none;
    padding: 20px 30px;
    margin-top: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(61, 61, 61, 0.644);
    border-radius: 10px;
    background: rgba(29, 29, 29, 0.666);
    box-shadow: inset 0px 0px 10px rgba(15, 15, 15, 0.479), inset 0px 0px 20px rgba(0, 0, 0, 0.411);
    backdrop-filter: blur(2px) saturate(20%);
}

.light-theme section {
    border: 1px solid rgba(255, 255, 255, 0);
    background: #e9e9e9;
    box-shadow: 5px 5px 10px rgba(81, 81, 81, 0.256), -5px -5px 10px #ffffff;
}

section:target {
    display: block;
}

.subsection_grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
}

/* =========================================
   7. ARTICLES
========================================= */
article {
    display: block;
    padding: 10px 20px 20px;
    margin: 20px 0 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.68);
    color: inherit;
    font: 300 1rem 'Inter', sans-serif;
    text-align: start;
}

.light-theme article {
    background-color: rgba(255, 255, 255, 0.693);
}

article h3 {
    padding-left: 5%;
    font-family: 'Lexend';
    font-size: 18px;
    font-weight: 400;
    text-align: left;
}

.subarticle {
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 300px;
    min-height: 400px;
    padding: 10px;
    margin: 5px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    font-family: 'Epilogue';
    overflow: hidden;
    transition: transform 0.2s ease;
    will-change: transform;
}

.light-theme .subarticle {
    background: #ededed;
    box-shadow: inset 5px 5px 4px #b6b6b672, inset -5px -5px 4px #ffffff;
}

#history .subarticle {
    background: rgba(0, 0, 0, 0.68);
}

.light-theme #history .subarticle {
    background-color: rgba(255, 255, 255, 0.693);
    box-shadow: none;
}

.subarticle h2 {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
}

.subarticle p {
    flex-grow: 1;
    font-family: 'Inter';
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    hyphens: auto;
}

.subarticle a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 240px;
    margin-bottom: 12px;
}

.subarticle img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 10px;
    object-fit: contain;
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
}

.subarticle img:hover {
    transform: scale(1.04) translateY(-4px);
    filter: drop-shadow(0 12px 20px rgba(0,0,0,0.4));
}

pre {
    padding: 6px;
    border-radius: 10px;
    background: #000;
    color: #fff;
    overflow-x: auto;
}

.edi {
    font-weight: bolder;
    text-align: justify;
}

/* =========================================
   8. FORM
========================================= */
form {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    padding: 2rem;
    margin: 0 auto;
    gap: 1rem;
}

.campo {
    display: flex;
    flex-direction: column;
}

.campo label {
    margin-bottom: 0.5rem;
    padding-left: 5%;
    font-size: 17px;
    font-weight: bold;
    text-align: left;
}

.campo input, 
.campo textarea {
    padding: 0.75rem;
    border: 1px solid #b8b8b8;
    border-radius: 4px;
    background-color: #000000;
    color: #ffffff;
    font-family: 'lexend', sans-serif;
    font-size: 1rem;
    resize: none;
    transition: box-shadow 0.5s ease;
}

.light-theme .campo input, 
.light-theme .campo textarea {
    border: 1px solid #ffffff;
    background: #fefefe;
    color: #272727;
    box-shadow: inset 3px 3px 5px #d4d4d4, inset -3px -3px 5px #efefef;
    transition-duration: 5ms;
}

.campo input:hover, 
.campo textarea:hover {
    box-shadow: 0 0 10px #ffffff, 0 0 5px #7ba5ff, 0 0 3px #ffffff;
    backdrop-filter: contrast(180%);
}

.light-theme .campo input:hover, 
.light-theme .campo textarea:hover {
    background: #ffffff;
    color: #262626;
    box-shadow: inset 5px 5px 8px #6e6e6e83, inset 5px 5px 10px #f2f2f2;
    transition: 1s;
}

.light-theme .campo input:focus, 
.light-theme .campo textarea:focus {
    border: 1px solid #525252;
    background: #dbdbdb;
    color: #000000;
    transition: 1s;
    transition-duration: 5ms;
}

.contact button {
    margin: 0 30%;
    padding: 0.7rem;
    border: none;
    border-radius: 4px;
    background-color: #5353538f;
    box-shadow: 0 0 20px #2a2a2a63;
    color: rgb(255, 255, 255);
    font: 500 1rem 'Epilogue', sans-serif;
    transition: box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.light-theme .contact button {
    background: rgb(220, 220, 220);
    box-shadow: 8px 8px 15px #acacac, 8px 8px 15px #f2f2f2;
    color: #000000;
}

.contact button:hover {
    background-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    color: #000;
    font-weight: 500;
    backdrop-filter: contrast(150%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.light-theme .contact button:hover {
    transform: none;
    background: #cfcfcf;
    box-shadow: inset 5px 5px 10px #acacac, inset 5px 5px 10px #f2f2f2;
}

.contact button:active {
    background-color: #ffffff;
    box-shadow: 0 0 100px #b3c8ff, 0 0 20px #feffc5, 0 0 15px #386dff, 0 0 8px #ff8400, 0 0 7px #b1ff90;
    color: #000000;
    filter: brightness(1.2);
    animation: 77ms;
    transition-duration: 0.3s;
}

.light-theme .contact button:active {
    background-color: #d8d8d8;
    box-shadow: inset 5px 5px 10px rgba(0, 0, 0, 0.1), inset 2px 2px 5px rgba(0, 0, 0, 0.3);
    font-weight: 900;
    transition: box-shadow 0.1s ease;
}

/* =========================================
   9. FOOTER
========================================= */
footer {
    display: block;
    padding: 0 30px;
    margin: 15px 0 0 0;
    border: 1px solid rgba(61, 61, 61, 0.644);
    border-radius: 10px 10px 0 0;
    background: rgba(29, 29, 29, 0.666);
    box-shadow: inset 0px 0px 10px rgba(15, 15, 15, 0.479), inset 0px 0px 20px rgba(0, 0, 0, 0.411);
    backdrop-filter: blur(2px) saturate(20%);
    font-weight: 300;
    user-select: none;
}

.light-theme footer {
    border: 1px solid rgba(255, 255, 255, 0);
    background: #e9e9e9;
    box-shadow: 5px 5px 10px rgba(81, 81, 81, 0.256), -5px -5px 10px #ffffff;
}

.fin p {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    font: 600 1.25rem 'Lexend', sans-serif;
    letter-spacing: 0.05rem;
    text-align: center;
    transition: all 0.6s ease;
}

.light-theme .fin p {
    color: #000000;
}

/* =========================================
   10. MEDIA QUERIES
========================================= */
@media (max-width: 768px) {
    body {
        margin: 0 2% !important;
    }
    header {
        padding: 10px;
    }
    .content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .subsection_grid {
        flex-direction: column;
        align-items: center;
    }
    .subarticle {
        width: 95% !important;
        max-width: 100% !important;
        min-height: auto !important;
    }
    #history .subarticle {
        width: 100% !important;
    }
    .watermark {
        display: none;
    }
}

@media (pointer: coarse) {
    .cards_section {
        display: none !important;
    }
    .solo-pc-aviso {
        display: block;
    }
}

.solo-pc-aviso {
    display: none;
    padding: 10px;
    margin-top: 20px;
    border: 1.4px solid #ffca1b;
    border-radius: 10px;
    background-color: rgba(251, 255, 0, 0.22); 
    box-shadow: 0 0 10px rgba(255, 217, 67, 0.79);
    font: 600 1rem sans-serif;
    text-align: center;
}
