/*
 * Koave landing site · DA V3 warm + Fraunces / DM Sans
 * Aligne avec design-system/tokens (palette warm, terracotta + sunshine).
 * Mobile-first, i18n-ready (RTL via [dir=rtl]).
 */

:root {
  --cream: #FBF6EE;
  --sable: #F4EADB;
  --surface-soft: #FFF9F0;
  --ink: #2B1D14;
  --ink-soft: #6B5A4E;
  --ink-muted: #A5968A;
  --espresso: #1E1713;
  --terracotta: #D56A4A;
  --terracotta-dark: #A8492F;
  --terracotta-soft: #F4CBB8;
  --sunshine: #F4B942;
  --sunshine-soft: #FCE4A8;
  --sage: #8AA68A;
  --berry: #C7577E;
  --sky: #6FA8C9;

  --hair: rgba(43, 29, 20, 0.08);
  --hair-strong: rgba(43, 29, 20, 0.14);

  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(ellipse 140% 70% at 80% -5%, rgba(244, 185, 66, 0.20) 0%, transparent 55%),
    radial-gradient(ellipse 100% 50% at 5% 60%, rgba(213, 106, 74, 0.06) 0%, transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }

img { display: block; max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════ */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(251, 246, 238, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--hair);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-mark {
  filter: drop-shadow(0 2px 4px rgba(43, 29, 20, 0.08));
}
.nav-wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-links {
  display: flex;
  gap: 22px;
  font-size: 13px;
  font-weight: 500;
}
.nav-links a {
  color: var(--ink);
  opacity: 0.65;
  transition: opacity 150ms ease;
}
.nav-links a:hover { opacity: 1; }

/* Lang switcher */
.lang-switch {
  position: relative;
  font-size: 13px;
  font-weight: 500;
}
.lang-switch summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(43, 29, 20, 0.05);
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  transition: background 150ms;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { background: rgba(43, 29, 20, 0.10); }
.lang-switch summary svg { opacity: 0.55; }
.lang-switch[open] summary { background: rgba(43, 29, 20, 0.10); }
.lang-switch ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface-soft);
  border: 1px solid var(--hair-strong);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(43, 29, 20, 0.12);
  min-width: 180px;
  max-height: 60vh;
  overflow-y: auto;
}
[dir="rtl"] .lang-switch ul { right: auto; left: 0; }
.lang-switch li a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  transition: background 120ms;
}
.lang-switch li a:hover { background: rgba(43, 29, 20, 0.06); }
.lang-switch li.current a { background: var(--terracotta-soft); color: var(--terracotta-dark); font-weight: 600; }

@media (max-width: 720px) {
  .nav { padding: 12px 18px; }
  .nav-links { display: none; }
  .nav-wordmark { font-size: 20px; }
}

/* ═══════════════════════════════════════════
   Type system
   ═══════════════════════════════════════════ */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
  opacity: 0.55;
  margin: 0 0 16px;
}
.eyebrow:empty { display: none; }
.eyebrow.eyebrow-terracotta { color: var(--terracotta); opacity: 1; }
.eyebrow.eyebrow-soft { opacity: 0.42; }

.display-xl {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 7vw, 92px);
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--ink);
  margin: 0 0 22px;
  text-wrap: balance;
}
.display-l {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4.5vw, 52px);
  font-variation-settings: 'opsz' 96;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 16px;
  text-wrap: balance;
}
.display-m {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 3.4vw, 40px);
  font-variation-settings: 'opsz' 60;
  letter-spacing: -0.015em;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 14px;
  text-wrap: balance;
}

.display-xl em, .display-l em, .display-m em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(95deg, var(--terracotta) 0%, var(--sunshine) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lead {
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: 56ch;
}

.hero-sub {
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 52ch;
}

/* ═══════════════════════════════════════════
   Layout helpers
   ═══════════════════════════════════════════ */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}
.wrap-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}
@media (max-width: 720px) {
  .wrap, .wrap-narrow { padding: 0 20px; }
}

