/* ============================================================
   CODEVREA — Stylesheet
   Design: Apple-inspired, minimal, Hick's Law applied
   ============================================================ */

/* ===== RESET & TOKENS ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* --- Brand Colors --- */
  --co:       #0047AB;
  --co-dark:  #001F5B;
  --co-light: #64B5F6;

  --dev:       #009E73;
  --dev-dark:  #004D40;
  --dev-light: #A5D6A7;

  --rea:       #D32F2F;
  --rea-dark:  #8B0000;
  --rea-light: #FF8A80;

  /* --- Neutrals --- */
  --text:   #333333;
  --bg:     #FAF9F6;
  --dark:   #0c0f1a;
  --dark-2: #12172a;

  /* --- Type --- */
  --font:   'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-2: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* --- Motion --- */
  --ease-out:    cubic-bezier(0.0,  0.0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }

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

/* Secondary font — body copy & descriptions */
.body-text,
.service-intro,
.service-desc,
.card p,
.hero-sub,
.footer-copy,
.footer-nav,
.form-status,
.contact-header p {
  font-family: var(--font-2);
}

img { display: block; max-width: 100%; }
a  { text-decoration: none; }

/* ===== COLOR UTILS ===== */
.co-c  { color: var(--co); }
.dev-c { color: var(--dev); }
.rea-c { color: var(--rea); }
.dot   { color: rgba(255,255,255,0.2); }

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }

.d1 { transition-delay: 0.12s; }
.d2 { transition-delay: 0.24s; }
.d3 { transition-delay: 0.36s; }

/* ============================================================
   NAVIGATION
============================================================ */
#navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 999;
  padding: 22px 0;
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 14px 0;
  border-bottom-color: rgba(0,0,0,0.07);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img { height: 38px; transition: opacity 0.3s; }
.nav-logo:hover img { opacity: 0.75; }

/* Links */
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.3s;
}
/* On dark hero: white */
#navbar:not(.scrolled) .nav-links a { color: rgba(255,255,255,0.8); }
#navbar:not(.scrolled) .nav-links a:hover { color: white; }
/* On scrolled: dark */
#navbar.scrolled .nav-links a { color: var(--text); }
#navbar.scrolled .nav-links a:hover { color: var(--co); }

/* CTA pill */
.nav-cta {
  padding: 9px 22px;
  border-radius: 100px;
  font-weight: 600 !important;
  border: 1.5px solid;
  transition: background 0.3s, color 0.3s, border-color 0.3s !important;
}
#navbar:not(.scrolled) .nav-cta {
  border-color: rgba(255,255,255,0.45);
  color: white !important;
}
#navbar:not(.scrolled) .nav-cta:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.7);
}
#navbar.scrolled .nav-cta { border-color: var(--co); color: var(--co) !important; }
#navbar.scrolled .nav-cta:hover { background: var(--co); color: white !important; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; border-radius: 2px; background: white; transition: all 0.3s; }
#navbar.scrolled .hamburger span { background: var(--text); }
#navbar.in--communication .hamburger span,
#navbar.in--developpement .hamburger span,
#navbar.in--realisation   .hamburger span { background: white; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== NAVBAR — couleurs par section ===== */
#navbar.in--communication {
  background: rgba(0, 50, 140, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom-color: rgba(255,255,255,0.1);
}
#navbar.in--developpement {
  background: rgba(0, 120, 85, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom-color: rgba(255,255,255,0.1);
}
#navbar.in--realisation {
  background: rgba(180, 30, 30, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom-color: rgba(255,255,255,0.1);
}

/* Texte blanc dans les sections colorées */
#navbar.in--communication .nav-links a,
#navbar.in--developpement .nav-links a,
#navbar.in--realisation   .nav-links a { color: rgba(255,255,255,0.75); }

#navbar.in--communication .nav-links a:hover,
#navbar.in--developpement .nav-links a:hover,
#navbar.in--realisation   .nav-links a:hover { color: white; }

/* CTA dans les sections colorées */
#navbar.in--communication .nav-cta,
#navbar.in--developpement .nav-cta,
#navbar.in--realisation   .nav-cta {
  border-color: rgba(255,255,255,0.45) !important;
  color: white !important;
}
#navbar.in--communication .nav-cta:hover,
#navbar.in--developpement .nav-cta:hover,
#navbar.in--realisation   .nav-cta:hover {
  background: rgba(255,255,255,0.18) !important;
  border-color: white !important;
}

/* ===== LIEN ACTIF ===== */
/* Sur fond neutre (sections hors service) */
#navbar.scrolled .nav-links a.active {
  font-weight: 600;
  color: var(--text) !important;
}
#navbar.scrolled .nav-links a.active::after {
  content: '';
  display: block;
  height: 2px;
  border-radius: 2px;
  margin-top: 3px;
  background: var(--co);
}
/* Overrides couleur par section */
#navbar.in--communication .nav-links a.active::after { background: white; }
#navbar.in--developpement .nav-links a.active::after { background: white; }
#navbar.in--realisation   .nav-links a.active::after { background: white; }

