/* ============================================================
   FLOWKYMO — Design System
   Tokens, base, components. Shared across all pages.
   Accessibility target: WCAG AAA, text/interactive ≥ 10:1 on light.
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Public+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* Brand — neon (DECORATIVE ONLY, never text on light) */
  --neon-cyan: #00F5D4;
  --neon-pink: #FF2DAF;
  --grad-brand: linear-gradient(135deg, #00F5D4 0%, #2BB7FF 45%, #FF2DAF 100%);
  --grad-brand-soft: linear-gradient(135deg, #00F5D4 0%, #FF2DAF 100%);

  /* Ink — text & high-contrast surfaces */
  --ink: #0B1020;        /* primary text & primary button — ~18.5:1 */
  --ink-2: #2A3140;      /* secondary text — ~13:1 */
  --ink-3: #475063;      /* meta / captions — ~8:1 (non-essential only) */

  /* Accessible accents derived from neon (text-safe, ≥10:1) */
  --teal: #084A42;       /* links & teal accent — ~10:1 */
  --teal-deep: #06352F;  /* hover */
  --magenta: #7C0C52;    /* magenta accent — ~10.6:1 */
  --magenta-deep: #5E093E;

  /* Surfaces */
  --bg: #FDFDFD;
  --surface: #FFFFFF;
  --surface-2: #F4F5F8;
  --surface-3: #ECEEF3;
  --navy: #0B1020;       /* dark showcase panel */
  --navy-2: #141A2E;

  /* Borders */
  --border: #E2E5EC;
  --border-strong: #C7CCD8;

  /* Feedback (accessible) */
  --danger: #9B1C1C;     /* error text — ~8.6:1 */
  --danger-bg: #FCEDED;
  --success: #0B5A33;    /* ~8.7:1 */
  --success-bg: #E9F6EF;

  /* Spacing — 4px grid */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* Radius */
  --r-s: 8px; --r-m: 12px; --r-l: 20px; --r-xl: 28px; --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(11,16,32,.06), 0 1px 3px rgba(11,16,32,.07);
  --shadow-md: 0 6px 22px -8px rgba(11,16,32,.14), 0 2px 6px rgba(11,16,32,.05);
  --shadow-lg: 0 28px 60px -22px rgba(11,16,32,.28), 0 6px 16px rgba(11,16,32,.06);
  --shadow-glow: 0 0 0 1px rgba(0,245,212,.0), 0 18px 50px -16px rgba(255,45,175,.35);

  /* Type scale */
  --fs-eyebrow: .78rem;
  --fs-sm: .9rem;
  --fs-base: 1.0625rem;   /* 17px body for comfortable reading */
  --fs-lg: 1.25rem;
  --fs-h4: 1.4rem;
  --fs-h3: clamp(1.5rem, 1.1rem + 1.6vw, 2rem);
  --fs-h2: clamp(2rem, 1.4rem + 2.6vw, 2.9rem);
  --fs-h1: clamp(2.6rem, 1.6rem + 4.6vw, 4.4rem);

  /* Layout */
  --maxw: 1200px;
  --maxw-narrow: 760px;
  --header-h: 72px;

  --ease: cubic-bezier(.22, .61, .36, 1);

  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Public Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1;
}

img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4, h5 { font-family: var(--font-head); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol { padding-left: 1.25em; }

a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--teal-deep); text-decoration-thickness: 2.5px; }

