/* * PROJECT: LinkHub Personal Site
 * COMPONENT: Main Stylesheet (Desktop UX Optimized)
 * SYSTEM: Scriptorium Design System v3.3 (Golden Ratio Edition)
 * AUTHOR: Jerry Augusto
 */

/* --- 1. DESIGN TOKENS (The Golden Ratio) --- */
/* --- 1. DESIGN TOKENS (The Golden Ratio) --- */
:root {
    /* --- PALETA --- */
    --bg-body: #1C1917; 
    --accent-main: #E3B505;       
    --accent-structure: #C5A059;  
    --accent-warmth: #78350F;     
    --accent-error: #782626;      
    
    --text-primary: #E7E5E4;      
    --text-secondary: #A8A29E;    
    --border-subtle: rgba(197, 160, 89, 0.15);

    /* --- THE GOLDEN MODULAR SCALE --- */
    --ratio: 1.618;
    
    /* Font Sizes (Base * Ratio^n) */
    --fs-base: 1rem;                       /* ~16px */
    --fs-md: calc(1rem * var(--ratio));    /* ~25.8px */
    --fs-lg: calc(1rem * var(--ratio) * var(--ratio)); /* ~41.8px */
    --fs-xl: calc(1rem * var(--ratio) * var(--ratio) * var(--ratio)); /* ~67px */
    --fs-sm: calc(1rem / var(--ratio));    /* ~9.8px */

    /* Typography */
    --font-serif: 'EB Garamond', serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* --- ESPAÇAMENTO (Rhythm) --- */
    --space-unit: 1rem;
    --space-phi: calc(var(--space-unit) * var(--ratio));            /* ~26px */
    --space-phi-double: calc(var(--space-unit) * var(--ratio) * 2); /* ~52px */
    --space-section: calc(var(--space-unit) * var(--ratio) * var(--ratio) * var(--ratio)); /* ~100px */

    --radius-card: 2px;
    
    /* CORREÇÃO CRÍTICA: Definindo ambas as variáveis para compatibilidade */
    --ease-physics: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1); /* Recuperado para as animações */
    
    --touch-target: 44px; 
}

/* --- 2. RESET & GLOBAL BASE --- */
* { 
    box-sizing: border-box; margin: 0; padding: 0; 
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overscroll-behavior-y: none; 
    background-color: var(--bg-body);
    overflow-x: hidden; width: 100%;
}

body {
    color: var(--text-primary);
    font-family: var(--font-sans); 
    font-size: 1.125rem; /* Desktop Luxury Base */
    line-height: 1.6;
    min-height: 100vh;
    
    display: flex; flex-direction: column; align-items: center;
    padding: 0; 

    /* Safe Areas */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);

    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");

    /* Font Rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Selection (Rust Red) */
::selection { background-color: var(--accent-error); color: var(--text-primary); text-shadow: none; }
::-moz-selection { background-color: var(--accent-error); color: var(--text-primary); text-shadow: none; }

/* --- 3. PRELOADER & SPINNERS (Counter-Rotation Logic) --- */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-body); z-index: 9999; 
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s ease;
}
body.reveal-content #preloader { opacity: 0; visibility: hidden; pointer-events: none; }

/* Configuração dos Containers SVG */
.loader-star svg, .rosette-spinner svg {
    width: 100%; height: 100%; overflow: visible;
}

.loader-star {
    width: 80px; height: 80px;
    filter: drop-shadow(0 0 10px rgba(227, 181, 5, 0.3));
}

/* O container do Aviso de Construção */
.rosette-spinner {
    width: 60px; height: 60px;
    margin: 0 auto 1.5rem;
    color: var(--accent-main);
    opacity: 0.7;
}

/* Lógica de Rotação Dupla (Aplica-se a ambos) */
.spin-clockwise, .spin-counter-clockwise {
    transform-origin: 50px 50px;
    will-change: transform;
}
.spin-clockwise { animation: rotateSacred 12s linear infinite; }
.spin-counter-clockwise { animation: rotateSacred 12s linear infinite reverse; }

