/* Language controls share the navbar link rules below. */
@media (min-width: 1101px) {
    .front-navbar > .front-navbar__panel > .menu {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

.front-navbar__controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex: 0 0 auto;
    gap: 0.875rem;
    max-width: 100%;
}
.front-navbar__controls > .language-selector { align-self: center; }
@media (max-width: 1100px) {
    .front-navbar__controls { align-self: flex-end; }
}

.language-selector {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    color: var(--front-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
}
.language-selector__button {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}
body[data-page] .language-selector__button[aria-pressed="true"] {
    color: var(--front-primary);
    font-weight: 600;
}
body[data-page] .language-selector__button[aria-pressed="true"]::after {
    opacity: 1;
    transform: scaleX(1);
}
body[data-page="intro"] > .language-selector {
    position: absolute;
    z-index: 10;
    top: max(1.35rem, env(safe-area-inset-top));
    right: clamp(1.25rem, 3vw, 2.75rem);
}

:root {
    --font-logo: "Playfair Display", serif;
    --font-title: "Noto Serif", serif;
    --font-body: "Manrope", sans-serif;
    --font-code: "JetBrains Mono", monospace;

    --bg-primary: #f6faff;
    --bg-secondary: #eaf3ff;
    --blue-light: #bfd9ff;
    --blue-main: #4a90e2;
    --blue-dark: #163a5f;
    --blue-deep: #0b1f33;
    --text-primary: #18324a;
    --text-secondary: #6f8294;

    --front-background: var(--bg-primary);
    --front-surface: rgba(255, 255, 255, 0.78);
    --front-surface-soft: rgba(234, 243, 255, 0.9);

    --front-primary: var(--blue-main);
    --front-primary-hover: #3578c8;
    --front-primary-light: #d9eaff;
    --front-primary-soft: rgba(234, 243, 255, 0.94);
    --front-primary-glow: rgba(74, 144, 226, 0.24);

    --front-text: var(--text-primary);
    --front-text-secondary: var(--text-secondary);
    --front-border: rgba(74, 144, 226, 0.18);

    --front-shadow: 0 28px 55px rgba(74, 144, 226, 0.14);
    --front-shadow-soft: 0 18px 36px rgba(22, 58, 95, 0.1);

    --back-background: #081524;
    --back-surface: rgba(15, 32, 52, 0.9);
    --back-surface-soft: rgba(20, 43, 69, 0.96);
    --back-primary: #86bbff;
    --back-primary-hover: #b5d6ff;
    --back-primary-light: #dbeaff;
    --back-primary-soft: rgba(36, 72, 112, 0.46);
    --back-text: #f2f7ff;
    --back-text-secondary: #9eb1c5;
    --back-border: rgba(155, 196, 245, 0.2);
    --back-shadow: 0 24px 60px rgba(0, 8, 18, 0.48);

    --background: var(--front-background);
    --surface: var(--front-surface);
    --surface-soft: var(--front-surface-soft);
    --primary: var(--front-primary);
    --primary-hover: var(--front-primary-hover);
    --primary-light: var(--front-primary-light);
    --primary-soft: var(--front-primary-soft);
    --primary-glow: var(--front-primary-glow);
    --text: var(--front-text);
    --text-secondary: var(--front-text-secondary);
    --border: var(--front-border);
    --shadow: var(--front-shadow);
    --shadow-soft: var(--front-shadow-soft);

    --radius-sm: 0.75rem;
    --radius-md: 1.35rem;
    --radius-lg: 2rem;
    --radius-xl: 3rem;
    --radius-round: 999px;

    --transition-fast: 0.2s ease;
    --transition: 0.35s ease;
    --transition-slow: 0.6s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    font-family: var(--font-body);
    color: var(--text);
    background: #f2f7ff;
    transition:
        background var(--transition-slow),
        color var(--transition);
}

body[data-page="front"] {
    background:
        radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.96) 0, rgba(255, 255, 255, 0.82) 24%, transparent 44%),
        radial-gradient(circle at 80% 80%, rgba(191, 217, 255, 0.24) 0, transparent 32%),
        linear-gradient(160deg, #ffffff 0%, #f4f9ff 44%, #e8f2ff 100%);
}

body[data-page="back"] {
    color: var(--back-text);
    background:
        radial-gradient(circle at 78% 20%, rgba(134, 187, 255, 0.16) 0, transparent 30%),
        radial-gradient(circle at 20% 88%, rgba(74, 144, 226, 0.12) 0, transparent 28%),
        linear-gradient(150deg, #081524 0%, #0d2137 52%, #112c47 100%);
}

img {
    display: block;
    max-width: 100%;
}

/* =========================
   FRONT-END — NAVBAR
   ========================= */
body[data-page="front"] .front-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: min(100% - clamp(2.5rem, 6vw, 5.5rem), 90rem);
    min-height: 6.25rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1.5rem, 3vw, 4rem);
    padding: 1.35rem 0;
}

/* Keep the existing navbar in flow, preserving the Hero's original position. */
body[data-page="front"] .front-navbar::before {
    content: "";
    position: absolute;
    inset: 0 calc((100% - 100vw) / 2);
    z-index: -1;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 rgba(74, 144, 226, 0.12);
    opacity: 0;
    transition: opacity 300ms ease;
}
body[data-page="front"] .front-navbar.is-scrolled::before { opacity: 1; }
body[data-page="front"] {
    --navbar-offset: calc(var(--navbar-height, 6.25rem) + 1rem);
}
body[data-page="front"] :is(#inicio, #tecnologias, #sobre, #projetos, #contato) {
    scroll-margin-top: var(--navbar-offset);
}
@media (prefers-reduced-motion: reduce) {
    body[data-page="front"] .front-navbar::before { transition: none; }
}

