/* =============================================
   PixelNest – Landing Page Stylesheet
   ============================================= */

/* ----------- Custom Properties ----------- */
:root {
  --c-bg:        #0B1820;
  --c-surface:   #111F2A;
  --c-card:      #152231;
  --c-border:    #1E3448;
  --c-teal-dark: #1A6478;
  --c-teal:      #2A8FA8;
  --c-teal-light:#5BC4DC;
  --c-ice:       #A2D8E8;
  --c-text:      #8BAFC4;
  --c-text-muted:#4E6F84;
  --c-white:     #E8F4FA;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);

  --section-pad: clamp(80px, 12vw, 140px);
}

/* ----------- Reset ----------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ----------- Typography ----------- */
.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-teal);
  margin-bottom: 18px;
}
.label::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--c-teal);
}

.section-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.section-subtitle {
  color: var(--c-text);
  max-width: 520px;
  font-size: clamp(15px, 1.1vw, 17px);
}

/* ----------- Reveal animation ----------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ----------- Layout ----------- */
.container {
  width: min(1160px, 92vw);
  margin: 0 auto;
}

/* =============================================
   NAV
   ============================================= */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 5vw 0 2vw;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(11, 24, 32, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--c-border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo img {
  height: 100px;
  width: auto;
}
.nav-logo-text {
  font-weight: 700;
  font-size: 17px;
  color: var(--c-white);
  letter-spacing: -0.01em;
}
.nav-logo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-teal);
  margin-top: -2px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--c-teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}
.nav-links a:hover { color: var(--c-white); }
.nav-links a:hover::after { transform: scaleX(1); }

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.lang-toggle button {
  padding: 4px 10px;
  border-radius: 5px;
  color: var(--c-text-muted);
  transition: background 0.2s, color 0.2s;
}
.lang-toggle button.active {
  background: var(--c-teal);
  color: #fff;
}
.lang-toggle button:hover:not(.active) {
  color: var(--c-white);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* =============================================
   HERO
   ============================================= */
#hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 40%, rgba(42, 143, 168, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 70%, rgba(26, 100, 120, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 160px 0 80px;
  width: min(820px, 90vw);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(42, 143, 168, 0.12);
  border: 1px solid rgba(91, 196, 220, 0.25);
  border-radius: 100px;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-teal-light);
  margin-bottom: 28px;
  width: fit-content;
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--c-teal-light);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 800;
  color: var(--c-white);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.hero-title span {
  color: transparent;
  background: linear-gradient(135deg, var(--c-teal-light) 0%, var(--c-teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 1.3vw, 19px);
  color: var(--c-text);
  max-width: 520px;
  margin-bottom: 44px;
  line-height: 1.65;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ----------- Buttons ----------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, background 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}
.btn:hover::after { background: rgba(255,255,255,0.05); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--c-teal) 0%, var(--c-teal-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(42, 143, 168, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(42, 143, 168, 0.5);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text);
}
.btn-ghost:hover {
  border-color: var(--c-teal);
  color: var(--c-white);
  transform: translateY(-2px);
}

.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  z-index: 2;
}
.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--c-teal-dark));
  animation: scrollLine 1.8s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* =============================================
   ABOUT
   ============================================= */
#about {
  padding: var(--section-pad) 0;
  position: relative;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: start;
}

.about-description {
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.75;
  color: var(--c-text);
  margin-top: 16px;
}

.about-values {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}

.value-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  transition: border-color 0.3s, transform 0.3s var(--ease-out);
}
.value-card:hover {
  border-color: var(--c-teal-dark);
  transform: translateX(6px);
}
.value-icon {
  font-size: 20px;
  color: var(--c-teal);
  margin-top: 2px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.value-title {
  font-weight: 600;
  color: var(--c-white);
  font-size: 15px;
  margin-bottom: 4px;
}
.value-text {
  font-size: 14px;
  color: var(--c-text);
  line-height: 1.6;
}

/* Decorative line */
#about::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5vw;
  right: 5vw;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-border), transparent);
}

/* =============================================
   PROJECTS
   ============================================= */
#projects {
  padding: var(--section-pad) 0;
  position: relative;
}
#projects::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5vw;
  right: 5vw;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-border), transparent);
}

.projects-header {
  margin-bottom: clamp(40px, 5vw, 64px);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 24px;
}

.project-card-wrap {
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
}
.project-card-wrap .project-card {
  flex: 1;
}

.project-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s, transform 0.35s var(--ease-out), box-shadow 0.35s;
  position: relative;
}
.project-card-wrap:hover .project-card {
  border-color: var(--c-teal-dark);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(42, 143, 168, 0.15);
}

.project-card-top {
  height: 200px;
  position: relative;
  overflow: hidden;
  background: var(--c-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.project-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: brightness(0.85);
  transition: filter 0.3s;
}
.project-card-wrap:hover .project-card-img {
  filter: brightness(1);
}
.project-card[data-id="progiq"] .project-card-img {
  object-fit: contain;
  background: #0a0a0a;
}

/* Fallback si l'image n'existe pas encore */
.project-card-top.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-card);
}
.project-card-top.no-img::after {
  content: '—';
  color: var(--c-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(21, 34, 49, 0.7) 100%
  );
  pointer-events: none;
}

.project-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.project-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  background: rgba(42, 143, 168, 0.1);
  border: 1px solid rgba(42, 143, 168, 0.2);
  border-radius: 100px;
  color: var(--c-teal-light);
}

.project-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: -0.01em;
}
.project-description {
  font-size: 14px;
  color: var(--c-text);
  line-height: 1.65;
  flex: 1;
}

.project-cta {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-teal-light);
  transition: gap 0.25s;
}
.project-cta svg {
  transition: transform 0.25s var(--ease-out);
}
.project-card-wrap:hover .project-cta svg { transform: translate(3px, -3px); }
.project-card-wrap:hover .project-cta { gap: 10px; }

/* =============================================
   CONTACT
   ============================================= */
#contact {
  padding: var(--section-pad) 0;
  position: relative;
}
#contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5vw;
  right: 5vw;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-border), transparent);
}

.contact-inner {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 72px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact-inner::before {
  content: '';
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(42, 143, 168, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.contact-title {
  margin-bottom: 12px;
}
.contact-subtitle {
  margin: 0 auto 36px;
  max-width: 420px;
}
.contact-domain {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.contact-domain::before,
.contact-domain::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--c-border);
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  border-top: 1px solid var(--c-border);
  padding: 28px 5vw;
  text-align: center;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-logo img { height: 28px; }
.footer-logo-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--c-white);
}
.footer-logo-tagline {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-teal);
  margin-top: -1px;
}
.footer-copy {
  font-size: 12px;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
}

/* =============================================
   NOISE TEXTURE OVERLAY
   ============================================= */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

/* =============================================
   MOBILE NAV DRAWER
   ============================================= */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: rgba(11, 24, 32, 0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--c-border);
    padding: 12px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 14px 24px;
    font-size: 16px;
    border-bottom: 1px solid var(--c-border);
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a::after { display: none; }

  .nav-hamburger { display: flex; }

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

  .hero-title { font-size: clamp(34px, 8vw, 52px); }
}

@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; }
  .btn { justify-content: center; }
  .contact-inner { padding: 32px 20px; }
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-teal-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-teal); }

/* =============================================
   SELECTION
   ============================================= */
::selection {
  background: rgba(42, 143, 168, 0.3);
  color: var(--c-white);
}