/* Ajustes de Velocidade por Contexto */
.rosette-spinner .spin-clockwise { animation-duration: 20s; }
.rosette-spinner .spin-counter-clockwise { animation-duration: 20s; }

@keyframes rotateSacred {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- 4. HERO HEADER --- */
header {
    position: relative; width: 100%;
    min-height: 100vh; min-height: 100dvh; 
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
    padding: 0 1.5rem; 

    background-image: 
        linear-gradient(to bottom, rgba(28, 25, 23, 0.9) 0%, rgba(28, 25, 23, 0.7) 45%, rgba(28, 25, 23, 1.0) 100%),
        url("assets/the-calling-of-saint-matthew.avif"); 
    background-size: cover; background-position: 65% center; 
    transition: background-image 0.3s ease-in-out; box-shadow: 0 15px 50px rgba(0,0,0,0.8); z-index: 2;
}
@media (min-width: 768px) {
    header { background-position: center 50%; padding-bottom: 4rem; }
}

/* Language Switcher */
.language-switch {
    position: absolute; top: max(2rem, env(safe-area-inset-top)); right: max(1.5rem, env(safe-area-inset-right));
    z-index: 50; display: flex; align-items: center; gap: 0.5rem;
    background: rgba(28, 25, 23, 0.6); backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle); padding: 0.5rem 1rem; border-radius: 50px;
    font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text-secondary);
}
.lang-btn {
    background: none; border: none; padding: 4px; color: var(--text-secondary); cursor: pointer;
    font-family: inherit; font-size: inherit; opacity: 0.6; transition: all 0.2s ease;
}
.lang-btn.active { color: var(--accent-main); opacity: 1; font-weight: bold; }

/* --- 5. TYPOGRAPHY & ELEMENTS --- */
.header-content {
    width: 100%; max-width: 618px; margin: 0 auto;
    display: flex; flex-direction: column; align-items: center;
}

h1 {
    font-family: var(--font-serif); font-weight: 500; 
    font-size: clamp(2.5rem, 5vw, var(--fs-xl)); /* Escala Modular */
    line-height: 1.1; letter-spacing: -0.04em; font-style: italic;
    margin-bottom: 0.5rem; color: var(--text-primary);
    text-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: center; white-space: nowrap; 
}
@media (max-width: 350px) { h1 { white-space: normal; } }

.subtitle {
    font-family: var(--font-mono); font-size: var(--fs-small); color: var(--accent-main);
    letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: var(--space-phi);
    background: rgba(227, 181, 5, 0.08); padding: 8px 16px; border-radius: 4px;
    border: 1px solid rgba(227, 181, 5, 0.3); display: inline-block; text-align: center;
}

/* AVATAR (Ethereal Vessel) */
.avatar {
    width: clamp(120px, 20vw, 150px); height: clamp(120px, 20vw, 150px);
    border-radius: 50%; margin-bottom: var(--space-phi);
    background: linear-gradient(45deg, #c5a059 0%, #722f37 40%, #3d1c51 70%, #1a1a2e 100%);
    padding: 3px; display: flex; align-items: center; justify-content: center;
    animation: sacredPulse 8s ease-in-out infinite;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease; will-change: transform, box-shadow;
}
.avatar img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    border: 3px solid var(--bg-body); box-sizing: border-box; transition: filter 0.5s ease;
}
@media (hover: hover) {
    .avatar:hover { transform: scale(1.03) translateY(-2px); box-shadow: 0 0 40px rgba(227, 181, 5, 0.5); cursor: pointer; }
}
@keyframes sacredPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(227, 181, 5, 0.05); }
    50% { box-shadow: 0 0 35px rgba(227, 181, 5, 0.25); }
}

/* Manifesto */
.manifesto-container { margin: 1.5rem 0 2rem; padding: 0 0.5rem; display: flex; justify-content: center; width: 100%; }
.manifesto {
    position: relative; font-family: var(--font-serif); font-size: clamp(1.1rem, 4vw, 1.25rem);
    line-height: 1.4; color: var(--text-primary); text-align: center; max-width: 90%;
}
.manifesto .highlight { color: var(--accent-main); font-style: italic; font-weight: 500; }
@media (hover: hover) {
    .manifesto { cursor: help; }
    .manifesto::after {
        content: attr(data-subtext); position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(0px); 
        width: max-content; max-width: 300px; padding: 0.8rem 1rem;
        background-color: rgba(28, 25, 23, 0.98); border: 1px solid var(--border-subtle); border-bottom: 2px solid var(--accent-main); 
        border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.6);
        font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary);
        opacity: 0; visibility: hidden; pointer-events: none; z-index: 100;
        transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .manifesto:hover::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(10px); }
}

