/* Nebula Technosys — Design System */

:root {
  --bg: #0a0e17;
  --bg-elevated: #111827;
  --bg-card: #151d2e;
  --bg-card-hover: #1a2438;
  --text: #e8ecf4;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  --accent-glow: rgba(6, 182, 212, 0.25);
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --header-bg: rgba(10, 14, 23, 0.85);
  --header-bg-scrolled: rgba(10, 14, 23, 0.95);
  --hero-overlay: linear-gradient(to bottom, rgba(10, 14, 23, 0.7) 0%, rgba(10, 14, 23, 0.85) 50%, var(--bg) 100%);
  --radius: 12px;
  --radius-lg: 20px;
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --header-h: 72px;
  --container: 1200px;
  --masonry-gap: 10px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent: #0891b2;
  --accent-hover: #0e7490;
  --accent-glow: rgba(8, 145, 178, 0.2);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --header-bg: rgba(241, 245, 249, 0.9);
  --header-bg-scrolled: rgba(255, 255, 255, 0.95);
  --hero-overlay: linear-gradient(to bottom, rgba(241, 245, 249, 0.75) 0%, rgba(241, 245, 249, 0.9) 50%, var(--bg) 100%);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
code { font-size: 0.85em; background: var(--bg-card); padding: 0.15em 0.45em; border-radius: 4px; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.container-narrow { width: min(100% - 2rem, 720px); margin-inline: auto; }

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 0.9rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 24px var(--accent-glow); }
.btn-outline { border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.site-header.scrolled {
  background: var(--header-bg-scrolled);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.header-inner { display: flex; align-items: center; height: 100%; gap: 2rem; }

.logo {
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}

.logo-img {
  height: 44px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.footer-logo-img {
  height: 50px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.logo-text {
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav { display: flex; gap: 1.75rem; margin-left: auto; }
.nav a { font-size: 0.9rem; color: var(--text-muted); transition: color var(--transition); position: relative; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav a.active::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--accent); border-radius: 1px;
}

.header-ctas { display: flex; gap: 0.5rem; flex-shrink: 0; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  padding: 0.5rem; margin-left: auto;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 1px; }

.hero {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a0e17 0%, #0f172a 40%, #134e4a 100%);
  background-size: cover; background-position: center;
}

.hero-bg.has-image { background-color: var(--bg); }

.hero-bg-layer {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.5s ease;
}
.hero-bg-layer.active { opacity: 0.35; }

.hero-overlay {
  position: absolute; inset: 0;
  background: var(--hero-overlay);
}

.hero-content {
  position: relative; z-index: 1; text-align: center;
  padding: calc(var(--header-h) + 2rem) 0 4rem; max-width: 820px;
}

.hero-eyebrow {
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted); max-width: 560px; margin: 0 auto 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.hero-scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; color: var(--text-dim); animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

.section { padding: 5rem 0; }
.section:nth-child(even) { background: var(--bg-elevated); }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 3rem; }

.section-label {
  display: inline-block; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.75rem;
}

.section-head p { color: var(--text-muted); font-size: 1.05rem; }

.paths-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.path-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem; transition: var(--transition);
  display: flex; flex-direction: column;
}
.path-card:hover {
  border-color: var(--accent); transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.path-icon { width: 48px; height: 48px; color: var(--accent); margin-bottom: 1.25rem; }
.path-icon svg { width: 100%; height: 100%; }
.path-card h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.path-card p { color: var(--text-muted); font-size: 0.95rem; flex: 1; margin-bottom: 1.25rem; }
.path-link { font-weight: 600; font-size: 0.9rem; color: var(--accent); }
.path-link:hover { color: var(--accent-hover); }

.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }

.service-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem; transition: var(--transition);
}
.service-card:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }

.service-num {
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.05em; display: block; margin-bottom: 0.75rem;
}
.service-card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; }