/* Sur fond coloré : pill blanc */
#navbar.in--communication .nav-links a.active,
#navbar.in--developpement .nav-links a.active,
#navbar.in--realisation   .nav-links a.active {
  color: white !important;
  background: rgba(255,255,255,0.2);
  padding: 5px 14px;
  border-radius: 100px;
}
#navbar.in--communication .nav-links a.active::after,
#navbar.in--developpement .nav-links a.active::after,
#navbar.in--realisation   .nav-links a.active::after { display: none; }

/* ============================================================
   HERO
============================================================ */
#hero {
  height: 100vh;
  min-height: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #080b15 0%, #001F5B 55%, #091425 100%);
}

/* Radial glow spots */
.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 55% at 15% 55%, rgba(0, 71, 171, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 35% 40% at 85% 25%, rgba(0, 158, 115, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 72% 78%, rgba(211, 47, 47, 0.12) 0%, transparent 60%);
  animation: glowPulse 9s ease-in-out infinite alternate;
}
@keyframes glowPulse { to { opacity: 0.85; } }

/* Subtle grid */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 70% at center, black 0%, transparent 75%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}

/* Logo */
.hero-logo {
  width: clamp(320px, 56vw, 680px);
  margin: 0 auto 44px;
  opacity: 0;
  transform: translateY(28px);
  animation: fadeUp 1s var(--ease-out) 0.2s forwards;
  filter: drop-shadow(0 16px 48px rgba(100,181,246,0.22));
}

