/* ============================================================
   SKETCHNOTE.ME — système visuel (tokens, thèmes, base, composants)
   Papier + feutres/marqueurs/fluo
   ============================================================ */

/* ---------- THEMES (CSS variables) ---------- */
:root,
[data-theme="feutre"] {
  --paper:   #F3ECDA;
  --paper-2: #EBE1CB;
  --paper-card: #FBF7EC;
  --ink:     #211E18;
  --ink-soft:#5A554B;
  --line:    #211E18;

  --c-yellow: #FFCE2E;
  --c-orange: #FF5A2C;
  --c-blue:   #2A5FE0;
  --c-green:  #14A86A;
  --c-pink:   #E8489B;
  --c-purple: #7B4BE3;

  --accent:   #FF5A2C;
  --accent-2: #2A5FE0;
  --hl:       #FFCE2E;

  --grain: 0.55;
  --shadow-ink: 4px 4px 0 var(--ink);
}

[data-theme="encre"] {
  --paper:   #F6F2E8;
  --paper-2: #EDE7D7;
  --paper-card: #FCFAF3;
  --ink:     #16140F;
  --ink-soft:#534E44;
  --line:    #16140F;

  --c-yellow: #F2CE54;
  --c-orange: #C9402A;
  --c-blue:   #1E48A8;
  --c-green:  #2C7A57;
  --c-pink:   #B4427C;
  --c-purple: #5B47B0;

  --accent:   #1E48A8;
  --accent-2: #C9402A;
  --hl:       #F2CE54;

  --grain: 0.40;
  --shadow-ink: 3px 3px 0 var(--ink);
}

[data-theme="neon"] {
  --paper:   #141319;
  --paper-2: #1D1C25;
  --paper-card: #211F2A;
  --ink:     #F4EFE2;
  --ink-soft:#A8A293;
  --line:    #44414e;

  --c-yellow: #EEFF42;
  --c-orange: #FF7A45;
  --c-blue:   #54B6FF;
  --c-green:  #3CF7A6;
  --c-pink:   #FF57CB;
  --c-purple: #C295FF;

  --accent:   #EEFF42;
  --accent-2: #FF57CB;
  --hl:       #EEFF42;

  --grain: 0.22;
  --shadow-ink: 4px 4px 0 #000;
}

/* ---------- RESET ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .6s ease, color .6s ease;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--paper); }

/* accessibilité */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; word-wrap: normal !important;
}
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px;
}
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- PAPER GRAIN + RULES ---------- */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--grain);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
[data-theme="neon"] body::before { mix-blend-mode: screen; }

/* ---------- TYPE ---------- */
.font-hand   { font-family: 'Caveat', cursive; }
.font-marker { font-family: 'Permanent Marker', cursive; }

h1, h2, h3 { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; line-height: 1.0; letter-spacing: -0.02em; }

.eyebrow {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  color: var(--accent-2);
  font-weight: 700;
  transform: rotate(-2deg);
  display: inline-block;
}

/* ---------- HIGHLIGHTER ---------- */
.hl {
  position: relative;
  white-space: nowrap;
  isolation: isolate;
}
.hl::before {
  content: "";
  position: absolute;
  left: -0.12em; right: -0.12em;
  top: 12%; bottom: 6%;
  background: var(--hl);
  z-index: -1;
  border-radius: 40% 60% 55% 45% / 60% 50% 55% 45%;
  transform: rotate(-1.4deg) skewX(-6deg);
  mix-blend-mode: multiply;
  transform-origin: left center;
  transition: clip-path .7s cubic-bezier(.6,.05,.2,1);
}
[data-theme="neon"] .hl::before { mix-blend-mode: screen; opacity: .85; }
/* animated swipe-in version */
.hl-anim::before { clip-path: inset(0 100% 0 0); }
.reveal.in .hl-anim::before,
.in .hl-anim::before { clip-path: inset(0 0 0 0); }

/* underline scribble */
.scribble {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 92%;
  background-repeat: no-repeat;
  background-size: 100% 0.14em;
  padding-bottom: 0.05em;
}

/* ---------- SKETCHY (wobble) BORDERS ---------- */
.sketchy { filter: url(#wobble); }
.sketch-box {
  border: 2.5px solid var(--line);
  background: var(--paper-card);
}

/* ---------- BUTTONS ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: .5em;
  font-weight: 700; font-size: 1.02rem;
  white-space: nowrap;
  padding: .82em 1.4em;
  border: 2.5px solid var(--ink);
  border-radius: 14px 12px 16px 11px;
  background: var(--paper-card);
  color: var(--ink);
  box-shadow: var(--shadow-ink);
  transition: transform .14s ease, box-shadow .14s ease, background-color .2s ease;
}
.btn:hover  { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px,2px);  box-shadow: 1px 1px 0 var(--ink); }
.btn-accent { background: var(--accent); color: #fff; }
[data-theme="neon"] .btn-accent { color: #141319; }
[data-theme="encre"] .btn-accent { color: #fff; }
.btn-ghost  { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--paper-2); box-shadow: none; transform: translateY(-1px); }
.btn-sm { padding: .55em 1em; font-size: .92rem; border-radius: 11px 9px 12px 10px; }
.btn-lg { padding: 1em 1.7em; font-size: 1.18rem; }

/* ---------- CHIPS ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .42em .9em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-card);
  font-weight: 600; font-size: .9rem;
  transition: all .15s ease;
  white-space: nowrap;
}
.chip:hover { transform: translateY(-2px) rotate(-1deg); }
.chip.active { background: var(--ink); color: var(--paper); }
.chip-dot { width:.7em; height:.7em; border-radius:50%; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
section { position: relative; z-index: 2; }
.section-pad { padding: clamp(64px, 9vw, 130px) 0; }

/* ---------- SCROLL REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity calc(.7s * var(--anim-scale, 1)) ease, transform calc(.7s * var(--anim-scale, 1)) cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: calc(.08s * var(--anim-scale, 1)); }
.reveal.d2 { transition-delay: calc(.16s * var(--anim-scale, 1)); }
.reveal.d3 { transition-delay: calc(.24s * var(--anim-scale, 1)); }
.reveal.d4 { transition-delay: calc(.32s * var(--anim-scale, 1)); }
.reveal.pop { transform: translateY(34px) scale(.96) rotate(-1.5deg); }
.reveal.pop.in { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- DECOR ---------- */
.tape {
  position: absolute;
  width: 92px; height: 30px;
  background: color-mix(in srgb, var(--hl) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  mix-blend-mode: multiply;
  z-index: 5;
}
[data-theme="neon"] .tape { mix-blend-mode: screen; }
.star { color: var(--accent); display: inline-block; }
.dotgrid {
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 22%, transparent) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
}

/* utility */
.rot-n2 { transform: rotate(-2deg); }
.rot-n1 { transform: rotate(-1deg); }
.rot-p1 { transform: rotate(1deg); }
.rot-p2 { transform: rotate(2deg); }
