/* Pas d'ici — "endpapers & cloth": the page opens and closes on the book's deep teal,
   patterned with the illustrator's own birds; the craft lives on a terracotta cloth block;
   the story sits on a quiet paper page. Brush lettering for the title only. */
:root {
  --teal: #0f5961;          /* endpaper cloth */
  --teal-deep: #0b464d;
  --teal-bird: #3fb3bd;
  --clay: #a3481f;          /* terracotta cloth */
  --clay-deep: #8f3f1c;
  --paper: #f7f0e3;
  --paper-2: #efe4d0;
  --cream: #fbf4e6;         /* text on dark cloth */
  --ink: #26201c;
  --ink-soft: #5f5148;
  --line: #dccdb3;
  --brush: "Caveat Brush", cursive;
  --head: "Bricolage Grotesque", "Noto Sans Arabic", system-ui, sans-serif;
  --body: "Figtree", "Noto Sans Arabic", system-ui, sans-serif;
  --wrap: min(1180px, 100% - 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.65 var(--body); -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; display: block; }
picture { display: block; }
a { color: inherit; }
::selection { background: var(--teal-bird); color: var(--teal-deep); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }
.wrap { width: var(--wrap); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 1rem; top: 1rem; z-index: 100; background: #fff; padding: .5rem 1rem; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h2 { font: 700 clamp(2.1rem, 4.4vw, 3.4rem)/1.02 var(--head); letter-spacing: -.025em; font-variation-settings: "opsz" 96; text-wrap: balance; }
h3 { font: 700 1rem/1.3 var(--head); letter-spacing: -.005em; }
section { padding-block: clamp(5rem, 10vw, 8.5rem); }
.intro { font-size: 1.15rem; margin: 1.1rem 0 0; max-width: 34rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem; padding: 1rem 1.75rem; border-radius: 999px;
  font: 700 1rem/1 var(--head); letter-spacing: -.005em; text-decoration: none; border: 0; cursor: pointer;
  transition: background .25s, color .25s, transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
.btn svg { width: 1.1rem; height: 1.1rem; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--clay); color: var(--cream); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .45); }
.btn-primary:hover { background: #8f3c18; }
.btn-paper { background: var(--cream); color: var(--clay-deep); box-shadow: 0 10px 24px -14px rgb(0 0 0 / .4); }
.btn-paper:hover { background: #fff; }
.btn-outline { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-outline:hover { background: var(--cream); color: var(--teal-deep); box-shadow: none; }
.link-arrow { font: 700 1rem/1 var(--head); text-decoration: none; padding-bottom: 4px; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat; transition: background-size .3s; }
.link-arrow:hover { background-size: 0 1.5px; background-position: 100% 100%; }

/* ---------- Language menu ---------- */
.lang { position: absolute; top: 1.4rem; inset-inline-end: 1.6rem; z-index: 60; }
.lang summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .45rem; color: var(--cream);
  font: 700 .8rem/1 var(--head); text-transform: uppercase; letter-spacing: .08em;
  padding: .6rem .85rem; border-radius: 999px; background: rgb(255 255 255 / .1); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22);
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 1rem; height: 1rem; }
.lang ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + .5rem); margin: 0; padding: .4rem; list-style: none;
  background: var(--cream); border-radius: 14px; min-width: 12rem; box-shadow: 0 24px 50px -20px rgb(0 0 0 / .5);
}
.lang li a { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .8rem; border-radius: 9px; text-decoration: none; }
.lang li a span { color: var(--ink-soft); font-size: .75rem; text-transform: uppercase; font-weight: 700; }
.lang li a:hover, .lang li a[aria-current] { background: var(--paper-2); }