.hero-headline {
  font-size: clamp(38px, 6vw, 74px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: white;
  opacity: 0;
  transform: translateY(28px);
  animation: fadeUp 1s var(--ease-out) 0.45s forwards;
}
.hero-headline em {
  font-style: normal;
  background: linear-gradient(130deg, var(--co-light) 0%, var(--dev-light) 50%, var(--rea-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-family: var(--font-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(28px);
  animation: fadeUp 1s var(--ease-out) 0.7s forwards;
}
.hero-sub .co-c  { color: var(--co-light); }
.hero-sub .dev-c { color: var(--dev-light); }
.hero-sub .rea-c { color: var(--rea-light); }
.hero-sub .dot   { color: rgba(255,255,255,0.25); }

.btn-primary {
  display: inline-block;
  margin-top: 44px;
  padding: 16px 52px;
  border-radius: 100px;
  background: white;
  color: var(--dark);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(28px);
  animation: fadeUp 1s var(--ease-out) 0.95s forwards;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.35s;
  box-shadow: 0 4px 32px rgba(0,0,0,0.35);
}
.btn-primary:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 10px 48px rgba(0,0,0,0.45);
}

@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* Scroll indicator */
.scroll-mouse {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 1.2s forwards;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 13px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.scroll-wheel {
  width: 4px;
  height: 8px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  animation: scrollDown 1.6s ease-in-out infinite;
}
@keyframes scrollDown {
  0%   { transform: none; opacity: 1; }
  60%  { transform: translateY(11px); opacity: 0; }
  61%  { transform: none; opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* ============================================================
   SHARED SECTION LAYOUT
============================================================ */
.section-inner {
  max-width: 1160px;
  margin: 0 auto;
}
.section-inner.centered { text-align: center; }

.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--co);
  margin-bottom: 20px;
}
.eyebrow.light { color: var(--co-light); }

.big-title {
  font-size: clamp(38px, 5.5vw, 68px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.04em;
  color: var(--dark);
  margin-bottom: 28px;
}
.big-title.light { color: white; }

.body-text {
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.75;
  color: #777;
  max-width: 580px;
  margin: 0 auto;
}
.body-text.light { color: rgba(255,255,255,0.5); }

/* ============================================================
   VISION
============================================================ */
#vision {
  padding: 130px 40px;
  background: var(--bg);
}
#vision .body-text { margin-bottom: 60px; }

.pillars {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pillar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 14px 30px;
  border-radius: 100px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.pillar strong { font-weight: 900; }
.pillar span   { font-weight: 400; opacity: 0.75; }
.co-bg  { background: rgba(0,  71, 171, 0.08); color: var(--co-dark); }
.dev-bg { background: rgba(0, 158, 115, 0.08); color: var(--dev-dark); }
.rea-bg { background: rgba(211,47,  47, 0.08); color: var(--rea-dark); }

/* ============================================================
   SERVICE SECTIONS
============================================================ */
.service-section {
  padding: 130px 40px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.service-section.alt-bg { background: #f5fbf8; }

/* Giant background letter — decorative only */
.bg-letter {
  position: absolute;
  right: -0.04em;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(280px, 38vw, 520px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
  pointer-events: none;
  user-select: none;
}
.co-letter  { color: rgba(0,  71, 171, 0.045); }
.dev-letter { color: rgba(0, 158, 115, 0.045); }
.rea-letter { color: rgba(211,47,  47, 0.045); }

.service-header {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin-bottom: 56px;
}

.service-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 15px;
  border-radius: 100px;
  margin-bottom: 26px;
}
.co-tag  { background: rgba(0,  71, 171, 0.09); color: var(--co); }
.dev-tag { background: rgba(0, 158, 115, 0.09); color: var(--dev); }
.rea-tag { background: rgba(211,47,  47, 0.09); color: var(--rea); }

.service-title {
  font-size: clamp(34px, 4.5vw, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--dark);
  margin-bottom: 22px;
}
.service-intro {
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.75;
  color: #888;
}

/* --- Cards --- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  position: relative;
  z-index: 1;
}

.card {
  background: white;
  border-radius: 20px;
  padding: 34px 28px;
  box-shadow: 0 2px 18px rgba(0,0,0,0.05);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s;
}
.card:hover {
  transform: translateY(-7px);
  box-shadow: 0 14px 44px rgba(0,0,0,0.10);
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.card-icon svg { width: 24px; height: 24px; }

.co-icon  { background: rgba(0,  71, 171, 0.09); color: var(--co); }
.dev-icon { background: rgba(0, 158, 115, 0.09); color: var(--dev); }
.rea-icon { background: rgba(211,47,  47, 0.09); color: var(--rea); }

.card h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dark);
  margin-bottom: 10px;
}
.card p {
  font-size: 14px;
  line-height: 1.65;
  color: #999;
}

/* ============================================================
   CONTACT
============================================================ */
#contact {
  padding: 130px 40px;
  background: var(--dark-2);
}

.contact-form {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 680px;
  margin: 0 auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 15px;
  font-family: var(--font);
  color: white;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: rgba(255,255,255,0.28); }
.form-field input:focus,
.form-field textarea:focus {
  border-color: rgba(100,181,246,0.55);
  background: rgba(255,255,255,0.10);
}
.form-field input.invalid { border-color: var(--rea-light); }
.field-error {
  display: none;
  font-size: 12px;
  color: var(--rea-light);
  margin-top: 5px;
  padding-left: 4px;
}
.field-error.visible { display: block; }
.form-field textarea { resize: vertical; min-height: 130px; }

.form-btn {
  width: 100%;
  padding: 17px;
  border-radius: 12px;
  background: var(--co);
  color: white;
  font-size: 16px;
  font-family: var(--font);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.3s, transform 0.35s var(--ease-spring);
  letter-spacing: -0.01em;
}
.form-btn:hover { background: #0052cc; transform: translateY(-2px); }
.form-btn:active { transform: none; }
.form-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-status {
  text-align: center;
  font-size: 14px;
  min-height: 20px;
  color: rgba(255,255,255,0.35);
  transition: color 0.3s;
}
.form-status.success { color: var(--dev-light); }
.form-status.error   { color: var(--rea-light); }

/* ============================================================
   FOOTER
============================================================ */
#footer {
  background: var(--dark);
  padding: 64px 40px;
  text-align: center;
}
.footer-inner { max-width: 900px; margin: 0 auto; }

.footer-logo {
  height: 50px;
  margin: 0 auto 20px;
  opacity: 0.88;
}
.footer-tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 36px;
}
.footer-tagline .co-c  { color: var(--co-light); }
.footer-tagline .dev-c { color: var(--dev-light); }
.footer-tagline .rea-c { color: var(--rea-light); }
.footer-tagline .dot   { color: rgba(255,255,255,0.18); }

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.footer-nav a {
  color: rgba(255,255,255,0.38);
  font-size: 13px;
  transition: color 0.3s;
}
.footer-nav a:hover { color: rgba(255,255,255,0.75); }

.footer-copy {
  color: rgba(255,255,255,0.2);
  font-size: 12px;
}

/* ============================================================
   RESPONSIVE — Tablet
============================================================ */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   RESPONSIVE — Mobile
============================================================ */
@media (max-width: 700px) {

  /* Nav */
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(250,249,246,0.97);
    backdrop-filter: blur(24px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.07);
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    display: block;
    padding: 14px 32px;
    font-size: 16px;
    color: var(--text) !important;
  }
  .nav-cta {
    margin: 8px 32px !important;
    border-radius: 12px !important;
    text-align: center;
    border-color: var(--co) !important;
    color: var(--co) !important;
  }
  .nav-inner { padding: 0 24px; }

  /* Hero */
  .hero-sub { flex-direction: column; gap: 6px; }
  .hero-sub .dot { display: none; }

  /* Sections */
  #vision,
  .service-section,
  #contact { padding: 80px 24px; }

  /* Cards */
  .cards { grid-template-columns: 1fr; }

  /* Pillars */
  .pillars { flex-direction: column; align-items: center; }

  /* Form */
  .form-row { grid-template-columns: 1fr; }

  /* Footer */
  #footer { padding: 48px 24px; }
  .footer-nav { gap: 20px; }
  .footer-tagline { flex-direction: column; gap: 6px; }
  .footer-tagline .dot { display: none; }
}
