/* PHDesenvolvimento
   Identidade: primary #3b82f6 · dark #09090b · surface #18181b · escala zinc · Inter.
   Princípios: o "PH" de partículas é o único gesto forte da página; o resto é
   silencioso, alinhado à esquerda num grid de 12 colunas, sem rótulos decorativos. */

:root {
    --ink: #09090b;
    --graphite: #18181b;
    --rule: #27272a;
    --fog: #a1a1aa;
    --mute: #71717a;
    --paper: #fafafa;
    --signal: #3b82f6;
    --signal-deep: #2563eb;
    --gallery: #f4f4f5;
    --gallery-ink: #18181b;

    /* escala tipográfica (quarta justa, base 17px) */
    --t-sm: .875rem;
    --t-base: 1.0625rem;
    --t-md: 1.25rem;
    --t-lg: 1.5rem;
    --t-2xl: clamp(2.125rem, 3.8vw, 2.75rem);
    --t-3xl: clamp(2.5rem, 5.4vw, 4.25rem);

    --gutter: clamp(1rem, 4vw, 2.5rem);
    --section: clamp(5.5rem, 12vw, 10rem);
    --ease: cubic-bezier(.22, 1, .36, 1);
}

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body { font-size: var(--t-base); line-height: 1.6; font-optical-sizing: auto; font-feature-settings: "cv11", "ss03"; overflow-x: hidden; }

.wrap { width: 100%; max-width: 78rem; margin-inline: auto; padding-inline: var(--gutter); }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

