/* =============================================
   RESET
   ============================================= */

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

/* =============================================
   CSS VARIABLES — Design system CR Entreprise
   ============================================= */

:root {
  /* Fonds */
  --bg-primary: #FFFFFF;
  --bg-soft: #FAFAF8;
  --bg-green: #EDF4EE;

  /* Texte */
  --text-primary: #0A0A0A;
  --text-secondary: #525252;
  --text-muted: #8A8A8A;

  /* Accents */
  --green: #2F6B4E;
  --green-dark: #1F4A36;
  --coral: #E76F51;

  /* Bordures */
  --border: #E8E8E6;
  --border-strong: #D0D0CC;

  /* Typographie */
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tailles */
  --h1: clamp(2.5rem, 8vw, 5.5rem);
  --h2: clamp(1.75rem, 5vw, 3rem);
  --h3: clamp(1.25rem, 3vw, 1.75rem);
  --body-size: 1rem;
  --body-size-lg: 1.125rem;
  --line-height-body: 1.65;

  /* Espacement */
  --section-padding: clamp(4rem, 10vh, 8rem);
  --container-padding: clamp(1.25rem, 4vw, 2.5rem);
  --gap: clamp(1rem, 3vw, 2rem);

  /* Bordures */
  --radius-card: 16px;
  --radius-pill: 999px;
  --radius-btn: 8px;
}

/* Grain de fond — texture subtile */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* =============================================
   BASE — html / body
   ============================================= */

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  body {
    font-size: var(--body-size-lg);
  }
}

/* =============================================
   TYPOGRAPHIE
   ============================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.15;
  font-weight: 400;
}

h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.375rem); }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

a {
  color: var(--green);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--green-dark);
}

/* =============================================
   LAYOUT — .container & .section
   ============================================= */

.container {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: var(--section-padding);
}

/* =============================================
   NAVIGATION
   ============================================= */

.nav {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: auto;
  max-width: calc(100% - 2rem);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.6rem 0.6rem 0.6rem 1.25rem;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav__logo:hover {
  opacity: 0.75;
}

.nav__logo-img {
  height: 32px;
  width: 32px;
  display: block;
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav__links a {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--green-dark);
}

@media (max-width: 767px) {
  .nav__links {
    display: none;
  }
}

/* =============================================
   HERO
   ============================================= */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
}

@media (min-width: 768px) {
  .hero {
    min-height: 100vh;
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  align-items: center;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1.4fr 0.9fr;
    gap: clamp(2rem, 5vw, 4rem);
  }
}

.hero-text {
  position: relative;
}

.hero-text::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--green), transparent);
  border-radius: 2px;
}

@media (max-width: 767px) {
  .hero-text::before {
    display: none;
  }
}

/* Texte */

.hero-surtitre {
  display: block;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--h1);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.accent-green {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--green);
  font-weight: 400;
}

.distinctive {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  color: var(--coral);
  margin-top: 1rem;
  margin-bottom: 2.5rem;
  max-width: none;
}

.distinctive-line {
  display: inline-block;
  width: 40px;
  height: 2px;
  background-color: var(--coral);
  flex-shrink: 0;
}

/* CTA */

.cta {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  background-color: var(--green);
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.cta:hover {
  background-color: var(--green-dark);
  color: #ffffff;
  transform: scale(1.02);
}

/* Image */

.hero-image {
  order: -1;
}

@media (min-width: 768px) {
  .hero-image {
    order: 0;
  }
}

.hero-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-card);
  background-color: var(--bg-soft);
  border: 3px solid var(--bg-green);
  outline: 1px solid var(--border);
}

/* =============================================
   SCROLL REVEAL
   ============================================= */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   SECTION LABEL (réutilisable)
   ============================================= */

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

/* =============================================
   À PROPOS
   ============================================= */

.about {
  background-color: var(--bg-soft);
}

.about-title {
  font-size: var(--h2);
  max-width: 18ch;
  margin-bottom: 1.75rem;
  line-height: 1.2;
}

.about-text {
  font-size: 1.0625rem;
  max-width: 60ch;
  color: var(--text-secondary);
  line-height: var(--line-height-body);
  margin-bottom: 3rem;
}

.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.5rem 2rem 1.5rem 0;
  margin-right: 2rem;
  border: none;
  background: none;
  border-radius: 0;
}

