:root {
    --bg: #F1FAEE;
    --text: #0A1128;
    --accent: #2A9D8F;

    --surface: rgba(217, 237, 146, 0.6);
    --surface-strong: rgba(217, 237, 146, 0.9);
    --border: rgba(112, 224, 0, 0.8);

    --header-offset: 90px;
}

[data-theme="dark"] {
    --bg: #0A1128;
    --text: #F1FAEE;
    --accent: #2A9D8F;

    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] header {
    background: rgba(10, 17, 40, 0.8);
}

[data-theme="dark"] header.shrink {
    background: rgba(10, 17, 40, 0.95);
}

[data-theme="dark"] .filter-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(241, 250, 238, 0.85);
    backdrop-filter: blur(6px);
}

[data-theme="dark"] .filter-btn.active {
    background: var(--accent);
    color: #F1FAEE;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.35);
}

[data-theme="dark"] .filter-btn:hover {
    border-color: var(--accent);
    background: rgba(42, 157, 143, 0.15);
}

[data-theme="dark"] .card-featured {
    background: linear-gradient(
        180deg,
        rgba(42, 157, 143, 0.15),
        rgba(255, 255, 255, 0.04)
    );
    border-color: rgba(42, 157, 143, 0.4);
}

[data-theme="dark"] .card-featured::before {
    color: rgba(241, 250, 238, 0.6);
}

[data-theme="dark"] .card-institutional {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .card-institutional::before {
    color: rgba(241, 250, 238, 0.55);
}

[data-theme="dark"] .card-institutional .tag {
    background: rgba(42, 157, 143, 0.1);
    color: rgba(241, 250, 238, 0.85);
    border: 1px solid rgba(42, 157, 143, 0.25);
}

[data-theme="dark"] .card-institutional .btn {
    background: #F1FAEE;
    color: var(--bg);
}

[data-theme="dark"] .card-institutional .decision {
    border-left-color: rgba(42, 157, 143, 0.7);
}

[data-theme="dark"] .tag {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(241, 250, 238, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .footer {
    background: rgba(10, 17, 40, 0.9);
    border-top: 1px solid var(--border);
}

[data-theme="dark"] .modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.18);
    color: rgba(241, 250, 238, 0.85);
}

[data-theme="dark"] .modal-close:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #0A1128;
}

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

body {
    font-family: "Nunito", sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 0;
}

header {
    width: 100%;
    padding: 0.9rem 1.5rem;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: padding 0.3s ease, background 0.3s ease;
}

header.shrink {
    padding: 0.6rem 1.5rem;
    background: var(--surface-strong);
}

.header-content {
    max-width: 1100px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header.shrink .logo {
    font-size: 1.2rem;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(90deg, #2a9d8f, #1d6f63);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.65px;
}

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

.nav {
    display: flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    width: 1.5rem;
    cursor: pointer;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1.6rem;
}

.nav-list a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    position: relative;
}

.nav-list a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-list a:hover::after {
    width: 100%;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

section[id] {
    scroll-margin-top: var(--header-offset);
}

.theme-toggle {
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    cursor: pointer;
    border-radius: 0.6rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

header.shrink .theme-toggle {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text);
}

.theme-toggle:hover {
    background: rgba(42, 157, 143, 0.15);
}

.hero {
    max-width: 1100px;
    margin: 4rem auto 5rem;
    padding: 3rem 1.5rem;
    border-left: 4px solid var(--accent);
}

.hero .headline {
    max-width: 720px;
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

.hero .subheadline {
    max-width: 620px;
    margin-top: 1.4rem;
    font-size: 1.1rem;
    opacity: 0.75;
}

.hero .subheadline::before {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--accent);
    margin-bottom: 1rem;
}

.hero-actions {
    margin-top: 2.4rem;
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.hero .btn {
    padding: 0.75rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.8rem;
    box-shadow: 0 8px 20px rgba(42, 157, 143, 0.25);
}

.hero .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(42, 157, 143, 0.35);
}

.hero .btn-outline {
    padding: 0.75rem 1.6rem;
    font-size: 1rem;
    border-radius: 0.8rem;
    background: transparent;
}

.hero .btn-outline:hover {
    background: rgba(42, 157, 143, 0.1);
}

.container {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 2rem 1.5rem;
}

.about h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--accent);
    font-weight: 600;
}

.about p {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.9;
    max-width: 750px;
}

.projects h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--accent);
    font-weight: 600;
}

.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2.2rem;
    align-items: center;
}

.filters-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 0.8rem;
}

.filter-btn {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: var(--accent);
    color: #F1FAEE;
    border-color: var(--accent);
    font-weight: 700;
}