.timeline { max-width: 640px; margin: 0 auto; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 12px; bottom: 12px;
  width: 2px; background: var(--border-strong);
}

.timeline-item { position: relative; padding-left: 2.75rem; padding-bottom: 0.5rem; }
.timeline-trigger { display: flex; align-items: center; width: 100%; text-align: left; padding: 0.75rem 0; }

.timeline-dot {
  position: absolute; left: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); transition: var(--transition);
}
.timeline-item.is-open .timeline-dot { background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

.timeline-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.timeline-title em { font-style: normal; color: var(--text-dim); font-weight: 400; font-size: 0.9em; }

.timeline-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, opacity 0.35s ease; opacity: 0; }
.timeline-item.is-open .timeline-body { max-height: 200px; opacity: 1; padding-bottom: 0.75rem; }
.timeline-body p { color: var(--text-muted); font-size: 0.95rem; }

/* Overlapping collage gallery */
.collage-stages {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0 1rem;
  width: 100%;
  min-width: 0;

}

.collage-stage {
  position: relative;
  width: 100%;
  max-width: 920px;
  min-width: 280px;
  height: 520px;
  margin: -15px auto;
  flex-shrink: 0;
}

.collage-stage--preview {
  margin-bottom: 0.5rem;
}

.collage-card {
  position: absolute;
  display: block;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  border-radius: 10px;
  border: 3px solid var(--bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;
  cursor: pointer;
  background: var(--bg-card);
  opacity: 0;
  min-width: 48px;
  min-height: 48px;
}

.collage-card.visible {
  opacity: 1;
}

.collage-card:hover,
.collage-card:focus-visible {
  transform: scale(1.06) rotate(0deg) !important;
  z-index: 20 !important;
  box-shadow: 0 20px 50px var(--accent-glow);
  outline: none;
}

.collage-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.collage-c1 { width: 42%; height: 48%; top: 0; left: 5%; transform: rotate(-2deg); z-index: 3; }
.collage-c2 { width: 38%; height: 42%; top: 8%; right: 4%; transform: rotate(3deg); z-index: 5; }
.collage-c3 { width: 28%; height: 55%; top: 38%; left: 18%; transform: rotate(1deg); z-index: 2; }
.collage-c4 { width: 45%; height: 35%; top: 42%; right: 8%; transform: rotate(-1.5deg); z-index: 4; }
.collage-c5 { width: 32%; height: 32%; top: 22%; left: 38%; transform: rotate(4deg); z-index: 6; }
.collage-c6 { width: 36%; height: 38%; bottom: 2%; left: 2%; transform: rotate(-3deg); z-index: 1; }
.collage-c7 { width: 30%; height: 45%; bottom: 0; right: 22%; transform: rotate(2deg); z-index: 3; }

.portfolio-section--preview {
  padding-bottom: 4rem;
}

.portfolio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.portfolio-page .section-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
}

.portfolio-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.portfolio-panel-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.portfolio-status {
  font-weight: 600;
  color: var(--accent);
}

.portfolio-hint {
  color: var(--text-dim);
}

.portfolio-scroll {
  max-height: min(72vh, 720px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--masonry-gap);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* Full portfolio page — page scrolls, not a tiny inner box */
.portfolio-panel--collage .portfolio-gallery {
  width: 100%;
  padding: 1.25rem;
  overflow: visible;
  max-height: none;
}

.portfolio-section--full .portfolio-panel {
  overflow: visible;
}

.portfolio-scroll.is-expanded {
  max-height: min(85vh, 900px);
}

.portfolio-scroll::-webkit-scrollbar {
  width: 8px;
}

.portfolio-scroll::-webkit-scrollbar-track {
  background: var(--bg);
}

.portfolio-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.portfolio-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.portfolio-section--full .portfolio-actions {
  margin-top: 1.5rem;
}

.portfolio-empty {
  text-align: center; padding: 4rem 2rem;
  background: var(--bg-card); border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg); color: var(--text-muted);
}
.empty-icon { width: 64px; height: 64px; margin: 0 auto 1rem; color: var(--text-dim); }
.empty-icon svg { width: 100%; height: 100%; }

