/* =========================================================
   D4P Tech, Design system
   Apple-inspired: sober, spacious, high contrast.
   Landing = black & white. Product pages add a brand accent.
   ========================================================= */

:root {
  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, "Segoe UI", Roboto, Arial, sans-serif;

  /* Monochrome palette (Apple-like neutrals) */
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --bg-softer: #fafafc;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.16);

  /* Accent, neutral on the landing page, overridden per product */
  --accent: #1d1d1f;
  --accent-ink: #1d1d1f;
  --accent-2: #1d1d1f;
  --glow: rgba(0, 0, 0, 0.04);
  --glow-2: rgba(0, 0, 0, 0.02);
  --on-accent: #ffffff;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 52px;

  /* Layout */
  --maxw: 1120px;
  --maxw-narrow: 760px;
  --radius: 22px;
  --radius-sm: 14px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* Avoid flash before i18n resolves */
html:not(.i18n-ready) [data-i18n],
html:not(.i18n-ready) [data-i18n-html] {
  opacity: 0;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: clamp(72px, 11vw, 140px);
}

.section--tight {
  padding-block: clamp(48px, 7vw, 88px);
}

.narrow {
  max-width: var(--maxw-narrow);
  margin-inline: auto;
}

.center {
  text-align: center;
}

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  margin: 0 0 18px;
  text-transform: none;
}

/* The eyebrow sitting under the hero logo reads as a subtitle: give it more presence */
.hero .eyebrow {
  font-size: 19px;
}

/* izilda: subtitles (hero "Fidelisation client" and section "Pourquoi izilda")
   share the same larger size for consistency */
body[data-theme="izilda"] .eyebrow {
  font-size: clamp(24px, 3.8vw, 34px);
  letter-spacing: -0.01em;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}

.display {
  font-size: clamp(42px, 8.2vw, 88px);
  letter-spacing: -0.035em;
  line-height: 1.03;
}

h2.title {
  font-size: clamp(30px, 4.6vw, 52px);
}

h3 {
  font-size: clamp(21px, 2.4vw, 26px);
  letter-spacing: -0.02em;
}

.lead {
  font-size: clamp(19px, 2.3vw, 25px);
  line-height: 1.4;
  color: var(--ink-2);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 22px 0 0;
  text-wrap: balance;
}

.muted {
  color: var(--ink-2);
}

p {
  margin: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  padding: 13px 24px;
  border-radius: 980px;
  border: 1px solid transparent;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease),
    opacity 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  white-space: nowrap;
}

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

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

.btn--primary:hover {
  opacity: 0.88;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn--light {
  background: #fff;
  color: var(--accent-ink);
  border-color: #fff;
  font-weight: 600;
}

.btn--light:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 400;
  color: var(--accent-ink);
}

.link-arrow::after {
  content: "›";
  font-size: 1.25em;
  line-height: 0;
  transition: transform 0.35s var(--ease);
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
}

.center .btn-row {
  justify-content: center;
}

/* =========================================================
   Navigation
   ========================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.nav__inner {
  max-width: var(--maxw);
  height: 100%;
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--line);
}

.brand b {
  font-weight: 600;
}

.brand b span {
  color: var(--ink-3);
  font-weight: 500;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav__link {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  opacity: 0.85;
  transition: opacity 0.2s var(--ease);
}

.nav__link:hover {
  opacity: 1;
}

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

/* Language switcher */
.lang {
  position: relative;
}

.lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 980px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.lang__btn:hover {
  border-color: var(--ink);
}

.lang__btn svg {
  width: 13px;
  height: 13px;
  opacity: 0.6;
}

.lang__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 176px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 7px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
    visibility 0.25s;
}

.lang.open .lang__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.lang__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  transition: background 0.18s var(--ease);
}

.lang__opt:hover {
  background: var(--bg-soft);
}

.lang__opt[aria-selected="true"] {
  font-weight: 600;
}

.lang__opt[aria-selected="true"]::after {
  content: "✓";
  color: var(--accent-ink);
}

