/* ============================================================
   HOLLOW KNIGHT — Portfolio Style
   Palette: #2b2d31 / #35373c / #404249 + #FDB813 Soul Gold
   Fonts:   Cinzel Decorative (display) · Cinzel (thematic headings)
            Lora (prose) · Inter (functional UI — nav/buttons/forms/labels)
   ============================================================ */

/* ======== VARIABLES ======== */
/* Dark is the primary/default identity. --accent adapts per theme for use as
   foreground (text/icons/borders/outline); --accent-fill is the constant brand
   gold used only for solid fills that always pair with the fixed dark on-accent
   text (#1a1506), so it never has a page-background contrast problem. */
:root {
    color-scheme: dark;

    --bg:           #2b2d31;
    --bg-2:         #35373c;
    --bg-3:         #404249;
    --bg-deep:      #1e2024;
    --bg-deep-rgb:  30, 32, 36;
    --accent:       #FDB813;
    --accent-fill:  #FDB813;
    --accent-dim:   rgba(253, 184, 19, 0.08);
    --accent-glow:  rgba(253, 184, 19, 0.25);
    --text:         #d4cdc0;
    --text-muted:   #aaa194; /* AA-compliant against --bg and --bg-2 (was #6e6860 at 2.5:1) */
    --text-dim:     #a8a298;
    --border:       rgba(253, 184, 19, 0.2);
    --border-dim:   rgba(255, 255, 255, 0.06);
    --atmo-top:     rgba(30, 34, 46, 0.7);
    --success:      #6ee7a0;
    --error:        #e07a5f;
    --radius:       4px;
    --radius-lg:    6px;

    /* Fonts — display/heading stay thematic, ui/body carry the functional-modern layer */
    --font-display: 'Cinzel Decorative', serif;
    --font-heading: 'Cinzel', serif;
    --font-body:    'Lora', Georgia, serif;
    --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Elevation scale — flat panels rest at none; interactive/floating elements step sm → xl */
    --shadow-sm:      0 6px 16px rgba(0, 0, 0, 0.3);
    --shadow-md:      0 16px 36px rgba(0, 0, 0, 0.42);
    --shadow-lg:      0 20px 48px rgba(0, 0, 0, 0.48);
    --shadow-xl:      0 24px 64px rgba(0, 0, 0, 0.55);
    --shadow-glow-sm: 0 0 10px var(--accent-glow);
    --shadow-glow-md: 0 0 20px var(--accent-glow);
}

/* ======== LIGHT THEME ========
   A professional adaptation, not an inversion: the gold brand accent is kept
   constant (--accent-fill) but darkened to a legible amber (--accent) wherever
   it appears as text/icon/border against the new light surfaces — the raw
   brand gold measures ~1.6:1 on this background (fails AA), the adapted
   amber measures ~5.3:1 (passes comfortably). Verified with axe-core. */
:root[data-theme="light"] {
    color-scheme: light;

    --bg:           #f7f4ee;
    --bg-2:         #ffffff;
    --bg-3:         #ece4d3;
    --bg-deep:      #eee7d8;
    --bg-deep-rgb:  238, 231, 216;
    --accent:       #8a5c00;
    --accent-dim:   rgba(253, 184, 19, 0.14);
    --accent-glow:  rgba(253, 184, 19, 0.4);
    --text:         #2a2620;
    --text-muted:   #6b6357;
    --text-dim:     #5c574c;
    --border:       rgba(138, 92, 0, 0.35);
    --border-dim:   rgba(0, 0, 0, 0.08);
    --atmo-top:     rgba(40, 35, 25, 0.05);
    --h1-glow:      transparent;
    --portrait-glow-color: rgba(138, 92, 0, 0.16);
    --portrait-baseline-glow: rgba(138, 92, 0, 0.25);
    /* Dark theme's success/error read fine on dark surfaces but fall to ~1.3:1 and
       ~2.9:1 against the light theme's white/cream surfaces — darkened here to clear AA. */
    --success:      #0f6b32;
    --error:        #b91c1c;

    --shadow-sm:      0 6px 16px rgba(20, 16, 8, 0.10);
    --shadow-md:      0 16px 36px rgba(20, 16, 8, 0.13);
    --shadow-lg:      0 20px 48px rgba(20, 16, 8, 0.15);
    --shadow-xl:      0 24px 64px rgba(20, 16, 8, 0.18);
}

/* No saved preference yet: follow the OS setting until JS/localStorage takes over */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --bg:           #f7f4ee;
        --bg-2:         #ffffff;
        --bg-3:         #ece4d3;
        --bg-deep:      #eee7d8;
        --bg-deep-rgb:  238, 231, 216;
        --accent:       #8a5c00;
        --accent-dim:   rgba(253, 184, 19, 0.14);
        --accent-glow:  rgba(253, 184, 19, 0.4);
        --text:         #2a2620;
        --text-muted:   #6b6357;
        --text-dim:     #5c574c;
        --border:       rgba(138, 92, 0, 0.35);
        --border-dim:   rgba(0, 0, 0, 0.08);
        --atmo-top:     rgba(40, 35, 25, 0.05);
        --h1-glow:      transparent;
        --portrait-glow-color: rgba(138, 92, 0, 0.16);
        --portrait-baseline-glow: rgba(138, 92, 0, 0.25);
        --success:      #0f6b32;
        --error:        #b91c1c;

        --shadow-sm:      0 6px 16px rgba(20, 16, 8, 0.10);
        --shadow-md:      0 16px 36px rgba(20, 16, 8, 0.13);
        --shadow-lg:      0 20px 48px rgba(20, 16, 8, 0.15);
        --shadow-xl:      0 24px 64px rgba(20, 16, 8, 0.18);
    }
}