.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-close { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 2.5rem; line-height: 1; opacity: 0.8; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 3rem; opacity: 0.7; padding: 1rem; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: center; }
.about-content h2 { font-family: var(--font-display); font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 700; margin-bottom: 1.25rem; }
.about-content p { color: var(--text-muted); margin-bottom: 1rem; }
.about-list { list-style: none; margin-top: 1.5rem; }
.about-list li { position: relative; padding-left: 1.5rem; margin-bottom: 0.65rem; color: var(--text-muted); font-size: 0.95rem; }
.about-list li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.about-stats { display: grid; gap: 1rem; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; text-align: center; }
.stat-value { display: block; font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; color: var(--accent); margin-bottom: 0.25rem; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-item summary { padding: 1.15rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.25rem; color: var(--accent); float: right; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1.25rem 1.15rem; color: var(--text-muted); font-size: 0.95rem; }

.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: start; }
.contact-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.75rem 1rem; background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: var(--text); font: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.hidden { position: absolute; opacity: 0; pointer-events: none; height: 0; width: 0; }
.form-status { min-height: 1.5rem; margin-bottom: 0.75rem; font-size: 0.9rem; }
.form-status.success { color: #34d399; }
.form-status.error { color: #f87171; }

.contact-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; margin-bottom: 1.25rem; }
.contact-card h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 1rem; }
.contact-list { list-style: none; }
.contact-list li { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; }
.contact-list svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); }
.contact-list a { color: var(--text-muted); }
.contact-list a:hover { color: var(--accent); }

.map-wrap { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.map-iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
  background: var(--bg-card);
}
.map-address { padding: 0.85rem 1rem; font-size: 0.85rem; color: var(--text-muted); background: var(--bg-card); border-top: 1px solid var(--border); }

.footer-social { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-muted);
  transition: var(--transition);
}
.footer-social a:hover { color: var(--accent); border-color: var(--accent); }
.footer-social svg { width: 18px; height: 18px; }

.site-footer { padding: 2.5rem 0; border-top: 1px solid var(--border); background: var(--bg); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2rem; }
.footer-brand p { font-size: 0.85rem; color: var(--text-dim); margin-top: 0.25rem; }
.footer-nav { display: flex; gap: 1.5rem; margin-left: auto; }
.footer-nav a { font-size: 0.9rem; color: var(--text-muted); }
.footer-copy { width: 100%; font-size: 0.8rem; color: var(--text-dim); padding-top: 1rem; border-top: 1px solid var(--border); }

.fab-whatsapp {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 900;
  width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); transition: var(--transition);
}
.fab-whatsapp svg { width: 28px; height: 28px; }
.fab-whatsapp:hover { transform: scale(1.08); }

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

@media (max-width: 1023px) {
  .collage-stage { height: 460px; }
  .paths-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .header-ctas .btn { display: none; }
  .header-ctas { display: flex; margin-left: auto; }
  .theme-toggle { display: flex; }
  .nav-toggle { display: flex; }
  .nav.is-open {
    display: flex; flex-direction: column; position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: var(--bg-elevated); padding: 1.5rem; border-bottom: 1px solid var(--border); gap: 1rem; margin-left: 0;
  }
  .header-ctas.is-open {
    display: flex; position: fixed; top: calc(var(--header-h) + 280px);
    left: 1rem; right: 1rem; flex-direction: column;
  }
  .services-grid { grid-template-columns: 1fr; }
  .collage-stage { height: 400px; }
  .collage-c1, .collage-c2, .collage-c4 { width: 48%; }
  .portfolio-hint { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .footer-nav { margin-left: 0; }
}

@media (max-width: 480px) {
  .collage-stage { height: 360px; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .portfolio-scroll { max-height: 65vh; }
}
