/* Polices auto-hebergees (cdn.breizhzion.com, pas Google Fonts) , voir
   D:/git/cdn/fonts/maeil-fonts.css. Le wordmark coreen "매일" reste une image
   (logo.png), jamais du texte en police web CJK. */
@import url('https://cdn.breizhzion.com/fonts/maeil-fonts.css');

/* Direction "Encre" : papier + encre de sumi, sceau cinabre , identite deja etablie
   dans l'app mobile (src/theme/index.ts), reprise ici a l'identique plutot que
   reinventee. Palette sombre dediee (pas une inversion filtree) comme dans l'app. */
:root {
  --paper: #FBFAF6;
  --paper-dim: #F1EEE4;
  --ink: #141311;
  --ink-soft: #4A463D;
  --hairline: #E4E0D2;
  --seal: #B4472A;
  --seal-soft: #F4E1D8;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'General Sans', -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141311;
    --paper-dim: #1D1B17;
    --ink: #F1EEE4;
    --ink-soft: #B8B2A2;
    --hairline: #33302A;
    --seal: #E07A52;
    --seal-soft: #3A241C;
  }
  /* Glyphe noir sur fond transparent (logo-mark.png) : inverse en blanc pour rester
     lisible sur le fond papier sombre, meme logique que l'ancien sceau. */
  .hero-logo { filter: invert(1); }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain de papier tres discret + tache d'encre diffuse, jamais un aplat uni */
.paper-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 55% at 88% 8%, color-mix(in srgb, var(--seal) 7%, transparent), transparent 60%),
    radial-gradient(ellipse 60% 50% at -5% 95%, color-mix(in srgb, var(--ink) 5%, transparent), transparent 55%),
    var(--paper);
}
.paper-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.08  0 0 0 0 0.075  0 0 0 0 0.065  0 0 0 0.045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a { color: var(--seal); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 32px; }

header {
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
}
header .wrap { display: flex; align-items: center; justify-content: space-between; }
/* Sur l'accueil, plus de logo/mot "Maeil" dans la barre (le grand logo centre du hero
   juste en dessous suffit deja comme identite visuelle) : marge auto plutot qu'un
   justify-content sur header .wrap, pour ne pas pousser aussi a droite le lien "Maeil"
   de privacy.html (seule page qui utilise encore .brand, sans nav ni burger). */
.brand { text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 20px; }
nav.top-links { display: flex; gap: 28px; font-size: 15px; margin-left: auto; }
nav.top-links a { color: var(--ink-soft); text-decoration: none; }
nav.top-links a:hover { color: var(--seal); }

/* Case a cocher masquee mais toujours focusable/actionnable au clavier (pas
   display:none, qui la retirerait de l'ordre de tabulation) : menu burger en CSS pur,
   sans dependance JS pour l'etat ouvert/ferme (juste une fermeture au clic sur un lien,
   voir le petit script en bas de page). */
.nav-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.nav-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.nav-toggle-btn span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 1px; }
.nav-toggle-input:focus-visible ~ .nav-toggle-btn { outline: 2px solid var(--seal); outline-offset: 3px; }

@media (max-width: 760px) {
  .nav-toggle-btn { display: flex; margin-left: auto; }
  nav.top-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    /* Sans z-index explicite, .hero (juste apres dans le DOM, lui aussi position:
       relative) repeint par-dessus dans l'ordre d'empilement -- le menu restait
       visible mais les liens devenaient impossibles a cliquer (le clic atterrissait
       sur .hero, invisible a cet endroit mais bien present). */
    z-index: 20;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--ink) 20%, transparent);
  }
  nav.top-links a { padding: 16px 32px; border-top: 1px solid var(--hairline); }
  nav.top-links a:first-child { border-top: none; }
  .nav-toggle-input:checked ~ nav.top-links { display: flex; }
  header .wrap { position: relative; flex-wrap: nowrap; }
}

/* ---------------------------------------------------------------------- */
/* Hero : titre editorial + sceau cinabre a droite, marges genereuses      */
/* ---------------------------------------------------------------------- */