/* ---------- Tipografia ---------- */
.h2 {
    color: var(--paper);
    font-size: var(--t-2xl);
    font-weight: 650;
    line-height: 1.08;
    letter-spacing: -.032em;
    text-wrap: balance;
}
.section-intro { color: var(--fog); max-width: 34ch; font-size: var(--t-md); line-height: 1.5; text-wrap: pretty; }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 3.25rem; padding-inline: 1.5rem; border-radius: .5rem;
    font-weight: 600; font-size: var(--t-base); letter-spacing: -.01em; white-space: nowrap;
    transition: background-color .25s, color .25s, box-shadow .25s;
}
.btn-sm { height: 2.5rem; padding-inline: 1.1rem; font-size: var(--t-sm); }
.btn-block { width: 100%; }
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-deep); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: #e4e4e7; }
.btn-outline { color: var(--paper); box-shadow: inset 0 0 0 1px #3f3f46; }
.btn-outline:hover { box-shadow: inset 0 0 0 1px var(--paper); }

/* ---------- Header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto; z-index: 50;
    transition: transform .45s var(--ease), background-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { background: rgba(9, 9, 11, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--rule); }
.site-header.is-hidden { transform: translateY(-100%); }
.header-row { height: 4.5rem; display: flex; align-items: center; justify-content: space-between; }

.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--paper); }
.brand-mark { width: 2rem; height: 2rem; border-radius: .375rem; background: var(--signal); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1rem; letter-spacing: -.04em; }
.brand-name { font-weight: 650; letter-spacing: -.02em; }

.header-nav { display: none; align-items: center; gap: 2rem; font-size: var(--t-sm); }
.header-nav a:not(.btn) { color: var(--fog); transition: color .2s; }
.header-nav a:not(.btn):hover { color: var(--paper); }
@media (min-width: 768px) { .header-nav { display: flex; } .menu-toggle { display: none; } }

.menu-toggle { width: 2.75rem; height: 2.75rem; position: relative; color: var(--paper); margin-right: -.5rem; }
.menu-toggle span { position: absolute; left: .7rem; right: .7rem; height: 1.5px; background: currentColor; transition: transform .4s var(--ease), top .4s var(--ease); }
.menu-toggle span:first-child { top: 1.1rem; }
.menu-toggle span:last-child { top: 1.55rem; }
.menu-open .menu-toggle span:first-child { top: 1.33rem; transform: rotate(45deg); }
.menu-open .menu-toggle span:last-child { top: 1.33rem; transform: rotate(-45deg); }

.mobile-menu { position: fixed; inset: 0; z-index: 40; background: var(--ink); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.menu-open .mobile-menu { opacity: 1; visibility: visible; transition: opacity .3s; }
.mm-nav { padding-top: 6.5rem; display: flex; flex-direction: column; }
.mm-link { color: var(--paper); font-size: 2rem; font-weight: 650; letter-spacing: -.03em; padding: .6rem 0; transform: translateY(8px); opacity: 0; transition: transform .45s var(--ease), opacity .3s; }
.menu-open .mm-link { transform: none; opacity: 1; }
.menu-open .mm-link:nth-child(2) { transition-delay: .04s; }
.menu-open .mm-link:nth-child(3) { transition-delay: .08s; }
.menu-open .mm-link:nth-child(4) { transition-delay: .12s; }
.menu-open .mm-link:nth-child(5) { transition-delay: .16s; color: var(--signal); }
@media (min-width: 768px) { .mobile-menu { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; overflow: hidden; background: var(--ink); }
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.hero-content { position: relative; z-index: 1; display: flex; align-items: flex-end; padding-top: 7rem; padding-bottom: clamp(3rem, 8vh, 6rem); pointer-events: none; }
.hero-copy { max-width: 44rem; }

.hero-title {
    color: var(--paper);
    font-size: var(--t-3xl);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -.042em;
    text-wrap: balance;
}
.hero-lead { margin-top: 1.75rem; max-width: 38ch; color: var(--fog); font-size: var(--t-md); line-height: 1.5; }
.hero-actions { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .75rem; pointer-events: auto; }

/* legenda do "PH", posicionada pelo script a partir da forma desenhada */
.hero-caption {
    position: absolute; z-index: 1;
    left: var(--ph-left, 50%); top: var(--ph-bottom, 40%);
    margin-top: 1.25rem; color: var(--mute); font-size: var(--t-sm);
    opacity: 0; transition: opacity 1s .2s;
}
.hero.is-ready .hero-caption { opacity: 1; }

/* entrada única: o texto aparece enquanto as partículas se assentam */
.hero-copy > * { opacity: 0; transform: translateY(12px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.hero.is-ready .hero-copy > * { opacity: 1; transform: none; }
.hero.is-ready .hero-copy > :nth-child(2) { transition-delay: .12s; }
.hero.is-ready .hero-copy > :nth-child(3) { transition-delay: .24s; }

@media (min-width: 1280px) {
    .hero-content { align-items: center; padding-bottom: 4rem; }
    .hero-copy { max-width: 40rem; }
}
@media (max-width: 1279px) {
    .hero-content { padding-top: calc(min(56vw, 210px) * .73 + 96px + 5.5rem); }
}
@media (max-width: 767px) {
    .hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- Seções ---------- */
.section { padding-block: var(--section); }
.section-head { display: grid; gap: 1.25rem; margin-bottom: clamp(3rem, 7vw, 5.5rem); }
@media (min-width: 900px) {
    .section-head { grid-template-columns: repeat(12, 1fr); column-gap: 2rem; align-items: end; }
    .section-head .h2 { grid-column: 1 / span 6; }
    .section-head .section-intro { grid-column: 8 / span 5; }
}

/* Serviços: grade aberta, sem cartões */
.services { display: grid; gap: 3rem 2rem; }
@media (min-width: 640px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .services { grid-template-columns: repeat(3, 1fr); row-gap: 4.5rem; } }
.service-icon { width: 1.75rem; height: 1.75rem; color: var(--signal); margin-bottom: 1.5rem; }
.service h3 { color: var(--paper); font-size: var(--t-lg); font-weight: 600; letter-spacing: -.022em; line-height: 1.2; }
.service p { margin-top: .6rem; color: var(--fog); max-width: 36ch; }

/* Portfólio: galeria clara, os sites são o protagonista */
.gallery { background: var(--gallery); color: #52525b; }
.gallery .h2 { color: var(--gallery-ink); }
.gallery .section-intro { color: #52525b; }
.works { display: grid; gap: 3.5rem 2rem; }
@media (min-width: 768px) {
    .works { grid-template-columns: repeat(12, 1fr); row-gap: 5rem; }
    .work { grid-column: span 5; }
    .work-wide { grid-column: span 7; }
}
.work-frame {
    display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: .625rem;
    background: #fff; box-shadow: 0 0 0 1px rgba(24, 24, 27, .08), 0 24px 48px -28px rgba(24, 24, 27, .35);
    cursor: zoom-in; transition: box-shadow .4s var(--ease);
}
/* ao passar o mouse, o print rola como se a pessoa estivesse navegando no site */
.work-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: object-position 3.2s cubic-bezier(.45, 0, .2, 1); }
.work-frame:hover img, .work-frame:focus-visible img { object-position: 50% 100%; }
.work-frame:hover { box-shadow: 0 0 0 1px rgba(24, 24, 27, .14), 0 32px 60px -28px rgba(24, 24, 27, .45); }
.work-name { margin-top: 1.1rem; color: var(--gallery-ink); font-size: var(--t-md); font-weight: 600; letter-spacing: -.018em; }
.work-type { margin-top: .15rem; color: #71717a; font-size: var(--t-sm); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(9, 9, 11, .94); opacity: 0; transition: opacity .3s; }
.modal[hidden] { display: none; }
.modal.is-open { opacity: 1; }
.modal-scroll { height: 100%; overflow-y: auto; padding: 4.5rem var(--gutter) 3rem; display: flex; justify-content: center; align-items: flex-start; }
.modal-img { width: 100%; max-width: 64rem; border-radius: .5rem; transform: translateY(16px); transition: transform .45s var(--ease); }
.modal.is-open .modal-img { transform: none; }
.modal-close { position: fixed; top: 1rem; right: 1rem; z-index: 1; color: var(--paper); padding: .5rem; transition: color .2s; }
.modal-close:hover { color: var(--signal); }

/* Sobre */
.mission { display: grid; gap: 1.5rem; }
.mission-title { font-size: var(--t-3xl); line-height: 1.04; letter-spacing: -.04em; max-width: 16ch; }
.mission-text { color: var(--fog); font-size: var(--t-md); line-height: 1.55; max-width: 44ch; }
@media (min-width: 1024px) {
    .mission { grid-template-columns: repeat(12, 1fr); column-gap: 2rem; }
    .mission-title { grid-column: 1 / span 8; }
    .mission-text { grid-column: 8 / span 5; margin-top: 1.5rem; }
}
.mission-media { margin-top: clamp(3rem, 7vw, 5.5rem); aspect-ratio: 21 / 9; overflow: hidden; border-radius: .75rem; background: var(--graphite); position: relative; }
.mission-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(.9); transition: filter 1s var(--ease), transform 1.2s var(--ease); }
.mission-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(9, 9, 11, .45)), rgba(59, 130, 246, .12); mix-blend-mode: normal; pointer-events: none; }
.mission-media:hover img { filter: saturate(1) brightness(1); transform: scale(1.02); }
@media (max-width: 639px) { .mission-media { aspect-ratio: 4 / 3; } }

.values { margin-top: clamp(3rem, 6vw, 4.5rem); display: grid; gap: 2rem; }
@media (min-width: 640px) { .values { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .values { grid-template-columns: repeat(4, 1fr); } }
.values dt { color: var(--paper); font-weight: 600; letter-spacing: -.015em; }
.values dd { margin-top: .4rem; color: var(--mute); font-size: var(--t-sm); line-height: 1.55; max-width: 30ch; }

/* Contato */
.contact { background: var(--graphite); }
.contact-grid { display: grid; gap: 3.5rem; }
@media (min-width: 1024px) {
    .contact-grid { grid-template-columns: repeat(12, 1fr); column-gap: 2rem; }
    .contact-copy { grid-column: 1 / span 5; }
    .contact-form { grid-column: 7 / span 6; }
}
.contact-copy .section-intro { margin-top: 1.25rem; }
.contact-list { margin-top: 2.75rem; display: grid; gap: 1.5rem; }
.contact-list dt { color: var(--mute); font-size: var(--t-sm); }
.contact-list dd { color: var(--paper); font-weight: 600; font-size: var(--t-md); letter-spacing: -.01em; overflow-wrap: anywhere; }
.contact-list a { transition: color .2s; }
.contact-list a:hover { color: var(--signal); }

.contact-form { display: grid; gap: 1.5rem; align-content: start; }
.form-row { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: .5rem; min-width: 0; }
.field > span, .field legend { color: #d4d4d8; font-size: var(--t-sm); font-weight: 500; }
.field legend { margin-bottom: .5rem; }
.field input, .field textarea {
    width: 100%; background: var(--ink); color: var(--paper); border: 1px solid #3f3f46; border-radius: .5rem;
    padding: .85rem 1rem; font-size: var(--t-base); transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: #52525b; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.field.invalid input, .field.invalid textarea { border-color: #ef4444; }

.choices { display: grid; gap: .5rem; }
@media (min-width: 640px) { .choices { grid-template-columns: 1fr 1fr; } }
.choices label { cursor: pointer; position: relative; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span {
    display: flex; align-items: center; gap: .75rem; height: 100%; padding: .8rem 1rem; border-radius: .5rem;
    border: 1px solid #3f3f46; color: #d4d4d8; font-size: var(--t-sm); line-height: 1.35; transition: border-color .2s, background-color .2s;
}
.choices span::before { content: ""; flex: none; width: 1rem; height: 1rem; border-radius: 99px; box-shadow: inset 0 0 0 1.5px #52525b; transition: box-shadow .2s; }
.choices label:hover span { border-color: #52525b; }
.choices input:checked + span { border-color: var(--signal); background: rgba(59, 130, 246, .08); color: var(--paper); }
.choices input:checked + span::before { box-shadow: inset 0 0 0 4.5px var(--signal); }
.choices input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }

.form-response { padding: .9rem 1rem; border-radius: .5rem; font-weight: 500; font-size: var(--t-sm); }
.form-response.ok { background: rgba(34, 197, 94, .1); color: #4ade80; }
.form-response.err { background: rgba(239, 68, 68, .1); color: #f87171; }

/* Rodapé */
.site-footer { background: var(--ink); padding-block: 4.5rem 2rem; font-size: var(--t-sm); }
.footer-top { display: grid; gap: 2.5rem; padding-bottom: 3.5rem; }
@media (min-width: 768px) { .footer-top { grid-template-columns: 1fr auto; } }
.footer-brand p { margin-top: 1.25rem; color: var(--mute); max-width: 36ch; font-size: var(--t-base); }
.footer-nav { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; align-content: start; }
.footer-nav h4 { width: 100%; color: var(--paper); font-weight: 600; margin-bottom: .25rem; }
.footer-nav a, .footer-legal a { color: var(--fog); transition: color .2s; }
.footer-nav a:hover, .footer-legal a:hover { color: var(--paper); }
.footer-bottom { border-top: 1px solid var(--rule); padding-top: 1.75rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--mute); }
.footer-legal { display: flex; gap: 1.75rem; }

/* WhatsApp */
.wa-float { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; width: 3.5rem; height: 3.5rem; border-radius: 99px; background: #22c55e; color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .6); transition: background-color .2s; }
.wa-float:hover { background: #16a34a; }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .001ms !important; transition-delay: 0s !important; animation-duration: .001ms !important; }
    .hero-copy > *, .hero-caption { opacity: 1 !important; transform: none !important; }
}
