/* =========================================================
   Anderson Martins — Portfólio | tema dark + neon/glow
   ========================================================= */

:root {
    --bg: #05060a;
    --bg-alt: #0a0d16;
    --surface: #0e1220;
    --surface-border: rgba(0, 240, 255, 0.14);
    --text: #e7ecf7;
    --muted: #8b93a7;
    --cyan: #00f0ff;
    --purple: #a855f7;
    --gradient: linear-gradient(120deg, var(--cyan), var(--purple));
    --glow-cyan: 0 0 24px rgba(0, 240, 255, 0.35);
    --glow-purple: 0 0 24px rgba(168, 85, 247, 0.35);
    --radius: 14px;
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }

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

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

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Fundo de grade animado sutil */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.055) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: rgba(5, 6, 10, 0.72);
    border-bottom: 1px solid var(--surface-border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.logo .dot { color: var(--cyan); }
.logo-caret {
    color: var(--purple);
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.main-nav a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    color: var(--muted);
    transition: color 0.2s, background 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--text);
    background: rgba(0, 240, 255, 0.08);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    cursor: pointer;
}

.nav-toggle span {
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--text);
    transition: transform 0.2s, opacity 0.2s;
}

/* ---------- Botões ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
    background: var(--gradient);
    color: #05060a;
}

.btn-primary:hover { box-shadow: var(--glow-cyan); }

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--surface-border);
}

.btn-outline:hover {
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-danger { background: #ef4444; color: #fff; }

/* ---------- Hero ---------- */
.hero {
    padding: 96px 0 64px;
    text-align: center;
}

.hero .eyebrow {
    font-family: var(--font-mono);
    color: var(--cyan);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1.1;
    margin: 0 0 20px;
}

.hero h1 .accent {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero h1 .outline {
    -webkit-text-stroke: 1.5px rgba(231, 236, 247, 0.55);
    color: transparent;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px 7px 12px;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 24px;
}

.rotator {
    display: inline-block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.rotator--out {
    opacity: 0;
    transform: translateY(4px);
}

.status-pill .dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 rgba(52, 211, 153, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero p.lead {
    max-width: 640px;
    margin: 0 auto 32px;
    color: var(--muted);
    font-size: 1.1rem;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Marquee (faixa de tecnologias) ---------- */
.marquee {
    border-top: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
    overflow: hidden;
    white-space: nowrap;
    padding: 18px 0;
    background: var(--surface);
}

.marquee__track {
    display: inline-flex;
    align-items: center;
    gap: 40px;
    animation: marquee 28s linear infinite;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__track span {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    color: var(--muted);
}

.marquee__track span.sep { color: var(--cyan); }

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .marquee__track { animation: none; }
}

/* ---------- Seções ---------- */
.section { padding: 64px 0; }
.section-head { margin-bottom: 40px; text-align: center; }

.section-head .eyebrow {
    font-family: var(--font-mono);
    color: var(--purple);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 8px 0 0; }

/* ---------- Cards / grids ---------- */
.grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
    background: linear-gradient(180deg, var(--surface), rgba(14, 18, 32, 0.4));
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 12px 32px rgba(0, 240, 255, 0.12);
}

.card-cover {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(168, 85, 247, 0.12));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.card-cover img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.15rem; }
.card-body p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

.tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--surface-border);
    color: var(--cyan);
}

.card-links { display: flex; gap: 12px; padding: 0 22px 22px; }
.card-links a { font-size: 0.85rem; color: var(--cyan); }
.card-links a:hover { text-decoration: underline; }

/* ---------- Timeline (experiência) ---------- */
.timeline {
    position: relative;
    margin: 0 auto;
    max-width: 760px;
    padding-left: 28px;
    border-left: 1px solid var(--surface-border);
}

.timeline-item { position: relative; padding-bottom: 36px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -33px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: var(--glow-cyan);
}

.timeline-item .period {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-item .idx {
    color: var(--purple);
    font-weight: 600;
}

.timeline-item h3 { margin: 4px 0 2px; font-size: 1.05rem; }
.timeline-item .org { color: var(--purple); font-size: 0.9rem; margin-bottom: 6px; }
.timeline-item p { color: var(--muted); margin: 0; }

/* ---------- Skills ---------- */
.skills-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Formulários ---------- */
.form-group { margin-bottom: 20px; text-align: left; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--muted);
    font-family: var(--font-mono);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

textarea.form-control { resize: vertical; min-height: 140px; }

.form-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    padding: 32px;
}

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 0.92rem;
}

.alert-success { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.alert-error { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--surface-border);
    padding: 48px 0 24px;
    margin-top: 64px;
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-links { display: flex; gap: 20px; align-items: center; }
.footer-links a:hover { color: var(--cyan); }

/* ---------- Página de detalhe ---------- */
.detail-hero { padding: 56px 0 32px; text-align: center; }
.detail-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 12px 0; }
.detail-cover {
    max-width: var(--max-width);
    margin: 0 auto 40px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--surface-border);
    aspect-ratio: 21 / 9;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.prose {
    max-width: 760px;
    margin: 0 auto;
    color: #cdd4e4;
}

