:root {
  --bg: #111317;
  --bg-soft: #1a1f25;
  --paper: #f7f4ee;
  --paper-strong: #ffffff;
  --ink: #171717;
  --muted: #6d747d;
  --line: rgba(255,255,255,.16);
  --gold: #d89a2f;
  --gold-light: #f4c76a;
  --green: #2f7f6f;
  --teal: #3d8fa6;
  --danger: #c84747;
  --radius: 8px;
  --shadow: 0 22px 60px rgba(0,0,0,.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--paper);
  background: var(--bg);
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(17,19,23,.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; }
.brand__mark { width: 42px; height: 42px; }
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  font-size: .83rem;
  font-weight: 700;
  text-transform: uppercase;
}
.site-nav a { position: relative; color: rgba(247,244,238,.78); }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0;
  height: 2px;
  background: var(--gold-light);
  transition: width .25s ease;
}
.site-nav a:hover { color: var(--paper); }
.site-nav a:hover::after { width: 100%; }
.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.06);
  color: var(--paper);
  cursor: pointer;
}
.menu-button span { display: block; width: 20px; height: 2px; margin: 5px auto; background: currentColor; }

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: center;
  padding: 132px clamp(18px, 7vw, 90px) 72px;
  overflow: hidden;
}
.hero__bg, .hero__overlay { position: absolute; inset: 0; }
.hero__bg {
  background-image: url("../img/gabriel-alves.png");
  background-position: center right 16%;
  background-size: min(850px, 78vw);
  background-repeat: no-repeat;
  filter: saturate(.95);
}
.hero__overlay {
  background:
    linear-gradient(90deg, rgba(17,19,23,.98) 0%, rgba(17,19,23,.84) 42%, rgba(17,19,23,.3) 100%),
    radial-gradient(circle at 78% 32%, rgba(216,154,47,.28), transparent 34%),
    linear-gradient(135deg, rgba(47,127,111,.35), transparent 48%);
}
.hero__content { position: relative; z-index: 2; width: min(760px, 100%); }
.eyebrow { margin: 0 0 14px; color: var(--gold-light); font-size: .82rem; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 18px; font-size: clamp(3rem, 9vw, 6.7rem); line-height: .93; letter-spacing: 0; }
h2 { color: inherit; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1; letter-spacing: 0; }
h3 { font-size: 1.25rem; line-height: 1.2; }
.hero__subtitle { min-height: 34px; margin-bottom: 18px; color: var(--gold-light); font-size: clamp(1.1rem, 2.3vw, 1.55rem); font-weight: 800; }
.typing-cursor { display: inline-block; width: 2px; height: 1em; margin-left: 5px; background: currentColor; animation: blink .8s infinite; vertical-align: -.15em; }
.hero__copy { width: min(620px, 100%); margin-bottom: 34px; color: rgba(247,244,238,.84); font-size: 1.08rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button--primary { color: #14110a; background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
.button--ghost { color: var(--paper); border-color: var(--line); background: rgba(255,255,255,.08); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats article { padding: clamp(24px, 4vw, 42px); background: var(--bg-soft); text-align: center; }
.stats strong { display: block; color: var(--gold-light); font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1; }
.stats span { color: rgba(247,244,238,.72); font-weight: 700; }

.section { padding: clamp(64px, 9vw, 108px) clamp(18px, 6vw, 82px); background: var(--bg); }
.section--light { color: var(--ink); background: var(--paper); }
.section__heading { width: min(830px, 100%); margin-bottom: 38px; }
.section__heading h2 { margin-bottom: 0; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 430px); gap: clamp(28px, 5vw, 58px); align-items: center; }
.about-grid p { color: #3e454c; font-size: 1.05rem; }
.profile-panel { overflow: hidden; border-radius: var(--radius); background: var(--paper-strong); box-shadow: 0 20px 55px rgba(17,19,23,.12); }
.profile-panel img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; }
.profile-panel div { display: flex; justify-content: space-between; gap: 16px; padding: 18px; color: var(--ink); }
.profile-panel span { color: var(--muted); font-weight: 700; }

.cards-grid, .project-grid, .social-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.service-card, .project-card, .social-card { border-radius: var(--radius); transition: transform .2s ease, box-shadow .2s ease; }
.service-card { min-height: 245px; padding: 28px; border: 1px solid var(--line); background: #171b20; }
.service-card:hover, .project-card:hover, .social-card:hover { transform: translateY(-4px); }
.service-card span { display: inline-flex; margin-bottom: 32px; color: var(--gold-light); font-weight: 900; }
.service-card p { color: rgba(247,244,238,.72); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.filter-button {
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid rgba(17,19,23,.14);
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}
.filter-button.is-active { color: #111317; background: var(--gold-light); border-color: var(--gold-light); }
.project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project-card { min-height: 240px; padding: 26px; color: var(--ink); background: var(--paper-strong); border: 1px solid rgba(17,19,23,.1); box-shadow: 0 16px 42px rgba(17,19,23,.08); }
.project-card.is-hidden { display: none; }
.project-card__top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 42px; color: var(--muted); font-size: .85rem; font-weight: 800; }
.project-card__top strong { color: var(--green); }
.project-card p { color: #4e565f; }

.social-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.social-card { overflow: hidden; min-height: 285px; border: 1px solid var(--line); background: #171b20; box-shadow: var(--shadow); }
.social-card__browser { display: flex; gap: 8px; padding: 14px; background: rgba(255,255,255,.08); }
.social-card__browser span { width: 11px; height: 11px; border-radius: 50%; background: var(--gold-light); }
.social-card__browser span:nth-child(2) { background: var(--teal); }
.social-card__browser span:nth-child(3) { background: #d66666; }
.social-card__content { padding: clamp(24px, 4vw, 38px); }
.social-card small { display: block; margin-bottom: 18px; color: var(--gold-light); font-weight: 900; text-transform: uppercase; }
.social-card strong { display: block; margin-bottom: 16px; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.1; overflow-wrap: anywhere; }
.social-card p { color: rgba(247,244,238,.72); }
.social-card--instagram { background: linear-gradient(145deg, rgba(216,154,47,.22), transparent 48%), #171b20; }
.social-card--github { background: linear-gradient(145deg, rgba(61,143,166,.26), transparent 50%), #171b20; }

.section--contact { color: var(--ink); background: linear-gradient(135deg, rgba(47,127,111,.12), rgba(216,154,47,.16)), var(--paper); }
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; width: min(980px, 100%); }
.form-row { display: grid; gap: 8px; }
.form-row--full { grid-column: 1 / -1; }
.form-row label { font-weight: 800; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  border: 1px solid rgba(17,19,23,.2);
  border-radius: var(--radius);
  padding: 14px 15px;
  color: var(--ink);
  background: var(--paper-strong);
  outline: none;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(47,127,111,.14); }
.error-message { min-height: 18px; color: var(--danger); font-weight: 700; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.site-footer { padding: 26px clamp(18px, 5vw, 64px); color: rgba(247,244,238,.65); background: #0c0e11; text-align: center; }
.site-footer p { margin: 0; }

.back-to-top, .toast { position: fixed; z-index: 30; }
.back-to-top {
  right: 18px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: var(--radius);
  color: #111317;
  background: var(--gold-light);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.toast {
  left: 50%;
  bottom: 24px;
  max-width: min(92vw, 460px);
  padding: 14px 18px;
  border-radius: var(--radius);
  color: var(--paper);
  background: #171b20;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .25s ease, transform .25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

@media (max-width: 980px) {
  .menu-button { display: block; }
  .site-nav {
    position: absolute;
    top: 79px;
    left: 18px;
    right: 18px;
    display: grid;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(17,19,23,.98);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease;
  }
  .site-nav.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .site-nav a { padding: 13px 10px; }
  .hero { min-height: 820px; align-items: end; }
  .hero__bg { background-position: center top 84px; background-size: min(620px, 112vw); }
  .hero__overlay { background: linear-gradient(0deg, rgba(17,19,23,.98) 0%, rgba(17,19,23,.8) 42%, rgba(17,19,23,.18) 100%), radial-gradient(circle at 50% 24%, rgba(216,154,47,.25), transparent 36%); }
  .about-grid, .cards-grid, .project-grid, .social-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .site-header { padding: 14px 16px; }
  .brand span { display: none; }
  .hero { min-height: 760px; padding: 112px 18px 48px; }
  h1 { font-size: clamp(2.75rem, 17vw, 4.8rem); }
  .hero__copy { font-size: 1rem; }
  .hero__actions, .button { width: 100%; }
  .stats, .about-grid, .cards-grid, .project-grid, .social-grid, .contact-form { grid-template-columns: 1fr; }
  .profile-panel div { display: grid; }
  .section { padding: 58px 18px; }
}