.filter-btn:hover {
    border-color: var(--accent);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.cards {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.8rem;
    border-radius: 1rem;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.card.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    line-height: 1.25;
}

.card .tags {
    opacity: 0.25;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card:hover .tags {
    opacity: 1;
    transform: translateY(0);
}

.card p {
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.card-featured {
    grid-column: span 2;
    background: rgba(217, 237, 146, 0.85);
    border-color: var(--accent);
}

.card-featured h3 {
    font-size: 1.6rem;
}

.card-featured .tag {
    background: rgba(42, 157, 143, 0.12);
    border-color: rgba(42, 157, 143, 0.25);
}

.card-featured p {
    font-size: 1rem;
}

.card-featured .decision {
    font-size: 1rem;
}

.card-featured::before {
    content: "Projeto principal";
    display: inline-block;
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.card-institutional {
    grid-column: span 3;
    background: rgba(241, 250, 238, 0.95);
    border-color: rgba(10, 17, 40, 0.15);
    order: 99;
}

.card-institutional h3 {
    font-size: 1.35rem;
    letter-spacing: 0.2px;
}

.card-institutional .decision {
    border-left-color: rgba(10, 17, 40, 0.35);
    font-size: 0.95rem;
}

.card-institutional::before {
    content: "Projeto institucional";
    display: inline-block;
    margin-bottom: 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(10, 17, 40, 0.6);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.card-institutional .btn {
    background: var(--text);
}

.card-institutional .btn-outline {
    border-color: var(--text);
    color: var(--text);
}

.card-institutional .tag {
    background: rgba(10, 17, 40, 0.06);
    color: rgba(10, 17, 40, 0.7);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    list-style: none;
    padding: 0;
}

.tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    background: rgba(10, 17, 40, 0.08);
    color: rgba(10, 17, 40, 0.75);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.decision {
    font-size: 0.95rem;
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
    opacity: 0.85;
}

.btns {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.btn, .btn-outline {
    padding: 0.45rem 0.9rem;
    border-radius: 0.6rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn {
    position: relative;
    overflow: hidden;
    background: var(--accent);
    color: #f1faee;
}

.btn-label {
    display: inline-block;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.btn:hover .btn-label {
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-details {
    align-self: flex-start;
    margin-top: auto;
    padding: 0.5rem 0;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--accent);
    cursor: pointer;
    position: relative;
    transition: opacity 0.2s ease;
}

.btn-details::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.btn-details:hover::after {
    transform: scaleX(1);
}

.btn-details:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.contact {
    text-align: center;
}

.contact h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--accent);
    font-weight: 600;
}

.contact p {
    opacity: 0.9;
    margin-bottom: 1.8rem;
}

.links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-link {
    padding: 0.7rem 1.2rem;
    border-radius: 0.6rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
    transition: 0.3s ease;
}

.contact-link:hover {
    background: var(--accent);
    color: #f1faee;
}

.footer {
    width: 100%;
    text-align: center;
    padding: 1.8rem 1rem;
    border-top: 1px solid rgba(112, 224, 0, 0.8);
    background: rgba(217, 237, 146, 0.6);
    backdrop-filter: blur(10px);
    margin-top: 3rem;
}

.footer p {
    opacity: 0.7;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 999;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal.open .modal-content {
    transform: translateY(0) scale(1);
}

.modal-content {
    position: relative;
    background: var(--bg);
    color: var(--text);
    width: min(640px, 92%);
    padding: 2.4rem;
    border-radius: 1.2rem;
    border: 1px solid var(--border);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.25),
        0 2px 10px rgba(0, 0, 0, 0.08);
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.25s ease;
}

.modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: var(--accent);
    color: #F1FAEE;
    border-color: var(--accent);
}

.modal-title {
    font-size: 1.6rem;
    margin-bottom: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
}

.modal-content section {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-content section:last-of-type {
    border-bottom: none;
}

.modal-content h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
    opacity: 0.6;
}

.modal-content p {
    line-height: 1.6;
    margin-bottom: 1.4rem;
    opacity: 0.9;
}

.modal-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none;
        transition: none;
    }
}

@media (max-width: 768px) {
    [data-theme="dark"] .nav-list {
        background: rgba(10, 17, 40, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }

    header {
        padding: 1rem 1rem;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        font-size: 1.25rem;
    }

    .nav-toggle {
        display: block;
        width: 2.4rem;
        height: 2.4rem;
        padding: 0.4rem;
        border-radius: 0.5rem;
    }

    .nav-toggle svg {
        width: 100%;
        height: 100%;
        fill: var(--text);
    }

    .nav-toggle:hover {
        background: rgba(42, 157, 143, 0.15);
    }

    .nav-list {
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 1rem;
        min-width: 180px;
        background: rgba(217, 237, 146, 0.98);
        border: 1px solid rgba(112, 224, 0, 0.4);
        border-radius: 0.9rem;
        padding: 0.9rem 1rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
        flex-direction: column;
        gap: 0.9rem;
        opacity: 0;
        transform: translateY(-6px);
        pointer-events: none;
        transition: opacity 0.25s ease, transform 0.25s ease;
        display: none;
    }

    .nav-list.open {
        display: flex;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-list a {
        font-size: 1rem;
        padding: 0.3rem 0;
    }

    .nav-list a::after {
        display: none;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-actions a {
        width: 100%;
        max-width: 260px;
        text-align: center;
    }

    .project-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.4rem;
        scrollbar-width: none;
    }

    .project-filters::-webkit-scrollbar {
        display: none;
    }

    .card-featured {
        grid-column: span 1;
    }

    .card-institutional {
        grid-column: span 1;
    }
}