/* ==========================================================================
   Capleia Technologies — site vitrine
   Design system: native CSS, palette "graphite + emerald" (single accent),
   shape lock: pills for actions, 20px for panels, 10px for inputs.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

:root {
  /* Light (default) */
  --bg: #f4f5ef;
  --bg-elevated: #ffffff;
  --bg-sunken: #eceee4;
  --ink: #13150e;
  --ink-soft: #4c5044;
  --ink-faint: #666a58;
  --line: rgba(19, 21, 14, 0.1);
  --line-strong: rgba(19, 21, 14, 0.18);
  --accent: #1c7a51;
  --accent-strong: #14603e;
  --accent-soft: #e2eee2;
  --accent-contrast: #f7faf4;
  --shadow-sm: 0 1px 2px rgba(19, 21, 14, 0.07);
  --shadow-md: 0 16px 40px -18px rgba(19, 21, 14, 0.24);
  --shadow-lg: 0 28px 64px -20px rgba(19, 21, 14, 0.3);

  --radius-panel: 20px;
  --radius-tile: 16px;
  --radius-input: 10px;
  --radius-pill: 999px;

  --font-sans: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-w: 1240px;
  --nav-h: 72px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f0a;
    --bg-elevated: #171911;
    --bg-sunken: #0a0b07;
    --ink: #f1f2ea;
    --ink-soft: #c5c9b7;
    --ink-faint: #888c78;
    --line: rgba(241, 242, 234, 0.1);
    --line-strong: rgba(241, 242, 234, 0.18);
    --accent: #3ecb8b;
    --accent-strong: #5ee0a2;
    --accent-soft: rgba(62, 203, 139, 0.14);
    --accent-contrast: #06210f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 16px 40px -18px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 28px 64px -20px rgba(0, 0, 0, 0.6);
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, p { margin: 0; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
}

/* Typography scale ------------------------------------------------------ */

h2.section-title {
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 18ch;
}

.section-body {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 52ch;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 44px;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border: 1px solid var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn-small { height: 40px; padding: 0 16px; font-size: 0.875rem; }

.btn-block { width: 100%; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
  white-space: nowrap;
}

.nav-right { display: flex; align-items: center; gap: 18px; }

.nav-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-input);
  flex-shrink: 0;
}
.nav-toggle svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  fill: currentColor;
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 1;
  transition: opacity 180ms ease, transform 180ms var(--ease);
}
.nav-toggle .icon-close { opacity: 0; transform: translate(-50%, -50%) rotate(-90deg); }
.nav-open .nav-toggle .icon-open { opacity: 0; transform: translate(-50%, -50%) rotate(90deg); }
.nav-open .nav-toggle .icon-close { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-right .btn-primary { display: none; }

  .mobile-panel {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    z-index: 49;
    background: var(--bg);
    padding: 28px 20px 40px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 0s linear 220ms;
  }
  .nav-open .mobile-panel {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 0s linear 0s;
  }
  .mobile-panel .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .mobile-panel .nav-links a {
    width: 100%;
    padding: 14px 4px;
    font-size: 1.05rem;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .mobile-panel .btn-primary { margin-top: 22px; }
}
@media (min-width: 901px) {
  .mobile-panel { display: none !important; }
}

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

.hero {
  padding: clamp(40px, 8vw, 96px) 0 72px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.3rem, 1.7rem + 2.6vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 15ch;
}

.hero-content .section-body {
  margin-top: 20px;
  font-size: 1.125rem;
  max-width: 44ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-sunken));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-visual svg { width: 100%; height: 100%; }
.hero-visual .flow-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1100ms var(--ease-in-out) 200ms;
}
.hero-visual.is-visible .flow-line { stroke-dashoffset: 0; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; margin: 0 auto; aspect-ratio: 4 / 3; }
}
@media (max-width: 480px) {
  .hero-actions .btn { flex: 1 1 auto; }
}

/* Generic section -------------------------------------------------------- */

section { padding: 88px 0; }
@media (max-width: 640px) { section { padding: 64px 0; } }