.lang__opt span {
  color: var(--ink-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 34px;
  height: 34px;
  position: relative;
}

.nav__toggle span {
  position: absolute;
  left: 7px;
  right: 7px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}

.nav__toggle span:nth-child(1) {
  top: 12px;
}
.nav__toggle span:nth-child(2) {
  top: 21px;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(60px, 11vw, 130px));
  padding-bottom: clamp(60px, 10vw, 120px);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--glow) 0%, transparent 60%),
    radial-gradient(80% 60% at 85% 10%, var(--glow-2) 0%, transparent 55%);
}

.hero .display {
  margin-top: 6px;
}

.hero__mark {
  width: clamp(84px, 12vw, 116px);
  height: clamp(84px, 12vw, 116px);
  border-radius: clamp(20px, 3vw, 27px);
  margin: 0 auto 34px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 20px 50px rgba(0, 0, 0, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

.hero__logo {
  height: clamp(40px, 6vw, 62px);
  width: auto;
  margin: 0 auto 30px;
}

/* =========================================================
   Product cards (landing)
   ========================================================= */
.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 460px;
  padding: 42px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.pcard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.pcard--flawmap::before {
  background: radial-gradient(120% 120% at 80% 0%, rgba(51, 204, 52, 0.16), transparent 60%);
}

.pcard--izilda::before {
  background: radial-gradient(120% 120% at 80% 0%, rgba(128, 160, 205, 0.22), transparent 60%);
}

.pcard:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.pcard:hover::before {
  opacity: 1;
}

.pcard__logo {
  height: 38px;
  width: auto;
  margin-bottom: 26px;
}

/* izilda's mark is a compact square lockup, give it a touch more presence */
.pcard--izilda .pcard__logo {
  height: 56px;
  margin-bottom: 18px;
}

.pcard h3 {
  font-size: clamp(24px, 3vw, 32px);
}

.pcard p {
  color: var(--ink-2);
  margin-top: 12px;
  font-size: 18px;
  max-width: 38ch;
}

.pcard__foot {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.pcard__tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 980px;
  margin-bottom: 22px;
  width: fit-content;
}

.pcard--flawmap .pcard__tag {
  background: rgba(51, 204, 52, 0.14);
  color: #1a7d1b;
}

.pcard--flawmap .pcard__foot {
  color: #1a7d1b;
}

.pcard--izilda .pcard__tag {
  background: rgba(128, 160, 205, 0.2);
  color: #3a5f92;
}

.pcard--izilda .pcard__foot {
  color: #3a5f92;
}

.pcard__foot::after {
  content: "›";
  font-size: 1.3em;
  line-height: 0;
  transition: transform 0.35s var(--ease);
}

.pcard:hover .pcard__foot::after {
  transform: translateX(5px);
}

/* =========================================================
   Feature grids
   ========================================================= */
.grid {
  display: grid;
  gap: 24px;
}

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

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.feature {
  padding: 36px 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid transparent;
  transition: transform 0.5s var(--ease), background 0.4s var(--ease);
}

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

.feature__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line);
  color: var(--accent-ink);
}

.feature__icon svg {
  width: 24px;
  height: 24px;
}

.feature h3 {
  font-size: 21px;
  margin-bottom: 10px;
}

.feature p {
  color: var(--ink-2);
  font-size: 16px;
}

/* Stat / highlight row */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}

