@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #08170f;
    --content: #12271a;
    --surface: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.1);
    --text: #edf7ed;
    --muted: #b8ccb7;
    --accent: #7fbe65;
    --radius: 22px;
    --shadow: 0 28px 60px rgba(10, 25, 14, 0.22);
}

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

body {
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(79, 175, 93, 0.14), transparent 32%),
        linear-gradient(180deg, #08170f 0%, #0f2517 100%);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

img {
    width: 100%;
    display: block;
    border-radius: 24px;
    object-fit: cover;
}

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

.container {
    width: min(1080px, calc(100% - 2rem));
    margin: 0 auto;
}

/* ── HEADER ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 15;
    background: rgba(8, 23, 13, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.brand { font-weight: 800; letter-spacing: 0.08em; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.main-nav a {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.nav-button {
    border: 1px solid rgba(118, 193, 97, 0.4);
    padding: 0.7rem 1.3rem;
    color: var(--text) !important;
}

/* ── HERO ── */
.history-hero {
    padding: 3rem 0 2rem;
}

.history-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.history-copy { display: flex; flex-direction: column; gap: 1.25rem; }

.section-label {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.history-copy h1 {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    line-height: 1.1;
}

.history-copy p {
    color: var(--muted);
    max-width: 600px;
    line-height: 1.75;
}

.history-hero-img { aspect-ratio: 4/3; overflow: hidden; border-radius: 28px; }
.history-hero-img img { width: 100%; height: 100%; border-radius: 0; }

/* ── LINHA DO TEMPO ── */
.timeline-section { padding: 3rem 0 2rem; }

.timeline-title {
    font-size: clamp(1.8rem, 2.5vw, 2.6rem);
    margin-bottom: 0.75rem;
    margin-top: 0.5rem;
    line-height: 1.15;
}

.timeline-subtitle {
    color: var(--muted);
    max-width: 620px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 2px solid rgba(127, 190, 101, 0.25);
    padding-left: 2rem;
    margin-left: 1rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    padding-bottom: 2.5rem;
    position: relative;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    background: rgba(127, 190, 101, 0.15);
    border: 1px solid rgba(127, 190, 101, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    position: relative;
    left: -3.5rem;
    margin-right: -1.5rem;
}

.timeline-content { padding-top: 0.25rem; }

.timeline-period {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--text);
}

.timeline-content p {
    color: var(--muted);
    line-height: 1.75;
    font-size: 0.95rem;
    margin-bottom: 0.65rem;
}

.timeline-content p:last-child { margin-bottom: 0; }

/* ── SEÇÃO CARDS ── */
.section { padding: 3rem 0; }

.reveal {
    opacity: 0;
    transform: translateY(30px);
    visibility: hidden;
    transition: opacity 1s ease, transform 1s ease;
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        visibility: visible !important;
    }
}

.section-cards-title {
    font-size: clamp(1.8rem, 2.5vw, 2.6rem);
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    line-height: 1.15;
}

.history-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: transform 280ms cubic-bezier(.2,.9,.2,1), border-color 280ms ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(127, 190, 101, 0.25);
}

.card-icon { font-size: 1.6rem; margin-bottom: 0.75rem; }

.card h2 {
    font-size: 1.05rem;
    margin-bottom: 0.65rem;
    color: var(--text);
}

.card p {
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.7;
}

/* ── CONTEÚDO ALTERNADO ── */
.history-content { display: flex; flex-direction: column; gap: 3rem; }

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.reverse-grid { direction: rtl; }
.reverse-grid .image-block,
.reverse-grid .text-block { direction: ltr; }

.text-block { display: flex; flex-direction: column; gap: 1rem; }

.text-block h2 {
    font-size: clamp(1.7rem, 2vw, 2.4rem);
    line-height: 1.15;
}

.text-block p {
    color: var(--muted);
    line-height: 1.75;
    font-size: 0.95rem;
}

.image-block { aspect-ratio: 4/3; overflow: hidden; border-radius: 28px; }
.image-block img { width: 100%; height: 100%; border-radius: 0; }