/* ---------- Hero: teal endpaper ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--cream);
  padding-block: clamp(5rem, 9vw, 7.5rem) clamp(5rem, 9vw, 7rem);
  background:
    url("img/endpaper-birds.webp") center top / 760px auto repeat,
    var(--teal);
}
.hero::before { content: ""; position: absolute; inset: 0; background: rgb(15 89 97 / .86); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: clamp(2.5rem, 7vw, 6.5rem); align-items: center; }
.hero h1 { font: 400 clamp(5rem, 11.5vw, 9rem)/.84 var(--brush); color: var(--cream); margin: 0; text-shadow: 0 2px 0 rgb(0 0 0 / .08); }
.gloss { margin: .9rem 0 0; color: rgb(251 244 230 / .82); font-size: .98rem; font-style: italic; }
.tagline { font: 500 clamp(1.3rem, 2.1vw, 1.6rem)/1.35 var(--head); letter-spacing: -.012em; margin: 1.7rem 0 0; max-width: 24ch; text-wrap: balance; }
.byline { margin: 1.3rem 0 0; color: rgb(251 244 230 / .84); font-size: .95rem; }
.byline a { color: var(--cream); font-weight: 600; text-decoration: underline; text-decoration-color: rgb(251 244 230 / .35); text-underline-offset: 4px; transition: text-decoration-color .2s; }
.byline a:hover { text-decoration-color: var(--cream); }
.person { scroll-margin-top: 2rem; }
.byline br.m { display: none; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem; margin-top: 2.5rem; }
.hero .link-arrow { color: var(--cream); }
.unhcr-note {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 3rem; text-decoration: none;
  color: rgb(251 244 230 / .78); font-size: .82rem; transition: color .2s;
}
.unhcr-note img { width: 24px; height: auto; filter: brightness(0) invert(1); opacity: .55; transition: opacity .2s; }
.unhcr-note svg { width: .9rem; height: .9rem; flex: none; opacity: .8; }
.unhcr-note:hover { color: var(--cream); }
.unhcr-note:hover img { opacity: 1; }
.cover img {
  width: 100%; border-radius: 3px 9px 9px 3px; transform: rotate(2deg);
  box-shadow: -4px 0 0 -1px rgb(0 0 0 / .12), 0 50px 80px -30px rgb(0 0 0 / .65), 0 16px 30px -16px rgb(0 0 0 / .45);
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
}
.cover { display: block; cursor: pointer; position: relative; }
/* Renaud-Bray "Coup de cœur" sticker, stuck over the cover's top corner */
.cover img.award {
  position: absolute; z-index: 2; border-radius: 50%; box-shadow: none; top: -3.5%; right: -6%; width: clamp(72px, 23%, 108px); height: auto;
  transform: rotate(12deg); filter: drop-shadow(0 10px 14px rgb(0 0 0 / .35));
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.cover:hover img.award { transform: rotate(4deg) scale(1.04); }
.cover:hover img, .cover:focus-visible img { transform: rotate(0) translateY(-6px); }
.story { scroll-margin-top: 0; }

/* ---------- Story: paper page ---------- */
.story { background: var(--paper); }
.story-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2.5rem, 7vw, 6rem); align-items: center; }
.story-text { max-width: 36rem; }
.story .lede { font: 700 clamp(2.4rem, 5vw, 4rem)/1 var(--head); letter-spacing: -.03em; margin-bottom: 2rem; color: var(--teal); }
.story p { font-size: clamp(1.1rem, 1.4vw, 1.22rem); line-height: 1.7; margin: 0 0 1.3rem; }
.story p.voices { font: 600 clamp(1.25rem, 1.9vw, 1.5rem)/1.4 var(--head); letter-spacing: -.012em; color: var(--clay-deep); margin-block: 2rem; text-wrap: balance; }
.story p.closing em { font: 400 1.7em/1 var(--brush); color: var(--clay); font-style: normal; }
.story .publisher { font: 700 .82rem/1 var(--head); color: var(--ink-soft); margin-top: 2.8rem; letter-spacing: .02em; }
.story-art { width: 100%; max-width: 520px; justify-self: center; mix-blend-mode: multiply; }

/* ---------- Craft: terracotta cloth ---------- */
.craft { background: var(--clay); color: var(--cream); }
.craft-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1fr); gap: clamp(2.5rem, 7vw, 6rem); align-items: start; }
.video-frame { position: sticky; top: 2rem; border-radius: 16px; overflow: hidden; aspect-ratio: 3/4; background: var(--clay-deep); box-shadow: 0 40px 70px -35px rgb(0 0 0 / .6); }
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
.video-toggle {
  position: absolute; inset-inline-end: .9rem; bottom: .9rem; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 0; background: rgb(251 244 230 / .9); color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.video-toggle svg { width: 1rem; height: 1rem; }
.video-toggle .play { display: none; }
.video-toggle[aria-pressed="true"] .play { display: block; }
.video-toggle[aria-pressed="true"] .pause { display: none; }
.craft .intro { color: var(--cream); }
.craft h3 { margin: 2.6rem 0 .9rem; color: var(--cream); font-size: 1.05rem; }
.materials { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.materials li { padding: .45rem .9rem; border-radius: 10px; background: rgb(0 0 0 / .12); font-size: .95rem; }
.how { list-style: none; counter-reset: s; padding: 0; margin: 0 0 2.6rem; display: grid; gap: 1.1rem; }
.how li { counter-increment: s; display: grid; grid-template-columns: 2.6rem 1fr; align-items: baseline; }
.how li::before { content: counter(s); font: 400 2rem/1 var(--brush); color: var(--cream); opacity: .9; }
.note { color: rgb(251 244 230 / .92); font-size: .88rem; margin: 1.1rem 0 0; max-width: 32rem; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 3vw, 2rem); margin-top: clamp(3.5rem, 7vw, 5.5rem); }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; }
.photo-grid figcaption { margin-top: .8rem; color: rgb(251 244 230 / .92); font-size: .95rem; }

