/* =========================================================================
   Deenius — feuille de style principale
   Palette et typographie reprises du design system de l'app iOS.
   Mobile-first · dark mode automatique (prefers-color-scheme).
   ========================================================================= */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  /* Surfaces */
  --bg-primary:   #F5F0E6;
  --bg-secondary: #FAF6EE;
  --bg-elevated:  #FFFFFF;
  --bg-tinted:    #ECE4D2;
  /* Texte */
  --text-primary:   #1F1A14;
  --text-secondary: #6B6258;
  --text-tertiary:  #7D7166;
  --text-on-accent: #FAF6EE;
  /* Accents */
  --accent-primary: #1B5E3F;
  --accent-gold:    #856738;
  --accent-needle:  #B33A2E;
  /* Lignes & états */
  --divider: rgba(31, 26, 20, 0.08);
  --shadow-sm: 0 1px 2px rgba(31, 26, 20, 0.04), 0 2px 8px rgba(31, 26, 20, 0.05);
  --shadow-md: 0 4px 12px rgba(31, 26, 20, 0.07), 0 12px 32px rgba(31, 26, 20, 0.09);
  --shadow-lg: 0 8px 24px rgba(31, 26, 20, 0.10), 0 24px 60px rgba(31, 26, 20, 0.14);
  /* Typo */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  /* Rythme */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary:   #0F0E0C;
    --bg-secondary: #16140F;
    --bg-elevated:  #1E1B16;
    --bg-tinted:    #1A1813;
    --text-primary:   #F2EBDD;
    --text-secondary: #9C9382;
    --text-tertiary:  #857A6D;
    --text-on-accent: #0F0E0C;
    --accent-primary: #5A9B7A;
    --accent-gold:    #D4A867;
    --accent-needle:  #D4564A;
    --divider: rgba(242, 235, 221, 0.09);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  }
}

/* ---- Reset & base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 17px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; }
h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.15rem; }

.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.015em; }
:lang(ar) { direction: rtl; }

/* ---- Layout helpers ---------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 11vw, 128px); }
.eyebrow {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-gold);
  margin-bottom: 14px;
}
.lead { color: var(--text-secondary); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.center { text-align: center; }
.section-head { max-width: 640px; margin-inline: auto; margin-bottom: clamp(40px, 6vw, 64px); }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 1rem; line-height: 1;
  padding: 15px 26px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn-primary { background: var(--accent-primary); color: var(--text-on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; border-color: var(--divider); color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-tinted); }

/* App Store badge (image officiel SVG inline) */
.appstore-badge { display: inline-block; transition: transform .18s ease, opacity .18s ease; }
.appstore-badge:hover { transform: translateY(-2px); }
.appstore-badge svg { height: 54px; width: auto; }

/* ---- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: color-mix(in srgb, var(--bg-primary) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--divider); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.12rem; letter-spacing: -0.02em; }
.brand .crescent { width: 26px; height: 26px; }
.nav-links { display: none; align-items: center; gap: 30px; }
.nav-links a { font-size: 0.95rem; color: var(--text-secondary); transition: color .15s ease; }
.nav-links a:hover { color: var(--text-primary); }
.nav-right { display: flex; align-items: center; gap: 14px; }

/* Sélecteur de langue */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; font-size: 0.82rem; font-weight: 600; color: var(--text-tertiary); }
.lang-switch a { padding: 4px 7px; border-radius: 7px; transition: background .15s ease, color .15s ease; }
.lang-switch a[aria-current="true"] { color: var(--text-primary); background: var(--bg-tinted); }
.lang-switch a:not([aria-current="true"]):hover { color: var(--text-primary); }
.lang-sep { opacity: .4; }

.header-cta { display: none; }

@media (min-width: 860px) {
  .nav-links { display: flex; }
  .header-cta { display: inline-flex; }
}

/* ---- Crescent motif ---------------------------------------------------- */
.crescent { color: var(--accent-gold); }