/* ======== RESET ======== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ======== ACCESSIBILITY UTILITIES ======== */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 1rem;
    z-index: 1000;
    background: var(--accent-fill);
    color: #1a1506;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* Consistent, visible keyboard focus ring across interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Respect reduced-motion preference: strip decorative animation/motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .soul-particle { display: none; }
}

/* picture wrappers should not affect layout of the img they hold */
picture { display: contents; }

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    /* Underground atmospheric gradient — the top vignette is dark-mode-specific
       mood, so it's tokenized down to near-nothing in light mode rather than
       inverted, which would just look like a smudge on a light page */
    background-image:
        radial-gradient(ellipse 120% 40% at 50% 100%, rgba(253,184,19,0.04) 0%, transparent 60%),
        radial-gradient(ellipse 80% 60% at 50% -5%,   var(--atmo-top) 0%, transparent 65%);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

a   { text-decoration: none; }
img { display: block; }

/* ======== SCROLL REVEAL ======== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ======== TYPOGRAPHY ======== */
h2, h3 { font-family: var(--font-heading); line-height: 1.25; }

h2 {
    font-size: clamp(1.8rem, 3.8vw, 2.6rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
}

.highlight  { color: var(--accent); }
.text-accent { color: var(--accent); font-style: italic; }

/* ======== BUTTONS ======== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: var(--accent-fill);
    color: #1a1506;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.22s, transform 0.22s, box-shadow 0.22s;
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.22s;
}
.btn-primary:hover { background: #ffc832; transform: translateY(-3px); box-shadow: var(--shadow-glow-md); }
.btn-primary:hover::after { opacity: 1; }
.btn-primary:active { transform: translateY(-1px); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.22s, color 0.22s, transform 0.22s, background 0.22s;
}
.btn-ghost:hover { border-color: var(--border); color: var(--accent); transform: translateY(-3px); background: var(--accent-dim); }
.btn-ghost:active { transform: translateY(-1px); }

/* ======== HEADER ======== */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 1rem 6%;
    background: rgba(var(--bg-deep-rgb), 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid var(--border-dim);
}

.header-actions { display: flex; align-items: center; gap: 1.4rem; }

.logo { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--text); letter-spacing: 0.02em; }
.logo-accent { color: var(--accent); }

.command-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    height: 2rem;
    padding: 0 0.65rem;
    background: none;
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.22s, border-color 0.22s, transform 0.15s ease;
}
.command-trigger:hover { color: var(--accent); border-color: var(--border); }
.command-trigger:active { transform: scale(0.94); }
.command-trigger-kbd {
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-dim);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
}
/* Touch-primary devices have no keyboard shortcut to hint at — the icon alone is the tap target */
@media (pointer: coarse) {
    .command-trigger-kbd { display: none; }
    .command-trigger { padding: 0 0.5rem; }
}

.lang-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    padding: 0 0.6rem;
    background: none;
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.22s, border-color 0.22s, transform 0.15s ease;
}
.lang-toggle:hover { color: var(--accent); border-color: var(--border); }
.lang-toggle:active { transform: scale(0.92); }
.lang-toggle-code {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: none;
    border: 1px solid var(--border-dim);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.22s, border-color 0.22s, transform 0.15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border); }
.theme-toggle:active { transform: scale(0.9); }
.theme-toggle-icon--dark { display: none; }
:root[data-theme="light"] .theme-toggle-icon--light { display: none; }
:root[data-theme="light"] .theme-toggle-icon--dark { display: inline-flex; }

.navbar a {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-left: 2.2rem;
    transition: color 0.22s;
    position: relative;
}
.navbar a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.28s ease;
}
.navbar a:hover { color: var(--accent); }
.navbar a:hover::after { width: 100%; }
.navbar a.is-current { color: var(--accent); }
.navbar a.is-current::after { width: 100%; }
.mobile-link.is-current { color: var(--accent); }

/* Contato reads as the standing call-to-action, reachable from anywhere on the site */
.navbar a.nav-cta {
    margin-left: 1.6rem;
    padding: 0.5rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--accent);
    transition: background 0.22s, color 0.22s, border-color 0.22s, transform 0.22s;
}
.navbar a.nav-cta::after { display: none; }
.navbar a.nav-cta:hover,
.navbar a.nav-cta.is-current {
    background: var(--accent-fill);
    color: #1a1506;
    border-color: var(--accent-fill);
    transform: translateY(-1px);
}
.navbar a.nav-cta:active { transform: translateY(0); }

#menu-icon { font-size: 2rem; cursor: pointer; display: none; color: var(--text); transition: color 0.22s, transform 0.15s ease; }
#menu-icon:hover { color: var(--accent); }
#menu-icon:active { transform: scale(0.9); }

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(var(--bg-deep-rgb), 0.98);
    backdrop-filter: blur(24px);
    padding: 0.5rem 6% 1.5rem;
    flex-direction: column;
    border-bottom: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
    display: block;
    padding: 0.9rem 0;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-dim);
    transition: color 0.22s;
}
.mobile-nav a:hover { color: var(--accent); }

/* ======== SECTIONS ======== */
.section { padding: 7rem 6%; position: relative; scroll-margin-top: 88px; }

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 1;
}

/* Ornate divider above eyebrow */
.ornate-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.od-line {
    display: block;
    width: 80px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent));
    opacity: 0.4;
}
.od-line:last-child {
    background: linear-gradient(to left, transparent, var(--accent));
}
.od-gem { font-size: 0.55rem; color: var(--accent); opacity: 0.7; }

