:root {
  --bg: #08050f;
  --bg-soft: #120b1e;
  --card: rgba(25, 17, 40, 0.78);
  --card-strong: #171022;
  --purple: #6f42c1;
  --purple-2: #8a63d2;
  --purple-soft: #b79af0;
  --purple-dark: #2b1a44;
  --text: #f8f4ff;
  --muted: #b9adc9;
  --muted-2: #8f82a3;
  --line: rgba(255, 255, 255, 0.11);
  --line-purple: rgba(183, 154, 240, 0.26);
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 14% 8%, rgba(111, 66, 193, 0.24), transparent 34%),
    radial-gradient(circle at 88% 20%, rgba(83, 50, 148, 0.24), transparent 30%),
    linear-gradient(135deg, #07040c 0%, #10091c 46%, #08050f 100%);
}

.page-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.20;
  background-image:
    linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 78%);
}

.container {
  width: min(1160px, calc(100% - 44px));
  margin: 0 auto;
}

.section-padding {
  padding: 98px 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(8, 5, 15, 0.72);
  backdrop-filter: blur(18px);
}

.navbar {
  width: min(1160px, calc(100% - 44px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-text {
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
}

.nav-links a,
.lang-switch {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0 13px;
  transition: 0.25s ease;
}

.nav-links a svg,
.btn svg,
.eyebrow svg,
.quick-facts svg,
.contact-links svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.055);
}

.lang-switch {
  border: 1px solid var(--line-purple);
  background: rgba(111, 66, 193, 0.14);
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
  font-family: inherit;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  display: block;
  margin: 4px auto;
  background: var(--text);
  border-radius: 10px;
  transition: 0.25s ease;
}

h1,
h2,
h3 {
  line-height: 1.06;
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

h3 {
  font-size: 1.18rem;
}

.hero {
  position: relative;
  overflow: hidden;
  padding-top: 92px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.78fr);
  align-items: center;
  gap: 70px;
  position: relative;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ddd0f4;
  background: rgba(111, 66, 193, 0.14);
  border: 1px solid var(--line-purple);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 800;
  margin-bottom: 18px;
}

.hero-greeting {
  display: block;
  margin-bottom: 8px;
  color: var(--purple-soft);
  font-size: 1.06rem;
  font-weight: 850;
}

.hero-title {
  max-width: 880px;
  min-height: 1.15em;
  font-size: clamp(3.1rem, 7.4vw, 6.15rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
  font-weight: 900;
}

.hero-title-fixed,
.typed-text {
  white-space: nowrap;
}

.typed-text {
  display: inline-block;
  min-width: 13ch;
  color: var(--purple-2);
}

.hero-content p,
.about-text p,
.contact-card p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.78;
  max-width: 680px;
}

.hero-content p {
  margin-top: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 900;
  transition: transform 0.25s ease, border 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--purple), #4b2d78);
  box-shadow: 0 20px 40px rgba(111, 66, 193, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 26px 54px rgba(111, 66, 193, 0.32);
}

.btn-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.hero-panel {
  width: min(100%, 640px);
  margin-top: 38px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.035);
  box-shadow: var(--shadow);
}

.panel-line {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.075);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
}

.panel-line:last-child {
  border-bottom: 0;
}

.panel-line span {
  color: var(--muted-2);
}

.panel-line strong {
  color: var(--text);
  font-weight: 700;
}

.hero-photo-wrap {
  position: relative;
  justify-self: end;
  width: min(100%, 420px);
}

.photo-card {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line-purple);
  border-radius: 38px;
  background: linear-gradient(145deg, rgba(255,255,255,0.095), rgba(111,66,193,0.08));
  box-shadow: var(--shadow);
}

.photo-card::before,
.photo-card::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  z-index: -1;
}

.photo-card::before {
  width: 170px;
  height: 170px;
  right: -42px;
  top: -44px;
  background: rgba(111,66,193,0.22);
  filter: blur(22px);
}

