/* ============================================================
   Portfólio — Bruno Teixeira Sá Costa
   Desenvolvedor Full Stack Pleno
   ============================================================ */

:root {
  --bg: #0b1220;
  --bg-alt: #0e1626;
  --surface: #131d31;
  --surface-2: #18243c;
  --border: #20304d;
  --text: #e7edf6;
  --text-dim: #9fb0c8;
  --text-mute: #6c7d97;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --accent-3: #34d399;
  --danger: #f472b6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, .7);
  --maxw: 1140px;
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

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

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: .95rem;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn--primary {
  background: var(--gradient);
  color: #08121f;
  box-shadow: 0 10px 28px -12px rgba(56, 189, 248, .8);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(56, 189, 248, .9); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--block { width: 100%; }
.btn--lg { padding: 16px 34px; font-size: 1.05rem; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 18, 32, .72);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.is-scrolled { border-bottom-color: var(--border); background: rgba(11, 18, 32, .9); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.nav__logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--gradient);
  color: #08121f;
  border-radius: 9px;
  font-weight: 800;
}
.nav__name { font-size: 1rem; }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a { color: var(--text-dim); font-size: .95rem; font-weight: 500; transition: color .18s; position: relative; }
.nav__links a:not(.nav__cta)::after {
  content: ''; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--accent); transition: width .2s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover:not(.nav__cta)::after,
.nav__links a.is-active:not(.nav__cta)::after { width: 100%; }
.nav__links a.is-active:not(.nav__cta) { color: var(--text); }
.nav__cta {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--text) !important;
}
.nav__cta:hover { border-color: var(--accent); }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 150px 0 90px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(56, 189, 248, .16), transparent 60%),
    radial-gradient(700px 500px at 0% 20%, rgba(129, 140, 248, .14), transparent 55%);
}
.hero__inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .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__title { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.hero__role { margin-top: 14px; font-size: 1.35rem; font-weight: 600; color: var(--accent); }
.hero__desc { margin-top: 18px; color: var(--text-dim); font-size: 1.05rem; max-width: 560px; }
.hero__desc strong { color: var(--text); font-weight: 600; }
.hero__actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }

.hero__stats { margin-top: 44px; display: flex; gap: 36px; flex-wrap: wrap; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 1.7rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__stats span { font-size: .82rem; color: var(--text-mute); line-height: 1.3; margin-top: 2px; }

/* Hero code card */
.hero__visual { display: flex; justify-content: center; }
.code-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-6deg) rotateX(2deg);
  transition: transform .4s ease;
}
.code-card:hover { transform: perspective(1200px) rotateY(0) rotateX(0); }
.code-card__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.code-card__bar span { width: 11px; height: 11px; border-radius: 50%; background: #475569; }
.code-card__bar span:nth-child(1) { background: #f87171; }
.code-card__bar span:nth-child(2) { background: #fbbf24; }
.code-card__bar span:nth-child(3) { background: #34d399; }
.code-card__bar p { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--text-mute); }
.code-card__body { padding: 20px; font-family: 'JetBrains Mono', monospace; font-size: .82rem; line-height: 1.8; color: var(--text-dim); overflow-x: auto; }
.c-key { color: var(--accent-2); }
.c-cls { color: var(--accent-3); }
.c-fn { color: var(--accent); }
.c-str { color: #fbbf24; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 50%; color: var(--text-dim);
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* ---------- Sections ---------- */
.section { padding: 92px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__head { margin-bottom: 50px; max-width: 720px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__tag { font-family: 'JetBrains Mono', monospace; font-size: .82rem; color: var(--accent); letter-spacing: .05em; }
.section__title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin-top: 10px; letter-spacing: -.02em; }
.section__sub { margin-top: 14px; color: var(--text-dim); font-size: 1.02rem; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.about__text p { color: var(--text-dim); margin-bottom: 18px; }
.about__text strong { color: var(--text); font-weight: 600; }
.about__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.about__card h3 { font-size: 1.1rem; margin-bottom: 18px; }
.about__card dl div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.about__card dl div:last-of-type { border-bottom: none; }
.about__card dt { color: var(--text-mute); font-size: .88rem; }
.about__card dd { color: var(--text); font-size: .88rem; font-weight: 500; text-align: right; }
.about__card .btn { margin-top: 22px; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: transform .2s, border-color .2s; }
.skill-group:hover { transform: translateY(-4px); border-color: var(--accent); }
.skill-group--highlight { border-color: var(--accent-2); background: linear-gradient(160deg, rgba(129, 140, 248, .1), var(--surface)); position: relative; }
.skill-group--highlight::after { content: 'Diferencial'; position: absolute; top: 18px; right: 18px; font-size: .68rem; font-weight: 700; color: var(--accent-2); border: 1px solid var(--accent-2); padding: 3px 9px; border-radius: 999px; letter-spacing: .04em; }
.skill-group__icon { font-size: 1.8rem; margin-bottom: 12px; }
.skill-group h3 { font-size: 1.15rem; margin-bottom: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: .82rem; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px; }
.tags--sm li { font-size: .76rem; padding: 4px 10px; }

/* ---------- Projects ---------- */
.projects { display: flex; flex-direction: column; gap: 28px; }
.project {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}
.project:hover { transform: translateY(-4px); border-color: var(--accent); }
.project:nth-child(even) { grid-template-columns: 1.1fr .9fr; }
.project:nth-child(even) .project__media { order: 2; }

.project__media { min-height: 280px; display: grid; place-items: center; position: relative; overflow: hidden; }
.project__media--docs { background: radial-gradient(circle at 30% 30%, rgba(129, 140, 248, .35), transparent 60%), linear-gradient(160deg, #1a2440, #111a2e); }
.project__media--elite { background: radial-gradient(circle at 70% 30%, rgba(56, 189, 248, .35), transparent 60%), linear-gradient(160deg, #102233, #0e1626); }
.project__media--finance { background: radial-gradient(circle at 35% 25%, rgba(56, 189, 248, .28), transparent 55%), radial-gradient(circle at 82% 80%, rgba(129, 140, 248, .22), transparent 55%), linear-gradient(160deg, #111a30, #0e1626); }
.project__media--apostas { background: radial-gradient(circle at 50% 30%, rgba(52, 211, 153, .3), transparent 60%), linear-gradient(160deg, #102a24, #0e1626); }

.project__body { padding: 34px; }
.project__label { font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.project__title { font-size: 1.5rem; font-weight: 700; margin: 8px 0 14px; }
.project__desc { color: var(--text-dim); margin-bottom: 18px; }
.project__desc strong { color: var(--text); font-weight: 600; }
.project__features { display: grid; gap: 9px; margin-bottom: 20px; }
.project__features li { position: relative; padding-left: 24px; color: var(--text-dim); font-size: .92rem; }
.project__features li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-3); font-weight: 700; }
.project--feature { border-color: var(--accent-2); }

/* Decorative media: GED doc stack */
.doc-stack { position: relative; width: 150px; height: 170px; }
.doc-stack .doc { position: absolute; width: 110px; height: 140px; background: #f8fafc; border-radius: 6px; box-shadow: 0 12px 24px -10px rgba(0,0,0,.6); }
.doc-stack .doc::before, .doc-stack .doc::after { content: ''; position: absolute; left: 14px; right: 14px; height: 7px; border-radius: 3px; background: #cbd5e1; top: 22px; }
.doc-stack .doc::after { top: 40px; right: 40px; }
.doc-stack .doc:nth-child(1) { transform: rotate(-9deg) translate(-6px, 8px); }
.doc-stack .doc:nth-child(2) { transform: rotate(4deg) translate(20px, 2px); opacity: .92; }
.doc-stack .doc:nth-child(3) { transform: rotate(-2deg) translate(8px, -6px); }
.doc-stack__badge { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: var(--gradient); color: #08121f; font-weight: 800; font-size: .8rem; letter-spacing: .08em; padding: 6px 16px; border-radius: 999px; box-shadow: var(--shadow); }

/* Decorative media: Elite mockup */
.mockup { width: 230px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.mockup__bar { display: flex; gap: 5px; padding: 9px 12px; background: #0c1626; }
.mockup__bar span { width: 8px; height: 8px; border-radius: 50%; background: #475569; }
.mockup__screen { padding: 16px; }
.m-row--title { height: 14px; width: 60%; background: linear-gradient(90deg, var(--accent), transparent); border-radius: 4px; margin-bottom: 14px; }
.m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.m-card { height: 48px; background: #1c2942; border-radius: 6px; }
.m-btn { height: 26px; width: 90px; background: var(--gradient); border-radius: 6px; }

/* Decorative media: SaaS dashboard */
.dash { width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.dash__kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.dash__kpis span { height: 30px; border-radius: 6px; background: #1c2942; position: relative; overflow: hidden; }
.dash__kpis span::after { content: ''; position: absolute; left: 8px; top: 8px; width: 60%; height: 6px; border-radius: 3px; background: var(--accent); opacity: .7; }
.dash__kpis span:nth-child(2)::after { background: var(--accent-2); }
.dash__kpis span:nth-child(3)::after { background: var(--accent-3); }
.dash__chart { display: flex; align-items: flex-end; gap: 7px; height: 78px; padding: 0 2px; }
.dash__chart i { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(var(--accent), var(--accent-2)); }
.dash__line { height: 2px; margin-top: 12px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent); }

/* Decorative media: Apostas bet slip */
.betslip { width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.betslip__row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; margin-bottom: 7px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; color: var(--text-dim); }
.betslip__row b { color: var(--text); font-family: 'JetBrains Mono', monospace; }
.betslip__row--on { border-color: var(--accent-3); box-shadow: 0 0 0 2px rgba(52, 211, 153, .18); }
.betslip__row--on b { color: var(--accent-3); }
.betslip__stake { margin-top: 4px; text-align: center; font-size: .78rem; font-weight: 700; color: #08121f; background: var(--gradient); padding: 9px; border-radius: 8px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 760px; margin-inline: auto; padding-left: 34px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), var(--accent-2), transparent); }
.timeline__item { position: relative; padding-bottom: 30px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot { position: absolute; left: -34px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-alt); border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(56, 189, 248, .15); }
.timeline__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; transition: border-color .2s, transform .2s; }
.timeline__card:hover { border-color: var(--accent); transform: translateX(4px); }
.timeline__period { font-family: 'JetBrains Mono', monospace; font-size: .76rem; color: var(--accent-3); text-transform: uppercase; letter-spacing: .05em; }
.timeline__card h3 { font-size: 1.25rem; margin: 6px 0 2px; }
.timeline__role { color: var(--accent); font-weight: 600; font-size: .95rem; margin-bottom: 10px; }
.timeline__card p:not(.timeline__period):not(.timeline__role) { color: var(--text-dim); font-size: .95rem; margin-bottom: 14px; }
.timeline__card strong { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 40px 0 36px; max-width: 760px; margin-inline: auto; }
.contact__item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .2s, border-color .2s; }
.contact__item:hover { transform: translateY(-4px); border-color: var(--accent); }
.contact__ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); font-size: 1.2rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.contact__item strong { font-size: 1rem; }
.contact__item span { font-size: .82rem; color: var(--text-mute); word-break: break-all; }

/* ---------- Footer ---------- */
.footer { padding: 34px 0; border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer p { color: var(--text-mute); font-size: .88rem; }
.footer__made { font-family: 'JetBrains Mono', monospace; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__visual { order: -1; }
  .code-card { transform: none; }
  .about { grid-template-columns: 1fr; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .project, .project:nth-child(even) { grid-template-columns: 1fr; }
  .project:nth-child(even) .project__media { order: 0; }
  .contact__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav__links {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    padding: 12px 24px 22px;
    transform: translateY(-120%); transition: transform .3s ease;
    box-shadow: var(--shadow);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .nav__links a:last-child { border-bottom: none; }
  .nav__cta { text-align: center; margin-top: 10px; }
  .nav__toggle { display: flex; }
  .hero { padding-top: 120px; }
  .hero__stats { gap: 24px; }
}

@media (max-width: 520px) {
  .skills, .contact__grid { grid-template-columns: 1fr; }
  .project__body, .about__card { padding: 24px; }
  .section { padding: 70px 0; }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; transition: none !important; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