/* Quote Tooltip (Ghost Fade Refined) */
.quote {
    position: relative; font-family: var(--font-mono); font-size: var(--fs-small);
    text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-secondary); opacity: 0.8; 
    margin-top: 1rem; margin-bottom: 2rem; display: inline-block;
    border-top: 1px solid var(--border-subtle); padding-top: 1rem;
}
@media (hover: hover) {
    .quote::after {
        content: attr(data-meaning); position: absolute; bottom: 100%; left: 50%; 
        transform: translateX(-50%) translateY(-10px); /* Posição Estática */
        background-color: rgba(28, 25, 23, 0.98); border: 1px solid var(--accent-main); color: var(--text-primary); 
        border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.9); padding: 0.6rem 1rem 0.6rem 2.4rem;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23E3B505' d='M9 3a1 1 0 0 1 1 1v1h3a1 1 0 1 1 0 2h-.055c-.223 2.032-1.116 3.99-2.545 5.688a13 13 0 0 0 2.121 1.494l2.067-4.592a1 1 0 0 1 1.824 0l4.5 10a1 1 0 0 1-1.824.82L18.003 18h-5.007l-1.084 2.41a1 1 0 0 1-1.824-.82l1.61-3.576a15.2 15.2 0 0 1-2.7-1.895c-1.287 1.136-2.848 2.098-4.627 2.81a1 1 0 1 1-.743-1.857c1.557-.623 2.887-1.441 3.972-2.382a11.5 11.5 0 0 1-1.978-3.34a1 1 0 0 1 1.873-.702A9.4 9.4 0 0 0 9 11.244C10.065 9.921 10.72 8.458 10.928 7H4a1 1 0 0 1 0-2h4V4a1 1 0 0 1 1-1m8.103 13L15.5 12.437L13.898 16z'/%3E%3C/svg%3E");
        background-repeat: no-repeat; background-size: 16px; background-position: 12px center;
        font-family: var(--font-serif); font-size: 0.95rem; font-style: italic; white-space: nowrap; pointer-events: none;
        
        opacity: 0; visibility: hidden; 
        transition: opacity 0.8s ease, visibility 0.8s ease; /* Fade-in Fantasma ideal */
    }
    .quote:hover::after {
        opacity: 1; visibility: visible; 
        transition-delay: 0.1s; /* Delay sutil para não piscar */
    }
}

/* Socials */
.socials {
    display: flex; justify-content: center; gap: var(--space-phi); margin-top: var(--space-phi-double); flex-wrap: wrap; width: 100%;
}
.social-link {
    display: flex; align-items: center; justify-content: center; width: var(--touch-target); height: var(--touch-target);
    border-radius: 4px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.03); transition: all 0.3s ease;
}
.social-link:active { background: rgba(227, 181, 5, 0.2); transform: scale(0.95); }
.social-link svg { width: 24px; height: 24px; fill: var(--text-secondary); filter: drop-shadow(0 1px 3px rgba(0,0,0,0.9)); transition: all 0.3s ease; }
@media (hover: hover) {
    .social-link:hover { background: rgba(227, 181, 5, 0.1); border-color: rgba(227, 181, 5, 0.3); transform: translateY(-2px); }
    .social-link:hover svg { fill: var(--accent-main); transform: translateY(-2px); filter: drop-shadow(0 0 8px var(--accent-main)); }
}

