/* ─────────────────────────────────────────────────────────────────
   HannibalAi — Landing
   Tokens repris de src/theme.ts (Geist, palette light/dark, espacements)
   Inspiration visuelle : minimal, dense, typographique (vercel.com).
   ───────────────────────────────────────────────────────────────── */

:root {
  --bg: #FFFFFF;
  --bg-elevated: #FAFAFA;
  --bg-subdued: #F5F5F5;
  --surface: #FAFAFA;
  --surface-hover: #F2F2F2;
  --text: #0A0A0A;
  --text-secondary: #525252;
  --text-muted: #8F8F8F;
  --text-faint: #A8A8A8;
  --primary: #0A0A0A;
  --primary-text: #FFFFFF;
  --primary-hover: #262626;
  --border: #EBEBEB;
  --border-strong: #E5E5E5;
  --accent: #0070F3;
  --accent-2: #7928CA;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
  --shadow-lg: 0 30px 80px rgba(0,0,0,0.08);
  --nav-bg: rgba(255,255,255,0.72);
  --nav-border: rgba(0,0,0,0);
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #0A0A0A;
    --bg-subdued: #111111;
    --surface: #0A0A0A;
    --surface-hover: #171717;
    --text: #EDEDED;
    --text-secondary: #A1A1A1;
    --text-muted: #8F8F8F;
    --text-faint: #6E6E6E;
    --primary: #FFFFFF;
    --primary-text: #0A0A0A;
    --primary-hover: #EDEDED;
    --border: #1F1F1F;
    --border-strong: #292929;
    --accent: #3291FF;
    --accent-2: #B265FF;
    --shadow: 0 1px 2px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 30px 80px rgba(0,0,0,0.6);
    --nav-bg: rgba(0,0,0,0.65);
  }
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* Focus ring net, accent-blue, à la Vercel */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 3px; }
summary:focus-visible { outline-offset: 4px; }

/* Tabular nums partout où des chiffres apparaissent en ligne */
.spec-strip, .step-num, .music-tags, .video-caption, .footer-meta {
  font-variant-numeric: tabular-nums;
}

/* light/dark logo swap */
.dark-only { display: none; }
@media (prefers-color-scheme: dark) {
  .light-only { display: none; }
  .dark-only  { display: inline-block; }
}

/* ─── Nav ───────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.3px;
}
.brand-name { font-size: 15px; }
.brand-mark { width: 28px; height: 28px; border-radius: 6px; }
.nav-links {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: 14px;
  color: var(--text-secondary);
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  margin-left: auto;
  padding: 8px 14px;
}

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.1px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-hover); }

/* Boutons compacts en paire inversée — signature Vercel rounded */
.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 999px;
}
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.1px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}
.btn-store svg { flex-shrink: 0; }
.btn-store-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-store-primary:hover { opacity: .9; }
.btn-store-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text);
}
.btn-store-secondary:hover { background: var(--surface-hover); }
.btn-store:active { transform: translateY(1px); }

/* Lien "Ouvrir sur le web" — plus discret que les CTAs */
.btn-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color .15s ease;
}
.btn-link:hover { color: var(--text); }

/* ─── Hero ──────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 96px 24px 64px;
  overflow: hidden;
}

/* Grille hairline derrière le hero — signature Vercel "blueprint" */
.hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: calc(100% / 12) 88px;
  background-position: 0 88px;
  opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, black 30%, transparent 95%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 35%, black 30%, transparent 95%);
}
.hero-inner { position: relative; z-index: 1; }
@media (max-width: 720px) {
  .hero-grid { display: none; }
}

/* Stagger fade-up — la page se lève comme un terminal qui scrolle */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero h1,
.hero .lede,
.hero .cta-row,
.hero .spec-strip,
.carousel {
  opacity: 0;
  animation: rise .9s cubic-bezier(.22, .66, .13, 1) forwards;
}
.hero h1          { animation-delay: .05s; }
.hero .lede       { animation-delay: .15s; }
.hero .cta-row    { animation-delay: .25s; }
.carousel       { animation-delay: .40s; animation-duration: 1.1s; }
.hero .spec-strip { animation-delay: .65s; }
@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero .lede, .hero .cta-row, .hero .spec-strip, .carousel {
    animation: none;
    opacity: 1;
  }
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
  text-align: center;
  align-items: center;
}
/* Mono inline label, à la Vercel */
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
  text-transform: lowercase;
  margin-bottom: 24px;
}