body[data-page="front"] .logonav {
    flex: 0 0 auto;
}

body[data-page="front"] .menulogo {
    width: auto;
    height: 3rem;
    max-height: 3rem;
    object-fit: contain;
}

body[data-page="front"] .menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.9rem, 1.5vw, 1.75rem);
    min-width: 0;
}

body[data-page] .language-selector__button,
body[data-page="front"] .menu a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    color: var(--front-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition-fast);
}

body[data-page] .language-selector__button::after,
body[data-page="front"] .menu a::after {
    position: absolute;
    right: 0;
    bottom: -0.35rem;
    left: 0;
    height: 2px;
    border-radius: var(--radius-round);
    background: var(--front-primary);
    content: "";
    opacity: 0;
    transform: scaleX(0.45);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

body[data-page="front"] .menu a:first-child,
body[data-page="front"] .menu a.is-active {
    color: var(--front-primary);
    font-weight: 600;
}

body[data-page="front"] .menu a:first-child::after,
body[data-page="front"] .menu a.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

body[data-page="front"] .menu a:hover,
body[data-page="front"] .menu a:focus-visible,
body[data-page] .language-selector__button:is(:hover, :focus-visible) {
    color: var(--front-primary);
}

.front-navbar__perspective {
    justify-self: center;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 2.4rem;
    padding: 0.625rem 0.9rem;
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--front-text);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.front-navbar__moon,
.front-navbar__sun {
    width: 1.0625rem;
    height: 1.0625rem;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}

.front-navbar__sun {
    color: var(--front-primary);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.front-navbar__moon {
    filter: brightness(0) saturate(100%) invert(55%) sepia(56%) saturate(676%) hue-rotate(173deg) brightness(93%) contrast(89%);
}

@media (hover: hover) and (pointer: fine) {
.front-navbar__perspective:hover {
    border-color: rgba(74, 144, 226, 0.38);
    background: #fafdff;
}
}

.front-navbar__perspective:focus-visible {
    outline: 3px solid rgba(74, 144, 226, 0.28);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    body[data-page="front"] .front-navbar {
        flex-wrap: wrap;
        gap: 1rem 1.5rem;
    }

    body[data-page="front"] .menu {
        order: 3;
        flex: 1 0 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    background: none;
}

body[data-page="intro"] {
    background: #eaf3ff;
}

body[data-page="intro"] .intro {
    background: #eaf3ff;
}

.intro__photo {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: -1;
    width: min(65vw, 66.6667svh);
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: contain;
    object-position: left center;
    transform: translateY(-50%);
    opacity: 0.38;
    pointer-events: none;
    user-select: none;
    -webkit-mask-image:
        linear-gradient(to right, #000 0%, #000 22%, rgba(0, 0, 0, 0.8) 45%, rgba(0, 0, 0, 0.3) 75%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, #000 8%, #000 90%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to right, #000 0%, #000 22%, rgba(0, 0, 0, 0.8) 45%, rgba(0, 0, 0, 0.3) 75%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, #000 8%, #000 90%, transparent 100%);
    mask-composite: intersect;
}

@media (max-width: 767px) {
    .intro__photo {
        opacity: 0.26;
    }
}

.intro {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    overflow: hidden;
    isolation: isolate;
}

.intro::before,
.intro::after {
    display: none;
}

.intro::before {
    content: none;
}

.intro::after {
    content: none;
}

.intro__content {
    position: relative;
    width: min(100%, 50rem);
    min-height: min(100%, 44rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(2rem, 3vw, 3.2rem);
    text-align: center;
}

.intro__content::before,
.intro__content::after {
    display: none;
}

.intro__content::before {
    content: none;
}

.intro__content::after {
    content: none;
}

.intro__logo {
    width: clamp(16rem, 25vw, 20.5rem);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 16px 30px rgba(74, 144, 226, 0.12));
    user-select: none;
    pointer-events: none;
}

.theme-selector {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(3rem, 7vw, 5rem);
    width: min(100%, 32rem);
    margin-top: clamp(0.2rem, 1vw, 0.6rem);
}

.theme-selector::before {
    display: none;
}

.theme-selector::after {
    display: none;
}

.theme-selector__option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.95rem;
    min-width: clamp(6.5rem, 12vw, 7.5rem);
}

.theme-selector__button {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: clamp(5rem, 9vw, 5.85rem);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 50%;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(234, 243, 255, 0.78));
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.28) inset,
        var(--shadow-soft);
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast);
}

.theme-selector__button svg {
    width: 2.2rem;
    height: 2.2rem;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.theme-selector__button--front {
    color: var(--primary);
    background:
        linear-gradient(145deg, rgba(222, 238, 255, 0.96), rgba(191, 217, 255, 0.82));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 18px 32px rgba(74, 144, 226, 0.18);
}

.theme-selector__button--front svg {
    stroke: currentColor;
}

.theme-selector__button--back {
    color: #244260;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 246, 255, 0.9));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.72) inset,
        0 14px 28px rgba(22, 58, 95, 0.08);
}

.theme-selector__button--back svg {
    stroke: currentColor;
}

@media (hover: hover) and (pointer: fine) {
.theme-selector__button--front:hover {
    background:
        linear-gradient(145deg, rgba(228, 241, 255, 1), rgba(195, 220, 255, 0.92));
}
}

@media (hover: hover) and (pointer: fine) {
.theme-selector__button--back:hover {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(231, 241, 255, 0.94));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.84) inset,
        0 16px 28px rgba(22, 58, 95, 0.1);
}
}

.theme-selector__button:focus-visible {
    outline: 3px solid rgba(74, 144, 226, 0.34);
    outline-offset: 4px;
}

