/* ============================================================
   Portfólio · Paulo Henrique de Almeida
   Tema escuro moderno
   ============================================================ */

:root {
    --bg:        #0d0f12;   /* fundo principal */
    --surface:   #16191f;   /* cards / superfícies */
    --border:    #262b33;   /* linhas e contornos */
    --text:      #e8eaed;   /* texto principal */
    --muted:     #9aa1ad;   /* texto secundário */
    --accent:    #7cf29c;   /* verde de destaque */
    --accent-ink:#0d0f12;   /* texto sobre o accent */

    --radius: 14px;
    --maxw: 1080px;

    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-head: 'Space Grotesk', 'Inter', sans-serif;
}

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

html { background: var(--bg); scroll-behavior: smooth; }

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

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

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

/* ---------- HEADER ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(13, 15, 18, 0.72);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-head);
    font-weight: 600;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.85rem;
    font-weight: 700;
}

.brand-name { font-size: 0.98rem; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 0.94rem;
}

.main-nav a { color: var(--muted); transition: color 0.2s ease; }
.main-nav a:hover { color: var(--text); }

.nav-cta {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); }

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

.hero-inner {
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.hero-text { flex: 1 1 560px; }

.hero-image { flex: 0 1 auto; }

.hero-image img {
    width: 480px;
    height: 480px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    -webkit-mask-image: radial-gradient(circle at center, #000 50%, transparent 100%);
    mask-image: radial-gradient(circle at center, #000 50%, transparent 100%);
}

.eyebrow {
    display: inline-block;
    margin: 0 0 18px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0 0 20px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.accent { color: var(--accent); }

.hero-lead {
    margin: 0 0 32px;
    max-width: 620px;
    font-size: 1.12rem;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 56px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text);
}
.stat-label { font-size: 0.85rem; color: var(--muted); }

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #93f7ac; }

.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- SECTIONS ---------- */
.section { padding: 80px 0; border-bottom: 1px solid var(--border); }
.page-top { padding-top: 64px; }

.section-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 40px;
}

.section-index {
    font-family: var(--font-head);
    font-size: 0.9rem;
    color: var(--accent);
}

.section-title {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    letter-spacing: -0.01em;
}

/* ---------- ABOUT ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.about-text { margin: 0; color: var(--muted); font-size: 1.02rem; }

/* ---------- SKILLS ---------- */
.skills-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.skill-card {
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    transition: border-color 0.2s ease, transform 0.15s ease;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-3px); }

/* ---------- PROJECTS ---------- */
.page-lead { margin: 0 0 40px; color: var(--muted); font-size: 1.05rem; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.18s ease;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-4px); }

.project-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1b2029, #12151a);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.05); }

.project-thumb-fallback {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 2.4rem;
    letter-spacing: 0.05em;
    color: var(--accent);
    opacity: 0.85;
}

.project-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
}

.project-index {
    font-family: var(--font-head);
    font-size: 0.85rem;
    color: var(--accent);
}

.project-title {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.3rem;
}

.project-desc { margin: 0; color: var(--muted); font-size: 0.95rem; }

.project-arrow {
    margin-top: auto;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.empty-state { color: var(--muted); }

/* ---------- TIMELINE / EXPERIENCE ---------- */
.timeline {
    list-style: none;
    margin: 0 0 48px;
    padding: 0;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 20px;
    padding-bottom: 36px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 22px;
    bottom: -4px;
    width: 1px;
    background: var(--border);
}
.timeline-item:last-child::before { display: none; }

.timeline-marker {
    width: 14px;
    height: 14px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    z-index: 1;
}

.timeline-period {
    display: block;
    font-size: 0.82rem;
    color: var(--accent);
    margin-bottom: 6px;
}

.timeline-role {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.15rem;
}

.timeline-company {
    margin: 2px 0 10px;
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 500;
}

.timeline-text { margin: 0; color: var(--muted); font-size: 0.98rem; }

.timeline-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    font-size: 0.98rem;
}

.timeline-list li { line-height: 1.45; }

/* ---------- INDUSTRIAL PROJECTS ---------- */
.industrial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.industrial-card {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, transform 0.15s ease;
}
.industrial-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}
.industrial-card-title {
    margin: 0 0 10px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}
.industrial-card-text {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ---------- EDUCATION ---------- */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.edu-card {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.edu-title {
    margin: 0 0 14px;
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 600;
}

.edu-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}
.edu-list li { line-height: 1.45; }

/* ---------- CONTACT ---------- */
.contact { border-bottom: none; }

.contact-card {
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.contact-lead {
    margin: 0 0 28px;
    font-family: var(--font-head);
    font-size: 1.35rem;
    font-weight: 500;
}

.contact-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.contact-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}
.contact-link:hover { border-color: var(--accent); }

.contact-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.contact-value { font-weight: 500; }

/* ---------- DETAIL ---------- */
.detail-wrap { max-width: 760px; }

.back-link {
    display: inline-block;
    margin-bottom: 32px;
    color: var(--muted);
    font-size: 0.92rem;
    transition: color 0.2s ease;
}
.back-link:hover { color: var(--accent); }

.detail-head { margin-bottom: 40px; }
.detail-title {
    margin: 12px 0 0;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.02em;
}

.detail-body { display: flex; flex-direction: column; gap: 32px; }

.detail-block {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.detail-block:last-child { border-bottom: none; }

.detail-label {
    margin: 0 0 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}
.detail-text { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* ---------- FOOTER ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.site-footer p { margin: 0; font-size: 0.9rem; }
.footer-muted { color: var(--muted); }

/* ---------- CHATBOT ---------- */
.chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
}

.chatbot-toggle {
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: var(--accent-ink);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chatbot-toggle-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(340px, calc(100vw - 48px));
    height: 440px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.chatbot-panel[hidden] {
    display: none;
}

.chatbot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-head);
    font-weight: 600;
}

.chatbot-header span { flex: 1; }

.chatbot-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px;
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-message-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chatbot-message-row-user { justify-content: flex-end; }

.chatbot-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 2px;
    flex-shrink: 0;
}

.chatbot-message {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.chatbot-message-bot {
    align-self: flex-start;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.chatbot-message-user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--accent-ink);
}

.chatbot-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--border);
}

.chatbot-input-row input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

.chatbot-input-row input:focus { outline: 2px solid var(--accent); }

.chatbot-send { padding: 10px 18px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
    .brand-name { display: none; }
    .main-nav { gap: 18px; }
    .hero { padding: 64px 0 56px; }
    .hero-inner { flex-direction: column-reverse; gap: 32px; text-align: center; }
    .hero-image img { width: 320px; height: 320px; }
    .hero-stats { grid-template-columns: 1fr; gap: 16px; }
    .about-grid { grid-template-columns: 1fr; }
    .chatbot { right: 16px; bottom: 16px; }
    .chatbot-panel { height: min(440px, calc(100vh - 120px)); }
    .contact-links { grid-template-columns: 1fr; }
    .contact-card { padding: 28px; }
}