.section-head {
  max-width: 720px;
  margin-bottom: 64px;
}

/* ═══════════════════════════════════════════
   CTA buttons
   ═══════════════════════════════════════════ */
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cta-row-center { justify-content: center; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease, opacity 180ms;
}
.cta svg { width: 18px; height: 18px; }
.cta-store {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 6px 20px rgba(43, 29, 20, 0.18);
}
.cta-store:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(43, 29, 20, 0.24); }
.cta-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.cta-meta {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
  padding: 64px 32px 96px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}
.hero-text { min-width: 0; }
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 860px) {
  .hero { padding: 40px 20px 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-text .cta-row { justify-content: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
}

/* ═══════════════════════════════════════════
   Phone frame (real screenshot inside)
   ═══════════════════════════════════════════ */
.phone-frame {
  position: relative;
  width: 280px;
  aspect-ratio: 540 / 1170;
  border-radius: 42px;
  padding: 8px;
  background: linear-gradient(155deg, #1a1310 0%, #0a0705 100%);
  box-shadow:
    0 30px 60px rgba(43, 29, 20, 0.18),
    0 12px 28px rgba(43, 29, 20, 0.10),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: rotateY(-2deg) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform 360ms var(--ease-out);
}
.phone-frame:hover { transform: rotateY(0) rotateX(0); }
.phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 34px;
  display: block;
}
.phone-frame-lg { width: 320px; }

[dir="rtl"] .phone-frame { transform: rotateY(2deg) rotateX(2deg); }
[dir="rtl"] .phone-frame:hover { transform: rotateY(0) rotateX(0); }

@media (max-width: 860px) {
  .phone-frame-lg { width: 280px; }
}

/* ═══════════════════════════════════════════
   FEATURES
   ═══════════════════════════════════════════ */
.features {
  padding: 96px 0 64px;
  border-top: 1px solid var(--hair);
}
.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 64px 0;
}
.feature-block[data-side="left"] .feature-visual { order: -1; }
.feature-text { min-width: 0; }
.feature-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 8px;
}
.pill:empty { display: none; }
.pill-dark { background: var(--ink); color: var(--cream); border-color: var(--ink); }

@media (max-width: 860px) {
  .features { padding: 48px 0 32px; }
  .feature-block {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 36px 0;
    text-align: center;
  }
  .feature-block[data-side="left"] .feature-visual { order: 0; }
  .lead { margin-left: auto; margin-right: auto; }
}

/* ═══════════════════════════════════════════
   JOIN section
   ═══════════════════════════════════════════ */
.join {
  padding: 64px 0 96px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(244, 185, 66, 0.16) 0%, transparent 60%),
    linear-gradient(180deg, transparent 0%, rgba(244, 234, 219, 0.4) 100%);
}
.join-wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}
.join-text { min-width: 0; }
.join-visual { display: flex; justify-content: center; }

@media (max-width: 860px) {
  .join-wrap { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .join-text .lead { margin-left: auto; margin-right: auto; }
}

/* ═══════════════════════════════════════════
   DOWNLOAD section
   ═══════════════════════════════════════════ */
.download {
  padding: 96px 0 80px;
  text-align: center;
  border-top: 1px solid var(--hair);
}
.download .lead { margin: 0 auto 32px; }

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--hair);
  padding: 32px 0;
  font-size: 13px;
}
.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.footer-brand strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
  display: block;
  line-height: 1;
}
.footer-tagline {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.footer-links {
  display: flex;
  gap: 22px;
  font-size: 13px;
}
.footer-links a {
  color: var(--ink-soft);
  transition: color 150ms;
}
.footer-links a:hover { color: var(--terracotta); }
.footer-copyright {
  color: var(--ink-muted);
  font-size: 12px;
}

@media (max-width: 720px) {
  .footer-wrap { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════
   Reduced motion + RTL details
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .phone-frame { transform: none; }
}

[dir="rtl"] .nav-mark { transform: scaleX(1); }
