/* ==========================================================
   PORTFOLIO — Pablo Henrique Araújo
   Design Pattern: BEM + CSS Custom Properties
   Architecture: variables → reset → layout → components → sections → responsive
   ========================================================== */


/* ----------------------------------------------------------
   1. CUSTOM PROPERTIES
   ---------------------------------------------------------- */
:root {
  /* Colors */
  --c-bg:           #111111;
  --c-sidebar:      #0d0d0d;
  --c-card:         #1a1a1a;
  --c-card-hover:   #222222;
  --c-accent:       #e63e21;
  --c-accent-h:     #ff4d2e;
  --c-text:         #ffffff;
  --c-muted:        #9ca3af;
  --c-border:       rgba(255, 255, 255, 0.07);

  /* Layout */
  --sidebar-w:      260px;
  --section-py:     88px;
  --container-px:   48px;

  /* Typography */
  --font:           'Inter', system-ui, -apple-system, sans-serif;

  /* Effects */
  --ease:           0.3s ease;
  --r:              8px;
  --r-lg:           16px;
  --shadow:         0 4px 28px rgba(0, 0, 0, 0.45);
}


/* ----------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

ul { list-style: none; }

strong { font-weight: 700; }

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ----------------------------------------------------------
   3. LAYOUT — Sidebar + Main
   ---------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--c-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 32px;
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid var(--c-border);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

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


/* ----------------------------------------------------------
   4. SIDEBAR COMPONENTS
   ---------------------------------------------------------- */

/* Profile */
.sidebar__profile {
  text-align: center;
  margin-bottom: 32px;
  width: 100%;
}

.sidebar__avatar-wrap {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 14px;
  border: 3px solid var(--c-accent);
  flex-shrink: 0;
}

.sidebar__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.sidebar__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: 0.01em;
}

/* Nav */
.sidebar__nav {
  width: 100%;
  margin-bottom: 28px;
}

.sidebar__nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: block;
  text-align: center;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--c-muted);
  border-radius: var(--r);
  transition: color var(--ease), background var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--c-accent);
  background: rgba(230, 62, 33, 0.09);
}

/* CTA */
.sidebar__cta {
  display: inline-block;
  background: var(--c-accent);
  color: #fff;
  font-size: 0.83rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 50px;
  margin-bottom: 28px;
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
  white-space: nowrap;
  text-align: center;
}

.sidebar__cta:hover {
  background: var(--c-accent-h);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 62, 33, 0.4);
}

/* Social */
.sidebar__social {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.sidebar__social a {
  color: var(--c-muted);
  transition: color var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.sidebar__social a:hover { color: var(--c-accent); }
.sidebar__social svg { width: 18px; height: 18px; }

/* Mobile toggle */
.sidebar__toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--c-accent);
  border: none;
  border-radius: var(--r);
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  transition: background var(--ease);
}

.sidebar__toggle:hover { background: var(--c-accent-h); }

.sidebar__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
  pointer-events: none;
}

/* Hamburger → X */
.sidebar__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.sidebar__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Backdrop */
.sidebar__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
  backdrop-filter: blur(2px);
}

.sidebar__backdrop.visible { display: block; }


/* ----------------------------------------------------------
   5. BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 13px 30px;
  border-radius: 50px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--ease);
  line-height: 1;
}

.btn--primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}

.btn--primary:hover {
  background: var(--c-accent-h);
  border-color: var(--c-accent-h);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230, 62, 33, 0.38);
}

.btn--outline {
  background: transparent;
  color: var(--c-accent);
  border-color: var(--c-accent);
}

.btn--outline:hover {
  background: var(--c-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230, 62, 33, 0.38);
}

.btn--full { width: 100%; }


/* ----------------------------------------------------------
   6. SECTION COMMONS
   ---------------------------------------------------------- */
.section {
  padding: var(--section-py) 0;
}

.section__header {
  text-align: center;
  margin-bottom: 52px;
}

.section__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 12px;
}

.section__title {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--c-text);
}

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


