/* ============================================================
   Veridis Go — design system
   ============================================================ */

:root {
  --bg: #E9E5D8;
  --fg: #16201B;
  --muted: #6C7168;
  --accent: #1C5A3C;
  --accent-2: #C0673B;
  --line: rgba(22, 32, 27, 0.12);
  --line-strong: rgba(22, 32, 27, 0.2);
  --header-bg: rgba(233, 229, 216, 0.74);

  --font-sans: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --font-display: 'Syne', 'Geist', system-ui, sans-serif;

  --maxw: 1220px;
  --pad: 32px;
}

[data-theme="dark"] {
  --bg: #14201B;
  --fg: #E9EDE9;
  --muted: #8A9A92;
  --accent: #7EE0A6;
  --accent-2: #E0A46C;
  --line: rgba(233, 237, 233, 0.13);
  --line-strong: rgba(233, 237, 233, 0.2);
  --header-bg: rgba(20, 32, 27, 0.72);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

::selection { background: rgba(30, 122, 82, 0.18); }

a { color: inherit; }

/* Accessibilité ------------------------------------------------ */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 8px;
  font: 600 14px/1 var(--font-sans);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Décorations plein écran ------------------------------------- */

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 100;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.06;
  /* Pas de mix-blend-mode : un calque fixe qui se mélange repeint à chaque
     frame de scroll. En calque composite isolé, il ne repeint jamais. */
  transform: translateZ(0);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'/%3E%3C/svg%3E");
}

.crt { display: none; }
[data-crt="on"] .crt {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
    rgba(0,0,0,0.1) 0px, rgba(0,0,0,0.1) 1px,
    transparent 1px, transparent 3px);
  box-shadow: inset 0 0 180px 50px rgba(0,0,0,0.45);
}

/* Header ------------------------------------------------------ */

.header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px var(--pad);
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  user-select: none;
}
.brand__mark { color: var(--accent); flex: 0 0 auto; }
.brand__name {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.brand__accent { color: var(--accent); }
.brand--sm .brand__name { font-size: 16px; }

.nav { display: flex; align-items: center; }

.nav__menu {
  display: flex;
  align-items: center;
  gap: 26px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav__link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav__link:hover { color: var(--accent); }

.nav__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.nav__theme:hover { border-color: var(--accent); color: var(--accent); }
.nav__theme-icon::before { content: "☾"; font-size: 15px; }
[data-theme="dark"] .nav__theme-icon::before { content: "☀"; }

.nav__toggle { display: none; }

/* Hero -------------------------------------------------------- */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px var(--pad);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 69px);
}