.section-alt { background: var(--bg-elevated); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Bento / feature grid (OK César) ---------------------------------------- */

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.bento-tile {
  border-radius: var(--radius-tile);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bento-tile.tile-lg { grid-column: span 3; grid-row: span 2; background: linear-gradient(150deg, var(--bg-elevated), var(--accent-soft)); }
.bento-tile.tile-sm { grid-column: span 3; }
.bento-tile.tile-tint { background: var(--bg-sunken); }

.tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tile-icon svg { width: 22px; height: 22px; fill: currentColor; }

.bento-tile h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.bento-tile p { font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.55; }

.tile-graphic { margin-top: auto; padding-top: 18px; }
.tile-graphic svg { width: 100%; height: auto; display: block; }

.how-it-works {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.how-step { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.how-step h4 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.how-step p { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; }
.how-arrow { width: 20px; height: 20px; margin-top: 22px; flex-shrink: 0; fill: var(--ink-faint); }

@media (max-width: 780px) {
  .how-it-works { flex-direction: column; gap: 28px; }
  .how-arrow { display: none; }
}

.section-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.section-cta .section-body { margin: 0; max-width: 40ch; }
@media (max-width: 640px) {
  .section-cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-tile.tile-lg { grid-column: span 2; grid-row: auto; }
  .bento-tile.tile-sm { grid-column: span 2; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
}

.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8125rem;
  font-weight: 600;
  width: fit-content;
}
.product-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-strong);
}

/* Viticole teaser ---------------------------------------------------------- */

.teaser {
  border-radius: 28px;
  background: var(--ink);
  color: var(--bg);
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.teaser-content {
  padding: clamp(36px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
}
.teaser-content h2 { color: var(--bg); max-width: 16ch; }
.teaser-content .section-body { color: color-mix(in srgb, var(--bg) 72%, transparent); }
.teaser .product-badge { background: rgba(255,255,255,0.1); color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .teaser { background: var(--bg-sunken); }
  :root:not([data-theme="light"]) .teaser-content h2,
  :root:not([data-theme="light"]) .teaser .section-body { color: var(--ink); }
  :root:not([data-theme="light"]) .teaser-content .section-body { color: var(--ink-soft); }
}

.teaser-visual {
  position: relative;
  min-height: 320px;
  background: linear-gradient(155deg, #0f2118, #0a1712);
}
.teaser-visual svg { width: 100%; height: 100%; }

@media (max-width: 780px) {
  .teaser { grid-template-columns: 1fr; }
  .teaser-visual { min-height: 220px; order: -1; }
}

/* Process / sur-mesure ------------------------------------------------------ */

.process-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
}
@media (max-width: 860px) {
  .process-layout { grid-template-columns: 1fr; gap: 36px; }
}

.process-list { display: flex; flex-direction: column; }
.process-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 20px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.process-step:last-child { border-bottom: 1px solid var(--line); }
.process-index {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--accent-strong);
  padding-top: 2px;
}
.process-step h3 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.process-step p { font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.55; max-width: 46ch; }

.process-aside {
  border-radius: var(--radius-panel);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: fit-content;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.process-aside h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.process-aside p { font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.6; }

/* Approche ------------------------------------------------------------------ */

.approach-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 860px) {
  .approach-layout { grid-template-columns: 1fr; gap: 32px; }
}

.principle-list { display: flex; flex-direction: column; gap: 0; }
.principle {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.principle:first-child { border-top: 1px solid var(--line); }
.principle .tile-icon { width: 38px; height: 38px; border-radius: 10px; }
.principle .tile-icon svg { width: 19px; height: 19px; }
.principle h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.principle p { font-size: 0.9375rem; color: var(--ink-soft); line-height: 1.55; }

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

.contact-panel {
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: clamp(32px, 5vw, 56px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 780px) {
  .contact-panel { grid-template-columns: 1fr; gap: 32px; }
}

.contact-links { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-tile);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.contact-link:active { transform: scale(0.98); }
.contact-link .tile-icon { width: 38px; height: 38px; border-radius: 10px; }
.contact-link .tile-icon svg { width: 19px; height: 19px; }
.contact-link .label { font-size: 0.8125rem; color: var(--ink-faint); }
.contact-link .value { font-size: 0.9375rem; font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 0.875rem; font-weight: 600; }
.field input, .field textarea {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  padding: 13px 14px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9375rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-hint { font-size: 0.8125rem; color: var(--ink-faint); margin-top: -2px; }
.form-note { font-size: 0.8125rem; color: var(--ink-faint); margin-top: 14px; line-height: 1.5; }

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

footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
}
.footer-brand { max-width: 320px; display: flex; flex-direction: column; gap: 14px; }
.footer-brand .section-body { font-size: 0.9375rem; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h4 { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-bottom: 4px; }
.footer-col a { font-size: 0.9375rem; color: var(--ink-soft); transition: color 0.2s var(--ease); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* Hover states — pointer devices only, avoids sticky :hover on touch tap ---------- */

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
  .nav-links a:hover { color: var(--ink); }
  .bento-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
  .contact-link:hover { border-color: var(--accent); transform: translateX(2px); }
  .footer-col a:hover { color: var(--accent-strong); }
}

/* Reveal on scroll -------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-group.is-visible .reveal-item { opacity: 1; transform: none; }
.reveal-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 450ms var(--ease), transform 450ms var(--ease);
}
.reveal-group.is-visible .reveal-item:nth-child(1) { transition-delay: 0.02s; }
.reveal-group.is-visible .reveal-item:nth-child(2) { transition-delay: 0.08s; }
.reveal-group.is-visible .reveal-item:nth-child(3) { transition-delay: 0.14s; }
.reveal-group.is-visible .reveal-item:nth-child(4) { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-item { opacity: 1; transform: none; transition: none; }
  .hero-visual .flow-line { stroke-dashoffset: 0; transition: none; }
  .nav-toggle svg { transition: opacity 150ms ease; }
  .nav-toggle .icon-close,
  .nav-open .nav-toggle .icon-open,
  .nav-open .nav-toggle .icon-close {
    transform: translate(-50%, -50%);
  }
  .mobile-panel,
  .nav-open .mobile-panel {
    transform: none;
    transition: opacity 150ms ease, visibility 0s linear;
  }
}

/* Utility ------------------------------------------------------------------------ */

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