.prose p { margin: 0 0 18px; }
.prose h2, .prose h3 { margin-top: 36px; }

.prose blockquote {
    margin: 28px 0;
    padding: 4px 0 4px 20px;
    border-left: 2px solid var(--cyan);
    color: var(--text);
    font-style: italic;
}

.prose blockquote p { margin: 0; }
.prose ul, .prose ol { color: #cdd4e4; padding-left: 22px; margin: 0 0 18px; }
.prose strong { color: var(--text); }

.prose h3 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
    color: var(--cyan);
    margin-bottom: 12px;
}

.duotone {
    filter: grayscale(1) brightness(0.9) contrast(1.1);
    position: relative;
}

.duotone::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(168, 85, 247, 0.35));
    mix-blend-mode: color;
}

.about-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 48px;
    align-items: start;
    max-width: 900px;
    margin: 0 auto;
}

.sticky-photo {
    position: sticky;
    top: 96px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 24px;
    align-items: start;
}

.contact-card .card-body { align-items: center; text-align: center; }

.contact-card__avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--surface-border);
    margin: 4px auto 4px;
}

.contact-card__avatar img { width: 100%; height: 100%; object-fit: cover; }

.contact-card__links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.contact-card .link-pill { padding: 12px 16px; font-size: 0.9rem; }
.contact-card .link-pill__icon { width: 19px; height: 19px; }

@media (max-width: 640px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .about-grid .sticky-photo {
        position: static;
        width: min(78vw, 320px);
        margin: 0 auto;
        will-change: width;
    }

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

    .two-col {
        grid-template-columns: 1fr !important;
    }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 24px;
}
.back-link:hover { color: var(--cyan); }

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--muted);
    font-family: var(--font-mono);
}

/* ---------- Página de links (estilo "linktree") ---------- */
.links-body { min-height: 100vh; }

.links-page {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    padding: 64px 24px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.links-avatar {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--surface-border);
    margin-bottom: 20px;
    box-shadow: var(--glow-cyan);
}

.links-avatar img { width: 100%; height: 100%; object-fit: cover; }

.links-name {
    font-size: 1.5rem;
    margin: 0 0 6px;
}

.links-name .dot { color: var(--cyan); }

.links-tagline {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 320px;
    margin: 0 0 36px;
}

.links-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.link-pill {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    color: var(--text);
    font-weight: 600;
    transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}

.link-pill:hover {
    transform: translateY(-2px);
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

.link-pill__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--cyan);
}

.link-pill__icon svg { width: 100%; height: 100%; }

.links-back {
    margin-top: 40px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.links-back:hover { color: var(--cyan); }

/* ---------- Admin ---------- */
.admin-body { background: var(--bg-alt); }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--surface-border);
    padding: 24px 16px;
}

.admin-sidebar .logo { display: block; margin-bottom: 32px; padding-left: 8px; }

.admin-sidebar nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    background: rgba(0, 240, 255, 0.08);
    color: var(--text);
}

.badge {
    background: var(--purple);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
}

.admin-main { flex: 1; padding: 32px 40px; max-width: 1100px; }

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.admin-topbar h1 { margin: 0; font-size: 1.5rem; }

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

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

.stat-card .value { font-size: 2rem; font-family: var(--font-mono); color: var(--cyan); }
.stat-card .label { color: var(--muted); font-size: 0.85rem; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-table th, .admin-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface-border);
    font-size: 0.9rem;
}

.admin-table th { color: var(--muted); font-family: var(--font-mono); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .actions { display: flex; gap: 8px; }

/* ---------- Editor rico (Quill) ---------- */
.ql-toolbar.ql-snow {
    background: var(--surface);
    border-color: var(--surface-border) !important;
    border-radius: 10px 10px 0 0;
}

.ql-container.ql-snow {
    border-color: var(--surface-border) !important;
    border-radius: 0 0 10px 10px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    background: #0b0e19;
    min-height: 260px;
}

.ql-editor { color: var(--text); min-height: 260px; }
.ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }

.ql-snow .ql-stroke { stroke: var(--muted); }
.ql-snow .ql-fill { fill: var(--muted); }
.ql-snow .ql-picker { color: var(--muted); }

.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke { stroke: var(--cyan); }

.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--cyan); }

.ql-snow .ql-picker-options {
    background: var(--surface);
    border-color: var(--surface-border) !important;
}

.ql-editor img { border-radius: 8px; margin: 12px 0; }
.ql-editor h2, .ql-editor h3 { color: var(--text); }
.ql-editor a { color: var(--cyan); }

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; }

@media (max-width: 860px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; align-items: center; justify-content: space-between; }
    .admin-sidebar nav { display: flex; gap: 4px; }
    .admin-sidebar nav a span.badge { display: none; }
    .admin-main { padding: 24px; }
}

[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        height: calc(100vh - 72px);
        height: calc(100dvh - 72px);
        background: rgba(5, 6, 10, 0.98);
        transform: translateY(-110%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }
    .main-nav.open { transform: translateY(0); }
    .main-nav ul { flex-direction: column; padding: 24px; gap: 4px; }
    .main-nav a { display: block; padding: 14px; }
    .nav-toggle { display: flex; }
}