.photo-card::after {
  width: 130px;
  height: 130px;
  left: -34px;
  bottom: 30px;
  border: 1px solid rgba(155,122,217,0.3);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 28px;
}

.profile-card {
  position: absolute;
  left: -38px;
  bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 264px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(16, 10, 28, 0.86);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 46px rgba(0,0,0,0.36);
}

.profile-icon,
.card-icon,
.project-icon,
.service-head i {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #e8dcff;
  background: rgba(111,66,193,0.18);
  border: 1px solid var(--line-purple);
}

.profile-icon {
  width: 44px;
  height: 44px;
  border-radius: 15px;
}

.profile-icon svg,
.card-icon svg,
.project-icon svg,
.service-head svg {
  width: 21px;
  height: 21px;
}

.profile-card strong,
.profile-card span {
  display: block;
}

.profile-card span {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 3px;
}

.two-columns {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 70px;
  align-items: start;
}

.section-heading.center {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 44px;
}

.section-heading:not(.center) {
  max-width: 640px;
}

.about-text p + p {
  margin-top: 18px;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.quick-facts div {
  min-height: 94px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight: 750;
}

.quick-facts svg {
  color: var(--purple-soft);
}

.skill-grid,
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.skill-card,
.service-card,
.project-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 18px 48px rgba(0,0,0,0.22);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.skill-card::before,
.service-card::before,
.project-card::before,
.contact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(155,122,217,0.16), transparent 46%);
  opacity: 0;
  transition: 0.25s ease;
}

.skill-card:hover,
.service-card:hover,
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-purple);
  background: rgba(31, 22, 51, 0.86);
}

.skill-card:hover::before,
.service-card:hover::before,
.project-card:hover::before,
.contact-card:hover::before {
  opacity: 1;
}

.skill-card {
  padding: 24px;
  min-height: 210px;
}

.card-icon,
.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  margin-bottom: 24px;
}

.skill-card p,
.service-card p,
.project-card p {
  position: relative;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 42px;
}

.project-card {
  padding: 30px;
  min-height: 330px;
}

.project-top,
.service-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.project-tag {
  color: #dfd3f7;
  border: 1px solid var(--line-purple);
  background: rgba(111,66,193,0.14);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 850;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.tech-list span {
  color: #dfd3f7;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.045);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 0.82rem;
  font-weight: 780;
}

/* O link para o repositório é a prova do que o card afirma: fica no rodapé
   do cartão, alinhado entre eles mesmo quando os textos têm alturas
   diferentes. */
.project-card {
  display: flex;
  flex-direction: column;
}

.project-card .tech-list {
  margin-bottom: 22px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  align-self: flex-start;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: #efe7ff;
  font-size: 0.86rem;
  font-weight: 780;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.project-link:hover {
  border-color: rgba(155,122,217,0.55);
  background: rgba(155,122,217,0.16);
  transform: translateY(-1px);
}

.project-link i {
  width: 17px;
  height: 17px;
}

.service-card {
  padding: 24px;
  min-height: 260px;
}

.service-head i {
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.service-head span {
  color: rgba(255,255,255,0.18);
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.contact-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 34px;
  padding: 44px;
  border: 1px solid var(--line-purple);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(37, 25, 61, 0.92), rgba(16, 10, 28, 0.92));
  box-shadow: var(--shadow);
}

.contact-card p {
  margin-top: 16px;
}

.contact-links {
  display: grid;
  gap: 12px;
  min-width: 230px;
}

.contact-links a {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.045);
  color: var(--text);
  font-weight: 850;
  padding: 0 18px;
  transition: 0.25s ease;
}

.brand-icon {
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 22px;
  color: #f7f2ff;
}

.contact-links a:hover {
  transform: translateY(-3px);
  border-color: rgba(216, 200, 255, 0.36);
  background: rgba(111,66,193,0.15);
}

.site-footer {
  padding: 28px 22px 42px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  transition-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.18s;
}

.delay-3 {
  transition-delay: 0.26s;
}

@media (max-width: 980px) {
  .container,
  .navbar {
    width: min(100% - 32px, 760px);
  }

  .menu-toggle {
    display: block;
    position: relative;
    z-index: 31;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav-links {
    position: fixed;
    inset: 76px 16px auto 16px;
    z-index: 30;
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(14, 8, 25, 0.96);
    box-shadow: var(--shadow);
    transform: translateY(-14px);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a,
  .lang-switch {
    justify-content: flex-start;
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
  }

  .hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: 34px;
    padding-bottom: 34px;
    isolation: isolate;
  }

  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("carlos-hilario.png");
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    opacity: 0.34;
    z-index: -2;
  }

  .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(
        to bottom,
        rgba(8, 5, 16, 0.35) 0%,
        rgba(8, 5, 16, 0.72) 45%,
        rgba(8, 5, 16, 0.96) 100%
      );
    z-index: -1;
  }

  .hero-grid,
  .two-columns,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 0;
    position: relative;
    z-index: 2;
  }

  .hero-content {
    position: relative;
    z-index: 3;
  }

  .hero-photo-wrap {
    display: none !important;
  }

  .hero-title {
    max-width: 580px;
  }

  .skill-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-facts {
    grid-template-columns: 1fr;
  }

  .contact-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .contact-links a {
    justify-content: center;
  }
}