.theme-selector__button.is-active {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.28) inset,
        0 22px 36px rgba(74, 144, 226, 0.18);
}

.theme-selector__label {
    font-family: var(--font-code);
    font-size: clamp(0.72rem, 1vw, 0.84rem);
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.theme-selector__option--front .theme-selector__label {
    color: rgba(22, 58, 95, 0.9);
}

.theme-selector__option--back .theme-selector__label {
    color: rgba(11, 31, 51, 0.84);
}

.intro__text {
    display: grid;
    gap: 0.45rem;
    margin-top: clamp(0.35rem, 1vw, 0.8rem);
}

.intro__text p {
    font-family: var(--font-body);
    font-size: clamp(1.08rem, 1.7vw, 1.32rem);
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0.04em;
    color: #52687c;
}

.intro__text strong {
    color: var(--primary);
    font-weight: 600;
}

.intro__decoration {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.95rem;
    margin-top: clamp(0.9rem, 1.6vw, 1.4rem);
    color: rgba(74, 144, 226, 0.82);
}

.intro__decoration::before,
.intro__decoration::after {
    content: "";
    width: clamp(3.5rem, 6vw, 4.8rem);
    height: 1px;
    background: currentColor;
    opacity: 0.3;
}

.intro__decoration span {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 14px rgba(74, 144, 226, 0.2);
}

.page-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.page-shell__content {
    width: min(100%, 42rem);
    display: grid;
    gap: 0.85rem;
    text-align: center;
}

.page-shell__eyebrow {
    font-family: var(--font-code);
    font-size: 0.85rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(24, 50, 74, 0.62);
}

.page-shell__title {
    font-family: var(--font-logo);
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    color: inherit;
}

.page-shell__description {
    max-width: 32rem;
    margin: 0 auto;
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: rgba(24, 50, 74, 0.76);
}

.page-shell--front .page-shell__title {
    color: #2c6eb5;
}

.page-shell--back .page-shell__eyebrow {
    color: rgba(219, 234, 255, 0.72);
}

.page-shell--back .page-shell__title {
    color: #d4e7ff;
}

.page-shell--back .page-shell__description {
    color: rgba(219, 234, 255, 0.8);
}
/* =========================
   FRONT-END — HERO
   ========================= */
body[data-page="front"] {
    overflow-x: hidden;
    overflow-y: auto;
}

body[data-page="front"] .hero {
    position: relative;
    isolation: isolate;
    width: min(100% - clamp(2.5rem, 6vw, 5.5rem), 90rem);
    aspect-ratio: 7116 / 4424;
    min-height: 0;
    margin: 0 auto;
    display: flex;
    align-items: center;
    border-radius: clamp(1.5rem, 3vw, 2.5rem);
    background-image: url("../img/Front/background.webp");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    background-color: #eef5ff;
}

body[data-page="front"] .hero__content {
    position: relative;
    z-index: 2;
    width: min(42%, 33rem);
    margin-left: clamp(2rem, 5vw, 5rem);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

body[data-page="front"] .hero__portrait {
    position: absolute;
    z-index: 1;
    right: 20%;
    bottom: 0;
    width: 30%;
    height: 92%;
    object-fit: contain;
    object-position: center bottom;
    pointer-events: none;
}

body[data-page="front"] .hero__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-round);
    background: rgba(234, 243, 255, 0.92);
    color: var(--front-primary);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

body[data-page="front"] .hero h1 {
    max-width: 10ch;
    margin-top: clamp(1rem, 2vw, 1.6rem);
    color: var(--front-text);
    font-family: var(--font-body);
    font-size: clamp(2.45rem, 4.25vw, 4.25rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.055em;
}

body[data-page="front"] .hero h1 span {
    color: var(--front-primary);
}

body[data-page="front"] .hero__description {
    max-width: 31rem;
    margin-top: clamp(1.25rem, 2.5vw, 2rem);
    padding-left: 0.85rem;
    border-left: 2px solid var(--front-primary);
    color: rgba(24, 50, 74, 0.8);
    font-size: clamp(0.84rem, 1vw, 0.98rem);
    font-weight: 500;
    line-height: 1.65;
}

body[data-page="front"] .hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

body[data-page="front"] .btn-heroprojetos,
body[data-page="front"] .btn-herosobremim {
    min-height: 2.7rem;
    padding: 0.7rem 1.05rem;
    border-radius: 0.7rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}

body[data-page="front"] .btn-heroprojetos {
    background: var(--front-primary);
    color: #ffffff;
    box-shadow: 0 0.6rem 1.25rem rgba(74, 144, 226, 0.25);
}

@media (hover: hover) and (pointer: fine) {
body[data-page="front"] .btn-heroprojetos:hover {
    background: var(--front-primary-hover);
    box-shadow: 0 0.75rem 1.45rem rgba(74, 144, 226, 0.3);
}
}

body[data-page="front"] .btn-herosobremim {
    border: 1px solid rgba(74, 144, 226, 0.22);
    background: rgba(255, 255, 255, 0.88);
    color: var(--front-text);
}

@media (hover: hover) and (pointer: fine) {
body[data-page="front"] .btn-herosobremim:hover {
    border-color: rgba(74, 144, 226, 0.42);
    background: #ffffff;
}
}

body[data-page="front"] .btn-heroprojetos:focus-visible,
body[data-page="front"] .btn-herosobremim:focus-visible {
    outline: 3px solid rgba(74, 144, 226, 0.32);
    outline-offset: 3px;
}

@media (min-width: 1024px) {
    body[data-page="front"] .hero {
        width: 100%;
        height: calc(100svh - 6.25rem);
        height: calc(100dvh - 6.25rem);
        margin: 0;
        aspect-ratio: auto;
        border-radius: 0;
        background-position: 70% top;
        background-size: cover;
    }
}

@media (min-width: 1024px) and (max-height: 800px) {
    body[data-page="front"] .hero__eyebrow {
        min-height: 1.45rem;
        padding: 0.25rem 0.55rem;
    }

    body[data-page="front"] .hero h1 {
        margin-top: 0.75rem;
        font-size: clamp(2.25rem, 3.5vw, 3rem);
    }

    body[data-page="front"] .hero__description {
        margin-top: 0.85rem;
        font-size: 0.78rem;
        line-height: 1.5;
    }

    body[data-page="front"] .hero__actions {
        margin-top: 1rem;
    }

    body[data-page="front"] .btn-heroprojetos,
    body[data-page="front"] .btn-herosobremim {
        min-height: 2.45rem;
        padding: 0.6rem 0.9rem;
        font-size: 0.76rem;
    }
}

@media (max-width: 1023px) {
    body[data-page="front"] .hero__portrait {
        width: 24%;
        height: 70%;
        bottom: 20%;
    }

    body[data-page="front"] .hero {
        aspect-ratio: 7116 / 4424;
        min-height: 0;
        background-position: center;
    }

    body[data-page="front"] .hero__content {
        width: min(51%, 29rem);
        margin-left: clamp(1.75rem, 4vw, 2.75rem);
    }

    body[data-page="front"] .hero h1 {
        font-size: clamp(2.3rem, 5vw, 3.35rem);
    }
}

@media (max-width: 767px) {
    body[data-page="front"] .hero {
        padding-bottom: 18rem;
        width: min(100% - 2rem, 40rem);
        aspect-ratio: auto;
        min-height: 41rem;
        background-image:
            linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 53%, rgba(255, 255, 255, 0.22) 100%),
            url("../img/Front/background.webp");
        background-position: center, center bottom;
        background-size: 100% 100%, contain;
    }

    body[data-page="front"] .hero__content {
        width: min(100%, 30rem);
        min-height: 0;
        margin-left: 0;
        justify-content: center;
        padding: 3rem 1.5rem;
    }

    body[data-page="front"] .hero__portrait {
        width: min(60%, 12rem);
        height: 18rem;
        bottom: 0;
    }

    body[data-page="front"] .hero h1 {
        max-width: 9.5ch;
        font-size: clamp(2.3rem, 9.5vw, 3.25rem);
    }

    body[data-page="front"] .hero__description {
        max-width: 23rem;
    }
}

@media (max-width: 420px) {
    body[data-page="front"] .hero {
        min-height: 38rem;
    }

    body[data-page="front"] .hero__content {
        padding: 2.5rem 1.25rem;
    }

    body[data-page="front"] .hero h1 {
        font-size: clamp(2.1rem, 10.4vw, 2.65rem);
    }

    body[data-page="front"] .hero__actions {
        gap: 0.65rem;
    }

    body[data-page="front"] .btn-heroprojetos,
    body[data-page="front"] .btn-herosobremim {
        flex: 1 1 10rem;
    }
}

/* Shared interaction language. Individual transforms do not fight GSAP reveals. */
body[data-page] button:is(.theme-selector__button, .front-navbar__perspective, .btn-heroprojetos, .btn-herosobremim) {
    position: relative;
    overflow: hidden;
    transition: translate 250ms cubic-bezier(.215,.61,.355,1),
        scale 250ms cubic-bezier(.215,.61,.355,1),
        box-shadow 250ms ease, background 250ms ease, border-color 250ms ease, color 250ms ease;
}
body[data-page] button:is(.theme-selector__button, .front-navbar__perspective, .btn-heroprojetos, .btn-herosobremim)::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 35%;
    pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.18), transparent);
    transform: translateX(-150%) skewX(-15deg);
    opacity: 0;
}
body[data-page] button:is(.theme-selector__button, .front-navbar__perspective) :is(svg, img) {
    transition: translate 250ms cubic-bezier(.215,.61,.355,1);
}
.reveal-card {
    transition: translate 250ms cubic-bezier(.215,.61,.355,1), scale 250ms cubic-bezier(.215,.61,.355,1), box-shadow 250ms ease;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    body[data-page] button:is(.theme-selector__button, .front-navbar__perspective, .btn-heroprojetos, .btn-herosobremim):hover {
        translate: 0 -3px;
        scale: 1.02;
        box-shadow: 0 12px 28px rgba(22,58,95,.18);
    }
    body[data-page] button:is(.theme-selector__button, .front-navbar__perspective, .btn-heroprojetos, .btn-herosobremim):hover::after {
        animation: button-shine 450ms ease-out;
    }
    body[data-page] button:is(.theme-selector__button, .front-navbar__perspective):hover :is(svg, img) {
        translate: 3px 0;
    }
    .reveal-card:hover {
        translate: 0 -5px;
        scale: 1.01;
        box-shadow: 0 18px 36px rgba(22,58,95,.14);
    }
}
@keyframes button-shine {
    0% { transform: translateX(-150%) skewX(-15deg); opacity: 0; }
    20%, 75% { opacity: 1; }
    100% { transform: translateX(400%) skewX(-15deg); opacity: 0; }
}
body[data-page] button:is(.theme-selector__button, .front-navbar__perspective, .btn-heroprojetos, .btn-herosobremim):is(:active, .is-pressed) {
    translate: 0 0;
    scale: .97;
    transition-duration: 100ms;
}
body[data-page] button:focus-visible {
    outline: 3px solid var(--front-primary);
    outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
    body[data-page] button:is(.theme-selector__button, .front-navbar__perspective, .btn-heroprojetos, .btn-herosobremim):is(:active, .is-pressed) {
        scale: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    .intro {
        padding: 1.5rem;
    }

    .intro__logo {
        width: clamp(14.5rem, 48vw, 17rem);
    }

    .theme-selector {
        gap: clamp(2rem, 8vw, 3rem);
        width: min(100%, 24rem);
    }

    .theme-selector__button svg {
        width: 2rem;
        height: 2rem;
    }

    .intro__text p {
        font-size: clamp(1rem, 2.8vw, 1.2rem);
    }

}

@media (max-width: 560px) {
    .intro {
        padding: 1.25rem;
    }

    .intro__content {
        width: min(100%, 22rem);
        gap: 1.6rem;
    }

    .intro__logo {
        width: min(17rem, 78vw);
    }

    .theme-selector {
        gap: clamp(1.5rem, 8vw, 2.25rem);
        width: min(100%, 21rem);
    }

    .theme-selector__option {
        gap: 0.75rem;
    }

    .theme-selector__button {
        width: min(4.7rem, 24vw);
    }

    .theme-selector__button svg {
        width: 1.85rem;
        height: 1.85rem;
    }

    .theme-selector__label {
        font-size: 0.7rem;
        letter-spacing: 0.18em;
    }

    .intro__text {
        gap: 0.2rem;
    }

    .intro__text p {
        font-size: 1rem;
        line-height: 1.5;
        letter-spacing: 0.035em;
    }

    .intro__decoration {
        margin-top: 0.45rem;
    }

    .page-shell__content {
        gap: 0.7rem;
    }

    .page-shell__title {
        font-size: clamp(2.2rem, 10vw, 3.3rem);
    }
}

/* FRONT-END — TECNOLOGIAS (styles scoped to this section) */
body[data-page="front"] .technologies {
    width: min(100% - clamp(2.5rem, 6vw, 5.5rem), 80rem);
    margin: 0 auto;
    padding: clamp(4rem, 8vw, 7rem) 0;
    scroll-margin-top: 2rem;
}
.technologies__header {
    max-width: 38rem;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}
.technologies__eyebrow {
    margin-bottom: 0.75rem;
    color: var(--front-primary-hover);
    font-family: var(--font-code);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
}
.technologies__title {
    color: var(--front-text);
    font-family: var(--font-body);
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.04em;
}
.technologies__description {
    margin-top: 1rem;
    max-width: 34rem;
    color: var(--blue-dark);
    font-size: clamp(0.9375rem, 1.3vw, 1rem);
    line-height: 1.75;
}
.technologies__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
    list-style: none;
}
.technologies__card {
    min-width: 0;
    min-height: 10rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.125rem;
    padding: 1.5rem 0.75rem;
    border: 1px solid var(--front-border);
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(234, 243, 255, 0.65));
    box-shadow: 0 4px 16px rgba(22, 58, 95, 0.035);
    /* Individual transforms stay independent of the GSAP entrance transform. */
    transition: translate 250ms cubic-bezier(.215,.61,.355,1),
        scale 250ms cubic-bezier(.215,.61,.355,1),
        box-shadow 250ms ease, border-color 250ms ease;
}
.technologies__icon {
    display: grid;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    flex-shrink: 0;
    border-radius: 1rem;
    background: rgba(217, 234, 255, 0.55);
}
.technologies__icon img {
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
    transition: scale 250ms cubic-bezier(.215,.61,.355,1);
}
.technologies__name {
    color: var(--front-text);
    font-size: 0.9375rem;
    font-weight: 650;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .technologies__card:hover {
        translate: 0 -4px;
        scale: 1.02;
        border-color: rgba(74, 144, 226, 0.32);
        box-shadow: 0 12px 28px rgba(74, 144, 226, 0.11);
    }
    .technologies__card:hover .technologies__icon img {
        scale: 1.06;
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .technologies__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .technologies__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .technologies__card {
        min-height: 9rem;
        padding: 1.25rem 0.625rem;
        gap: 0.875rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    .technologies__card,
    .technologies__icon img {
        transition: none;
    }
}

/* FRONT-END — SOBRE MIM */
/* Clip horizontal overflow without making body a separate sticky scroll container. */
body[data-page="front"]:has(.about) {
    overflow-x: clip;
    overflow-y: visible;
}

body[data-page="front"] .about {
    width: min(100% - clamp(2.5rem, 6vw, 5.5rem), 80rem);
    margin: 0 auto;
    padding: clamp(4rem, 8vw, 7rem) 0 0;
    display: grid;
    grid-template-columns: minmax(0, 0.43fr) minmax(0, 0.57fr);
    grid-template-areas: "photo intro" "photo body";
    align-items: start;
    column-gap: clamp(2rem, 5vw, 5rem);
    row-gap: 2rem;
    scroll-margin-top: 2rem;
}
.about__intro {
    grid-area: intro;
    min-width: 0;
    max-width: 62ch;
}
.about__eyebrow {
    margin-bottom: 0.75rem;
    color: var(--front-primary-hover);
    font-family: var(--font-code);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
}
.about__title {
    color: var(--front-text);
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.04em;
}
.about__lead {
    margin-top: 1.5rem;
    color: var(--front-text);
    font-size: clamp(1.25rem, 1.9vw, 1.625rem);
    font-weight: 550;
    line-height: 1.55;
    letter-spacing: -0.02em;
}
.about__portrait {
    grid-area: photo;
    min-width: 0;
    width: 100%;
    align-self: start;
}
.about__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 50% 15%;
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(22, 58, 95, 0.09);
}
.about__body {
    grid-area: body;
    min-width: 0;
    max-width: 62ch;
    display: grid;
    gap: 1.75rem;
    color: var(--front-text);
    font-size: 1rem;
    line-height: 1.85;
    overflow-wrap: break-word;
}
.about__paragraph strong {
    color: var(--front-primary-hover);
    font-weight: 650;
}
.about__highlight {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
    border-left: 2px solid var(--front-primary);
    color: var(--blue-dark);
    font-size: 1.125rem;
    font-weight: 550;
    line-height: 1.7;
}
@media (min-width: 1024px) and (min-height: 600px) and (prefers-reduced-motion: no-preference) {
    .about__portrait {
        position: sticky;
        /* The sticky photo stops below the navbar, using the anchor offset. */
        top: var(--navbar-offset);
        /* Always fits the viewport; its grid area ends before Technologies. */
        max-width: calc(100svh - 6rem);
    }
}
@media (max-width: 899px) {
    body[data-page="front"] .about {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "intro" "photo" "body";
        row-gap: 2rem;
    }
    .about__portrait {
        max-width: 32rem;
    }
}
/* FRONT-END — PROJETOS */
body[data-page="front"] .projects {
    width: min(100% - clamp(2.5rem, 6vw, 5.5rem), 80rem);
    margin: 0 auto;
    padding: clamp(5rem, 10vw, 9rem) 0 clamp(4rem, 8vw, 7rem);
    scroll-margin-top: 2rem;
}
.projects__header { max-width: 44rem; margin-bottom: clamp(3rem, 6vw, 5rem); }
.projects__eyebrow {
    margin-bottom: 1rem;
    color: var(--front-primary-hover);
    font: 600 0.72rem var(--font-code);
    letter-spacing: 0.16em;
}
.projects__title {
    color: var(--front-text);
    font-size: clamp(2rem, 3.8vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.04em;
}
.projects__intro { max-width: 35rem; margin-top: 1.5rem; color: var(--blue-dark); line-height: 1.8; }
.projects__list { display: grid; gap: clamp(4rem, 8vw, 7rem); }
.projects__item {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas: "image content";
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}
.projects__item:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-areas: "content image";
}
.projects__visual {
    grid-area: image;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--front-border);
    border-radius: var(--radius-md);
    background: var(--front-surface);
    box-shadow: var(--front-shadow-soft);
}
.projects__visual img { width: 100%; height: auto; transition: transform 450ms ease; }
.projects__content { grid-area: content; min-width: 0; }
.projects__meta { display: flex; align-items: center; gap: 1rem; color: var(--front-primary-hover); font-size: 0.75rem; line-height: 1.6; }
.projects__number { font-family: var(--font-code); padding-right: 1rem; border-right: 1px solid var(--front-border); }
.projects__copy h3 { margin-top: 1rem; color: var(--front-text); font-size: clamp(1.75rem, 2.7vw, 2.625rem); line-height: 1.2; letter-spacing: -0.035em; }
.projects__description { max-width: 45ch; margin-top: 1.25rem; color: var(--blue-dark); font-size: 0.9375rem; line-height: 1.85; }
.projects__technologies { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 1.75rem; list-style: none; }
.projects__technologies li { padding: 0.45rem 0.75rem; border: 1px solid var(--front-border); border-radius: var(--radius-round); color: var(--blue-dark); background: var(--front-surface); font: 400 0.7rem var(--font-code); }
.projects__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--front-primary-hover);
    border-radius: var(--radius-round);
    color: var(--front-primary-hover);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 200ms ease, background 200ms ease;
}
.projects__arrow { display: inline-block; transition: transform 200ms ease; }
.projects__link svg { flex-shrink: 0; }
.projects__link:hover { background: var(--front-primary-soft); }
.projects__link:focus-visible { outline: 3px solid var(--front-primary); outline-offset: 5px; }
.projects__closing {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    margin-top: clamp(4rem, 8vw, 7rem);
    padding-top: clamp(2.5rem, 5vw, 4rem);
    border-top: 1px solid var(--front-border);
}
.projects__closing h3 { max-width: 28ch; color: var(--front-text); font-size: clamp(1.5rem, 2.3vw, 2rem); line-height: 1.3; letter-spacing: -0.03em; }
.projects__closing p { max-width: 57ch; margin-top: 1rem; color: var(--blue-dark); font-size: 0.9375rem; line-height: 1.8; }
.projects__link--github { white-space: nowrap; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .projects__visual:hover img { transform: scale(1.015); }
    .projects__link:hover { transform: translateY(-2px); }
    .projects__link:hover .projects__arrow { transform: translate(2px, -2px); }
    .projects__link--github:hover .projects__arrow { transform: translateX(3px); }
}
@media (max-width: 767px) {
    .projects__item, .projects__item:nth-child(even) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "image" "content"; gap: 1.75rem; }
    .projects__closing { flex-direction: column; align-items: flex-start; gap: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) {
    .projects__visual img, .projects__link, .projects__arrow { transition: none; }
}