/* ----------------------------------------------------------
   7. HERO
   ---------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-image: url('../img/hero-bg.jpg');
  background-size: cover;
  background-position: center center;
  padding: 0;
  overflow: hidden;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.7)  55%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  padding: 0 64px;
}

.hero__greeting {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-accent);
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

.hero__title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 36px;
  letter-spacing: -0.02em;
}

/* Scroll indicator */
.hero__scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.hero__scroll span {
  display: block;
  width: 24px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  position: relative;
}

.hero__scroll span::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--c-accent);
  border-radius: 2px;
  animation: scrollBounce 1.6s ease infinite;
}

@keyframes scrollBounce {
  0%   { opacity: 1;  transform: translateX(-50%) translateY(0); }
  100% { opacity: 0;  transform: translateX(-50%) translateY(14px); }
}


/* ----------------------------------------------------------
   8. ABOUT
   ---------------------------------------------------------- */
.about { background: var(--c-bg); }

.about__grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 64px;
}

.about__image-wrap {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.about__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform 0.5s ease;
}

.about__image-wrap:hover img { transform: scale(1.03); }

.about__image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(230, 62, 33, 0.35);
  border-radius: var(--r-lg);
  pointer-events: none;
}

.about__content .section__label { display: block; }
.about__content .section__title { margin-bottom: 20px; }

.about__content p {
  color: var(--c-muted);
  margin-bottom: 14px;
  font-size: 0.95rem;
  line-height: 1.85;
}

.about__content .btn { margin-top: 10px; }

/* Stats row */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
}

.stat {
  background: var(--c-card);
  padding: 36px 20px;
  text-align: center;
  transition: background var(--ease);
}

.stat:hover { background: var(--c-card-hover); }

.stat__number {
  display: block;
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--c-accent);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
}

.stat__label {
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.5;
}


/* ----------------------------------------------------------
   9. SERVICES
   ---------------------------------------------------------- */
.services { background: #0d0d0d; }

.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  transition: all var(--ease);
}

.service-card:hover {
  background: var(--c-card-hover);
  border-color: rgba(230, 62, 33, 0.28);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.service-card__icon {
  width: 52px;
  height: 52px;
  background: rgba(230, 62, 33, 0.1);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: var(--c-accent);
  transition: background var(--ease);
}

.service-card:hover .service-card__icon { background: rgba(230, 62, 33, 0.18); }
.service-card__icon svg { width: 26px; height: 26px; }

.service-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card p {
  font-size: 0.875rem;
  color: var(--c-muted);
  line-height: 1.75;
}


/* ----------------------------------------------------------
   10. PROJECTS
   ---------------------------------------------------------- */
.projects { background: var(--c-bg); }

.projects__filter {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  padding: 8px 22px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  font-family: var(--font);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: all var(--ease);
}

.project-card:hover {
  background: var(--c-card-hover);
  border-color: rgba(230, 62, 33, 0.28);
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-card__badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent);
  background: rgba(230, 62, 33, 0.1);
  padding: 4px 12px;
  border-radius: 50px;
}

.project-card__links-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.project-card__link {
  color: var(--c-muted);
  transition: color var(--ease);
  display: flex;
  align-items: center;
}

.project-card__link:hover { color: var(--c-accent); }
.project-card__link svg { width: 18px; height: 18px; }

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.project-card p {
  font-size: 0.875rem;
  color: var(--c-muted);
  line-height: 1.75;
  flex: 1;
  margin-bottom: 20px;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-card__tags span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--c-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--c-border);
  padding: 3px 10px;
  border-radius: 50px;
}

.project-card.hidden {
  display: none;
}


/* ----------------------------------------------------------
   11. SKILLS
   ---------------------------------------------------------- */
.skills { background: #0d0d0d; }

.skills__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.skill {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: border-color 0.25s;
}

.skill:hover { border-color: rgba(255, 255, 255, 0.14); }

.skill__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text);
}

.skill__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
}