/* ---------- Coloring ---------- */
.coloring { background: var(--paper-2); }
.section-head { max-width: 40rem; margin-bottom: 3.2rem; }
.section-head .intro { color: var(--ink-soft); }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); max-width: 820px; }
.sheet { text-decoration: none; display: block; }
.sheet-img {
  display: block; background: #fff; padding: 7%; border-radius: 4px;
  box-shadow: 0 1px 0 rgb(0 0 0 / .05), 0 30px 50px -34px rgb(38 32 28 / .55);
  transform: rotate(-1.2deg); transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s;
}
.sheet:nth-child(2) .sheet-img { transform: rotate(1.4deg); }
.sheet:hover .sheet-img { transform: rotate(0) translateY(-6px); box-shadow: 0 1px 0 rgb(0 0 0 / .05), 0 40px 60px -34px rgb(38 32 28 / .6); }
.sheet-img img { width: 100%; aspect-ratio: 5/6; object-fit: contain; }
.sheet-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 1.3rem; }
.sheet-title { font: 700 1.2rem/1.25 var(--head); letter-spacing: -.01em; }
.sheet-dl { display: inline-flex; align-items: center; gap: .35rem; font: 700 .85rem/1 var(--head); color: var(--clay); }
.sheet-dl svg { width: 1rem; height: 1rem; }
.download-all { margin: 2.8rem 0 0; text-align: center; }
.coloring .section-head { margin-inline: auto; text-align: center; }
.coloring .section-head .intro { margin-inline: auto; }
.coloring .color-grid { margin-inline: auto; }
.people > .wrap > h2 { text-align: center; }
.coloring .link-arrow { color: var(--ink); }

/* ---------- People: one creator at a time ---------- */
.people { background: var(--paper); }
.people-list { display: grid; gap: clamp(4rem, 9vw, 7rem); margin-top: clamp(3rem, 6vw, 4.5rem); }
.person { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.person:not(.has-photo) { grid-template-columns: minmax(0, 1fr); }
/* alternate sides: first creator's photo on the end side */
.person.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); }
.person.flip .portrait { order: 2; }
.person.flip .person-text { justify-self: end; }
.person:not(.has-photo) .person-text { max-width: 40rem; }
.person-text { max-width: 36rem; }
.portrait { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 16px; box-shadow: 0 40px 70px -40px rgb(38 32 28 / .55); }
.people .role { font: 700 .9rem/1 var(--head); color: var(--clay); margin: 0 0 .9rem; }
.people h3 { font: 700 clamp(2.2rem, 4.4vw, 3.4rem)/1 var(--head); letter-spacing: -.03em; margin-bottom: 1.4rem; color: var(--teal); }
.people .person-text p:not(.role) { font-size: clamp(1.08rem, 1.3vw, 1.18rem); line-height: 1.7; color: var(--ink); margin: 0 0 1.1rem; }
.social { display: inline-flex; align-items: center; gap: .55rem; margin-top: .6rem; font: 700 1rem/1 var(--head); color: var(--teal); text-decoration: none; padding: .6rem 1rem .6rem .8rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgb(15 89 97 / .25); transition: box-shadow .2s, background .2s; }
.social svg { width: 1.3rem; height: 1.3rem; }
.social:hover { background: var(--teal); color: var(--cream); box-shadow: none; }

/* ---------- Rights: teal endpaper closes the book ---------- */
.rights {
  position: relative; color: var(--cream); text-align: center;
  background: url("img/endpaper-birds.webp") center / 760px auto repeat, var(--teal);
}
.rights::before { content: ""; position: absolute; inset: 0; background: rgb(15 89 97 / .74); }
.rights .wrap { position: relative; max-width: 42rem; }
.rights p { color: rgb(251 244 230 / .9); font-size: 1.12rem; margin: 1.3rem auto 2.4rem; }
.rights .btn-outline { color: var(--cream); }
.rights .btn-outline:hover, .rights .btn-outline:focus-visible { background: var(--cream); color: var(--teal-deep); box-shadow: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-deep); color: rgb(251 244 230 / .8); padding-block: 2.2rem; font-size: .85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.brand { font: 400 1.6rem/1 var(--brush); color: var(--cream); text-decoration: none; }