.section-eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent);
    margin-bottom: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.22rem 1.1rem;
    background: var(--accent-dim);
}

.section-intro,
.contato-subtitulo {
    max-width: 580px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.97rem;
    font-style: italic;
    font-weight: 300;
}

/* Background roman numeral */
.section-bg-num {
    position: absolute;
    top: 1.5rem;
    right: 4%;
    font-family: var(--font-display);
    font-size: clamp(5rem, 12vw, 11rem);
    font-weight: 900;
    color: rgba(253, 184, 19, 0.04);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    letter-spacing: 0.02em;
}

/* ======== HERO ======== */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 0;
    overflow: visible;
}

/* SVG Hallownest seal — anchored behind the portrait, not the whole hero,
   so it stays put on mobile where text stacks below the photo */
.hero-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    height: 520px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.9;
    animation: seal-breathe 8s ease-in-out infinite;
}
/* Per-shape opacity stays fixed in the markup; only the hue adapts per theme —
   swapping bright gold for the deeper amber keeps the motif visible on light
   backgrounds instead of washing out at these low opacities. */
.hero-seal .hs-stroke { stroke: var(--accent); }
.hero-seal .hs-fill   { fill: var(--accent); }

@keyframes seal-breathe {
    0%, 100% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.015); }
}

/* Ambient warm glow from below */
.hero-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: radial-gradient(ellipse 60% 60% at 50% 100%, rgba(253,184,19,0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Logo watermark — centered behind hero content */
.hero-signature {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}
.hero-sig-img {
    width: 320px;
    height: 320px;
    display: block;
    opacity: 0.28;
    filter: drop-shadow(0 0 18px rgba(253,184,19,0.35));
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ---- HERO TEXT ---- */
.hero-text { flex: 1; min-width: 300px; max-width: 560px; }

.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--accent-dim);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.9rem 0.4rem 0.7rem;
    margin-bottom: 1.5rem;
}
.ab-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #6ee7a0;
    box-shadow: 0 0 0 0 rgba(110,231,160,0.6);
    animation: ab-pulse 2.2s ease-out infinite;
    flex-shrink: 0;
}
@keyframes ab-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(110,231,160,0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(110,231,160,0); }
    100% { box-shadow: 0 0 0 0 rgba(110,231,160,0); }
}

.hero-text h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6.5vw, 5.8rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 0.01em;
    margin-bottom: 1.25rem;
}

.h1-first {
    display: block;
    color: var(--text);
}
.h1-last {
    display: block;
    color: var(--accent);
    text-shadow: 0 0 30px var(--h1-glow, rgba(253,184,19,0.3));
}

.typing-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}
.typing-caret { color: var(--accent); font-size: 1.4rem; line-height: 1; font-weight: 700; }

#typing-effect { color: var(--text-dim); }
#typing-effect::after {
    content: '|';
    animation: blink 0.8s infinite;
    color: var(--accent);
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-bio {
    max-width: 490px;
    color: var(--text-muted);
    font-size: 0.97rem;
    line-height: 1.85;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

/* Primary stack — quick-scan, non-decorative chips (functional, not a flourish) */
.hero-stack {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}
.hero-stack-label {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    flex-shrink: 0;
}
.hero-stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
}
.hero-stack-list li {
    font-family: var(--font-ui);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--bg-2);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; }

.social-links { display: flex; gap: 0.65rem; flex-wrap: wrap; }
.social-links a {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--text-muted);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    background: var(--bg-2);
    transition: color 0.22s, border-color 0.22s, background 0.22s, transform 0.22s, box-shadow 0.22s;
}
.social-links a:hover {
    color: var(--accent);
    border-color: var(--border);
    background: var(--accent-dim);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow-sm);
}
.social-links a:active { transform: translateY(-1px); }

/* ---- PORTRAIT / PHOTO ---- */
.hero-photo-area {
    flex: 1;
    min-width: 280px;
    max-width: 440px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.portrait-wrap {
    position: relative;
    width: 340px;
    height: 420px;
}

/* Soul glow under figure */
.portrait-glow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 230px;
    height: 80px;
    background: radial-gradient(ellipse, var(--portrait-glow-color, rgba(253,184,19,0.36)) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
    animation: soul-pulse 3s ease-in-out infinite;
}

@keyframes soul-pulse {
    0%, 100% { opacity: 0.7; transform: translateX(-50%) scaleX(1); }
    50%       { opacity: 1;   transform: translateX(-50%) scaleX(1.1); }
}

.profile-photo {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    display: block;
}

/* Ornate portrait frame */
.portrait-frame {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.pf-corner {
    position: absolute;
    width: 44px;
    height: 44px;
    border-color: var(--accent);
    border-style: solid;
    border-width: 0;
    transition: width 0.35s, height 0.35s, opacity 0.35s;
    opacity: 0.7;
}
/* Diamond tip on each corner */
.pf-corner::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent);
    transform: rotate(45deg);
    opacity: 0.85;
    box-shadow: 0 0 8px var(--accent-glow);
}

.portrait-wrap:hover .pf-corner { width: 52px; height: 52px; opacity: 1; }

.pfc-tl { top: 0;    left: 0;   border-top-width: 2px; border-left-width: 2px; }
.pfc-tr { top: 0;    right: 0;  border-top-width: 2px; border-right-width: 2px; }
.pfc-bl { bottom: 0; left: 0;   border-bottom-width: 2px; border-left-width: 2px; }
.pfc-br { bottom: 0; right: 0;  border-bottom-width: 2px; border-right-width: 2px; }