.stat-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--green);
  font-weight: 400;
  line-height: 1;
}

.stat-label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* =============================================
   SERVICES — 3 piliers
   ============================================= */

.services-title {
  font-size: var(--h2);
  margin-bottom: 2.5rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.service-card:hover {
  border-color: var(--green);
  transform: translateY(-4px);
}

.service-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2rem, 5vw, 2.75rem);
  color: var(--green);
  font-weight: 400;
  line-height: 1;
}

.service-name {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.service-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: var(--line-height-body);
  max-width: none;
  flex: 1;
}

.service-stack {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: none;
  line-height: 1.4;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* =============================================
   CR ENTREPRISE
   ============================================= */

.cr-section {
  background-color: var(--bg-soft);
}

.cr-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 768px) {
  .cr-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.cr-title {
  font-size: var(--h2);
  margin-bottom: 1.25rem;
}

.cr-desc {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 52ch;
  margin-bottom: 2rem;
  line-height: var(--line-height-body);
}

.cr-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.cr-detail {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cr-detail-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cr-detail-value {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.cr-visual img {
  display: block;
  width: 100%;
  min-height: 320px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  object-fit: cover;
  object-position: top;
}

/* =============================================
   PROJETS
   ============================================= */

.projects-title {
  font-size: var(--h2);
  margin-bottom: 2.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-image {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.project-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.02);
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-type {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
}

.project-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: var(--line-height-body);
  max-width: none;
}

.project-link {
  position: relative;
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--green);
  text-decoration: none;
  margin-top: 0.25rem;
  width: fit-content;
}

.project-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background-color: var(--green);
  transition: width 0.25s ease;
}

.project-link:hover::after {
  width: 100%;
}

.project-link--demo {
  color: var(--text-muted);
  font-style: italic;
  cursor: default;
}

.project-link--demo::after {
  display: none;
}

/* =============================================
   OPENCLAW — restructuré
   ============================================= */

.openclaw {
  background-color: var(--bg-green);
}

.openclaw-title {
  font-size: var(--h2);
  margin-bottom: 2rem;
}

/* Stat géante */
.openclaw-stat {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.openclaw-number {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(4rem, 12vw, 7rem);
  color: var(--green);
  line-height: 1;
  font-weight: 400;
}

.openclaw-unit {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 20ch;
  line-height: 1.4;
}

/* 3 étapes */
.openclaw-steps {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.ocstep {
  flex: 1;
  min-width: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ocstep-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  font-weight: 500;
}

.ocstep-body strong {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.ocstep-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: none;
}

.ocstep-arrow {
  font-size: 1.25rem;
  color: var(--green);
  padding-top: 1.5rem;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .ocstep-arrow {
    display: none;
  }
  .openclaw-steps {
    flex-direction: column;
  }
}

/* Visuel */
.openclaw-visual {
  margin-bottom: 1.5rem;
}

.openclaw-visual img,
.openclaw-visual video {
  display: block;
  width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  object-fit: cover;
}

/* Infra */
.openclaw-infra {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  max-width: none;
  line-height: 1.6;
}

/* =============================================
   CLÔTURE
   ============================================= */

.closing {
  text-align: center;
  padding-block: clamp(5rem, 15vh, 10rem);
}

.closing-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  color: var(--text-primary);
  line-height: 1.3;
  max-width: 22ch;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.closing-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.closing-link {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.closing-link:hover {
  color: var(--green-dark);
  border-color: var(--green-dark);
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}

.footer-text {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  max-width: none;
}

/* =============================================
   TERMINAL OPENCLAW
   ============================================= */

.terminal {
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background-color: #0D1117;
  font-family: var(--font-mono);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: #161B22;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-title {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.terminal-body p {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.75);
  max-width: none;
  line-height: 1.5;
}

.t-muted { color: rgba(255,255,255,0.3); }
.t-green { color: #3FB950; }
.t-cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* =============================================
   MOBILE — 480px et moins
   ============================================= */

@media (max-width: 480px) {
  .cta {
    width: 100%;
    text-align: center;
  }

  .hero-image img {
    aspect-ratio: 3 / 2;
  }

  .terminal-body {
    padding: 1rem;
    overflow-x: auto;
  }

  .terminal-body p {
    white-space: nowrap;
  }

  .openclaw-infra {
    word-break: break-word;
  }
}