@media (max-width: 680px) {
  .section-padding {
    padding: 68px 0;
  }

  .brand-text {
    display: none;
  }

  .hero {
    min-height: 100svh;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .hero::before {
    background-size: cover;
    background-position: center top;
    opacity: 0.34;
  }

  .hero::after {
    background:
      linear-gradient(
        to bottom,
        rgba(8, 5, 16, 0.32) 0%,
        rgba(8, 5, 16, 0.72) 48%,
        rgba(8, 5, 16, 0.98) 100%
      );
  }

  .hero-content {
    min-height: calc(100svh - 124px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .eyebrow {
    width: fit-content;
    max-width: 100%;
    font-size: 0.78rem;
    padding: 7px 11px;
    margin-bottom: 14px;
  }

  .hero-greeting {
    font-size: 0.98rem;
    margin-bottom: 6px;
  }

  .hero-title {
    max-width: 360px;
    min-height: 2.25em;
    font-size: clamp(2.55rem, 14vw, 4.1rem);
    letter-spacing: -0.075em;
  }

  .typed-text {
    min-width: 13ch;
  }

  h2 {
    font-size: clamp(1.8rem, 9vw, 2.45rem);
  }

  .hero-content p,
  .about-text p,
  .contact-card p {
    font-size: 1rem;
    line-height: 1.68;
  }

  .hero-content p {
    max-width: 340px;
    margin-top: 0;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 28px;
    max-width: 340px;
  }

  .btn {
    width: 100%;
    min-height: 56px;
  }

  .hero-panel {
    max-width: 340px;
    margin-top: 24px;
    padding: 10px;
    border-radius: 20px;
    background: rgba(10, 6, 18, 0.58);
    backdrop-filter: blur(10px);
  }

  .panel-line {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px;
    font-size: 0.81rem;
  }

  .skill-grid,
  .service-grid,
  .project-grid,
  .contact-links {
    grid-template-columns: 1fr;
  }

  .skill-card,
  .service-card,
  .project-card {
    min-height: auto;
    padding: 22px;
  }

  .project-top,
  .service-head {
    align-items: flex-start;
  }

  .project-tag {
    text-align: right;
  }

  .contact-card {
    padding: 28px 20px;
    border-radius: 26px;
  }

  .contact-links a {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .container,
  .navbar {
    width: min(100% - 24px, 760px);
  }

  .hero-title {
    max-width: 330px;
    min-height: 2.35em;
    font-size: clamp(2.35rem, 13vw, 3.45rem);
  }

  .typed-text {
    min-width: 13ch;
  }

  .hero-content p,
  .hero-actions,
  .hero-panel {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