.pfc-tl::after { top: -3px;    left: -3px;  }
.pfc-tr::after { top: -3px;    right: -3px; }
.pfc-bl::after { bottom: -3px; left: -3px;  }
.pfc-br::after { bottom: -3px; right: -3px; }

.portrait-baseline {
    position: absolute;
    bottom: 0;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-fill) 20%, var(--accent-fill) 80%, transparent);
    z-index: 2;
    box-shadow: 0 0 18px var(--portrait-baseline-glow, rgba(253,184,19,0.4));
}

/* Soul orb floating cards */
.soul-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1.15rem;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(255,255,255,0.03) inset;
    z-index: 4;
}
/* Kept within hero-photo-area's own box (not bled into the gap) so it can never
   overlap the text column, regardless of how narrow that gap gets between breakpoints */
.sc-left  { top: 20%;   left: 0;  animation: soul-float 4s ease-in-out infinite;        }
.sc-right { bottom: 22%; right: 0; animation: soul-float 4s ease-in-out infinite 2.2s;   }

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

.sc-gem  { font-size: 1.2rem; color: var(--accent); line-height: 1; text-shadow: 0 0 10px var(--accent-glow); }
.sc-num  { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700; color: var(--accent); line-height: 1; }
.sc-lbl  { font-family: var(--font-heading); font-size: 0.6rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.sc-icon { font-size: 1.4rem; color: var(--accent); line-height: 1; }

/* ---- SOUL PARTICLES (injected by JS) ---- */
.soul-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 5px var(--accent), 0 0 10px rgba(253,184,19,0.4);
    pointer-events: none;
    z-index: 0;
    width: var(--size);
    height: var(--size);
    animation: particle-drift var(--dur) ease-in-out infinite var(--delay);
}
@keyframes particle-drift {
    0%   { transform: translateY(0) scale(1);   opacity: 0; }
    20%  { opacity: 0.8; }
    60%  { transform: translateY(-30px) scale(1.1); opacity: 0.6; }
    100% { transform: translateY(-60px) scale(0.7); opacity: 0; }
}

/* ---- STATS STRIP ---- */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 5rem;
    padding: 2.5rem 0 3rem;
    border-top: 1px solid var(--border-dim);
    position: relative;
    z-index: 1;
}
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0 3.5rem; }
.stat-sep  { width: 1px; height: 40px; background: var(--border-dim); }

.stat-num {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
    line-height: 1;
    text-shadow: 0 0 20px var(--accent-glow);
}
.stat-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

/* ======== TECH MARQUEE ======== */
.marquee-strip {
    overflow: hidden;
    padding: 1rem 0;
    background: var(--bg-deep);
    border-top: 1px solid var(--border-dim);
    border-bottom: 1px solid var(--border-dim);
    position: relative;
}
.marquee-strip::before,
.marquee-strip::after {
    content: '';
    position: absolute;
    top: 0;
    width: 140px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
.marquee-strip::before { left: 0;  background: linear-gradient(90deg, var(--bg-deep), transparent); }
.marquee-strip::after  { right: 0; background: linear-gradient(270deg, var(--bg-deep), transparent); }

.marquee-track {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    white-space: nowrap;
    animation: marquee-scroll 30s linear infinite;
    width: max-content;
}
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.marquee-track span {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}
.marquee-track .mx { color: var(--accent); font-size: 0.45rem; opacity: 0.7; }

/* ======== PERSONA NAV (contextual quick links) ======== */
.persona-strip {
    background: var(--bg-2);
    border-top: 1px solid var(--border-dim);
    border-bottom: 1px solid var(--border-dim);
    padding: 1.4rem 6%;
}
.persona-strip-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.persona-prompt {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.persona-buttons { display: flex; gap: 0.6rem; }
.persona-btn {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    padding: 0.5rem 1.15rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s ease;
}
.persona-btn:hover { color: var(--text-dim); border-color: var(--border); }
.persona-btn.is-active { color: #1a1506; background: var(--accent-fill); border-color: var(--accent-fill); }
.persona-btn:active { transform: scale(0.96); }

.persona-links {
    max-width: 1100px;
    margin: 1rem auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.persona-link {
    font-family: var(--font-ui);
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--bg);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, transform 0.15s ease;
}
.persona-link:hover { color: var(--accent); border-color: var(--accent-dim); }
.persona-link:active { transform: scale(0.96); }

.persona-dismiss {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 0.45rem 0.4rem;
}
.persona-dismiss:hover { color: var(--text-dim); }

/* ======== SOBRE ======== */
.about-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
}

.about-story p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 1.3rem;
    font-weight: 300;
}
.about-story p:last-child { margin-bottom: 0; }

.about-side { display: flex; flex-direction: column; gap: 1.25rem; }

.about-card {
    background: var(--bg-2);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.5rem 1.6rem;
    position: relative;
    overflow: hidden;
}
.about-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
}
.about-card h3 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
}
.about-list { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.about-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.5;
    font-weight: 300;
}
.about-list li i { color: var(--accent); font-size: 1.05rem; line-height: 1.3; flex-shrink: 0; }

/* ======== EXPERIÊNCIA / TIMELINE ======== */
#experiencia { background: var(--bg-2); border-top: 1px solid var(--border-dim); border-bottom: 1px solid var(--border-dim); }

.timeline {
    list-style: none;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.timeline-item {
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 2.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: -0.5rem;
    width: 1px;
    background: linear-gradient(to bottom, var(--border), transparent);
}
.timeline-item:last-child::before { display: none; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
    position: absolute;
    left: 0;
    top: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg-2);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-dim);
}

