/* ============================================================
   DPS Gestão & Tecnologia — Global Design System
   css/style.css
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
  /* Backgrounds */
  --bg-primary: #060b1a;
  --bg-secondary: #0c1228;
  --bg-tertiary: #111836;
  --bg-card: #0f1630;
  --bg-card-hover: #141d42;

  /* Accent */
  --accent: #1a6bff;
  --accent-light: #4d9fff;
  --accent-dark: #1255cc;
  --accent-glow: rgba(26, 107, 255, 0.35);

  /* Text */
  --text-primary: #f0f2f5;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(26, 107, 255, 0.2);

  /* Misc */
  --white: #ffffff;
  --green-whatsapp: #25d366;

  /* Spacing */
  --section-padding: 100px;
  --container-max: 1200px;
  --container-pad: 24px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 4px 30px var(--accent-glow);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.35s ease;
  --transition-slow: 0.6s ease;

  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

html {
  overflow: hidden;          /* scroll-container swap — no horizontal scroll on mobile */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul,
ol {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent);
  color: var(--white);
}

::-moz-selection {
  background: var(--accent);
  color: var(--white);
}

/* ---------- Scrollbar ---------- */
body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

body::-webkit-scrollbar-thumb {
  background: var(--accent-dark);
  border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Firefox */
body {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dark) var(--bg-secondary);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

h4 {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
}

h5 {
  font-size: 1.1rem;
  font-weight: 700;
}

h6 {
  font-size: 0.95rem;
  font-weight: 700;
}

p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

p:last-child {
  margin-bottom: 0;
}

a:hover {
  color: var(--accent-light);
}

strong {
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------- Utility — Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-title .highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
  box-shadow: 0 2px 12px rgba(26, 107, 255, 0.25);
}

.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 4px 24px var(--accent-glow);
  transform: translateY(-2px);
  color: var(--white);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 107, 255, 0.2);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-light);
  border: 1px solid var(--accent);
}

.btn-secondary:hover {
  background: rgba(26, 107, 255, 0.1);
  border-color: var(--accent-light);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-lg {
  font-size: 1rem;
  padding: 16px 36px;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 8px 20px;
}

/* Button white variant for CTA on colored bg */
.btn-white {
  background: var(--white);
  color: var(--accent-dark);
  border: 1px solid var(--white);
  font-weight: 700;
}

.btn-white:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.25);
}

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
  color: var(--white);
  transform: translateY(-2px);
}

/* ---------- Grid Utilities ---------- */
.grid {
  display: grid;
  gap: 24px;
}

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

/* ---------- Flex Utilities ---------- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-40 { gap: 40px; }

/* ---------- Text Utilities ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--white); }

/* ---------- Gradient text ---------- */
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Responsive Base ---------- */

/* Large desktop ≤ 1200px */
@media (max-width: 1200px) {
  :root {
    --container-pad: 20px;
  }

  .grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet landscape ≤ 1024px */
@media (max-width: 1024px) {
  :root {
    --section-padding: 80px;
  }

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

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

/* Tablet portrait ≤ 768px */
@media (max-width: 768px) {
  :root {
    --section-padding: 64px;
    --container-pad: 16px;
  }

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

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

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

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

  .btn-lg {
    padding: 14px 28px;
    font-size: 0.95rem;
  }
}

/* ==================== PORTFOLIO MODAL ==================== */
.portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.portfolio-modal.active {
    opacity: 1;
    visibility: visible;
}

.portfolio-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 11, 26, 0.9);
    backdrop-filter: blur(8px);
}

.portfolio-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.portfolio-modal.active .portfolio-modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: none;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--accent);
}

.modal-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
    }
}

.modal-gallery {
    flex: 1.2;
    background: var(--bg-primary);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-main-img {
    width: 100%;
    height: 270px;
    object-fit: cover;
    object-position: top center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.modal-thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.modal-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.modal-thumb:hover, .modal-thumb.active {
    opacity: 1;
    border-color: var(--accent);
}

.modal-info {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-category {
    font-size: 0.8rem;
    color: var(--accent-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 16px;
    font-family: var(--font-heading);
}

.modal-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Portfolio Item Hover Indicator */
.portfolio-item {
    cursor: pointer;
}
.portfolio-item::before {
    content: 'Ver Detalhes';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--accent);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    z-index: 5;
    transition: all 0.3s ease;
    pointer-events: none;
}
.portfolio-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6, 11, 26, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 4;
    pointer-events: none;
}
.portfolio-item:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.portfolio-item:hover::after {
    opacity: 1;
}


/* Mobile large ≤ 480px */
@media (max-width: 480px) {
  :root {
    --section-padding: 48px;
  }

  .grid-5,
  .grid-4,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

  .btn {
    padding: 10px 22px;
    font-size: 0.85rem;
  }

  .btn-lg {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .portfolio-modal-content {
      width: 95%;
      max-height: 95vh;
  }

  .modal-gallery {
      padding: 16px;
  }

  .modal-main-img {
      height: 220px;
  }

  .modal-info {
      padding: 20px;
  }

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

/* Mobile small ≤ 360px */
@media (max-width: 360px) {
  :root {
    --container-pad: 12px;
    --section-padding: 40px;
  }

  .grid-5,
  .grid-4,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
}