/* --- 6. PARTICLES (Background) --- */
.particles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; z-index: 1; }
.dust { position: absolute; border-radius: 50%; background: var(--accent-main); box-shadow: 0 0 10px var(--accent-main); opacity: 0; animation: floatUp linear infinite; }
.dust-1 { width: 3px; height: 3px; left: 10%; animation-duration: 45s; }
.dust-2 { width: 4px; height: 4px; left: 30%; animation-duration: 55s; animation-delay: 5s; }
.dust-3 { width: 2px; height: 2px; left: 50%; animation-duration: 40s; animation-delay: 15s; }
.dust-4 { width: 3px; height: 3px; left: 70%; animation-duration: 60s; animation-delay: 8s; }
.dust-5 { width: 5px; height: 5px; left: 85%; animation-duration: 48s; animation-delay: 2s; }
.dust-6 { width: 2px; height: 2px; left: 20%; animation-duration: 35s; animation-delay: 25s; }
@keyframes floatUp { 0% { transform: translateY(100vh) scale(0); opacity: 0; } 20%, 80% { opacity: 0.5; } 100% { transform: translateY(-10vh) scale(1); opacity: 0; } }

.scroll-hint {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 10;
    color: var(--text-secondary); opacity: 0.6; animation: scrollBeckon 3s infinite ease-in-out; pointer-events: none;
}
@keyframes scrollBeckon { 0%, 100% { transform: translateY(0); opacity: 0.3; } 50% { transform: translateY(6px); opacity: 0.8; color: var(--accent-main); } }

/* --- 7. MAIN CONTENT & FORTRESS LINKS --- */
.container {
    width: 100%; max-width: 618px; 
    display: flex; flex-direction: column; gap: var(--space-phi-double); 
    padding: var(--space-section) 1.5rem; /* Respiro de luxo */
}

.link-stack { display: flex; flex-direction: column; gap: var(--space-phi); padding-bottom: 2rem; width: 100%; }

/* Animações de Entrada */
header, .link-stack, footer { opacity: 0; transform: translateY(40px); filter: blur(4px); will-change: opacity, transform, filter; }
body.reveal-content header { animation: slideUpFade 1.4s var(--ease-out) forwards; }
body.reveal-content .link-stack { animation: slideUpFade 1.4s var(--ease-out) forwards; animation-delay: 0.2s; }
body.reveal-content footer { animation: slideUpFade 1.4s var(--ease-out) forwards; animation-delay: 0.5s; }
@keyframes slideUpFade { 0% { opacity: 0; transform: translateY(40px); filter: blur(4px); } 100% { opacity: 1; transform: translateY(0); filter: blur(0); } }