.display {
  margin: 0 auto;
  font-size: clamp(40px, 8vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 600;
  text-wrap: balance;
}
.display-sm {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.lede {
  margin: 0 auto;
  max-width: 640px;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.55;
  color: var(--text-secondary);
}
.lede-sm {
  margin: 0 auto;
  max-width: 580px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.lede-sm.center { text-align: center; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.cta-row.center { justify-content: center; }

/* Carrousel hero — slide centrale active, voisines en peek, décalage par tick */
.carousel {
  position: relative;
  margin: 48px auto 0;
  width: 100%;
  max-width: 1280px;
  overflow: hidden;
  container-type: inline-size;
  --slide-w: min(70cqw, 880px);
  --gap: 24px;
  --duration: 820ms;
  /* Fondu aux bords pour que les voisines s'effacent joliment hors cadre */
  -webkit-mask-image: linear-gradient(to right,
    transparent 0%, #000 10%, #000 90%, transparent 100%);
          mask-image: linear-gradient(to right,
    transparent 0%, #000 10%, #000 90%, transparent 100%);
}
.carousel-track {
  display: flex;
  gap: var(--gap);
  padding-inline: calc((100cqw - var(--slide-w)) / 2);
  transform: translateX(calc(-1 * var(--i, 0) * (var(--slide-w) + var(--gap))));
  transition: transform var(--duration) cubic-bezier(.22, .66, .13, 1);
  will-change: transform;
}
.carousel-slide {
  flex: 0 0 var(--slide-w);
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  position: relative;
  opacity: .38;
  transform: scale(.95);
  transition: opacity .55s cubic-bezier(.22, .66, .13, 1),
              transform .55s cubic-bezier(.22, .66, .13, 1);
}
.carousel-slide.is-active {
  opacity: 1;
  transform: scale(1);
}
.carousel-slide video,
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 720px) {
  .carousel { --slide-w: 86cqw; --gap: 14px; }
}

/* ─── Section ───────────────────────────────────────────────────── */
.section {
  padding: 96px 24px;
  border-top: 1px solid var(--border);
}
.section-alt { background: var(--bg-elevated); }
.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}
.section-inner.narrow { max-width: 720px; text-align: center; }

/* Header de section : kicker mono à gauche, titre à gauche, description à droite */
.section-head {
  margin: 0 0 56px;
}
.head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: end;
}
.head-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 460px;
}
.h1 {
  margin: 0;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 600;
}
@media (max-width: 760px) {
  .head-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
  }
  .head-desc { max-width: none; }
  .section-head { margin-bottom: 40px; }
}

/* ─── Feature grid (4) — cartes flat à la Vercel ─────────────────── */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
.card {
  padding: 28px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: background .15s ease;
}
.card:last-child { border-right: none; }
.card:hover { background: var(--surface); }
.card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: -0.1px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-glyph {
  color: var(--text-secondary);
  flex-shrink: 0;
}
.card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}
@media (max-width: 920px) {
  .card { border-right: none; }
  .card:last-child { border-bottom: none; }
}

/* ─── Gallery — image puis caption en dessous (à la Vercel changelog) */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.thumb {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thumb-img-wrap, .thumb > img {
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-elevated);
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}
.thumb figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 2px;
}

/* ─── Video showcase ────────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.video-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  position: relative;
}
.showcase-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-elevated);
  display: block;
}
.video-caption {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ─── Music ─────────────────────────────────────────────────────── */
.music-rows {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}
.music-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(240px, 2fr);
  gap: 16px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.music-row:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.music-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.music-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.music-tags {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.music-player {
  width: 100%;
  height: 36px;
  /* Harmoniser la couleur des contrôles avec le thème dark */
}
@media (prefers-color-scheme: dark) {
  .music-player { color-scheme: dark; }
}

@media (max-width: 560px) {
  .music-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
  }
}

/* ─── Before / After ────────────────────────────────────────────── */
.ba {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ba-side {
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  background: var(--bg-elevated);
}
.ba-side img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ba-tag {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: lowercase;
  color: #FFFFFF;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 6px;
}
.ba-tag-after {
  background: var(--text);
  color: var(--bg);
}
.ba-prompt {
  text-align: center;
  margin: 24px auto 0;
  max-width: 580px;
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-style: normal;
}

/* ─── Tunisia pillars — flat, no chips ──────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
.pillar {
  padding: 28px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.pillar:last-child { border-right: none; }
.pillar h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
}
.pillar p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}
@media (max-width: 920px) {
  .pillar { border-right: none; }
  .pillar:last-child { border-bottom: none; }
}

/* ─── CTA final ─────────────────────────────────────────────────── */
.cta-final {
  background: var(--bg);
}

/* ─── Footer ────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  background: var(--bg);
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  justify-content: space-between;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
  font-size: 14px;
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.footer-meta a:hover { color: var(--text); }

/* ─── Spec strip (sous la vidéo hero) — fil d'info discret ──────── */
.spec-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin: 32px auto 0;
  padding: 0;
  font-family: var(--font-mono);
  width: max-content;
  max-width: 100%;
  background: transparent;
}
.spec-strip > div {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 16px;
  border-right: 1px solid var(--border);
  font-size: 12px;
  white-space: nowrap;
}
.spec-strip > div:first-child { padding-left: 0; }
.spec-strip > div:last-child { border-right: none; padding-right: 0; }
.spec-strip dt {
  margin: 0;
  font-weight: 500;
  color: var(--text);
}
.spec-strip dd {
  margin: 0;
  color: var(--text-muted);
}
@media (max-width: 520px) {
  .spec-strip > div { padding: 4px 10px; font-size: 11px; }
}

/* ─── Steps (comment ça marche) ─────────────────────────────────── */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
.steps li {
  padding: 32px 28px;
  border-right: 1px solid var(--border);
  position: relative;
  transition: background .15s ease;
}
.steps li:last-child { border-right: none; }
.steps li:hover { background: var(--surface); }
.step-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.steps h3 {
  margin: 0 0 8px;
  font-size: 17px;
  letter-spacing: -0.2px;
  font-weight: 600;
}
.steps p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps li {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .steps li:last-child { border-bottom: none; }
}

/* ─── FAQ (s'ouvre comme un fichier de config) ──────────────────── */
.faq {
  max-width: 820px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}
.faq details {
  border-bottom: 1px solid var(--border);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.1px;
  color: var(--text);
  user-select: none;
  min-height: 44px;
  transition: color .15s ease;
}
.faq summary:hover { color: var(--accent); }
.faq summary::-webkit-details-marker,
.faq summary::marker { display: none; content: ''; }
.faq summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-muted);
  transition: transform .25s cubic-bezier(.22, .66, .13, 1);
  flex-shrink: 0;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
  color: var(--accent);
}
.faq details > p {
  margin: 0 4px 22px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 640px;
  animation: rise .35s cubic-bezier(.22, .66, .13, 1);
}

/* ─── Reduced motion ────────────────────────────────────────────── */
@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;
  }
}