/* ---- Hero -------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(48px, 8vw, 80px); padding-bottom: clamp(40px, 7vw, 80px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 50% -8%, color-mix(in srgb, var(--accent-gold) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 10%, color-mix(in srgb, var(--accent-primary) 9%, transparent), transparent 70%);
}
.hero-copy { text-align: center; max-width: 680px; margin-inline: auto; }
.hero-logo { width: 88px; height: 88px; margin: 0 auto 26px; filter: drop-shadow(0 6px 18px rgba(133,103,56,.22)); }
.hero h1 { margin-bottom: 20px; font-weight: 400; }
.hero h1 .serif { font-weight: 700; }
.hero-sub { font-size: clamp(1.1rem, 2.3vw, 1.4rem); color: var(--text-secondary); max-width: 34ch; margin: 0 auto 32px; }
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero-trust { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 22px; font-size: 0.85rem; color: var(--text-tertiary); }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { width: 15px; height: 15px; color: var(--accent-primary); }

/* ---- Features ---------------------------------------------------------- */
.features-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .features-grid { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--bg-elevated); border: 1px solid var(--divider);
  border-radius: var(--radius-lg); padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent-gold) 30%, var(--divider)); }
.card-icon {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent-gold) 14%, transparent);
  color: var(--accent-gold); margin-bottom: 18px;
}
.card-icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-secondary); font-size: 0.96rem; }

/* ---- Privacy section --------------------------------------------------- */
.privacy { background: var(--bg-secondary); }
.privacy-inner {
  display: grid; gap: clamp(36px, 6vw, 64px); align-items: center;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent-primary) 6%, var(--bg-elevated)), var(--bg-elevated));
  border: 1px solid var(--divider);
  border-radius: var(--radius-xl); padding: clamp(32px, 6vw, 64px);
  box-shadow: var(--shadow-md);
}
@media (min-width: 900px) { .privacy-inner { grid-template-columns: 1fr 0.85fr; } }
.privacy h2 { margin-bottom: 18px; }
.privacy p { color: var(--text-secondary); margin-bottom: 16px; }
.privacy-list { list-style: none; padding: 0; display: grid; gap: 14px; margin-top: 24px; }
.privacy-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.98rem; }
.privacy-list svg { width: 22px; height: 22px; color: var(--accent-primary); flex: none; margin-top: 1px; }
.privacy-shield { display: grid; place-items: center; }
.privacy-shield .shield-badge {
  width: min(240px, 60vw); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent-primary) 22%, var(--bg-elevated)), var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--accent-primary) 24%, transparent);
  box-shadow: var(--shadow-md);
}
.privacy-shield svg { width: 46%; height: 46%; color: var(--accent-primary); }

/* ---- Reviews ----------------------------------------------------------- */
.reviews-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .reviews-grid { grid-template-columns: repeat(3, 1fr); } }
.review {
  background: var(--bg-elevated); border: 1px solid var(--divider);
  border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm);
}
.stars { display: flex; gap: 3px; color: var(--accent-gold); margin-bottom: 14px; }
.stars svg { width: 17px; height: 17px; }
.review p { color: var(--text-secondary); font-size: 0.98rem; margin-bottom: 18px; min-height: 3em; }
.review .who { display: flex; align-items: center; gap: 11px; }
.review .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-tinted); display: grid; place-items: center; font-weight: 600; color: var(--accent-gold); font-size: 0.9rem; }
.review .who b { font-size: 0.92rem; font-weight: 600; }
.review .who small { display: block; color: var(--text-tertiary); font-size: 0.8rem; }
.review.placeholder { border-style: dashed; opacity: .85; }

/* ---- FAQ --------------------------------------------------------------- */
.faq { max-width: 780px; margin-inline: auto; }
.faq-item { border-bottom: 1px solid var(--divider); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 22px 4px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  font-weight: 600; font-size: 1.08rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex: none; width: 20px; height: 20px;
  background: currentColor; color: var(--accent-gold);
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  transition: transform .25s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 4px 24px; color: var(--text-secondary); }
.faq-item .faq-body p { margin-bottom: 12px; }
.faq-item .faq-body p:last-child { margin-bottom: 0; }