/* ── SUMMARY ── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.summary-grid article {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: transform 280ms cubic-bezier(.2,.9,.2,1), border-color 280ms ease;
}

.summary-grid article:hover {
    transform: translateY(-3px);
    border-color: rgba(127, 190, 101, 0.22);
}

.summary-icon { font-size: 1.6rem; margin-bottom: 0.75rem; }

.summary-grid h3 {
    font-size: 1.05rem;
    margin-bottom: 0.65rem;
    color: var(--text);
}

.summary-grid p {
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.7;
}

/* ── FOOTER ── */
.site-footer {
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(8, 23, 13, 0.9);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-content p { color: var(--muted); font-size: 0.9rem; }

.button {
    border-radius: 999px;
    padding: 0.85rem 1.4rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

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

.button-primary {
    background: linear-gradient(135deg, #76c161, #a4d38e);
    color: #07230f;
}

.button-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
}

/* ── RESPONSIVIDADE ── */
@media (max-width: 900px) {
    .history-grid,
    .history-cards,
    .content-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .reverse-grid { direction: ltr; }
    .timeline { margin-left: 0.5rem; padding-left: 1.5rem; }
}

@media (max-width: 620px) {
    .header-content,
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-hero { padding-top: 2rem; }
    .history-copy h1 { font-size: 2rem; }

    .timeline-marker {
        width: 2.2rem;
        height: 2.2rem;
        font-size: 1rem;
        left: -3rem;
    }
}


/* ── Acessibilidade, tema claro e brilho dos cards ── */
.a11y-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 5.25rem;
    z-index: 300;
    width: min(270px, calc(100vw - 2rem));
    padding: 1.15rem;
    border-radius: 24px;
    background: rgba(8, 28, 15, 0.96);
    border: 1px solid rgba(118, 193, 97, 0.45);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), 0 0 28px rgba(118, 193, 97, 0.12);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(.96);
    transition: opacity .24s ease, transform .24s ease;
}
.a11y-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.a11y-panel-header, .a11y-row, .a11y-toggle-btn { display: flex; align-items: center; }
.a11y-panel-header { justify-content: space-between; margin-bottom: 1rem; }
.a11y-panel-title, .a11y-group-label { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.a11y-panel-title { font-size: .9rem; }
.a11y-group { margin-top: .85rem; }
.a11y-group-label { margin-bottom: .5rem; font-size: .72rem; color: var(--muted); }
.a11y-row { gap: .45rem; }
.a11y-btn, .a11y-toggle-btn, .a11y-close {
    border: 1px solid rgba(255,255,255,.12);
    color: var(--text);
    background: rgba(255,255,255,.06);
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.a11y-btn { flex: 1; min-height: 42px; border-radius: 12px; font-weight: 800; }
.a11y-btn--lg { font-size: 1.15rem; }
.a11y-toggle-btn { width: 100%; justify-content: flex-start; gap: .65rem; min-height: 44px; margin-bottom: .45rem; padding: .65rem .8rem; border-radius: 14px; font-weight: 700; }
.a11y-close { width: 30px; height: 30px; border-radius: 10px; }
.a11y-btn:hover, .a11y-toggle-btn:hover, .a11y-close:hover, .a11y-toggle-btn.active { transform: translateY(-1px); border-color: rgba(118,193,97,.65); background: rgba(118,193,97,.14); box-shadow: 0 12px 30px rgba(118,193,97,.12); }
.a11y-fab {
    position: fixed;
    right: 1.35rem;
    bottom: 1.35rem;
    z-index: 301;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    border: 1px solid rgba(118,193,97,.55);
    background: rgba(9,31,16,.94);
    color: var(--accent);
    cursor: pointer;
    box-shadow: 0 18px 42px rgba(0,0,0,.28), 0 0 22px rgba(118,193,97,.12);
    backdrop-filter: blur(12px);
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.a11y-fab:hover, .a11y-fab:focus-visible { transform: translateY(-3px) scale(1.06); box-shadow: 0 24px 52px rgba(0,0,0,.32), 0 0 32px rgba(118,193,97,.26); background: rgba(27,66,33,.98); }

@media (hover: hover) and (pointer: fine) {
    .card:hover,
    .summary-grid article:hover,
    .quiz-card:hover,
    .quiz-stats div:hover,
    .history-hero-img:hover,
    .image-block:hover {
        transform: translateY(-6px) scale(1.015);
        border-color: rgba(135, 220, 105, 0.72) !important;
        box-shadow: 0 24px 58px rgba(3,16,8,.24), 0 0 0 1px rgba(135,220,105,.18), 0 0 30px rgba(118,193,97,.16);
        z-index: 8;
    }
    .card:hover .card-icon,
    .summary-grid article:hover .summary-icon { transform: translateY(-3px) scale(1.12); filter: drop-shadow(0 0 10px rgba(135,220,105,.42)); }
}
.card-icon, .summary-icon { transition: transform .28s ease, filter .28s ease; }

html[data-theme="light"] body { background: linear-gradient(180deg, #f2f8ef 0%, #e4f0df 100%); color: #102016; }
html[data-theme="light"] { --text:#102016; --muted:#446047; --accent:#2f8f37; --border:rgba(44,120,55,.16); --shadow:0 18px 45px rgba(50,100,55,.12); }
html[data-theme="light"] .site-header, html[data-theme="light"] .site-footer { background: rgba(240,248,236,.92); border-color: rgba(44,120,55,.16); }
html[data-theme="light"] .card, html[data-theme="light"] .summary-grid article, html[data-theme="light"] .quiz-card, html[data-theme="light"] .quiz-stats div, html[data-theme="light"] .timeline-content { background: rgba(255,255,255,.78); border-color: rgba(44,120,55,.18); color:#102016; }
html[data-theme="light"] p, html[data-theme="light"] .timeline-content p, html[data-theme="light"] .text-block p, html[data-theme="light"] .finish-detail { color:#446047; }
html[data-theme="light"] .a11y-panel, html[data-theme="light"] .a11y-fab { background: rgba(246,252,243,.96); color:#102016; }
html[data-contrast="high"] body { background:#000 !important; color:#fff !important; }
html[data-contrast="high"] .site-header, html[data-contrast="high"] .site-footer, html[data-contrast="high"] .card, html[data-contrast="high"] .quiz-card, html[data-contrast="high"] .summary-grid article { background:#050505 !important; border-color:#ffff66 !important; color:#fff !important; }
html[data-contrast="high"] p, html[data-contrast="high"] a, html[data-contrast="high"] h1, html[data-contrast="high"] h2, html[data-contrast="high"] h3, html[data-contrast="high"] span { color:#fff !important; }
html[data-contrast="high"] .section-label { color:#00ff66 !important; }

@media (max-width: 900px) {
    .a11y-panel { right: 1rem; bottom: 4.8rem; }
    .a11y-fab { right: 1rem; bottom: 1rem; }
}