/* Construction Notice */
.construction-notice {
    text-align: center; padding: var(--space-phi-double) var(--space-phi); 
    border: 1px dashed var(--border-subtle); border-radius: 2px; background: rgba(28, 25, 23, 0.3); 
    margin-bottom: var(--space-phi-double); max-width: 90%; margin-left: auto; margin-right: auto;
}
.construction-notice h3 { font-family: var(--font-serif); color: var(--text-primary); font-size: 1.4rem; margin-bottom: 0.5rem; font-style: italic; }
.construction-notice p { font-family: var(--font-serif); color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

/* Fortress Links (Desktop Physics) */
.fortress-link {
    display: flex; align-items: center; padding: var(--space-phi); 
    background: rgba(28, 25, 23, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle); border-left: 2px solid var(--border-subtle); 
    color: var(--text-primary); text-decoration: none; 
    transition: all 0.4s var(--ease-physics); position: relative; overflow: hidden;
    min-height: calc(var(--space-phi) * 3); 
}
.link-icon {
    display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-right: var(--space-phi); 
    color: var(--text-secondary); border: 1px solid rgba(255,255,255,0.05); background: rgba(0,0,0,0.2); transition: all 0.4s var(--ease-physics);
}
.link-icon svg { width: 20px; height: 20px; }
.link-content { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.link-title { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 500; letter-spacing: 0.01em; }
.link-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; }
.link-action { opacity: 0.4; transform: translateX(0); color: var(--accent-main); font-size: 1.2rem; transition: all 0.4s var(--ease-physics); }

.fortress-link:active { transform: scale(0.98); background: rgba(28, 25, 23, 0.9); border-color: var(--accent-main); }
@media (hover: hover) {
    .fortress-link:hover {
        background: rgba(35, 30, 28, 0.85); border-color: var(--accent-structure); border-left-color: var(--accent-main); 
        transform: translateY(-2px) scale(1.005); /* Physics Lift */
        box-shadow: -4px 4px 0px rgba(0,0,0,0.5), 0 0 25px rgba(227, 181, 5, 0.15);
    }
    .fortress-link:hover .link-icon { color: var(--accent-main); border-color: var(--accent-main); background: rgba(227, 181, 5, 0.05); transform: scale(1.1); }
    .fortress-link:hover .link-title { color: #fff; text-shadow: 0 0 15px rgba(227, 181, 5, 0.3); }
    .fortress-link:hover .link-action { opacity: 1; transform: translateX(5px); filter: drop-shadow(0 0 5px var(--accent-main)); }
}

/* --- 8. FOOTER --- */
footer {
    width: 100%; margin-top: auto; padding: 0; 
    border-top: 1px solid rgba(214, 206, 179, 0.08); background: linear-gradient(to bottom, rgba(28, 25, 23, 0), #12100e);
    display: flex; justify-content: center; 
    opacity: 0; animation: revealSlow 1.2s cubic-bezier(0.2, 1, 0.2, 1) forwards; animation-delay: 0.8s;
}
.footer-container {
    width: 100%; max-width: 618px; padding: 2.5rem 1.5rem; 
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2rem;
}
.footer-col { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-secondary); transition: opacity 0.3s ease; }
.footer-col.left { align-items: flex-start; }
.footer-col.center { align-items: center; order: -1; width: 100%; margin-bottom: 0.5rem; }
.footer-col.right { align-items: flex-end; }
@media (min-width: 768px) {
    .footer-col.center { order: 0; width: auto; margin-bottom: 0; }
    .footer-container { gap: 1.5rem; padding: 2.5rem 1rem; }
}
.copyright { color: var(--text-primary); font-weight: 500; }
.role { font-size: 0.65rem; opacity: 0.6; }
.made-in-badge {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 300px;
    background: rgba(255, 255, 255, 0.03); padding: 8px 16px; border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.7rem; letter-spacing: 0.02em; color: var(--text-secondary);
}
.made-in-badge svg { filter: grayscale(100%) contrast(0.8); opacity: 0.6; }
@media (hover: hover) {
    .made-in-badge:hover { border-color: var(--accent-main); background: rgba(255, 255, 255, 0.05); transform: translateY(-1px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
    .made-in-badge:hover svg { filter: grayscale(0%) contrast(1); opacity: 1; transform: scale(1.1); }
    .made-in-badge:hover .icon-heart { color: #e04a4a; animation: heartBeat 1.5s infinite ease-in-out; }
}
@keyframes heartBeat { 0%, 100% { transform: scale(1); } 15%, 45% { transform: scale(1.15); } 30%, 60% { transform: scale(1); } }
.tech-stack { letter-spacing: 0.1em; font-size: 0.65rem; opacity: 0.5; }
.version-tag { color: var(--accent-main); opacity: 0.6; letter-spacing: 0.05em; background: rgba(227, 181, 5, 0.05); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(227, 181, 5, 0.2); cursor: default; }

/* --- 9. MODAL & UTILITIES --- */
.art-wrapper {
    position: absolute; bottom: 20px; right: 20px; z-index: 20;
    display: flex; flex-direction: row-reverse; align-items: center; gap: 12px; pointer-events: none; 
}
.art-button {
    position: relative; width: 32px; height: 32px; border-radius: 50%;
    backdrop-filter: blur(4px); border: 1px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); cursor: help; pointer-events: auto; transition: all 0.3s ease; overflow: hidden;
}
.art-button svg {
    width: 16px; height: 16px; transform-origin: center 80%;
    animation: quillAlert 8s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}
@media (hover: hover) {
    .art-button:hover { background: var(--accent-main); border-color: var(--accent-main); color: var(--bg-body); transform: scale(1.1); box-shadow: 0 0 15px rgba(227, 181, 5, 0.5); }
    .art-button:hover svg { animation-play-state: paused; transform: rotate(0deg) scale(1.1); }
    .art-button:hover ~ .art-text { opacity: 1; visibility: visible; transform: translateX(0); }
}
@keyframes quillAlert {
    0%, 90% { transform: rotate(0deg); }
    92% { transform: rotate(-15deg); } 94% { transform: rotate(10deg); } 96% { transform: rotate(-8deg); } 98% { transform: rotate(4deg); } 100% { transform: rotate(0deg); }
}
.art-text {
    background: rgba(28, 25, 23, 0.95); color: var(--text-primary);
    padding: 6px 12px; border-radius: 4px; border-right: 2px solid var(--accent-main);
    font-size: 0.75rem; font-family: var(--font-mono); letter-spacing: 0.02em;
    opacity: 0; visibility: hidden; transform: translateX(10px); pointer-events: none; transition: all 0.4s var(--ease-out);
    white-space: normal; width: 180px; text-align: right;
}

/* Modal */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(18, 16, 14, 0.85); backdrop-filter: blur(8px); z-index: 10000; 
    display: flex; align-items: center; justify-content: center; padding: 1rem; 
    opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease-out), visibility 0.4s;
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal-parchment {
    position: relative; max-width: 600px; width: 100%; max-height: 85vh; overflow-y: auto; 
    background-color: #E6E2D3; 
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
    color: #1C1917; padding: 2rem 1.5rem; border-radius: 12px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.1) inset; 
    transform: scale(0.95) translateY(10px); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.is-open .modal-parchment { transform: scale(1) translateY(0); }
.modal-close {
    position: absolute; top: 0.5rem; right: 0.5rem; background: transparent; border: none; color: #5d5952; cursor: pointer; padding: 1rem; z-index: 10; 
}
.parchment-content { text-align: left; font-family: var(--font-serif); }
.parchment-title { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 600; font-style: italic; margin-bottom: 0.2rem; color: #1C1917; border-bottom: 1px solid rgba(28, 25, 23, 0.1); padding-bottom: 1rem; }
.parchment-meta { font-family: var(--font-mono); font-size: 0.75rem; color: #782626; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1.5rem; margin-top: 0.5rem; }
.parchment-body p { font-size: 1rem; line-height: 1.6; margin-bottom: 1rem; color: rgba(28, 25, 23, 0.9); }
.parchment-body p:first-of-type::first-letter { font-size: 3rem; float: left; line-height: 0.8; margin-right: 0.5rem; color: #782626; font-family: var(--font-serif); }
.parchment-decoration { margin-top: 2rem; text-align: center; opacity: 0.6; }

/* Toast */
.toast-notification {
    position: fixed; bottom: 3rem; left: 50%; transform: translateX(-50%) translateY(20px); 
    display: flex; align-items: center; gap: 12px;
    background-color: rgba(28, 25, 23, 0.95); border: 1px solid var(--accent-main); 
    padding: 12px 24px; border-radius: 50px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 11000; 
    width: 90%; max-width: 400px; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.toast-notification.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast-icon { display: flex; align-items: center; justify-content: center; color: var(--bg-body); background-color: var(--accent-main); width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.toast-message { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-primary); letter-spacing: 0.05em; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; border: 2px solid var(--bg-body); }


/* --- COLOPHON (INCEPTION) STYLES --- */
.interactive { cursor: pointer; transition: all 0.3s ease; }
.made-in-badge.interactive:hover { 
    background: rgba(227, 181, 5, 0.1); 
    border-color: var(--accent-main);
    transform: translateY(-2px);
}

.colophon-grid {
    display: flex; flex-direction: column; gap: 1.5rem;
    font-family: var(--font-mono); 
    /* CORREÇÃO: Usar cinza escuro em vez de claro */
    color: #57534E; 
}

.colophon-header {
    border-bottom: 1px solid rgba(28, 25, 23, 0.1); padding-bottom: 1rem; margin-bottom: 0.5rem;
    display: flex; justify-content: space-between; align-items: center;
}
.colophon-header h3 {
    font-family: var(--font-serif); color: #B45309; /* Tom dourado escuro para fundo claro */
    font-size: 1.4rem; margin: 0;
}
.mono-tag { 
    font-size: 0.7rem; background: rgba(0,0,0,0.05); padding: 2px 6px; border-radius: 4px; color: #78716C; 
}

.colophon-intro {
    font-family: var(--font-serif); font-style: italic; 
    /* CORREÇÃO: Texto quase preto para leitura */
    color: #1C1917; 
    line-height: 1.6; border-left: 2px solid #C5A059; padding-left: 1rem;
}

.spec-section h4 {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; 
    color: #78350F; /* Marrom avermelhado */
    margin-bottom: 0.8rem; border-bottom: 1px dashed rgba(0,0,0,0.1); padding-bottom: 4px;
}

.spec-row {
    display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 4px;
}
.spec-value { 
    /* CORREÇÃO: Valor escuro */
    color: #1C1917; font-weight: 600; 
}

/* Color Swatches */
.color-swatch-row { display: flex; gap: 10px; }
.swatch {
    width: 30px; height: 30px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.1);
    transition: transform 0.2s; cursor: help;
}
.swatch:hover { transform: scale(1.2); border-color: #000; }

/* Font Preview */
.font-preview { 
    padding: 8px; 
    /* Fundo escuro leve para destacar o texto branco do preview, OU invertemos */
    background: rgba(255,255,255,0.5); border: 1px solid rgba(0,0,0,0.05);
    border-radius: 4px; margin-bottom: 5px; font-size: 0.9rem; color: #1C1917;
}
.font-preview.serif { font-family: var(--font-serif); }
.font-preview.mono { font-family: var(--font-mono); font-size: 0.8rem; }

/* Stack List */
.stack-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; list-style: none;
}
.stack-list li {
    font-size: 0.8rem; display: flex; align-items: center; color: #44403C;
}
.stack-list li::before {
    content: '>'; margin-right: 6px; color: #B45309; font-size: 0.7rem;
}


/* --- LAPTOP & LOW-HEIGHT SCREENS OPTIMIZATION (1366x768 Focus) --- */
@media screen and (max-width: 1440px), screen and (max-height: 800px) {
    
    /* 1. Reduz a base da fonte de volta para 16px (1rem) 
       Isso fará TODOS os textos e espaçamentos 'em/rem' diminuírem proporcionalmente (Magic!) */
    body {
        font-size: 1rem; 
    }

    /* 2. Ajuste do Container Principal 
       Reduzimos o padding vertical drástico (--space-section) para algo mais contido */
    .container {
        padding: 4rem 1.5rem; /* ~64px vertical em vez de 100px */
        gap: 3rem; /* Reduz o gap entre seções */
    }

    /* 3. Header mais compacto
       Em telas baixas, garantimos que o conteúdo não toque as bordas */
    header {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* 4. Título H1 levemente menor para não gritar na tela pequena */
    h1 {
        font-size: 2.5rem; 
    }

    /* 5. Ajuste fino no "Opus in Progressu" para ocupar menos altura */
    .construction-notice {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    /* 6. Ícones sociais um pouco mais próximos */
    .socials {
        margin-top: 1.5rem;
    }
}

/* --- MOBILE MASTERY (iOS & Android Native Feel) --- */
@media screen and (max-width: 768px) {

    /* 1. TYPOGRAPHY & SCALING (Readable & Compact) */
    :root {
        /* Redefine font size specifically for small screens */
        --fs-base: 16px; 
    }

    body {
        /* Prevent horizontal scroll caused by animations */
        overflow-x: hidden; 
        width: 100%;
        /* Better scrolling momentum on iOS */
        -webkit-overflow-scrolling: touch; 
    }

    h1 {
        /* Allows the name to wrap if it's too long on small phones (iPhone SE) */
        font-size: clamp(2.2rem, 12vw, 3rem);
        white-space: normal; 
        padding: 0 10px;
        line-height: 1.1;
    }

    /* 2. HEADER: THE IMMERSIVE VIEWPORT (100dvh) */
    header {
        /* FIX: Solves the jumping address bar issue on iOS/Android */
        min-height: 100dvh; 
        
        /* Adjust background for portrait orientation */
        background-position: 65% center; 
        background-attachment: scroll; /* Performance fix for mobile scrolling */
        
        /* Ensure content doesn't touch the notch or home indicator */
        padding-top: max(2rem, env(safe-area-inset-top));
        padding-bottom: max(4rem, env(safe-area-inset-bottom));
    }

    /* 3. LAYOUT & RHYTHM (Efficiency) */
    .container {
        /* Remove the luxury gap of desktop. Mobile needs content density. */
        padding: 3rem 1.25rem; 
        gap: 2rem;
        width: 100%;
        max-width: 100%;
    }

    /* 4. FORTRESS LINKS (Thumb-Friendly Physics) */
    .fortress-link {
        /* Taller links for easier tapping (Fat Finger Rule) */
        min-height: 80px; 
        padding: 1.25rem;
        
        /* Mobile Feedback: Slightly darker background for contrast */
        background: rgba(28, 25, 23, 0.7);
    }
    
    .link-icon {
        /* Slightly smaller icons to balance the text */
        width: 42px; height: 42px;
        margin-right: 1rem;
    }

    .link-title {
        font-size: 1.2rem;
    }

    /* ACTIVE STATE (The "Tap" Feel) - Crucial for UX */
    .fortress-link:active {
        transform: scale(0.96); /* Significant physical compression */
        background: rgba(227, 181, 5, 0.15); /* Immediate gold flash */
        border-color: var(--accent-main);
        transition: transform 0.1s, background 0.1s; /* Instant response */
    }

    /* 5. UI CONTROLS (Language & Art) */
    .language-switch {
        /* Larger touch target */
        top: max(1.5rem, env(safe-area-inset-top));
        right: max(1rem, env(safe-area-inset-right));
        padding: 0.6rem 1.2rem;
    }

    .art-wrapper {
        /* Move away from the edge to avoid conflict with "Back" gestures */
        bottom: max(20px, env(safe-area-inset-bottom));
        right: 20px;
    }
    
    .art-button {
        /* A bit larger for easy thumb access */
        width: 48px; height: 48px;
        background: rgba(28, 25, 23, 0.8); /* More visibility */
    }

    /* 6. MODAL (Bottom Sheet Style) */
    .modal-parchment {
        max-height: 80dvh; /* Use dynamic height */
        width: 95%; /* Almost full width */
        margin-bottom: env(safe-area-inset-bottom); /* Respect iPhone Home Bar */
        overflow-y: scroll; /* Native scroll momentum */
        -webkit-overflow-scrolling: touch;
    }

    /* 7. FOOTER (Vertical Stack) */
    .footer-container {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
    
    .footer-col.left, .footer-col.right {
        align-items: center; /* Center everything on mobile */
    }
    
    .footer-col.center {
        order: -1; /* Keep "Made with" at the top or center as preferred */
        margin-bottom: 1rem;
    }

    /* Dentro de @media (max-width: 768px) */

    .socials {
        /* Muda de Flex para Grid para controle total */
        display: grid;

        /* Cria exatamente 3 colunas de tamanho automático */
        grid-template-columns: repeat(3, auto);

        /* Centraliza o grid na tela */
        justify-content: center;

        /* Espaçamento generoso entre os ícones */
        gap: 1.5rem 2rem; /* 1.5rem vertical, 2rem horizontal */

        padding: 0; /* Remove padding desnecessário */
    }
}


/* --- DEBUG MODE (KONAMI TRIGGER) --- */
body.debug-mode * {
    /* Desenha uma borda dourada translúcida em TODOS os elementos */
    outline: 1px solid rgba(227, 181, 5, 0.3) !important; 
    background: rgba(227, 181, 5, 0.02) !important; /* Leve tinta dourada */
}
body.debug-mode .container, 
body.debug-mode header,
body.debug-mode footer {
    outline: 2px solid #E3B505 !important; /* Borda forte nos blocos principais */
    position: relative;
}
/* Opcional: Mostra as tags HTML como pseudo-elementos (Avançado) */
body.debug-mode div::before,
body.debug-mode section::before, 
body.debug-mode header::before {
    content: '<' attr(class) '>';
    position: absolute; top: 0; left: 0;
    font-size: 10px; color: #E3B505; background: #000; padding: 2px;
    opacity: 0.7; pointer-events: none;
}
