/* ==========================================================================
   PORTFÓLIO GABRIEL FONSECA — CLEAN PROFESSIONAL THEME
   Light, modern, scroll-based layout
   ========================================================================== */

:root {
  /* Light Professional Palette */
  --bg-body: #fafafa;
  --bg-white: #ffffff;
  --bg-subtle: #f3f4f6;
  --bg-dark: #0f172a;
  --bg-dark-soft: #1e293b;

  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-on-dark: #f1f5f9;
  --text-on-dark-muted: #94a3b8;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.2);

  --green-dot: #22c55e;
  --green-soft-bg: rgba(34, 197, 94, 0.08);
  --green-soft-border: rgba(34, 197, 94, 0.25);

  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --nav-height: 72px;
  --max-width: 1120px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 32px);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  line-height: 1.25;
  font-weight: 700;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.navbar-inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.navbar-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

.navbar-links a:hover {
  color: var(--text-heading);
}

.navbar-links a.active {
  color: var(--text-heading);
}

.navbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: var(--text-heading);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.navbar-cta:hover {
  background-color: var(--bg-dark-soft);
  transform: translateY(-1px);
}

/* Mobile hamburger */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.navbar-toggle span {
  width: 22px;
  height: 2px;
  background-color: var(--text-heading);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 24px 80px;
}

.hero-inner {
  max-width: var(--max-width);
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 64px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background-color: var(--green-soft-bg);
  border: 1px solid var(--green-soft-border);
  border-radius: var(--radius-full);
  width: fit-content;
  font-size: 0.8rem;
  font-weight: 600;
  color: #16a34a;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--green-dot);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-heading);
}

.hero-title .accent {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-heading);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
}

.hero-photo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo {
  width: 320px;
  height: 320px;
  border-radius: var(--radius-xl);
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--bg-white);
}

/* ==========================================================================
   SECTION COMMON STYLES
   ========================================================================== */

.section {
  padding: 100px 24px;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
}

.section-header {
  margin-bottom: 56px;
}

/* ==========================================================================
   SERVICES SECTION
   ========================================================================== */

.services-section {
  background-color: var(--bg-white);
}

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

.service-card {
  padding: 36px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--bg-body);
  transition: all 0.25s ease;
}

.service-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 22px;
}

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.service-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ==========================================================================
   PROJECTS SECTION
   ========================================================================== */

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

.project-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.project-card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-card-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.project-card-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
  line-height: 1.3;
}

.project-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.project-card-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-pill {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.project-card-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.project-card:hover .project-card-arrow {
  background-color: var(--accent);
  color: #fff;
}

/* Featured cards (principal category) get more prominence */
.project-card.featured {
  border-color: var(--accent-border);
}

.project-card.featured .project-card-category {
  color: var(--accent);
}

/* Show more button */
.show-more-wrapper {
  text-align: center;
  margin-top: 40px;
}

.btn-show-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-body);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background-color: var(--bg-white);
  transition: all 0.2s ease;
}

.btn-show-more:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.btn-show-more .chevron {
  transition: transform 0.3s ease;
}

.btn-show-more.expanded .chevron {
  transform: rotate(180deg);
}

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

.project-card.hidden-card.visible {
  display: flex;
}

/* ==========================================================================
   PROJECT DETAIL MODAL
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-xl);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
  z-index: 2;
}

.modal-close:hover {
  background-color: var(--border);
  color: var(--text-heading);
}

.modal-header {
  padding: 36px 36px 0;
}

.modal-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}

.modal-title {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.modal-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.modal-link.primary {
  background-color: var(--accent);
  color: #fff;
}

.modal-link.primary:hover {
  background-color: var(--accent-hover);
}

.modal-link.secondary {
  background-color: var(--bg-subtle);
  color: var(--text-body);
  border: 1px solid var(--border);
}

.modal-link.secondary:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-white);
}

.modal-body {
  padding: 28px 36px 36px;
}

.modal-section {
  margin-bottom: 28px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-heading);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.modal-section-text {
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.7;
}

.modal-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-tech-item {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 14px;
  background-color: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-border);
}

/* ==========================================================================
   CONTACT / FOOTER SECTION
   ========================================================================== */

.contact-section {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 100px 24px 48px;
}

.contact-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.contact-header {
  text-align: center;
  margin-bottom: 48px;
}

.contact-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--text-on-dark);
  margin-bottom: 14px;
}

.contact-header p {
  font-size: 1.05rem;
  color: var(--text-on-dark-muted);
  max-width: 480px;
  margin: 0 auto;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.contact-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background-color: var(--bg-dark-soft);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  color: var(--text-on-dark);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}

.contact-link-card:hover {
  border-color: rgba(255,255,255,0.15);
  background-color: rgba(255,255,255,0.06);
  transform: translateY(-2px);
}

.contact-link-card svg {
  color: var(--text-on-dark-muted);
  flex-shrink: 0;
}

.contact-link-card:hover svg {
  color: var(--text-on-dark);
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-on-dark-muted);
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================================== */

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

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

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.12s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.19s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.33s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.40s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   SCROLLBAR (subtle for light theme)
   ========================================================================== */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-content {
    align-items: center;
  }

  .hero-subtitle {
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-photo {
    width: 240px;
    height: 240px;
    order: -1;
  }

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

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

  .navbar-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: rgba(255,255,255,0.97);
    backdrop-filter: blur(16px);
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .navbar-links.open {
    display: flex;
  }

  .navbar-toggle {
    display: flex;
  }

  .navbar-cta.desktop-only {
    display: none;
  }

  .section {
    padding: 64px 20px;
  }

  .modal-header,
  .modal-body {
    padding-left: 24px;
    padding-right: 24px;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .contact-link-card {
    width: 100%;
    max-width: 360px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .hero-photo {
    width: 180px;
    height: 180px;
  }

  .btn {
    padding: 11px 22px;
    font-size: 0.85rem;
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .modal-card {
    max-height: 90vh;
    margin: 12px;
    border-radius: var(--radius-lg);
  }
}

/* Hidden utility */
.hidden {
  display: none !important;
}
