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

:root {
    --bg: #f4f4f2;
    --paper: #fafaf8;
    --text: #111111;
    --muted: #858585;
    --line: #d8d8d5;
    --dark: #1b1b1b;
    --ease: cubic-bezier(.16, 1, .3, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
}

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

/* O cursor nativo só some quando o JS ativa o cursor personalizado (.has-custom-cursor).
   Sem JS ou em telas de toque, o cursor normal continua visível. */
.has-custom-cursor body {
    cursor: none;
}

:where(.has-custom-cursor) button,
:where(.has-custom-cursor) a {
    cursor: none;
}

.noise {
    position: fixed;
    inset: -10%;
    z-index: 20;
    pointer-events: none;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    will-change: transform;
    animation: noiseMove .2s steps(2) infinite;
}

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    opacity: 0;
    will-change: transform;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(17,17,17,.55);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -50%);
    transition:
        opacity .25s ease,
        width .25s var(--ease),
        height .25s var(--ease),
        background .25s ease,
        border-color .25s ease;
}

.cursor-glow.is-hovering {
    width: 58px;
    height: 58px;
    background: rgba(17,17,17,.07);
    border-color: rgba(17,17,17,.25);
}

.page {
    position: relative;
    min-height: 100vh;
    padding: 28px 42px 24px;
    display: flex;
    flex-direction: column;
}

.topbar,
.footer {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .12em;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 500;
}

.brand-mark {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--text);
    border-radius: 50%;
    font-size: 8px;
    letter-spacing: -.04em;
}

.top-status {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
}

.status-dot,
.pulse {
    width: 6px;
    height: 6px;
    display: inline-block;
    border-radius: 50%;
    background: #777;
}

.status-dot {
    animation: blink 1.8s infinite;
}

