/* ============================================
   R2C-SYSTEM — Styles (Mobile-First)
   Thème dark (défaut) + light via data-theme
   ============================================ */

/* --- FONTS --- */
@font-face {
  font-family: 'Muro';
  src: url('../fonts/Muro.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Comfortaa';
  src: url('../fonts/Comfortaa-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Comfortaa';
  src: url('../fonts/Comfortaa-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Comfortaa';
  src: url('../fonts/Comfortaa-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Comfortaa', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
}

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

/* --- THEME VARIABLES --- */
[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-surface: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #243050;
  --text: #f0f4f8;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --cta: #22c55e;
  --cta-hover: #16a34a;
  --border: #1e293b;
  --header-bg: rgba(10, 14, 26, 0.95);
  --modal-bg: rgba(0, 0, 0, 0.7);
  --footer-bg: #070b14;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --text: #1e293b;
  --text-secondary: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --cta: #16a34a;
  --cta-hover: #15803d;
  --border: #e2e8f0;
  --header-bg: rgba(248, 250, 252, 0.95);
  --modal-bg: rgba(0, 0, 0, 0.5);
  --footer-bg: #f1f5f9;
}

/* --- HEADER (mobile base) --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-img {
  height: 40px;
  width: auto;
}

[data-theme="dark"] .logo-dark { display: block; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }

.nav {
  display: none;
  width: 100%;
  justify-content: center;
  gap: 1rem;
  order: 3;
}

.nav-link {
  font-family: 'Muro', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-actions .btn-primary {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
}

/* --- THEME TOGGLE --- */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: inline; }

/* --- BUTTONS --- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-cta {
  background: var(--cta);
  color: #fff;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: 50px;
}

.btn-cta:hover {
  background: var(--cta-hover);
}

/* --- HERO (mobile base) --- */
.hero {
  text-align: center;
  padding: 5.5rem 1rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}


.hero-title {
  font-family: 'Muro', sans-serif;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-subtitle br {
  display: none;
}

.hero-title .line {
  display: block;
}

.hero-title > br {
  display: none;
}

/* --- SOLUTIONS (mobile base) --- */
.solutions {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.solutions-group {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 4.5rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 50%);
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  padding-right: 1rem;
}

.solutions-group-label {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(-90deg);
  white-space: nowrap;
  font-family: 'Muro', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.solution-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.75rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.solution-card .solution-desc {
  flex: 1;
}

.solution-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.solution-card--linked:hover {
  border-color: var(--cta);
}

.solution-name {
  font-family: 'Muro', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.solution-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.solution-external {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: var(--cta);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  transition: background 0.2s;
}

.solution-card:hover .solution-external {
  background: var(--cta-hover);
}

/* --- SPHERES (SVG) --- */
.sphere {
  display: block;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

/* --- CTA SECTION --- */
.cta-section {
  text-align: center;
  padding: 2rem 1rem 3rem;
}

/* --- FOOTER (mobile base) --- */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.footer-info,
.footer-center,
.footer-links {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.footer-links a {
  color: var(--accent);
}

.footer-links a:hover {
  text-decoration: underline;
}

/* --- MODAL --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--modal-bg);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
}

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

.modal-title {
  font-family: 'Muro', sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-item {
  display: block;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}

.modal-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

/* --- LEGAL MODAL --- */
.modal-legal {
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-legal h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  color: var(--accent);
}

.modal-legal p,
.modal-legal li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

.modal-legal ul {
  margin-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.modal-legal a {
  color: var(--accent);
}

.modal-legal a:hover {
  text-decoration: underline;
}

.modal-legal code {
  background: var(--bg-card);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

.legal-update {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
}

.footer-legal-link {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-legal-link:hover {
  color: var(--accent);
}

/* ============================================
   RESPONSIVE — min-width (mobile-first)
   ============================================ */

/* --- Tablet (>=600px) --- */
@media (min-width: 600px) {
  .header-inner {
    padding: 0.75rem 1.5rem;
  }

  .nav {
    display: flex;
  }

  .header-actions .btn-primary {
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
  }

  .hero {
    padding: 8rem 1.5rem 3rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .solutions {
    padding: 2rem 1.5rem 4rem;
  }

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

  .solution-name {
    font-size: 0.85rem;
  }

  .solution-desc {
    font-size: 0.75rem;
  }

  .sphere {
    width: 70px;
    height: 70px;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* --- Desktop (>=1024px) --- */
@media (min-width: 1024px) {
  .header-inner {
    flex-wrap: nowrap;
  }

  .nav {
    gap: 2rem;
    width: auto;
    order: 0;
  }

  .header-actions .btn-primary {
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
  }

  .hero {
    padding: 10rem 1.5rem 4rem;
  }

  .hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
  }

  .hero-subtitle br {
    display: inline;
  }

  .hero-title .line {
    display: inline;
  }

  .hero-title > br {
    display: inline;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .solutions-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
  }

  .solution-card {
    padding: 1.5rem 1rem;
  }

  .solution-card:hover {
    transform: translateY(-4px);
  }

  .solution-name {
    font-size: 0.9rem;
    margin-top: 1rem;
  }

  .solution-desc {
    font-size: 0.78rem;
    line-height: 1.5;
  }

  .sphere {
    width: 80px;
    height: 80px;
  }

  .cta-section {
    padding: 3rem 1.5rem 5rem;
  }

  .btn-cta {
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
  }

  .modal {
    padding: 2rem;
  }

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