/* ---------- Focus: highly visible (RGAA) ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible, .panel-dark :focus-visible { outline-color: var(--neon-cyan); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: var(--s4); top: -120px;
  background: var(--ink); color: #fff; padding: var(--s3) var(--s5);
  border-radius: var(--r-s); z-index: 200; font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: var(--s4); color: #fff; }

::selection { background: rgba(255,45,175,.22); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s5); }
.narrow { max-width: var(--maxw-narrow); }
.section { padding-block: clamp(var(--s8), 7vw, var(--s10)); }
.section--tight { padding-block: clamp(var(--s7), 5vw, var(--s8)); }
.stack > * + * { margin-top: var(--s4); }

/* ============================================================
   ELEMENTS — eyebrow, lead, badges
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex; align-items: center; gap: var(--s2);
}
.eyebrow--pink { color: var(--magenta); }
.eyebrow::before { content: '</>'; font-weight: 700; opacity: .85; }
.eyebrow.no-glyph::before { content: none; }

.lead { font-size: var(--fs-lg); color: var(--ink-2); line-height: 1.6; }

.badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--font-mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .04em;
  padding: 5px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--border);
}
.badge--teal { color: var(--teal); background: #E8F3F0; border-color: #CDE6DF; }
.badge--pink { color: var(--magenta); background: #FBEAF3; border-color: #F2CFE2; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  --btn-py: 12px; --btn-px: 22px; --btn-fs: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font-family: var(--font-body); font-weight: 600; font-size: var(--btn-fs);
  line-height: 1; letter-spacing: .005em;
  padding: var(--btn-py) var(--btn-px);
  border-radius: var(--r-m);
  border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 1.1em; height: 1.1em; }

.btn--sm { --btn-py: 8px; --btn-px: 14px; --btn-fs: .9rem; border-radius: var(--r-s); }
.btn--lg { --btn-py: 16px; --btn-px: 30px; --btn-fs: 1.1rem; }

.btn--primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { color: #fff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn--primary:focus-visible { outline-offset: 3px; }

/* Branded primary: navy with neon underline reveal */
.btn--brand { background: var(--ink); color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.btn--brand::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--grad-brand);
  transform: scaleX(.55); transform-origin: left; transition: transform .3s var(--ease);
}
.btn--brand:hover { color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--brand:hover::after { transform: scaleX(1); }

.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--secondary:hover { color: var(--ink); background: var(--surface-2); border-color: var(--ink-3); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { color: var(--ink); background: var(--surface-2); }

.btn--on-dark { background: #fff; color: var(--ink); }
.btn--on-dark:hover { color: var(--ink); background: #EDEFF4; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  padding: var(--s6);
  box-shadow: var(--shadow-sm);
}
.card--pad-lg { padding: var(--s7); }

/* App card */
.app-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), border-color .25s var(--ease);
}
a.app-card { text-decoration: none; color: inherit; }
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.app-card:focus-within { box-shadow: var(--shadow-lg); }

.app-card__media {
  position: relative; aspect-ratio: 16 / 10;
  background: var(--navy);
  overflow: hidden;
}
.app-card__body { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); flex: 1; }
.app-card__head { display: flex; align-items: center; gap: var(--s3); }
.app-card__title { font-size: var(--fs-h4); }
.app-card__desc { color: var(--ink-2); font-size: var(--fs-sm); flex: 1; }
.app-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s2); }

/* App icon tile */
.app-icon {
  width: 52px; height: 52px; flex: none; border-radius: 14px;
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.4rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), var(--shadow-sm);
}

/* ============================================================
   FORMS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s5); }
.field label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.field .hint { font-size: .82rem; color: var(--ink-3); }
.req { color: var(--magenta); font-family: var(--font-mono); }

.input, .textarea, .select {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-m);
  padding: 12px 14px;
  width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: #6B7280; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--ink-3); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8,74,66,.18);
}
.textarea { min-height: 120px; resize: vertical; }

.field--error .input, .field--error .textarea { border-color: var(--danger); }
.field--error .input:focus-visible { box-shadow: 0 0 0 3px rgba(155,28,28,.18); }
.error-msg { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: .85rem; font-weight: 600; }
.error-msg::before { content: '⚠'; font-size: 1em; }

/* Search input */
.search {
  position: relative; display: flex; align-items: center;
}
.search .input { padding-left: 42px; }
.search svg { position: absolute; left: 14px; color: var(--ink-3); width: 18px; height: 18px; pointer-events: none; }

/* Filter chips (keyboard accessible) */
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  font-family: var(--font-body); font-size: .9rem; font-weight: 600;
  padding: 8px 16px; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  border: 1.5px solid var(--border-strong); cursor: pointer;
  transition: all .15s var(--ease);
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ============================================================
   HEADER / NAV — sticky, accessible
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253,253,253,.82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: var(--s5); height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand img { width: 36px; height: 36px; }
.brand .tld { color: var(--ink-3); font-weight: 500; }