.timeline-period {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 0.4rem;
}
.timeline-body h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}
.timeline-body p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.7;
    font-weight: 300;
    max-width: 560px;
}
.timeline-body strong { color: var(--text-dim); font-weight: 600; }

.project-flagship { scroll-margin-top: 88px; }

/* ======== PROJECT FILTER BAR ======== */
.filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}
.filter-btn {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    padding: 0.5rem 1.15rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s ease;
}
.filter-btn:hover { color: var(--text-dim); border-color: var(--border); }
.filter-btn.is-active { color: #1a1506; background: var(--accent-fill); border-color: var(--accent-fill); }
.filter-btn:active { transform: scale(0.96); }

/* Weight/case (not opacity) carries the de-emphasis, so contrast stays AA-compliant */
.filter-count { font-weight: 500; letter-spacing: normal; text-transform: none; }

.filter-empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem 0;
}

.projects-more { text-align: center; margin-top: 2.5rem; }

/* ======== PROJECT CASE STUDY (details/summary) ======== */
.case-study { margin-top: 0.3rem; }
.case-study summary {
    cursor: pointer;
    list-style: none;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.18s ease;
}
.case-study summary:hover { color: #ffc832; }
/* On light backgrounds, brightening the already-light hover gold fails contrast —
   deepen it instead, which reads as "more emphasis" in both directions */
:root[data-theme="light"] .case-study summary:hover { color: #6b4700; }
.case-study summary::-webkit-details-marker { display: none; }
.case-study summary::after {
    content: '\2304';
    font-size: 0.9rem;
    transition: transform 0.22s ease;
}
.case-study[open] summary::after { transform: rotate(180deg); }
.case-study dl {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.case-study dt {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.case-study dd {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 300;
}

/* ======== PROJETOS ======== */
#projetos { background: var(--bg-2); border-top: 1px solid var(--border-dim); border-bottom: 1px solid var(--border-dim); }

/* ---- FLAGSHIP CASE STUDY ---- */
.project-flagship {
    position: relative;
    z-index: 1;
    margin-bottom: 3.5rem;
    padding: 2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.flagship-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #1a1506;
    background: var(--accent-fill);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    margin-bottom: 1.5rem;
}

.flagship-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.card-image.flagship-image {
    height: 420px;
    border-radius: var(--radius);
}

.flagship-body h3 {
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: 0.6rem;
}

.flagship-lead {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
    font-weight: 300;
}

.flagship-body .project-tags { margin-bottom: 1.5rem; }

.flagship-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-dim);
}
.flagship-detail dt {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.3rem;
}
.flagship-detail dd {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
    font-weight: 300;
}

/* ---- SECONDARY PROJECTS DIVIDER ---- */
.projects-subheading {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 2rem;
}
.projects-subheading::after { content: ''; flex: 1; height: 1px; background: var(--border-dim); }

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem;
    position: relative;
    z-index: 1;
}

.project-card {
    background: var(--bg);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
}
/* Yellow soul bar slides in on hover */
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
    z-index: 5;
    box-shadow: var(--shadow-glow-sm);
}
.project-card:hover::before { transform: scaleX(1); }
.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--border);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
}

.card-image { position: relative; overflow: hidden; height: 195px; }

/* Carousel */
.carousel { position: relative; width: 100%; height: 100%; cursor: zoom-in; }
.carousel-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}
.carousel-img.is-active { opacity: 1; pointer-events: auto; }
.project-card:hover .carousel-img.is-active { transform: scale(1.07); }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Floats over arbitrary screenshot content, so it stays dark-glass in both themes */
    background: rgba(30, 32, 36, 0.75);
    color: var(--accent-fill);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.22s ease, background 0.22s ease, transform 0.15s ease;
    z-index: 4;
    backdrop-filter: blur(4px);
}
.card-image:hover .carousel-btn,
.card-image:focus-within .carousel-btn { opacity: 1; }
.carousel-btn:hover { background: var(--accent-fill); color: #1a1506; }
.carousel-btn:active { transform: translateY(-50%) scale(0.88); }
.carousel-btn.prev { left: 0.55rem; }
.carousel-btn.next { right: 0.55rem; }

/* Always visible (not hover-gated) — the only zoom affordance touch/keyboard users can discover */
.carousel-zoom {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 32, 36, 0.75);
    color: var(--accent-fill);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.22s ease, transform 0.15s ease;
    z-index: 4;
    backdrop-filter: blur(4px);
}
.carousel-zoom:hover { background: var(--accent-fill); color: #1a1506; }
.carousel-zoom:active { transform: scale(0.88); }

.carousel-dots {
    position: absolute;
    bottom: 0.55rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    z-index: 4;
}
/* Button is the full tap target (>=24px, WCAG 2.5.8); ::before stays the small visible dot */
.carousel-dot {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.carousel-dot::before {
    content: '';
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    /* Dark ring keeps the dot legible over light areas of whatever screenshot is behind it */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
    transition: background 0.22s ease, transform 0.22s ease;
}
.carousel-dot.is-active::before { background: var(--accent-fill); transform: scale(1.2); }
.carousel-dot:active::before { transform: scale(0.85); }

/* Roman numeral badge */
.card-num {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent-fill);
    background: rgba(30, 32, 36, 0.9);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.18rem 0.55rem;
    z-index: 3;
    backdrop-filter: blur(6px);
}

.card-body { padding: 1.2rem; display: flex; flex-direction: column; gap: 0.55rem; }

.card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.04em;
}