/* FRONT-END — CONTATO */
body[data-page="front"] .contact {
    background: var(--blue-deep);
    color: #fff;
    padding: clamp(4.5rem, 8vw, 8rem) 0 2rem;
}
.contact__inner {
    width: min(100% - clamp(2.5rem, 6vw, 5.5rem), 80rem);
    margin: 0 auto;
}
.contact__eyebrow {
    color: var(--blue-light);
    font: 500 0.75rem/1.7 var(--font-code);
    letter-spacing: 0.14em;
}
.contact__invitation {
    margin-top: 1.75rem;
    max-width: 32ch;
    color: var(--back-text);
    font-size: clamp(1.5rem, 2.8vw, 2.5rem);
    line-height: 1.45;
    letter-spacing: -0.025em;
}
.contact__invitation span { color: var(--back-primary); }
.contact__email-wrap { margin-top: clamp(2rem, 4vw, 3.5rem); }
.contact__email-label {
    margin-bottom: 0.875rem;
    color: var(--blue-light);
    font: 500 0.65rem/1.5 var(--font-code);
    letter-spacing: 0.14em;
}
.contact__email {
    display: inline-flex;
    align-items: center;
    gap: clamp(0.625rem, 2.5vw, 2rem);
    max-width: 100%;
    padding: 0.25rem 0 1rem;
    border-bottom: 1px solid var(--back-border);
    color: #fff;
    font-size: clamp(1rem, 3.1vw, 2.625rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.035em;
    text-decoration: none;
    transition: border-color 300ms ease;
}
.contact__email-address { min-width: 0; overflow-wrap: anywhere; }
.contact__email-domain { color: var(--blue-light); font-weight: 400; opacity: 0.75; transition: opacity 300ms ease; }
.contact__email-affordance { position: relative; flex-shrink: 0; }
.contact__email-circle {
    display: grid;
    place-items: center;
    width: clamp(2rem, 4vw, 3.25rem);
    height: clamp(2rem, 4vw, 3.25rem);
    border: 1px solid var(--back-border);
    border-radius: 50%;
    color: var(--blue-light);
    transition: transform 300ms ease, background-color 300ms ease, border-color 300ms ease;
}
.contact__arrow { width: 45%; height: 45%; }
.contact__email-hint { display: none; }
.contact__email:is(:hover, :focus-visible) { border-color: var(--back-primary); }
.contact__email:is(:hover, :focus-visible) .contact__email-domain { opacity: 1; }
.contact__email:is(:hover, :focus-visible) .contact__email-circle { background-color: rgba(191, 217, 255, 0.07); border-color: var(--back-primary); }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
    .contact__email-hint {
        display: block;
        position: absolute;
        right: 0;
        bottom: calc(100% + 0.75rem);
        white-space: nowrap;
        color: var(--blue-light);
        font: 400 0.7rem/1.5 var(--font-body);
        letter-spacing: 0;
        opacity: 0;
        transition: opacity 300ms ease;
    }
    .contact__email:is(:hover, :focus-visible) .contact__email-hint { opacity: 1; }
}
.contact__socials { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; list-style: none; margin-top: 2.5rem; }
.contact__socials a {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 44px;
    color: var(--blue-light);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 220ms ease, transform 220ms ease;
}
.contact__socials a:hover { color: #fff; }
.contact a:focus-visible { outline: 2px solid var(--back-primary); outline-offset: 6px; border-radius: 3px; }
.contact__bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    margin-top: clamp(4rem, 7vw, 6rem);
    padding-top: 1.75rem;
    border-top: 1px solid var(--back-border);
}
.contact__signature { display: grid; gap: 0.375rem; line-height: 1.6; }
.contact__signature strong { color: var(--back-text); font-size: 0.875rem; font-weight: 600; }
.contact__signature span, .contact__bottom small { color: var(--back-text-secondary); font-size: 0.75rem; line-height: 1.6; }
@media (max-width: 767px) {
    .contact__bottom { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
    .contact__socials { column-gap: 1.25rem; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .contact__email:is(:hover, :focus-visible) .contact__email-circle { transform: translate(3px, -3px); }
    .contact__socials a:hover { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
    .contact__email, .contact__email-domain, .contact__email-circle, .contact__email-hint, .contact__socials a { transition: none; }
}

/* Responsive adaptations: the approved desktop remains unchanged above 1100px. */
.front-navbar__panel { display: contents; }
.front-navbar__toggle, .front-navbar__scrim { display: none; }
@media (max-width: 1100px) {
    html.front-menu-open { overflow: hidden; overscroll-behavior: none; }
    body[data-page="front"] .front-navbar {
        min-height: 5rem;
        padding: 1rem 0;
        flex-wrap: nowrap;
        gap: 1rem;
    }
    .front-navbar__toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
        width: 48px;
        height: 48px;
        border: 1px solid var(--front-border);
        border-radius: var(--radius-sm);
        color: var(--front-text);
        background: var(--front-surface);
        cursor: pointer;
    }
    .front-navbar__toggle span { display: block; width: 21px; height: 1.5px; background: currentColor; transition: transform 250ms ease, opacity 250ms ease; }
    .front-navbar__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
    .front-navbar__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .front-navbar__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
    .front-navbar__toggle:focus-visible { outline: 3px solid var(--front-primary); outline-offset: 3px; }
    body[data-page="front"] .front-navbar.is-menu-open::before { opacity: 1; }
    .front-navbar__scrim {
        display: block;
        position: fixed;
        inset: var(--navbar-height) 0 0;
        background: rgba(22, 58, 95, 0.12);
        opacity: 0;
        visibility: hidden;
        transition: opacity 250ms ease, visibility 250ms;
    }
    .front-navbar__panel {
        display: flex;
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2rem;
        padding: clamp(1.5rem, 5vw, 3rem);
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
        max-height: calc(100dvh - var(--navbar-height));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--front-border);
        box-shadow: 0 12px 24px rgba(22, 58, 95, 0.06);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 250ms ease, transform 250ms ease, visibility 250ms;
    }
    .is-menu-open .front-navbar__panel, .is-menu-open .front-navbar__scrim { opacity: 1; visibility: visible; transform: none; }
    body[data-page="front"] .front-navbar__panel .menu { display: flex; flex-direction: column; align-items: stretch; gap: 0.5rem; order: 0; flex: none; overflow: visible; padding: 0; }
    body[data-page="front"] .front-navbar__panel .menu a { min-height: 52px; font-size: clamp(1.25rem, 3vw, 1.75rem); padding: 0.5rem 0; }
    body[data-page="front"] .front-navbar__panel .menu a::after { bottom: 0; right: auto; width: 2rem; }
    .front-navbar__panel .front-navbar__perspective { align-self: flex-start; min-height: 48px; }
    body[data-page="front"] .btn-heroprojetos, body[data-page="front"] .btn-herosobremim { min-height: 48px; }
    body[data-page="front"] .hero {
        --hero-art-height: clamp(18rem, 42vw, 25rem);
        width: min(100% - 2.5rem, 80rem);
        height: auto;
        min-height: 0;
        aspect-ratio: auto;
        margin: 0 auto;
        padding: 0 0 var(--hero-art-height);
        background-image: none;
        background-color: #eef5ff;
        border-radius: var(--radius-md);
    }
    body[data-page="front"] .hero::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: var(--hero-art-height);
        background: url("../img/Front/background.webp") right bottom / auto 100% no-repeat;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        pointer-events: none;
    }
    body[data-page="front"] .hero__content { width: 100%; margin: 0; padding: clamp(2rem, 5vw, 3rem); }
    body[data-page="front"] .hero h1 { max-width: 16ch; font-size: clamp(2.1rem, 5.5vw, 3.5rem); }
    body[data-page="front"] .hero__description { max-width: 42ch; font-size: 0.9375rem; line-height: 1.75; }
    body[data-page="front"] .hero__portrait { width: 44%; height: calc(var(--hero-art-height) * 0.96); left: 6%; right: auto; bottom: 0; object-fit: contain; object-position: center bottom; }
    .contact__socials a { min-height: 48px; }
    .contact__email { min-height: 48px; }
}
@media (min-width: 900px) and (max-width: 1100px) {
    body[data-page="front"] .hero { --hero-art-height: 23rem; min-height: 36rem; padding: 1.5rem 0; }
    body[data-page="front"] .hero::before { left: 46%; }
    body[data-page="front"] .hero__content { width: 46%; padding: 2rem; }
    body[data-page="front"] .hero h1 { font-size: clamp(2.25rem, 3.8vw, 2.75rem); }
    body[data-page="front"] .hero__portrait { width: 25%; left: 46%; }
    .technologies__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
    body[data-page="front"] .about { grid-template-areas: "photo" "intro" "body"; }
    .about__portrait { position: static; max-width: 32rem; }
    .about__image { object-fit: contain; object-position: center; }
    .projects__item, .projects__item:nth-child(even) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "image" "content"; gap: 1.75rem; }
    .projects__description { max-width: 60ch; }
    .projects__closing { flex-direction: column; align-items: flex-start; gap: 1.75rem; }
}
@media (max-width: 599px) {
    body[data-page="front"] .hero { --hero-art-height: clamp(16rem, 70vw, 22rem); }
    body[data-page="front"] .hero__content { padding: 2rem 1.25rem; }
    body[data-page="front"] .hero h1 { font-size: clamp(2rem, 8.5vw, 2.75rem); }
    body[data-page="front"] .hero__actions { width: 100%; }
    body[data-page="front"] .btn-heroprojetos, body[data-page="front"] .btn-herosobremim { flex: 1 1 7rem; }
    body[data-page="front"] .hero__portrait { left: 0; width: 47%; }
    .contact__email { font-size: clamp(1rem, 4.1vw, 1.5rem); }
}
@media (prefers-reduced-motion: reduce) {
    .front-navbar__toggle span, .front-navbar__panel, .front-navbar__scrim { transition: none; }
}