.hero {
  padding: 100px 0 90px;
  position: relative;
}
.hero-logo {
  display: block;
  width: min(260px, 55vw);
  height: auto;
  margin: 0 auto 32px;
  opacity: 0;
  transform: scale(0.92);
  animation: stamp 560ms cubic-bezier(.34,1.56,.64,1) 0ms forwards;
}
.hero-mark-text {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 22px;
  max-width: 14ch;
  opacity: 0;
  transform: translateY(14px);
  animation: rise 900ms cubic-bezier(.2,.8,.2,1) 120ms forwards;
}
.hero-tag {
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--seal);
  font-weight: 600;
  margin: 0 0 22px;
  opacity: 0;
  animation: rise 700ms ease 320ms forwards;
}
.hero-pitch {
  font-size: 21px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 34px;
  opacity: 0;
  animation: rise 700ms ease 460ms forwards;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; opacity: 0; animation: rise 700ms ease 600ms forwards; }

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes stamp { to { opacity: 1; transform: none; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--ink) 60%, transparent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--seal); color: var(--seal); }

/* ---------------------------------------------------------------------- */
/* Fonctionnalites : liste editoriale numerotee, pas des cartes generiques */
/* ---------------------------------------------------------------------- */

.features { padding: 70px 0 100px; border-top: 1px solid var(--hairline); }
.features .kicker {
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seal);
  font-weight: 600;
  margin: 0 0 12px;
}
.features h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 56px;
  max-width: 20ch;
}
.feature-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 28px;
  padding: 34px 0 34px 16px;
  border-top: 1px solid var(--hairline);
  transition: background 200ms ease, box-shadow 200ms ease;
}
.feature-row:hover {
  background: color-mix(in srgb, var(--seal) 5%, var(--paper));
  box-shadow: inset 3px 0 0 var(--seal);
}
.feature-row:last-child { border-bottom: 1px solid var(--hairline); }
.feature-num {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-soft);
  padding-top: 4px;
}
.feature-row h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 8px; }
.feature-row p { margin: 0; color: var(--ink-soft); max-width: 56ch; }

/* Delibrement discret (pas un feature-row en titre serif) : ces points de confort
   existent ailleurs chez les concurrents, ne meritent pas la meme mise en avant que
   les vrais differenciateurs juste au-dessus. */
.comfort-note {
  margin: 40px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------------------------------------------------------------------- */
/* Page legale (privacy.html)                                             */
/* ---------------------------------------------------------------------- */

.legal { padding: 70px 0 100px; }
.legal .back { display: inline-block; margin-bottom: 28px; color: var(--ink-soft); text-decoration: none; font-size: 15px; }
.legal .back:hover { color: var(--seal); }
.legal .label {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seal);
  font-weight: 600;
}
.legal h1 { font-family: var(--serif); font-size: clamp(30px, 4.5vw, 44px); margin: 14px 0 6px; max-width: 20ch; }
.legal .updated { color: var(--ink-soft); font-size: 14px; margin: 0 0 44px; }
.legal .content { max-width: 68ch; }
.legal h2 { font-family: var(--serif); font-size: 22px; margin: 44px 0 14px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 10px; }
.contact-plate {
  margin-top: 44px;
  padding: 22px 26px;
  background: var(--paper-dim);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.contact-plate:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px -10px color-mix(in srgb, var(--ink) 18%, transparent);
}
.contact-plate a { font-family: var(--serif); font-size: 18px; text-decoration: none; }

footer { padding: 40px 0; border-top: 1px solid var(--hairline); }
footer .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer span { color: var(--ink-soft); font-size: 14px; }
.foot-links { display: flex; gap: 20px; }
.foot-links a { color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.foot-links a:hover { color: var(--seal); }

@media (max-width: 760px) {
  .feature-row { grid-template-columns: 1fr; gap: 6px; }
}

/* Stagger reveal par defilement (CSS scroll-driven animations, Chrome 115+ / FF 110+ /
   Safari 18+). Chaque feature-row entre naturellement en vue a un moment different, ce
   qui cree un effet de cascade sans IntersectionObserver ni JS. Sans support, les lignes
   s'affichent directement (opacity: 1 par defaut, aucun risque de contenu masque). */
@supports (animation-timeline: view()) {
  @keyframes rise-row {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  .feature-row {
    animation: rise-row 480ms ease both;
    animation-timeline: view();
    animation-range: entry 0% entry 28%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo, .hero-mark-text, .hero-tag, .hero-pitch, .hero-cta {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  html { scroll-behavior: auto; }
  /* Desactive les transitions et animations ajoutees ci-dessus */
  .feature-row, .contact-plate {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