/* ---------- Arabic ---------- */
[lang="ar"] h2, [lang="ar"] h3, [lang="ar"] .tagline, [lang="ar"] .story p.voices, [lang="ar"] .sheet-title, [lang="ar"] .btn, [lang="ar"] .link-arrow { letter-spacing: 0; }
[lang="ar"] .story p { line-height: 1.95; }
[lang="ar"] .story .lede { line-height: 1.35; }

/* ---------- The flying craft bird ---------- */
.flapper {
  position: absolute; z-index: 0; pointer-events: none;
  top: clamp(.9rem, 2.6vw, 1.9rem); left: 0; width: clamp(64px, 6.5vw, 92px); aspect-ratio: 640 / 683;
  animation: cross 24s linear infinite; filter: drop-shadow(0 8px 10px rgb(0 0 0 / .25));
}
.flapper-bird { position: absolute; inset: 0; transform: rotate(90deg); animation: glide 4s ease-in-out infinite; }
.flapper img { position: absolute; inset: 0; width: 100%; height: 100%; }
.flapper .wings { transform-origin: 50% 50%; animation: beat .6s ease-in-out infinite alternate; }
@keyframes beat { from { transform: scaleX(1); } to { transform: scaleX(.9); } }
@keyframes glide { 0%, 100% { transform: rotate(90deg) translateX(0); } 50% { transform: rotate(85deg) translateX(-10px); } }
@keyframes cross {
  0% { left: -12%; transform: translateY(0); }
  25% { transform: translateY(-6px); }
  50% { transform: translateY(10px); }
  75% { transform: translateY(-2px); }
  100% { left: 108%; transform: translateY(0); }
}

/* ---------- Buy popup ---------- */
.buy {
  width: min(30rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); overflow: auto;
  border: 0; border-radius: 22px; padding: 2.3rem 1.9rem 1.9rem; background: var(--paper); color: var(--ink);
  box-shadow: 0 40px 90px -30px rgb(0 0 0 / .6);
}
.buy::backdrop { background: rgb(11 70 77 / .6); backdrop-filter: blur(4px); }
.buy h2 { font-size: 1.9rem; margin: 0 2.5rem 1.4rem 0; color: var(--teal); }
[lang="ar"] .buy h2 { margin: 0 0 1.4rem 2.5rem; }
.buy h3 { font: 700 .85rem/1 var(--head); color: var(--ink-soft); margin: 1.6rem 0 .7rem; }
.buy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.buy-row, .buy-shop { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #fff; border-radius: 14px; padding: 1rem 1.15rem; text-decoration: none; box-shadow: 0 1px 2px rgb(38 32 28 / .08); transition: box-shadow .2s; }
.buy-row:hover { box-shadow: 0 0 0 2px var(--clay); }
.buy-row svg { width: 1.1rem; height: 1.1rem; flex: none; color: var(--clay); }
.buy strong { display: block; font: 700 1.05rem/1.3 var(--head); }
.buy small { display: block; color: var(--ink-soft); font-size: .88rem; }
.buy-shop { flex-direction: column; align-items: flex-start; gap: .55rem; }
.buy-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.buy-links a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; font-size: .9rem; color: var(--clay-deep); }
.buy-links svg { width: 1rem; height: 1rem; }
.buy-close {
  position: absolute; top: 1rem; inset-inline-end: 1rem; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  border: 0; background: var(--paper-2); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.buy-close:hover { background: var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .person, .person.flip { grid-template-columns: 1fr; }
  .person.flip .portrait { order: 0; }
  .person.flip .person-text { justify-self: start; }
  .portrait { max-width: 360px; }
  .hero-grid, .craft-grid, .story-grid { grid-template-columns: 1fr; }
  .cover { width: min(68%, 330px); margin-inline: auto; grid-row: 1; }
  .video-frame { position: relative; top: 0; max-width: 380px; }
  .story-art { max-width: 340px; }
  .flapper { top: .9rem; width: 54px; animation-duration: 14s; }
}
@media (max-width: 600px) {
  .color-grid, .photo-grid { grid-template-columns: 1fr; }
  .byline span[aria-hidden] { display: none; }
  .byline br.m { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flapper { display: none; }
  .cover img, .sheet-img, .btn { transition: none; }
}
