/* Variáveis */
:root {
    --bg: #f7f7f4;
    --surface: #ffffff;
    --surface-muted: #efefe9;
    --text: #1b1f1c;
    --text-muted: #5a615c;
    --border: #dcddd6;

    --brand: #1d4d33;
    --brand-hover: #163b27;
    --brand-soft: #e3ece5;
    --accent: #2f7d4f;
    --on-brand: #ffffff;

    --font: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --radius: 6px;
    --container: 1120px;
    --header-height: 64px;
}

[data-theme="dark"] {
    --bg: #121513;
    --surface: #1a1e1b;
    --surface-muted: #202522;
    --text: #e8ebe8;
    --text-muted: #a3aaa5;
    --border: #2d332f;

    --brand: #7fc79a;
    --brand-hover: #9bd6b0;
    --brand-soft: #1f2c24;
    --accent: #7fc79a;
    --on-brand: #0f1a13;
}

/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    display: block;
}

a {
    color: inherit;
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3 {
    line-height: 1.2;
    letter-spacing: -0.01em;
}

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

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Acessibilidade */
.sr-only {
    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;
    left: 16px;
    top: -48px;
    z-index: 2000;
    padding: 8px 14px;
    background: var(--brand);
    color: var(--on-brand);
    border-radius: var(--radius);
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg);
    border-bottom: 1px solid transparent;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header.is-scrolled {
    background-color: color-mix(in srgb, var(--bg) 82%, transparent);
    border-bottom-color: var(--border);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
}

.scroll-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background-color: var(--accent);
    transform: scaleX(var(--progress, 0));
    transform-origin: left;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.logo-mark {
    width: 28px;
    height: 28px;
}

.logo-mark rect {
    fill: var(--brand);
}

.logo-mark path {
    fill: none;
    stroke: var(--bg);
    stroke-width: 2.6;
    stroke-linecap: square;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav {
    margin-left: auto;
}

.nav-menu {
    display: flex;
    gap: 28px;
}

.nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: none;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.icon-button:hover {
    background-color: var(--surface-muted);
}

.icon-button .icon {
    width: 20px;
    height: 20px;
}

.theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

.theme-toggle .icon {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle:hover .icon {
    transform: rotate(-20deg) scale(1.08);
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: currentColor;
    transition: transform 0.2s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    transform: translateY(-4px) rotate(-45deg);
}

/* Botões */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.button-primary {
    background-color: var(--brand);
    color: var(--on-brand);
}

.button-primary:hover {
    background-color: var(--brand-hover);
}

.button:active {
    transform: scale(0.98);
}

.button-ghost {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text);
}

.button-ghost:hover {
    border-color: var(--text-muted);
}

/* Títulos de seção */
.eyebrow {
    margin-bottom: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.section {
    padding: 96px 0;
}

.section-header {
    max-width: 640px;
    margin-bottom: 40px;
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
}

.section-lead {
    margin-top: 12px;
    color: var(--text-muted);
}

/* Hero */
.hero {
    padding: 96px 0 88px;
    border-bottom: 1px solid var(--border);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 64px;
    align-items: end;
}

.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
    max-width: 14ch;
}

.hero-subtitle {
    margin-top: 20px;
    max-width: 52ch;
    font-size: 1.125rem;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.hero-facts {
    border-top: 1px solid var(--border);
}

.hero-facts > div {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.hero-facts dt {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.hero-facts dd {
    margin-top: 2px;
    font-weight: 600;
}

/* Busca e filtro */
.search-filter {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 12px;
}

.search-field {
    position: relative;
}

.search-field .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input,
.filter-select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    color: var(--text);
    font: inherit;
    transition: border-color 0.15s ease;
}

.search-input {
    padding-left: 42px;
}

.search-kbd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    min-width: 22px;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    font: 600 0.75rem/1.4 var(--font);
    color: var(--text-muted);
    text-align: center;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.search-input:focus ~ .search-kbd,
.search-input:not(:placeholder-shown) ~ .search-kbd {
    opacity: 0;
}

@media (hover: none) {
    .search-kbd {
        display: none;
    }
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.results-count {
    margin: 20px 0 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Cards de ponto de coleta */
.points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.point-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 24px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease;
}

.point-card:hover {
    border-color: var(--text-muted);
}

/* Brilho na borda que acompanha o cursor */
.point-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    padding: 1px;
    border-radius: inherit;
    background: radial-gradient(240px circle at var(--x, 50%) var(--y, 50%), var(--accent), transparent 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

@media (hover: hover) {
    .point-card:hover::before {
        opacity: 1;
    }
}

.point-type {
    align-self: flex-start;
    margin-bottom: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: var(--brand-soft);
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 600;
}

.point-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.point-details {
    display: grid;
    gap: 10px;
    margin: 16px 0 20px;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.point-details li {
    display: flex;
    gap: 10px;
}

.point-details .icon {
    width: 18px;
    height: 18px;
    margin-top: 3px;
}

.point-details a {
    color: var(--text);
    text-decoration: none;
}

.point-details a:hover {
    text-decoration: underline;
}

.point-map {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.point-map .icon {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease;
}

.point-map:hover {
    text-decoration: underline;
}

.point-map:hover .icon {
    transform: translate(2px, -2px);
}

.no-results {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.no-results .button {
    margin-top: 16px;
}

/* O que descartar */
.what-to-discard {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.item .icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.item h3 {
    font-size: 1rem;
    font-weight: 600;
}

.item p {
    margin-top: 4px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.note {
    margin-top: 32px;
    padding: 20px 24px;
    border-left: 3px solid var(--accent);
    background-color: var(--surface-muted);
}

.note h3 {
    font-size: 1rem;
    font-weight: 600;
}

.note p {
    margin-top: 4px;
    color: var(--text-muted);
}

/* Por que descartar */
.why-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 64px;
}

.reasons {
    counter-reset: reason;
}

.reasons li {
    counter-increment: reason;
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 16px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

.reasons li:last-child {
    border-bottom: 1px solid var(--border);
}

.reasons li::before {
    content: counter(reason, decimal-leading-zero);
    grid-row: span 2;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
}

.reasons h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.reasons p {
    margin-top: 6px;
    color: var(--text-muted);
}

/* Footer */
.footer {
    padding: 56px 0 32px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    padding-bottom: 32px;
}

.footer-brand p {
    margin-top: 6px;
    max-width: 40ch;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.footer-partner-logo {
    width: auto;
    height: 72px;
}

[data-theme="dark"] .footer-partner-logo {
    filter: brightness(0) invert(0.85);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Animações (só com a classe .motion, definida quando o movimento é permitido) */
.motion [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: var(--delay, 0ms);
}

.motion [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

.motion .hero-title .word {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}

.motion .hero-title .word > span {
    display: inline-block;
    animation: word-up 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i) * 60ms + 100ms);
}

@keyframes word-up {
    from { transform: translateY(105%); }
    to { transform: none; }
}

.motion .hero-subtitle,
.motion .hero-actions,
.motion .hero .eyebrow {
    animation: fade-up 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.motion .hero .eyebrow { animation-delay: 0ms; }
.motion .hero-subtitle { animation-delay: 450ms; }
.motion .hero-actions { animation-delay: 550ms; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.motion .point-card {
    animation: fade-up 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 40ms);
}

/* Ícones são "desenhados" quando aparecem */
.motion .item .icon {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.motion .item.is-visible .icon {
    animation: draw 1.1s ease forwards;
    animation-delay: calc(var(--delay, 0ms) + 150ms);
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

.item .icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
    .item:hover .icon {
        transform: translateY(-3px);
    }
}

/* Troca de tema com View Transitions */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

/* Responsivo */
@media (max-width: 960px) {
    .hero-grid,
    .why-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .items-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-flex;
    }

    .nav-menu {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 8px 24px 16px;
        background-color: var(--bg);
        border-bottom: 1px solid var(--border);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-link {
        display: block;
        padding: 12px 0;
        font-size: 1rem;
    }

    .section {
        padding: 64px 0;
    }

    .hero {
        padding: 56px 0;
    }

    .search-filter {
        grid-template-columns: 1fr;
    }

    .points-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .nav-menu {
        padding: 8px 16px 16px;
    }

    .hero-actions .button {
        flex: 1 1 100%;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .item {
        flex-direction: row;
        align-items: flex-start;
        padding: 16px;
    }

    .point-card {
        padding: 20px;
    }
}

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

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

@media (prefers-contrast: more) {
    :root {
        --text-muted: #2f3431;
        --border: #8a8f8b;
    }
}