.stat__num {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(180deg, var(--accent-ink), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat__label {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 16px;
}

/* Split feature (image/text alternating) */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
}

.split__visual {
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* =========================================================
   CTA band
   ========================================================= */
.cta-band {
  border-radius: var(--radius);
  padding: clamp(48px, 8vw, 96px) 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--ink);
}

.cta-band--accent {
  background: linear-gradient(135deg, var(--accent-ink) 0%, var(--accent) 100%);
}

.cta-band h2 {
  color: #fff;
}

.cta-band .lead {
  color: rgba(255, 255, 255, 0.82);
}

/* =========================================================
   Product hero washes
   ========================================================= */
body[data-theme="flawmap"] {
  --accent: #2bb32c;
  --accent-ink: #1a7d1b;
  --accent-2: #5fe05f;
  --glow: rgba(51, 204, 52, 0.18);
  --glow-2: rgba(51, 204, 52, 0.08);
}

body[data-theme="izilda"] {
  --accent: #80a0cd;
  --accent-ink: #4a6c99;
  --accent-2: #da997e;
  --glow: rgba(128, 160, 205, 0.26);
  --glow-2: rgba(218, 153, 126, 0.16);
}

/* flawmap eyebrows: darker green for legibility */
body[data-theme="flawmap"] .eyebrow {
  color: #15691a;
}

/* izilda bottom section: warm terracotta (cleaner, less brown) on stats + CTA block.
   stat__num uses background-image (not the shorthand) so background-clip:text is kept. */
body[data-theme="izilda"] .stat__num {
  background-image: linear-gradient(180deg, #d3654a 0%, #eaa184 100%);
}

body[data-theme="izilda"] .cta-band--accent {
  background: linear-gradient(135deg, #c65b3f 0%, #e78a68 100%);
}

body[data-theme="izilda"] .cta-band--accent .btn--light {
  color: #b95539;
}

/* izilda hero: rebalance the long title against the logo */
body[data-theme="izilda"] .hero .display {
  font-size: clamp(38px, 6.4vw, 66px);
}

.hero--product {
  padding-bottom: clamp(28px, 4.5vw, 60px);
}

.hero--product .hero__bg {
  background:
    radial-gradient(110% 75% at 50% -5%, var(--glow) 0%, transparent 58%),
    radial-gradient(70% 60% at 12% 18%, var(--glow-2) 0%, transparent 60%);
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  background: #000;
  color: rgba(255, 255, 255, 0.82);
  padding-block: 64px 40px;
  font-size: 14px;
}

.footer a {
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.2s var(--ease);
}

.footer a:hover {
  color: #fff;
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer__brand {
  max-width: 300px;
}

.footer__brand .brand {
  color: #fff;
  margin-bottom: 16px;
}

.footer__brand .brand img {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.footer__brand p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

.footer__cols {
  display: flex;
  gap: clamp(40px, 8vw, 90px);
  flex-wrap: wrap;
}

.footer__col h4 {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.66);
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}

.footer__col a {
  display: block;
  margin-bottom: 12px;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 30px;
  color: rgba(255, 255, 255, 0.62);
}

/* =========================================================
   Legal page
   ========================================================= */
.legal {
  padding-top: calc(var(--nav-h) + 70px);
}

.legal h1 {
  font-size: clamp(34px, 5vw, 52px);
}

.legal__updated {
  color: var(--ink-3);
  font-size: 15px;
  margin-top: 16px;
}

.legal article {
  margin-top: 56px;
}

.legal section {
  padding-block: 30px;
  border-top: 1px solid var(--line);
}

.legal h2 {
  font-size: 22px;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.legal h3 {
  font-size: 17px;
  margin: 22px 0 8px;
  letter-spacing: -0.01em;
}

.legal p,
.legal li {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
}

.legal p + p {
  margin-top: 12px;
}

.legal ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.legal li {
  margin-bottom: 8px;
}

.legal a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal .placeholder {
  color: var(--ink-3);
  font-style: italic;
}

/* =========================================================
   Scroll reveal
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal[data-delay="1"] {
  transition-delay: 0.08s;
}
.reveal[data-delay="2"] {
  transition-delay: 0.16s;
}
.reveal[data-delay="3"] {
  transition-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .nav__links {
    display: none;
  }

  .nav__toggle {
    display: block;
  }

  .products,
  .grid--3,
  .grid--2,
  .stats,
  .split {
    grid-template-columns: 1fr;
  }

  .split__visual {
    order: -1;
  }

  .pcard {
    min-height: 0;
    padding: 32px 28px;
  }

  /* Mobile menu (links injected) */
  .nav__links.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
    padding: 22px 24px 28px;
    gap: 20px;
    align-items: flex-start;
  }

  .nav__links.is-open .nav__link {
    font-size: 19px;
  }

  .footer__top {
    flex-direction: column;
    gap: 36px;
  }
}

@media (max-width: 480px) {
  .container {
    padding-inline: 20px;
  }
  .btn-row .btn,
  .btn-row .link-arrow {
    width: 100%;
    justify-content: center;
  }
}