/* ---- CTA band ---------------------------------------------------------- */
.cta-band { text-align: center; }
.cta-inner {
  background: linear-gradient(160deg, var(--accent-primary), color-mix(in srgb, var(--accent-primary) 70%, #000));
  border-radius: var(--radius-xl); padding: clamp(40px, 7vw, 72px) var(--gutter);
  color: var(--text-on-accent); box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
@media (prefers-color-scheme: dark) { .cta-inner { color: #F2EBDD; } }
.cta-inner::before {
  content: ""; position: absolute; top: -40%; right: -10%; width: 340px; height: 340px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-gold) 55%, transparent), transparent 65%); opacity: .5;
}
.cta-inner h2 { color: inherit; margin-bottom: 14px; position: relative; }
.cta-inner p { opacity: .82; max-width: 46ch; margin: 0 auto 28px; position: relative; }
.cta-inner .appstore-badge { position: relative; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { background: var(--bg-secondary); border-top: 1px solid var(--divider); padding-block: clamp(48px, 7vw, 72px); }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: var(--text-secondary); font-size: 0.92rem; max-width: 34ch; }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-tertiary); margin-bottom: 16px; font-weight: 600; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 11px; }
.footer-col a { color: var(--text-secondary); font-size: 0.95rem; transition: color .15s ease; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--divider);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  font-size: 0.85rem; color: var(--text-tertiary);
}

/* ---- Article / blog ---------------------------------------------------- */
.article-header { max-width: 760px; margin-inline: auto; text-align: center; }
.article-meta { color: var(--text-tertiary); font-size: 0.9rem; margin-top: 18px; display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.article-body { max-width: 720px; margin-inline: auto; font-size: 1.08rem; }
.article-body h2 { font-size: 1.7rem; margin: 44px 0 16px; }
.article-body h3 { font-size: 1.25rem; margin: 32px 0 12px; }
.article-body p { color: var(--text-secondary); margin-bottom: 20px; }
.article-body ul, .article-body ol { color: var(--text-secondary); margin: 0 0 20px; padding-left: 24px; display: grid; gap: 8px; }
.article-body a { color: var(--accent-primary); text-decoration: underline; text-underline-offset: 3px; }
.article-body blockquote {
  border-left: 3px solid var(--accent-gold); padding: 6px 0 6px 22px; margin: 0 0 24px;
  font-family: var(--font-serif); font-size: 1.2rem; color: var(--text-primary);
}

.post-list { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .post-list { grid-template-columns: repeat(2, 1fr); } }
.post-card {
  display: block; background: var(--bg-elevated); border: 1px solid var(--divider);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card .cat { font-size: 0.75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-gold); font-weight: 600; }
.post-card { position: relative; }
.post-card .badge {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: .02em;
  color: var(--bg-elevated);
  background: var(--accent-gold);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent-gold) 45%, transparent);
}
.post-card .badge svg { width: 11px; height: 11px; flex: 0 0 auto; }
.post-card h3 { font-size: 1.3rem; margin: 10px 0; }
.post-card p { color: var(--text-secondary); font-size: 0.96rem; margin-bottom: 16px; }
.post-card .date { font-size: 0.85rem; color: var(--text-tertiary); }
.blog-empty { text-align: center; color: var(--text-secondary); padding: 48px 0; }

/* ---- Legal / prose pages ---------------------------------------------- */
.prose { max-width: 760px; margin-inline: auto; }
.prose h1 { margin-bottom: 12px; }
.prose .updated { color: var(--text-tertiary); font-size: 0.9rem; margin-bottom: 40px; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 14px; }
.prose h3 { font-size: 1.2rem; margin: 28px 0 10px; }
.prose p, .prose li { color: var(--text-secondary); margin-bottom: 14px; }
.prose ul { padding-left: 24px; }
.prose a { color: var(--accent-primary); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text-primary); }

/* ---- Reveal on scroll -------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---- Skip link --------------------------------------------------------- */
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent-primary); color: var(--text-on-accent); padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; border-radius: 4px; }