/* Derived from each card's own repo/deploy link state — never hand-authored per project */
.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: middle;
}
.project-status::before { content: ''; width: 0.4rem; height: 0.4rem; border-radius: 50%; flex-shrink: 0; }
.project-status--live { color: var(--success); background: rgba(110, 231, 160, 0.12); border: 1px solid rgba(110, 231, 160, 0.3); }
.project-status--live::before { background: var(--success); }
/* --bg-2, not --bg-3: --text-muted only clears AA (4.5:1) against the two surfaces
   it was verified on — --bg-3 alone dips to ~3.94:1 in dark mode */
.project-status--dev { color: var(--text-muted); background: var(--bg-2); border: 1px solid var(--border-dim); }
.project-status--dev::before { background: var(--text-dim); }

.card-body p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.65;
    font-weight: 300;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card.is-hidden { display: none; }

.project-tags { display: flex; flex-wrap: wrap; gap: 0.38rem; margin-top: 0.2rem; }
.project-tags span {
    background: var(--bg-2);
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    font-family: var(--font-ui);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    border: 1px solid var(--border-dim);
    transition: border-color 0.22s, color 0.22s;
}
.project-card:hover .project-tags span { border-color: var(--border); color: var(--text-dim); }

.card-links {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0 1.2rem 1.2rem;
    border-top: 1px solid var(--border-dim);
    margin-top: -0.1rem;
    padding-top: 1rem;
}

.card-links a,
.card-links .project-link-disabled {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    transition: all 0.22s;
}
/* Deploy (production link) reads as the primary action — filled */
.card-links a:has(.bx-link-external) { background: var(--accent-fill); color: #1a1506; }
.card-links a:has(.bx-link-external):hover { background: #ffc832; transform: translateY(-2px); box-shadow: var(--shadow-glow-sm); }

/* Repository / documentation links read as secondary — outline */
.card-links a:has(.bxl-github),
.card-links a:has(.bx-book-open) { background: transparent; color: var(--text-dim); border: 1px solid var(--border-dim); }
.card-links a:has(.bxl-github):hover,
.card-links a:has(.bx-book-open):hover { border-color: var(--border); color: var(--accent); background: var(--accent-dim); transform: translateY(-2px); }

.card-links a:active { transform: translateY(0); }

.card-links .project-link-disabled { background: var(--bg-2); color: var(--text-muted); cursor: not-allowed; border: 1px solid var(--border-dim); }

/* ======== LIGHTBOX ======== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 12, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease;
    z-index: 999;
    backdrop-filter: blur(6px);
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox-figure { position: relative; max-width: min(90vw, 1000px); max-height: 85vh; }
.lightbox-img {
    display: block;
    max-width: min(90vw, 1000px);
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

.lightbox-close {
    position: absolute;
    top: -2.6rem;
    right: 0;
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 32, 36, 0.9);
    color: var(--accent-fill);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.22s ease, transform 0.15s ease;
}
.lightbox-close:hover { background: var(--accent-fill); color: #1a1506; }
.lightbox-close:active { transform: scale(0.88); }

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 32, 36, 0.85);
    color: var(--accent-fill);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background 0.22s ease, transform 0.15s ease;
}
.lightbox-btn:hover { background: var(--accent-fill); color: #1a1506; }
.lightbox-btn:active { transform: translateY(-50%) scale(0.88); }
.lightbox-btn.prev { left: -3.4rem; }
.lightbox-btn.next { right: -3.4rem; }

@media (max-width: 760px) {
    .lightbox-btn.prev { left: 0.4rem; }
    .lightbox-btn.next { right: 0.4rem; }
    .lightbox-close { top: 0.4rem; right: 0.4rem; }
}

/* ======== COMMAND PALETTE ======== */
.command-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 12, 0.75);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4rem 1rem 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease;
    z-index: 999;
    backdrop-filter: blur(4px);
}
.command-overlay.is-open { opacity: 1; visibility: visible; }

.command-palette {
    width: 100%;
    max-width: 560px;
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: translateY(-8px);
    transition: transform 0.22s ease;
}
.command-overlay.is-open .command-palette { transform: translateY(0); }

.command-input-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-dim);
    flex-shrink: 0;
}
.command-input-row i { font-size: 1.1rem; color: var(--text-muted); flex-shrink: 0; }
.command-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.95rem;
}
.command-input::placeholder { color: var(--text-muted); }

.command-results { overflow-y: auto; padding: 0.5rem; }
.command-group-label {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.6rem 0.6rem 0.3rem;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.6rem 0.65rem;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-ui);
    text-align: left;
    cursor: pointer;
}
.command-item i { font-size: 1.05rem; color: var(--accent); flex-shrink: 0; width: 1.2rem; text-align: center; }
.command-item-text { display: flex; flex: 1; flex-direction: column; gap: 0.1rem; min-width: 0; }
.command-item-label { display: block; font-size: 0.88rem; font-weight: 500; line-height: 1.3; }
.command-item-desc {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.command-item.is-selected { background: var(--accent-dim); }
.command-item.is-selected .command-item-label { color: var(--accent); }

.command-empty {
    padding: 1.5rem 0.65rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.command-hint {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-top: 1px solid var(--border-dim);
    font-family: var(--font-ui);
    font-size: 0.68rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.command-hint kbd {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    padding: 0.05rem 0.32rem;
    background: var(--bg-3);
}

@media (max-width: 480px) {
    .command-overlay { padding: 1.5rem 0.75rem; align-items: flex-start; }
    .command-palette { max-height: min(80vh, 560px); }
    .command-hint { display: none; }
}

/* ======== SKILLS / CHARMS ======== */
#skills { background: var(--bg); }

.skills-group { position: relative; z-index: 1; margin-bottom: 2.5rem; }
.skills-group:last-child { margin-bottom: 0; }

.skills-group-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}
.skills-group-heading::after { content: ''; flex: 1; height: 1px; background: var(--border-dim); }

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 220px));
    gap: 1rem;
}