/* Direct perspective navigation: the shared page-link controller owns the fade. */
.contact__perspective {
    --perspective-text: #dbeaff;
    --perspective-border: rgba(191, 217, 255, 0.28);
    --perspective-surface: rgba(191, 217, 255, 0.07);
    --perspective-hover: rgba(191, 217, 255, 0.13);
    --perspective-accent: #bfd9ff;
    --perspective-glow: rgba(191, 217, 255, 0.12);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.875rem 1.5rem;
    margin-top: 1.75rem;
}
body[data-page="back"] .contact__perspective {
    --perspective-text: #b5dcff;
    --perspective-border: rgba(146, 216, 255, 0.24);
    --perspective-surface: rgba(85, 164, 226, 0.06);
    --perspective-hover: rgba(85, 164, 226, 0.12);
    --perspective-accent: #92d8ff;
    --perspective-glow: rgba(146, 216, 255, 0.12);
}
.contact__perspective-label {
    color: var(--back-text-secondary);
    font-size: 0.75rem;
    line-height: 1.6;
}
.contact__perspective-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    min-height: 48px;
    color: var(--perspective-text);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
}
.contact__perspective-circle {
    display: grid;
    place-items: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border: 1px solid var(--perspective-border);
    border-radius: 50%;
    background: var(--perspective-surface);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
    transition: transform 300ms ease, border-color 300ms ease, background-color 300ms ease, box-shadow 300ms ease;
}
.contact__perspective-circle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.contact__perspective-link:is(:hover, :focus-visible) .contact__perspective-circle {
    border-color: var(--perspective-accent);
    background: var(--perspective-hover);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 0 16px var(--perspective-glow);
}
.contact .contact__perspective-link:focus-visible {
    outline: 2px solid var(--perspective-accent);
    outline-offset: 5px;
    border-radius: var(--radius-round);
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .contact__perspective-link:hover .contact__perspective-circle { transform: scale(1.04); }
}
@media (max-width: 599px) {
    .contact__perspective { gap: 0.625rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .contact__perspective-circle { transition: none; }
}

@media (max-width: 1100px) {
    .language-selector { align-self: flex-start; }
    body[data-page] .language-selector__button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    body[data-page] .language-selector__button,
    body[data-page] .language-selector__button::after { transition: none; }
}