.hero__intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 540px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: vg-pulse 2.4s ease-out infinite;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.4vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero__lead {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.62;
  color: var(--muted);
  max-width: 38ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.serif-italic { font-style: normal; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.hero__title .muted { color: var(--accent); }

.hero__note {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Boutons ----------------------------------------------------- */

.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: opacity 0.2s, transform 0.2s, border-color 0.2s, color 0.2s;
}
.btn--solid {
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
}
.btn--solid:hover { opacity: 0.9; transform: translateY(-1px); }
.btn--solid:disabled { opacity: 0.6; cursor: default; transform: none; }
.btn.is-loading {
  color: transparent;
  opacity: 1;
  cursor: default;
  pointer-events: none;
  transform: none;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid var(--bg);
  border-top-color: transparent;
  border-radius: 50%;
  animation: vg-spin 0.6s linear infinite;
}
@keyframes vg-spin { to { transform: rotate(360deg); } }
.btn--ghost {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Terminal ---------------------------------------------------- */

.terminal {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 468px;
  border: 1px solid rgba(126, 224, 166, 0.22);
  border-radius: 13px;
  background: #11201A;
  overflow: hidden;
  font-family: var(--font-mono);
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.6);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(126, 224, 166, 0.13);
  flex: 0 0 auto;
}
.terminal__dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: rgba(126, 224, 166, 0.22);
}
.terminal__path {
  margin-left: 8px;
  font-size: 12px;
  color: #5C7468;
  letter-spacing: 0.02em;
}

.terminal__body {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 17px 18px;
  font-size: 13.5px;
  line-height: 1.78;
  cursor: text;
}

.terminal__line {
  display: flex;
  gap: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal__prompt { color: #7EE0A6; flex: 0 0 auto; }

.terminal__live {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal__live[hidden] { display: none; }
[data-terminal-input] { color: #C9D6CF; }

.terminal__cursor {
  display: inline-block;
  width: 8px; height: 16px;
  background: #7EE0A6;
  margin-left: -2px;
  flex: 0 0 auto;
  animation: vg-blink 1s steps(1) infinite;
}

.terminal__field {
  /* Ancré en bas (sur l'invite), PAS sur toute la hauteur : sinon le curseur
     natif se place au centre de l'historique et fait sauter le scroll à chaque
     lettre. Le clic-pour-focus ailleurs est géré en JS. */
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2.6em;
  opacity: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font: inherit;
}

/* tons du terminal */
.t-ok    { color: #7EE0A6; }
.t-fg    { color: #C9D6CF; }
.t-muted { color: #647A6E; }
.t-accent{ color: #7EE0A6; }
.t-cmd   { color: #C9D6CF; }
.t-err   { color: #D69A6C; }

/* Sections ---------------------------------------------------- */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  scroll-margin-top: 80px;
}

.section__label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.section__num { color: var(--accent); }
.section__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.approche {
  padding-top: 96px;
  padding-bottom: 96px;
  border-top: 1px solid var(--line);
}
.approche .section__label { margin-bottom: 40px; }

.statement {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
  max-width: 22ch;
  text-wrap: balance;
}
.statement .accent {
  text-decoration: underline;
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}
.approche__text {
  margin: 32px 0 0;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
}

.savoir-faire { padding-bottom: 96px; }
.savoir-faire .section__label { margin-bottom: 8px; }

.capability {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 8px 28px;
  align-items: baseline;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  transition: padding-left 0.25s ease, border-color 0.25s;
}
.capability--last { border-bottom: 1px solid var(--line); }
.capability:hover { padding-left: 10px; border-color: var(--accent); }
.capability__num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
}
.capability__main { min-width: 0; }
.capability__title {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}
.capability__text {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 46ch;
}
.capability__tags {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

/* Contact ----------------------------------------------------- */

.contact {
  max-width: 700px;
  padding-bottom: 100px;
}
.contact .section__label { margin-bottom: 36px; }
.contact__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  letter-spacing: -0.015em;
}
.contact__lead {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.form { display: flex; flex-direction: column; gap: 14px; }
.form[hidden] { display: none; }
.form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.field {
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s;
}
textarea.field { resize: vertical; }
.field:focus { border-color: var(--accent); }
.field::placeholder { color: var(--muted); opacity: 1; }

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}
.form__mail {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.form__mail:hover { color: var(--accent); }
.form__error {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #C2603C;
}
.form__error[hidden] { display: none; }

.form__success {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--accent);
  border-radius: 11px;
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--fg);
  animation: vg-rise 0.4s ease both;
}
.form__success[hidden] { display: none; }
.form__check {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}
@keyframes vg-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::after { animation: none; }
  .form__success { animation: none; }
}

/* Footer ------------------------------------------------------ */

.footer { border-top: 1px solid var(--line); }
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 36px var(--pad) 42px;
}
.footer__legal {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.footer__links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.footer__links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--accent); }
.footer__crt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.footer__crt[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* Animations -------------------------------------------------- */

@keyframes vg-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes vg-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(192, 103, 59, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(192, 103, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 103, 59, 0); }
}
[data-theme="dark"] .dot { animation-name: vg-pulse-dark; }
@keyframes vg-pulse-dark {
  0%   { box-shadow: 0 0 0 0 rgba(224, 164, 108, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(224, 164, 108, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 164, 108, 0); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 860px) {
  :root { --pad: 22px; }

  /* Nav repliable en menu mobile */
  .nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
  }
  .nav__toggle-bar,
  .nav__toggle-bar::before,
  .nav__toggle-bar::after {
    content: "";
    display: block;
    width: 18px; height: 2px;
    background: var(--fg);
    transition: transform 0.25s, opacity 0.2s;
  }
  .nav__toggle-bar { position: relative; }
  .nav__toggle-bar::before { position: absolute; top: -6px; }
  .nav__toggle-bar::after  { position: absolute; top: 6px; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar { background: transparent; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar::before { top: 0; transform: rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar::after  { top: 0; transform: rotate(-45deg); }

  .nav__menu {
    position: absolute;
    top: 100%; right: var(--pad);
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 22px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.5);
    font-size: 13px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
  }
  .nav__menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav__theme { width: 40px; height: 40px; }
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: auto;
    padding-top: 56px;
    padding-bottom: 64px;
  }
  .hero__intro { max-width: none; }
  .terminal { height: 380px; }

  .approche { padding-top: 72px; padding-bottom: 72px; }
  .savoir-faire { padding-bottom: 72px; }

  /* La 3e colonne (tags) passe sous le titre */
  .capability {
    grid-template-columns: 40px 1fr;
    gap: 4px 16px;
  }
  .capability__tags { grid-column: 2; }
  .capability:hover { padding-left: 4px; }
}

@media (max-width: 420px) {
  .hero__title { font-size: clamp(2.3rem, 11vw, 3rem); }
  .btn { flex: 1 1 auto; }
}

/* Préférence mouvement réduit -------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