.skill-card {
    background: var(--bg-2);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease,
                box-shadow 0.35s ease;
}

/* soul bar slides in */
.skill-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
    box-shadow: var(--shadow-glow-sm);
}
.skill-card:hover { transform: translateY(-7px); border-color: var(--border); box-shadow: var(--shadow-md), 0 0 0 1px var(--border); }
.skill-card:hover::before { transform: scaleX(1); }

/* "Charm" icon ring */
.skill-charm {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: var(--accent);
    transition: filter 0.3s ease, transform 0.3s ease, background 0.3s ease;
    margin-bottom: 0.2rem;
}
.skill-card:hover .skill-charm {
    filter: drop-shadow(0 0 14px rgba(253,184,19,0.55));
    transform: scale(1.1);
    background: rgba(253,184,19,0.14);
}

.skill-name {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text);
    line-height: 1.3;
}
.skill-desc { font-size: 0.7rem; color: var(--text-muted); font-weight: 300; font-style: italic; line-height: 1.4; }

/* ======== CONTATO ======== */
#contato { background: var(--bg-2); border-top: 1px solid var(--border-dim); }

.contato-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 2rem;
    max-width: 980px;
    margin: 2rem auto 0;
    align-items: start;
    position: relative;
    z-index: 1;
}

.contato-info { display: flex; flex-direction: column; gap: 0.9rem; }
.contato-info-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    transition: border-color 0.22s, transform 0.22s, background 0.22s;
}
.contato-info-card:hover { border-color: var(--border); transform: translateY(-2px); background: var(--accent-dim); box-shadow: var(--shadow-sm); }
.contato-info-card:active { transform: translateY(0); }
.contato-info-card i { font-size: 1.5rem; color: var(--accent); flex-shrink: 0; }
.cic-label {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.cic-value { display: block; font-size: 0.9rem; color: var(--text); word-break: break-word; }

.contact-form {
    max-width: 560px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2.5rem;
    background: var(--bg);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    position: relative;
    z-index: 1;
}

/* Honeypot field — hidden from sighted users and screen readers, trap for bots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-field { display: flex; flex-direction: column; }
/* Soul bar accent on top of form */
.contact-form::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.9rem 1.1rem;
    font-family: var(--font-ui);
    font-size: 0.93rem;
    font-weight: 400;
    background: var(--bg-2);
    color: var(--text);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    resize: vertical;
    transition: border-color 0.22s, box-shadow 0.22s;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-muted); }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.contact-form input:invalid:not(:placeholder-shown),
.contact-form textarea:invalid:not(:placeholder-shown) { border-color: #e07a5f; }

.contact-form .btn-primary { align-self: flex-start; }
.contact-form .btn-primary[disabled] { opacity: 0.6; cursor: wait; transform: none; }

.form-status {
    font-size: 0.85rem;
    font-family: var(--font-body);
    font-style: italic;
    min-height: 1.2em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.form-status.is-success { color: var(--success); opacity: 1; transform: translateY(0); }
.form-status.is-error   { color: var(--error); opacity: 1; transform: translateY(0); }

/* ======== PROJECT DOCUMENTATION (documentacao.html) ======== */
.doc-breadcrumb { max-width: 800px; margin: 0 auto; padding: 6.5rem 6% 0; }
.doc-back {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: color 0.2s;
}
.doc-back i { transition: transform 0.2s; }
.doc-back:hover { color: var(--accent); }
.doc-back:hover i { transform: translateX(-3px); }

.doc-project { max-width: 800px; margin: 0 auto; padding: 2.5rem 6% 6rem; }

/* --- Hero: name + lead carry the weight; status is a secondary signal next to the eyebrow --- */
.doc-hero { margin-bottom: 2.25rem; }
.doc-hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 1.1rem; }

.doc-hero h1 { font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.15; margin: 0 0 1.1rem; }

.doc-lead {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 300;
    max-width: 620px;
    margin-bottom: 1.75rem;
}

.doc-stack { display: flex; align-items: center; flex-wrap: wrap; gap: 0.9rem; }
.doc-stack-label {
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.doc-tags { margin-top: 0; }

.doc-divider { margin: 2.5rem auto; }

.doc-section { margin-bottom: 3rem; }

/* --- Gallery --- */
.doc-gallery-section h2 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.1rem;
}
.doc-gallery { position: relative; }
.card-image.doc-image { height: 320px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* --- Desafio / Solução / Impacto read as one connected sequence, not three loose blocks --- */
.doc-outcomes { display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 3rem; }
.doc-outcome {
    display: flex;
    gap: 1.1rem;
    background: var(--bg-2);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem;
}
.doc-outcome-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--accent-dim);
    color: var(--accent);
}
/* Impacto reuses the same success token as the "live" status badge — a positive-outcome cue, not a new color */
.doc-outcome--result .doc-outcome-icon { background: rgba(110, 231, 160, 0.12); color: var(--success); }

.doc-outcome-body h2 {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 0.45rem;
}
.doc-outcome-body p { color: var(--text-dim); font-size: 0.98rem; line-height: 1.8; font-weight: 300; }

/* --- Closing CTAs --- */
.doc-cta-panel {
    background: var(--bg-2);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}