.hero {
    flex: 1;
    min-height: calc(100vh - 105px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 7vh 0 4vh;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    color: #9a9a98;
    font: 10px "DM Mono", monospace;
    letter-spacing: .12em;
}

.hero-meta .line {
    width: 55px;
    height: 1px;
    background: var(--line);
}

.headline {
    position: relative;
    width: 100%;
    user-select: none;
    perspective: 900px;
}

.word {
    display: flex;
    width: fit-content;
    font-size: clamp(70px, 15.2vw, 245px);
    line-height: .77;
    font-weight: 600;
    letter-spacing: -.085em;
    text-transform: uppercase;
}

.word-criativa {
    margin-left: 11.8vw;
}

.letter {
    position: relative;
    display: inline-block;
    transform-origin: center bottom;
    will-change: transform;
    transition:
        transform .65s var(--ease),
        color .4s ease,
        opacity .4s ease;
}

.word:hover .letter:not(:hover) {
    color: #c7c7c3;
}

.letter:hover {
    color: var(--text);
    z-index: 3;
}

.hero-bottom {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(300px, 440px);
    gap: 8vw;
    align-items: end;
    margin-top: 7vh;
}

.eyebrow {
    margin-bottom: 18px;
    color: #777;
    font: 10px "DM Mono", monospace;
    letter-spacing: .14em;
}

.eyebrow span {
    margin: 0 5px;
}

.manifesto h1 {
    font-size: clamp(27px, 3vw, 48px);
    line-height: 1.04;
    font-weight: 400;
    letter-spacing: -.045em;
}

.manifesto h1 em {
    font-family: Georgia, serif;
    font-weight: 400;
}

.intro {
    max-width: 420px;
    margin-top: 18px;
    color: #70706e;
    font-size: 13px;
    line-height: 1.65;
}

.build-panel {
    padding: 17px 0 0;
    border-top: 1px solid var(--line);
}

.build-header,
.build-code {
    display: flex;
    justify-content: space-between;
    font: 9px "DM Mono", monospace;
    letter-spacing: .1em;
    color: #777;
}

.progress {
    height: 2px;
    margin: 13px 0 18px;
    background: #ddd;
    overflow: hidden;
}

.progress span {
    display: block;
    width: 87%;
    height: 100%;
    background: var(--dark);
    animation: progressIn 1.8s var(--ease) both;
}

.build-code {
    justify-content: flex-start;
    gap: 10px;
    color: #999;
    white-space: nowrap;
}

.build-code strong {
    color: var(--text);
    font-weight: 500;
}

.interaction {
    position: absolute;
    left: 42px;
    bottom: 84px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #858585;
    font: 9px "DM Mono", monospace;
    letter-spacing: .1em;
}

.interaction p {
    line-height: 1.6;
    margin-top: -3px;
    letter-spacing: .03em;
}

.pulse {
    margin-top: 2px;
    animation: blink 1.2s infinite;
}

.footer {
    padding-top: 17px;
    border-top: 1px solid var(--line);
    color: #8a8a88;
}

.footer-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.arrow {
    display: inline-block;
    margin-left: 4px;
    transition: transform .3s var(--ease);
}

.footer:hover .arrow {
    transform: translate(3px, -3px);
}

@keyframes blink {
    0%, 100% { opacity: .3; }
    50% { opacity: 1; }
}

@keyframes progressIn {
    from { width: 0; }
    to { width: 87%; }
}

@keyframes noiseMove {
    0% { transform: translate(0,0); }
    25% { transform: translate(2%, -1%); }
    50% { transform: translate(-1%, 2%); }
    75% { transform: translate(1%, 1%); }
    100% { transform: translate(-2%, -2%); }
}

@media (max-width: 850px) {
    body {
        cursor: auto;
    }

    .cursor-glow {
        display: none;
    }

    .page {
        padding: 20px 20px 18px;
    }

    .hero {
        min-height: calc(100vh - 83px);
        padding: 8vh 0 5vh;
    }

    .word {
        font-size: clamp(54px, 15vw, 125px);
    }

    .word-criativa {
        margin-left: 4vw;
    }

    .hero-bottom {
        grid-template-columns: 1fr;
        gap: 35px;
        margin-top: 8vh;
    }

    .build-panel {
        max-width: 100%;
    }

    .interaction {
        display: none;
    }

    .footer-center {
        display: none;
    }
}

@media (max-width: 480px) {
    .topbar {
        font-size: 8px;
    }

    .brand-mark {
        width: 24px;
        height: 24px;
    }

    .hero {
        justify-content: center;
    }

    .hero-meta {
        margin-bottom: 17px;
    }

    .word {
        font-size: clamp(45px, 14.5vw, 76px);
        letter-spacing: -.075em;
    }

    .word-criativa {
        margin-left: 2vw;
    }

    .hero-bottom {
        margin-top: 55px;
    }

    .manifesto h1 {
        font-size: 29px;
    }

    .intro {
        font-size: 12px;
    }

    .build-code {
        gap: 5px;
        font-size: 7px;
        letter-spacing: .02em;
    }

    .footer {
        font-size: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
/* ==========================================================
   FORMULÁRIO DE CONTATO (COMPATIBILIDADE MOBILE RIGOROSA)
   ========================================================== */

/* Botão Topbar */
.btn-contato {
    background: transparent;
    border: 1px solid var(--text);
    color: var(--text);
    padding: 5px 9px;
    font-family: "DM Mono", monospace;
    font-size: 9px;
    letter-spacing: .12em;
    cursor: pointer;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.btn-contato:hover,
.btn-contato:focus-visible {
    background: var(--text);
    color: var(--bg);
}

/* Overlay */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.55);
    z-index: 998;
    opacity: 0;
    display: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.35s var(--ease);
}

.drawer-overlay.is-visible {
    display: block;
}

.drawer-overlay.is-open {
    opacity: 1;
}

/* Gaveta (Drawer) */
.drawer-contact {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    border-left: 1px solid var(--line);
    z-index: 999;
    padding: 30px 24px;
    box-sizing: border-box;
    display: none;
    flex-direction: column;
    transform: translate3d(100%, 0, 0);
    -webkit-transform: translate3d(100%, 0, 0);
    will-change: transform;
    transition: transform 0.4s var(--ease);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.drawer-contact.is-visible {
    display: flex;
}

.drawer-contact.is-open {
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

/* Cabeçalho da Gaveta */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 24px;
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: .12em;
    color: var(--muted);
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
    margin: -8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-close:active {
    opacity: 0.5;
}

/* Tipografia Interna */
.drawer-body h2 {
    font-family: "Inter", sans-serif;
    font-weight: 500;
    font-size: 1.3rem;
    line-height: 1.25;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    color: var(--text);
}

.drawer-body p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    margin-bottom: 24px;
}

/* Honeypot Invisível */
.hp-field {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Campos de Formulário */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-family: "DM Mono", monospace;
    font-size: 9px;
    color: var(--muted);
    margin-bottom: 6px;
    letter-spacing: 0.1em;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 12px;
    font-family: "Inter", sans-serif;
    /* 16px previne zoom involuntário no iOS Safari */
    font-size: 16px;
    color: var(--text);
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    transition: border-color 0.25s var(--ease);
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: var(--text);
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

/* Botão de Envio */
.btn-submit {
    width: 100%;
    background: var(--text);
    color: var(--bg);
    border: none;
    padding: 14px;
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    cursor: pointer;
    margin-top: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.25s var(--ease);
}

.btn-submit:hover:not(:disabled) {
    opacity: 0.85;
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback */
.form-feedback {
    display: none;
    margin: 12px 0 6px;
    font-size: 11px;
    line-height: 1.5;
    font-family: "DM Mono", monospace;
}

.form-feedback.is-visible {
    display: block;
}

.form-feedback.success {
    color: #1e7e34;
}

.form-feedback.error {
    color: #bd2130;
}

/* Ajustes Específicos para Mobile */
@media (max-width: 600px) {
    .drawer-contact {
        max-width: 100%;
        border-left: none;
        padding: 24px 20px;
    }

    .top-status {
        gap: 6px;
    }

    .btn-contato {
        padding: 3px 6px;
        font-size: 8px;
    }
}

/* ==========================================================
   ESTADOS GLOBAIS (cursor, gaveta aberta, foco, toque)
   ========================================================== */

/* Cursor personalizado só aparece depois do primeiro movimento do mouse */
.cursor-glow.is-active {
    opacity: 1;
}

/* Gaveta aberta: trava a rolagem do fundo, devolve o cursor nativo
   (o anel ficava escondido atrás do overlay e o mouse "sumia") e pausa o ruído */
html.drawer-open {
    overflow: hidden;
}

.has-custom-cursor.drawer-open body {
    cursor: auto;
}

.has-custom-cursor.drawer-open .cursor-glow {
    opacity: 0;
}

.drawer-open .noise {
    animation-play-state: paused;
}

/* Em telas de toque o ruído fica estático (economiza bateria) */
@media (pointer: coarse) {
    .noise {
        animation: none;
    }
}

/* Foco visível para navegação por teclado */
a:focus-visible,
.btn-close:focus-visible,
.btn-submit:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}
