/* ==========================================================================
   williandiniz.com
   ========================================================================== */

:root {
    --bg: #f6f7fb;
    --bg-alt: #eef1f7;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #586174;
    --border: #e1e6ef;
    --accent: #0d9488;
    --accent-2: #2563eb;
    --accent-soft: rgba(13, 148, 136, .1);
    --grad: linear-gradient(120deg, #0d9488 0%, #2563eb 100%);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, .12);
    --radius: 18px;
    --radius-sm: 10px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-head: "Sora", var(--font);
    --nav-h: 68px;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0a0f1e;
    --bg-alt: #0e1528;
    --surface: #121b31;
    --text: #e7ebf3;
    --muted: #9aa5bb;
    --border: #1f2b46;
    --accent: #2dd4bf;
    --accent-2: #60a5fa;
    --accent-soft: rgba(45, 212, 191, .12);
    --grad: linear-gradient(120deg, #2dd4bf 0%, #60a5fa 100%);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .45);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color .3s, color .3s;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

.container { width: min(1160px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prose p:last-child { margin-bottom: 0; }
.prose { color: var(--muted); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Botões / chips ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .5em;
    padding: .8em 1.4em; border-radius: 999px; font-weight: 600; font-size: .95rem;
    text-decoration: none; border: 1px solid transparent; cursor: pointer;
    transition: transform .2s, box-shadow .2s, background-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .25); }
[data-theme="dark"] .btn--primary { color: #04121a; }
.btn--ghost { border-color: var(--border); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); }
.btn .icon { transition: transform .2s; }
.btn:hover .icon { transform: translateX(3px); }

.icon-btn {
    display: inline-grid; place-items: center; width: 42px; height: 42px;
    border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
    transition: border-color .2s;
}
.icon-btn:hover { border-color: var(--accent); }

.badge {
    display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
    padding: .25em .75em; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
    margin-bottom: .75rem;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1rem; }
.tags li {
    font-size: .78rem; padding: .3em .7em; border-radius: 8px;
    border: 1px solid var(--border); color: var(--muted); background: var(--bg);
}
.tags--soft li { background: transparent; }

/* ---------- Navegação ---------- */
.nav {
    position: sticky; top: 0; z-index: 50; height: var(--nav-h);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 600; }
.nav__logo {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    background: var(--grad); color: #fff; font-size: .85rem; font-weight: 700;
}
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
    text-decoration: none; font-size: .93rem; font-weight: 500; color: var(--muted);
    padding: .5em .9em; border-radius: 999px; transition: color .2s, background-color .2s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: var(--accent-soft); }
.nav__links .nav__cta { color: var(--accent); }
.nav__actions { display: flex; gap: 8px; }
.nav__toggle { display: none; }
.icon--sun { display: none; }
[data-theme="dark"] .icon--sun { display: block; }
[data-theme="dark"] .icon--moon { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 9vw, 110px) 0 clamp(56px, 9vw, 110px); }
.hero__bg {
    position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(600px 400px at 85% 20%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%),
        radial-gradient(500px 380px at 10% 80%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.hero__bg::after {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 44px 44px; opacity: .45;
    mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}
.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 500;
    padding: .4em .9em; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.hero h1 { margin-top: .6em; }
.hero__title { font-family: var(--font-head); font-size: clamp(1.15rem, 2.2vw, 1.4rem); font-weight: 500; margin-bottom: .7em; }
.hero__lead { color: var(--muted); font-size: 1.05rem; max-width: 56ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.8rem 0 1.6rem; }
.socials { display: flex; gap: 10px; }
.socials a {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: color .2s, border-color .2s, transform .2s;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.hero__visual { position: relative; justify-self: center; width: min(400px, 100%); }
.avatar {
    position: relative; aspect-ratio: 1; border-radius: 36% 64% 58% 42% / 44% 40% 60% 56%;
    background: var(--grad); padding: 6px; box-shadow: var(--shadow-lg);
    animation: morph 12s ease-in-out infinite;
}
.avatar img, .avatar__initials { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar__initials {
    display: grid; place-items: center; background: var(--surface);
    font-family: var(--font-head); font-size: clamp(4rem, 12vw, 7rem); font-weight: 700;
}
.avatar__initials { color: var(--accent); }
@keyframes morph {
    50% { border-radius: 58% 42% 38% 62% / 52% 60% 40% 48%; }
}
.chip {
    position: absolute; display: flex; align-items: center; gap: 8px;
    padding: .55em .95em; border-radius: 14px; font-size: .85rem; font-weight: 600; white-space: nowrap;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
    animation: float 6s ease-in-out infinite;
}
.chip .icon { color: var(--accent); }
.chip--a { top: 8%; left: -10%; }
.chip--b { top: 48%; right: -4%; animation-delay: -2s; }
.chip--c { bottom: 4%; left: 2%; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Seções ---------- */
.section { padding: clamp(64px, 10vw, 112px) 0; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 680px; margin-bottom: clamp(32px, 5vw, 52px); }
.kicker {
    display: inline-flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: .8em;
}
.kicker::before { content: ""; width: 24px; height: 2px; background: var(--grad); border-radius: 2px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 3vw, 28px); box-shadow: var(--shadow); }

/* ---------- Sobre ---------- */
.about { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.about .prose { font-size: 1.04rem; }
.about__photo { border-radius: var(--radius); margin-bottom: 16px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 20px; box-shadow: var(--shadow);
}
.stat strong { display: block; font-family: var(--font-head); font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.1; }
.stat strong { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: .88rem; color: var(--muted); }

/* ---------- Carreira ---------- */
.career { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.timeline { position: relative; display: grid; gap: 20px; }
.timeline::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 2px; background: var(--border); }
.timeline__item { position: relative; padding-left: 64px; }
.timeline__icon {
    position: absolute; left: 0; top: 18px; display: grid; place-items: center;
    width: 44px; height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
    color: var(--accent); box-shadow: var(--shadow);
}
.timeline .card h3 { margin-bottom: .2em; font-size: 1.25rem; }
.timeline .card .muted { margin-bottom: .8em; font-size: .93rem; }

.edu { position: sticky; top: calc(var(--nav-h) + 20px); }
.edu__title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.edu__title .icon { color: var(--accent); }
.edu__list { display: grid; gap: 12px; }
.edu__item {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px;
}
.edu__item strong { display: block; line-height: 1.35; }
.edu__level { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 2px; }
.status { flex: none; font-size: .72rem; font-weight: 600; padding: .25em .7em; border-radius: 999px; background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border); }
.status--live { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: clamp(40px, 6vw, 64px); }
.skill { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: transform .25s, border-color .25s; }
.skill:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.skill__icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.skill .tags { margin-top: .6rem; }

/* ---------- Projetos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
    padding: .5em 1.1em; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
    font-size: .9rem; font-weight: 500; cursor: pointer; color: var(--muted); transition: all .2s;
}
.filter:hover { color: var(--text); border-color: var(--accent); }
.filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.project { display: flex; }
.project.is-hidden { display: none; }
.project--featured { grid-column: span 2; grid-row: span 2; }
.project__open {
    display: flex; flex-direction: column; width: 100%; text-align: left; padding: 0; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s, border-color .3s;
}
.project__open:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.project__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-alt); }
.project--featured .project__media { aspect-ratio: auto; flex: 1; min-height: 240px; }
.project--featured .project__body h3 { font-size: 1.5rem; }
.project--featured .project__body p { font-size: 1.02rem; }
.project__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.project__open:hover .project__media img { transform: scale(1.05); }
.project__placeholder {
    position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent);
    background:
        radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
        radial-gradient(circle at 75% 70%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 60%),
        var(--bg-alt);
}
.project__placeholder .icon { width: 64px; height: 64px; stroke-width: 1.3; transition: transform .4s; }
.project__open:hover .project__placeholder .icon { transform: scale(1.1) rotate(-4deg); }
.project__cat {
    position: absolute; top: 12px; left: 12px; font-size: .74rem; font-weight: 600; padding: .3em .75em;
    border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--border);
}
.project__body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.project__body h3 { font-size: 1.2rem; margin-bottom: .35em; }
.project__body p { color: var(--muted); font-size: .95rem; margin: 0; }
.project__body .tags { margin-bottom: 1rem; }
.project__more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--accent); }
.project__more .icon { transition: transform .2s; }
.project__open:hover .project__more .icon { transform: translateX(4px); }

/* ---------- Modal ---------- */
.modal {
    padding: 0; border: 0; background: transparent; color: var(--text);
    width: min(640px, calc(100% - 32px)); max-height: calc(100% - 48px);
}
.modal::backdrop { background: rgba(5, 10, 20, .6); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal__box { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.modal__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.modal__content { padding: 28px; }
.modal__content h3 { font-size: 1.6rem; }
.modal__content .btn { margin-top: 1.4rem; }
.modal__close { position: absolute; top: 12px; right: 12px; z-index: 2; }

/* ---------- Hobbies ---------- */
.hobbies { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.hobby {
    position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--surface); box-shadow: var(--shadow); min-height: 300px; display: flex;
}
.hobby__body { position: relative; padding: clamp(24px, 4vw, 36px); display: flex; flex-direction: column; justify-content: flex-end; width: 100%; }
.hobby:not(.hobby--img) .hobby__body { justify-content: flex-start; }
.hobby:not(.hobby--img)::after {
    content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%;
    background: var(--grad); opacity: .12; filter: blur(4px);
}
.hobby--img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.hobby--img:hover > img { transform: scale(1.04); }
.hobby--img .hobby__body { background: linear-gradient(to top, rgba(5, 10, 20, .88) 10%, rgba(5, 10, 20, .2) 70%, transparent); color: #fff; min-height: 360px; }
.hobby--img .prose { color: rgba(255, 255, 255, .85); }
.hobby__icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.hobby--img .hobby__icon { background: rgba(255, 255, 255, .15); color: #fff; backdrop-filter: blur(6px); }
.hobby__highlight { font-family: var(--font-head); font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 700; margin: 0 0 .1em; line-height: 1.1; }
.hobby:not(.hobby--img) .hobby__highlight { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hobby h3 { font-size: 1.3rem; }

/* ---------- Contato ---------- */
.contact { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact__links { display: grid; gap: 10px; margin-top: 1.5rem; }
.contact__links a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); font-weight: 500; transition: color .2s; }
.contact__links a:hover { color: var(--accent); }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; }
.field input, .field textarea {
    font: inherit; font-size: 1rem; color: var(--text); background: var(--bg); width: 100%;
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8em 1em; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form .btn { justify-self: start; }
.form .btn:disabled { opacity: .6; cursor: wait; }
.form__status { margin: 0; font-size: .92rem; min-height: 1.4em; }
.form__status.is-ok { color: #16a34a; }
.form__status.is-error { color: #dc2626; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Rodapé ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .9rem; color: var(--muted); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ---------- Animação ao rolar ---------- */
.intro { animation: intro .8s ease-out both; }
.intro--late { animation-delay: .15s; }
@keyframes intro { from { opacity: 0; transform: translateY(18px); } }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
    .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) {
    .projects { grid-template-columns: repeat(2, 1fr); }
    .project--featured { grid-row: auto; }
    .project--featured .project__media { aspect-ratio: 21 / 9; flex: none; min-height: 0; }
    .skills { grid-template-columns: repeat(2, 1fr); }
    .career { grid-template-columns: 1fr; }
    .edu { position: static; }
}

@media (max-width: 820px) {
    .nav__toggle { display: inline-grid; }
    .nav__links {
        position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 4px;
        padding: 12px 16px 20px; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
        transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .25s;
    }
    .nav__links.is-open { transform: none; opacity: 1; visibility: visible; }
    .nav__links a { padding: .8em 1em; border-radius: 12px; }
    .hero__inner, .about, .contact { grid-template-columns: 1fr; }
    .hero__visual { order: -1; width: min(280px, 72%); }
    .chip { font-size: .75rem; }
    .chip--a { left: -16%; }
    .chip--b { right: -10%; }
    .hobbies { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .projects, .skills { grid-template-columns: 1fr; }
    .project--featured { grid-column: auto; }
    .project--featured .project__media { aspect-ratio: 16 / 9; }
    .nav__brand span:last-child { display: none; }
    .timeline::before { left: 17px; }
    .timeline__item { padding-left: 50px; }
    .timeline__icon { width: 36px; height: 36px; border-radius: 11px; }
    .modal__content { padding: 22px; }
}