.doc-cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.doc-notfound {
    max-width: 480px;
    margin: 0 auto;
    padding: 8rem 6% 6rem;
    text-align: center;
}
.doc-notfound .bx-error-circle { font-size: 3rem; color: var(--accent); margin-bottom: 1rem; }
.doc-notfound h1 { font-size: 1.6rem; margin-bottom: 0.8rem; }
.doc-notfound p { color: var(--text-muted); margin-bottom: 2rem; }

@media (min-width: 640px) {
    .card-image.doc-image { height: 440px; }
}

@media (max-width: 560px) {
    .doc-outcome { flex-direction: column; gap: 0.7rem; padding: 1.2rem 1.3rem; }
    .doc-outcome-icon { width: 34px; height: 34px; font-size: 1rem; }
}

@media (max-width: 480px) {
    .doc-breadcrumb { padding-top: 6rem; }
    .doc-cta-panel { padding: 1.25rem; }
}

/* ======== FOOTER ======== */
.footer { background: var(--bg-deep); border-top: 1px solid var(--border-dim); padding: 2rem 6%; }
.footer-content { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-logo { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--text); }
.footer p { font-size: 0.82rem; color: var(--text-muted); font-weight: 300; font-style: italic; }
.footer-links { display: flex; gap: 0.7rem; }
.footer-links a { font-size: 1.35rem; color: var(--text-muted); transition: color 0.22s; }
.footer-links a:hover { color: var(--accent); }

/* ======== BACK TO TOP ======== */
.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1.3rem;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background 0.22s, border-color 0.22s;
    z-index: 90;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--accent-fill); color: #1a1506; border-color: var(--accent-fill); }
.back-to-top.is-visible:active { transform: translateY(0) scale(0.9); }

/* ======== RESPONSIVE ======== */
@media (max-width: 992px) {
    .hero-text h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); }
    .portrait-wrap { width: 290px; height: 360px; }
    .hero-seal { width: 420px; height: 420px; }
    .stat-item { padding: 0 2rem; }

    .about-grid  { grid-template-columns: 1fr; gap: 2.5rem; }
    .contato-grid { grid-template-columns: 1fr; max-width: 560px; }
    .contato-info { flex-direction: row; flex-wrap: wrap; }
    .contato-info-card { flex: 1 1 220px; }

    .flagship-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .card-image.flagship-image { height: 320px; }
}

@media (max-width: 768px) {
    .navbar    { display: none; }
    #menu-icon { display: block; }

    .hero-content { flex-direction: column-reverse; text-align: center; gap: 2rem; }
    .hero-text    { max-width: 100%; }
    .hero-text h1 { font-size: clamp(2.4rem, 9vw, 4rem); }
    .typing-wrap, .hero-actions, .social-links, .hero-stack-list { justify-content: center; }
    .hero-bio   { margin-left: auto; margin-right: auto; }
    .hero-stack { flex-direction: column; gap: 0.5rem; }

    .hero-photo-area { max-width: 280px; margin: 0 auto; }
    .portrait-wrap   { width: 240px; height: 300px; }
    .hero-seal       { width: 300px; height: 300px; }
    .hero-sig-img    { width: 200px; height: 200px; opacity: 0.14; }

    .hero-stats { margin-top: 3rem; }
    .stat-item  { padding: 0 1.5rem; }
    .stat-num   { font-size: 1.9rem; }

    h2 { font-size: 1.9rem; }
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content { flex-direction: column; text-align: center; align-items: center; }

    .availability-badge { margin-left: auto; margin-right: auto; }
    .contato-info { flex-direction: column; }
    .timeline-item { padding-left: 2rem; }
    .back-to-top { right: 1rem; bottom: 1rem; width: 40px; height: 40px; }

    .project-flagship { padding: 1.5rem; }
    .card-image.flagship-image { height: 260px; }
    .flagship-body h3 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .section     { padding: 4.5rem 5%; }
    .hero-text h1 { font-size: clamp(2rem, 11vw, 3rem); }
    h2           { font-size: 1.7rem; }

    .portrait-wrap   { width: 200px; height: 250px; }
    .hero-seal       { width: 240px; height: 240px; }
    .hero-signature  { display: none; }
    .sc-left, .sc-right { display: none; }

    .hero-stats  { gap: 0.8rem; }
    .stat-item   { padding: 0 0.9rem; }
    .stat-sep    { display: none; }
    .stat-num    { font-size: 1.6rem; }

    .project-grid { grid-template-columns: 1fr; }
    .skills-grid  { grid-template-columns: repeat(2, 1fr); }
    .section-bg-num { font-size: 5rem; }

    .contact-form { padding: 1.5rem; }
    .about-card   { padding: 1.25rem; }
    .filter-btn   { font-size: 0.66rem; padding: 0.45rem 0.9rem; }
    .contato-info-card { padding: 0.9rem 1rem; }

    .project-flagship { padding: 1.25rem; }
    .card-image.flagship-image { height: 210px; }
    .projects-subheading { font-size: 0.78rem; margin-bottom: 1.5rem; }
}

/* ======== AGRADECIMENTO ======== */
#agradecimento {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
.agradecimento-content { display: flex; flex-direction: column; align-items: center; text-align: center; }
.agradecimento-content .bx-check-circle {
    font-size: 5rem;
    color: var(--accent);
    filter: drop-shadow(0 0 20px var(--accent-glow));
    margin-bottom: 1.5rem;
}
.agradecimento-content h2 { font-size: 2.2rem; margin-bottom: 1rem; }
.agradecimento-content p {
    font-size: 1rem;
    max-width: 400px;
    margin-bottom: 2.5rem;
    color: var(--text-muted);
    font-style: italic;
}