.skill__badge--mid {
  background: rgba(99, 211, 163, 0.12);
  color: var(--c-accent);
  border: 1px solid rgba(99, 211, 163, 0.25);
}

.skill__badge--jun {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
}


/* ----------------------------------------------------------
   12. CONTACT
   ---------------------------------------------------------- */
.contact { background: var(--c-bg); }

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 64px;
  align-items: start;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact__item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.contact__icon {
  width: 46px;
  height: 46px;
  background: rgba(230, 62, 33, 0.1);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-accent);
  flex-shrink: 0;
  transition: background var(--ease);
}

.contact__item:hover .contact__icon { background: rgba(230, 62, 33, 0.18); }
.contact__icon svg { width: 20px; height: 20px; }

.contact__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-muted);
  margin-bottom: 4px;
}

.contact__item a {
  font-size: 0.9rem;
  color: var(--c-text);
  transition: color var(--ease);
  word-break: break-all;
}

.contact__item a:hover { color: var(--c-accent); }

/* Form */
.contact__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form__group input,
.form__group textarea {
  width: 100%;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  color: var(--c-text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 14px 16px;
  outline: none;
  transition: border-color var(--ease), background var(--ease);
  resize: vertical;
}

.form__group input::placeholder,
.form__group textarea::placeholder { color: var(--c-muted); }

.form__group input:focus,
.form__group textarea:focus {
  border-color: var(--c-accent);
  background: var(--c-card-hover);
}

.form__status {
  font-size: 0.875rem;
  text-align: center;
  min-height: 22px;
  transition: color var(--ease);
}

.form__status.success { color: #4ade80; }
.form__status.error   { color: #f87171; }


/* ----------------------------------------------------------
   13. FOOTER
   ---------------------------------------------------------- */
.footer {
  background: var(--c-sidebar);
  border-top: 1px solid var(--c-border);
  padding: 26px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer p {
  font-size: 0.82rem;
  color: var(--c-muted);
}

.footer__social {
  display: flex;
  gap: 16px;
}

.footer__social a {
  color: var(--c-muted);
  transition: color var(--ease);
  display: flex;
}

.footer__social a:hover { color: var(--c-accent); }


/* ----------------------------------------------------------
   14. SCROLL REVEAL ANIMATION
   ---------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* Staggered reveal delay for sibling cards */
.services__grid   .reveal:nth-child(2),
.projects__grid   .reveal:nth-child(2),
.skills__grid     .reveal:nth-child(2) { transition-delay: 0.1s; }

.services__grid   .reveal:nth-child(3),
.projects__grid   .reveal:nth-child(3),
.skills__grid     .reveal:nth-child(3) { transition-delay: 0.2s; }

.services__grid   .reveal:nth-child(4),
.projects__grid   .reveal:nth-child(4),
.skills__grid     .reveal:nth-child(4) { transition-delay: 0.3s; }


/* ----------------------------------------------------------
   15. RESPONSIVE
   ---------------------------------------------------------- */

/* ≤ 1024px — tablet landscape */
@media (max-width: 1024px) {
  :root {
    --container-px: 32px;
  }

  .about__grid {
    grid-template-columns: 280px 1fr;
    gap: 40px;
  }

  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* ≤ 900px — tablet portrait */
@media (max-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr;
  }

  .about__image {
    max-width: 340px;
    margin: 0 auto;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ≤ 768px — mobile */
@media (max-width: 768px) {
  :root {
    --section-py: 64px;
    --container-px: 24px;
  }

  /* Hide fixed sidebar, show as overlay */
  .sidebar {
    transform: translateX(-260px);
    transition: transform var(--ease);
    width: 260px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar__toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .hero__content {
    padding: 80px 24px 40px;
  }

  .hero__title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

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

  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ≤ 480px — small mobile */
@media (max-width: 480px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat { padding: 28px 16px; }
  .stat__number { font-size: 2rem; }

  .about__grid {
    gap: 32px;
  }

  .hero__title {
    font-size: 1.75rem;
  }
}