.nav__links { display: flex; align-items: center; gap: var(--s2); margin-left: var(--s4); list-style: none; padding: 0; margin-block: 0; }
.nav__link {
  font-weight: 600; font-size: .98rem; color: var(--ink-2); text-decoration: none;
  padding: 8px 14px; border-radius: var(--r-s);
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav__link:hover { color: var(--ink); background: var(--surface-2); }
.nav__link[aria-current="page"] { color: var(--ink); }
.nav__link[aria-current="page"]::after { content: ''; display: block; height: 2px; margin-top: 4px; border-radius: 2px; background: var(--grad-brand); }

.nav__right { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }

/* Language toggle */
.lang-toggle { display: inline-flex; border: 1.5px solid var(--border-strong); border-radius: var(--r-pill); overflow: hidden; background: var(--surface); }
.lang-toggle button {
  font-family: var(--font-mono); font-size: .78rem; font-weight: 600; letter-spacing: .05em;
  padding: 7px 12px; border: none; background: transparent; color: var(--ink-3); cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Mobile nav toggle */
.nav__burger { display: none; width: 44px; height: 44px; border: 1.5px solid var(--border-strong); border-radius: var(--r-s); background: var(--surface); cursor: pointer; align-items: center; justify-content: center; }
.nav__burger svg { width: 22px; height: 22px; color: var(--ink); }

/* nav__lang-item : visible uniquement dans le menu mobile */
.nav__lang-item { display: none; }

@media (max-width: 860px) {
  .nav { gap: var(--s3); }
  .nav__links { display: none; }
  .nav__burger { display: inline-flex; }
  .nav__right .btn { display: none; }
  .nav__right .lang-toggle { display: none; }
  .nav__right { gap: var(--s2); }
  .nav__links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: var(--s4); margin: 0; box-shadow: var(--shadow-md);
  }
  .nav__links.open .nav__link { padding: 12px 14px; }
  .nav__link[aria-current="page"]::after { display: none; }
  .nav__links.open .nav__lang-item {
    display: flex; align-items: center;
    padding: 10px 14px;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--navy); color: #C5CBDA; padding-block: var(--s8) var(--s6); margin-top: var(--s9); }
.site-footer a { color: #DCE1EE; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-decoration-thickness: 2px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s6); }
.footer-brand { display: inline-flex; align-items: center; gap: var(--s3); font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: #fff; }
.footer-brand img { width: 34px; height: 34px; }
.footer-col h3 { color: #fff; font-size: .82rem; font-family: var(--font-mono); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; margin-bottom: var(--s4); }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.footer-col li { font-size: .95rem; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: #9aa3ba; }
.footer-bottom .accent-line { height: 3px; width: 64px; border-radius: 2px; background: var(--grad-brand); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s5); } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============================================================
   DARK PANEL (hero showcase / decorative)
   ============================================================ */
.panel-dark { background: var(--navy); color: #E8EBF4; border-radius: var(--r-xl); position: relative; overflow: hidden; }
.panel-dark h1, .panel-dark h2, .panel-dark h3 { color: #fff; }
.glow-cyan { position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(0,245,212,.5), transparent 68%); filter: blur(20px); pointer-events: none; }
.glow-pink { position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(255,45,175,.45), transparent 68%); filter: blur(20px); pointer-events: none; }

/* Gradient hairline divider */
.grad-rule { height: 3px; border: 0; border-radius: 2px; background: var(--grad-brand); }

/* ============================================================
   PHONE MOCKUP (CSS only — simple, on-brand)
   ============================================================ */
.phone {
  width: 230px; border-radius: 34px; background: #05070F;
  padding: 9px; box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(255,255,255,.08);
  position: relative;
}
.phone__screen { border-radius: 26px; overflow: hidden; background: var(--navy-2); aspect-ratio: 9 / 19; position: relative; }
.phone__notch { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 78px; height: 20px; background: #05070F; border-radius: var(--r-pill); z-index: 3; }

/* ============================================================
   UTILITIES
   ============================================================ */
.grid { display: grid; gap: var(--s5); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.flow > * + * { margin-top: var(--s5); }
.muted { color: var(--ink-2); }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
.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; }
.text-grad { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

[hidden] { display: none !important; }
