/* =========================================================
   Le carnet de Tasnim — STEAM
   Palette: Prussian navy, letter cream, brooch emerald,
   antique gold, jacaranda violet, rose.
   ========================================================= */
:root {
  --navy: #27385f;
  --navy-deep: #1a2644;
  --ink: #2e2a3d;
  --ink-soft: #5b5670;
  --cream: #fff8ec;
  --paper: #fdf3e0;
  --gold: #d8b064;
  --gold-deep: #a9803a;
  --emerald: #2e9d7d;
  --violet: #9a7ad6;
  --rose: #e8a0b4;
  --sky: #a9c6ea;
  --s: #4f8fd8;      /* science */
  --t: #2e9d7d;      /* technology */
  --e: #e2a03a;      /* economy */
  --a: #e0708f;      /* art */
  --m: #8a6ad0;      /* maths */
  --radius: 22px;
  --shadow: 0 10px 30px rgba(39, 56, 95, .14), 0 2px 6px rgba(39, 56, 95, .08);
  --f-title: 'Cormorant Garamond', 'Georgia', serif;
  --f-body: 'Nunito', 'Segoe UI', sans-serif;
  --f-hand: 'Caveat', 'Nunito', cursive;
}
html[lang="ar"] {
  --f-title: 'Aref Ruqaa', 'Amiri', serif;
  --f-body: 'Tajawal', 'Segoe UI', sans-serif;
  --f-hand: 'Aref Ruqaa', 'Tajawal', serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(232, 160, 180, .12), transparent 40%),
    radial-gradient(circle at 90% 60%, rgba(169, 198, 234, .18), transparent 45%);
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--f-title); font-weight: 700; color: var(--navy); line-height: 1.15; margin: 0 0 .4em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { font-weight: 700; line-height: 1.4; }
p { margin: 0 0 1em; }
a { color: var(--navy); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgba(255, 248, 236, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(216, 176, 100, .35);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-title); font-size: 1.35rem; font-weight: 700; color: var(--navy); }
.brand-badge { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c9ffe9, var(--emerald) 45%, #0d5a45); border: 3px solid var(--gold); box-shadow: 0 0 0 3px var(--cream), 0 4px 10px rgba(0,0,0,.15); display: grid; place-items: center; color: #fff; font-size: 1rem; font-family: var(--f-body); font-weight: 800; }
.nav-links { display: flex; gap: 4px; margin-inline-start: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links a { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: .95rem; color: var(--ink-soft); transition: .2s; }
.nav-links a:hover { background: rgba(216, 176, 100, .2); color: var(--navy); }
.lang { display: flex; gap: 4px; background: #fff; border-radius: 999px; padding: 4px; box-shadow: inset 0 0 0 1px rgba(216,176,100,.5); }
.lang button { border: 0; background: transparent; font: 700 .85rem var(--f-body); padding: 6px 10px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.lang button[aria-pressed="true"] { background: var(--navy); color: var(--cream); }
.lang button[data-lang="ar"] { font-family: 'Tajawal', sans-serif; }
.menu-btn { display: none; border: 0; background: var(--navy); color: #fff; border-radius: 12px; width: 42px; height: 42px; font-size: 1.3rem; cursor: pointer; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; display: flex; align-items: center; }
.hero .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 2; width: min(1180px, 100% - 32px); margin-inline: auto; display: grid; grid-template-columns: 1.1fr .9fr; align-items: end; gap: 20px; padding-top: 90px; }
.hero-card {
  background: rgba(255, 250, 240, .86);
  border-radius: 28px;
  padding: clamp(22px, 4vw, 44px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(216, 176, 100, .6);
  position: relative;
  margin-bottom: 14vh;
  backdrop-filter: blur(4px);
}
.hero-card::before { content: ""; position: absolute; inset: 8px; border: 1.5px dashed rgba(216, 176, 100, .7); border-radius: 22px; pointer-events: none; }
.eyebrow { font-family: var(--f-hand); font-size: 1.5rem; color: var(--emerald); margin: 0 0 .2em; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
.hero h1 .steam-word { display: inline-flex; gap: .04em; }
.hero h1 .steam-word span { display: inline-block; animation: bob 3s ease-in-out infinite; }
.hero h1 .steam-word span:nth-child(1) { color: var(--s); animation-delay: 0s; }
.hero h1 .steam-word span:nth-child(2) { color: var(--t); animation-delay: .15s; }
.hero h1 .steam-word span:nth-child(3) { color: var(--e); animation-delay: .3s; }
.hero h1 .steam-word span:nth-child(4) { color: var(--a); animation-delay: .45s; }
.hero h1 .steam-word span:nth-child(5) { color: var(--m); animation-delay: .6s; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; padding: 14px 22px; border-radius: 999px; background: var(--navy); color: var(--cream); box-shadow: 0 6px 0 var(--navy-deep); transition: transform .15s, box-shadow .15s; border: 0; cursor: pointer; font-family: var(--f-body); font-size: 1rem; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--navy-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--navy-deep); }
.btn.ghost { background: #fff; color: var(--navy); box-shadow: 0 6px 0 var(--gold); }
.hero-tasnim { align-self: end; justify-self: center; width: min(330px, 80%); position: relative; margin-bottom: 2vh; }
.hero-tasnim svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 18px rgba(39,56,95,.25)); }
.speech {
  position: absolute; top: -2%; inset-inline-start: -52%;
  background: #fff; border-radius: 20px; padding: 10px 16px; font-weight: 800; color: var(--navy);
  box-shadow: var(--shadow); font-size: 1.05rem; max-width: 220px; animation: pop 4s ease-in-out infinite;
}
.speech::after { content: ""; position: absolute; bottom: -10px; inset-inline-end: 30px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
.petals { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.petal { position: absolute; top: -20px; width: 14px; height: 10px; border-radius: 80% 0 80% 0; background: linear-gradient(135deg, #ffd1e0, #e88fb5); opacity: .85; animation: fall linear infinite; }
.petal.v { background: linear-gradient(135deg, #e0cfff, #9a7ad6); }
.scroll-hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 4; color: #fff; font-size: 1.8rem; animation: bob 2s infinite; text-shadow: 0 2px 6px rgba(0,0,0,.3); text-decoration: none; }

/* scene animation */
.scene .cloud.c1 { animation: drift 60s linear infinite alternate; }
.scene .cloud.c2 { animation: drift 80s linear infinite alternate-reverse; }
.scene .cloud.c3 { animation: drift 70s linear infinite alternate; }
.scene .float { animation: float 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scene .float.f2 { animation-duration: 9s; animation-delay: -2s; }
.scene .float.f3 { animation-duration: 8s; animation-delay: -4s; }
.scene .rays { animation: glow 6s ease-in-out infinite; }
.scene .bird { animation: flap 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scene .canopy { animation: sway 8s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }

/* characters animation */
.char .eye { animation: blink 5s infinite; transform-box: fill-box; transform-origin: center 60%; }
.char.salma .eye { animation-delay: -1.7s; }
.char.adam .eye { animation-delay: -3.1s; }
.breathe { animation: breathe 4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
.char .steam, .prop .steam { animation: steam 2.5s ease-in-out infinite; }
.char.cat .tail { animation: tail 2s ease-in-out infinite; transform-box: fill-box; transform-origin: left center; }

@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.008); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pop { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.05) rotate(1deg); } }
@keyframes fall { 0% { transform: translate(0, -20px) rotate(0); } 100% { transform: translate(-120px, 110vh) rotate(540deg); } }
@keyframes drift { from { transform: translateX(-60px); } to { transform: translateX(80px); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-18px) rotate(calc(var(--r, 0deg) + 6deg)); } }
@keyframes glow { 0%, 100% { opacity: .5; } 50% { opacity: .85; } }
@keyframes flap { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.5); } }
@keyframes sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1.2deg); } }
@keyframes steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(14deg); } }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- sections ---------- */
section { padding: clamp(60px, 9vw, 110px) 0; position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }
.ornament { display: block; margin: 0 auto 10px; }
.paper {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(216, 176, 100, .45);
  position: relative;
}

/* friends */
.friends { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }
.friend { padding: 18px 18px 22px; text-align: center; transition: transform .25s; }
.friend:hover { transform: translateY(-6px) rotate(-.6deg); }
.friend .portrait { background: linear-gradient(180deg, #dfeafb, #fff3e2); border-radius: 18px; overflow: hidden; aspect-ratio: 1 / 1; display: grid; place-items: end center; margin-bottom: 12px; }
.friend .portrait svg { width: 92%; height: auto; display: block; }
.friend h3 { font-size: 1.6rem; margin-bottom: .1em; }
.friend .tag { font-family: var(--f-hand); color: var(--emerald); font-size: 1.25rem; }
.friend p { font-size: .98rem; color: var(--ink-soft); margin: .3em 0 0; }

/* steam letters */
.letters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.letter-card { padding: 24px 18px; text-align: center; border-top: 8px solid var(--c); transition: transform .25s; }
.letter-card:hover { transform: translateY(-8px); }
.letter-card .big { width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 3rem; color: #fff; background: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 25%, transparent); }
.letter-card h3 { font-size: 1.5rem; color: var(--c); }
.letter-card p { font-size: .95rem; color: var(--ink-soft); margin: 0; }
.letter-card .icon { font-size: 1.6rem; display: block; margin-top: 10px; }

/* levels */
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.lvcard { padding: 28px; overflow: hidden; }
.lvcard .ribbon { display: inline-block; background: var(--lc); color: #fff; font-weight: 800; padding: 6px 16px; border-radius: 999px; margin-bottom: 10px; }
.lvcard h3 { font-size: 2rem; }
.lvcard ul { padding-inline-start: 1.2em; margin: 0; }
.lvcard li { margin-bottom: 6px; }
.lvcard .deco { position: absolute; inset-inline-end: -10px; bottom: -14px; width: 140px; opacity: .95; }

/* roadmap */
.roadmap { position: relative; background: linear-gradient(180deg, #e6f0fb 0%, #fdf3e0 100%); }
.road-wrap { position: relative; }
.road-svg { width: 100%; height: auto; display: block; }
.stop { cursor: pointer; }
.stop .halo { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.stop:hover .bubble, .stop:focus .bubble { transform: scale(1.08); }
.stop .bubble { transition: transform .2s; transform-box: fill-box; transform-origin: center; }
.road-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 20px; }
.road-legend span { display: inline-flex; align-items: center; gap: 8px; background: #fff; padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 700; font-size: .92rem; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
#walker { transition: transform 1.2s cubic-bezier(.6,.05,.3,1); }

/* sessions */
.tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.tab { border: 2px solid var(--navy); background: #fff; color: var(--navy); font: 800 1rem var(--f-body); padding: 10px 20px; border-radius: 999px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--navy); color: var(--cream); }
.sessions { display: grid; gap: 26px; }
.session { padding: clamp(20px, 3vw, 34px); scroll-margin-top: 90px; }
.session-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.session-num { width: 64px; height: 64px; border-radius: 18px; background: var(--sc, var(--navy)); color: #fff; display: grid; place-items: center; font: 800 1.6rem var(--f-body); flex: none; transform: rotate(-6deg); box-shadow: 0 6px 0 rgba(0,0,0,.12); }
.session h3 { font-size: 1.9rem; margin: 0; }
.session .meta { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid rgba(216,176,100,.6); padding: 4px 12px; border-radius: 999px; font-size: .88rem; font-weight: 700; color: var(--ink-soft); }
.goal { background: #fff; border-inline-start: 5px solid var(--emerald); padding: 12px 16px; border-radius: 12px; margin: 10px 0 18px; }
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.part { background: #fff; border-radius: 16px; padding: 16px 18px; border-top: 6px solid var(--pc, var(--gold)); box-shadow: 0 4px 14px rgba(39,56,95,.07); }
.part h4 { margin: 0 0 6px; font-size: 1.12rem; color: var(--pc, var(--navy)); display: flex; align-items: center; gap: 8px; }
.part h4 .pl { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--pc); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.part h4 .pt { flex: 1; min-width: 0; line-height: 1.3; }
.part h4 { align-items: flex-start; }
.part .time { font-size: .82rem; font-weight: 800; color: var(--ink-soft); background: var(--cream); padding: 2px 8px; border-radius: 999px; margin-inline-start: auto; white-space: nowrap; }
.part ol, .part ul { margin: 6px 0 0; padding-inline-start: 1.25em; font-size: .97rem; }
.part li { margin-bottom: 4px; }
.materials { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.materials strong { margin-inline-end: 6px; }
.tip { margin-top: 14px; font-family: var(--f-hand); font-size: 1.3rem; color: var(--emerald); display: flex; gap: 10px; align-items: center; }
.tip svg { width: 56px; height: 56px; flex: none; }
.pending { text-align: center; color: var(--ink-soft); font-style: italic; }

/* project + modules */
.project { padding: clamp(20px, 3vw, 32px); margin-bottom: 26px; background: linear-gradient(135deg, #fff8ec, #fdeee2); }
.project h3 { font-size: 1.8rem; display: flex; align-items: center; gap: 10px; }
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.module { background: #fff; border-radius: 16px; padding: 12px 14px; border-inline-start: 5px solid var(--mc); box-shadow: 0 3px 10px rgba(39,56,95,.06); }
.module b { display: flex; gap: 6px; align-items: center; color: var(--mc); font-size: 1rem; }
.module small { display: block; color: var(--ink-soft); font-size: .86rem; line-height: 1.4; margin-top: 4px; }
.module .n { font: 800 .75rem var(--f-body); color: #fff; background: var(--mc); border-radius: 999px; padding: 1px 7px; }

/* manga */
.manga-section { background: linear-gradient(180deg, #fdf3e0, #efe6fb); }
.manga-book { display: grid; gap: 34px; }
.manga-page { background: #fff; padding: 14px; border-radius: 6px; box-shadow: 0 20px 40px rgba(39,56,95,.18); position: relative; }
.manga-page::after { content: attr(data-page); position: absolute; bottom: 6px; inset-inline-end: 14px; font: 700 .8rem var(--f-body); color: #aaa; }
.manga-title { text-align: center; font-family: var(--f-title); font-size: 1.6rem; color: var(--navy); margin: 0 0 10px; }
.panels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.panel { position: relative; border: 3px solid #1c1a28; border-radius: 4px; overflow: hidden; background: #fff; aspect-ratio: var(--ar, 4 / 3); grid-column: span var(--span, 3); }
.panel svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bubble-txt {
  position: absolute; z-index: 2;
  background: #fff; color: #1c1a28; border: 2.5px solid #1c1a28; border-radius: 50%;
  padding: .55em .95em; font-weight: 800; font-size: clamp(.72rem, 1.4vw, 1rem); line-height: 1.25;
  text-align: center; max-width: 52%;
}
.bubble-txt.shout { border-radius: 10px; background: #fff7c2; transform: rotate(-3deg); font-size: clamp(.85rem, 1.7vw, 1.2rem); }
.bubble-txt.think { border-style: dashed; }
.bubble-txt.box { border-radius: 2px; background: #fdf3e0; font-family: var(--f-hand); font-weight: 600; font-size: clamp(.85rem, 1.5vw, 1.15rem); }
.sfx { position: absolute; z-index: 2; font-family: 'Bangers', 'Nunito', sans-serif; font-weight: 800; color: #ff6b8a; -webkit-text-stroke: 1.5px #1c1a28; font-size: clamp(1.1rem, 3vw, 2.2rem); transform: rotate(-10deg); letter-spacing: .04em; }
html[lang="ar"] .sfx { font-family: 'Tajawal', sans-serif; -webkit-text-stroke: 1px #1c1a28; }

/* footer */
footer { background: var(--navy-deep); color: #e8e3f2; padding: 50px 0 30px; text-align: center; position: relative; overflow: hidden; }
footer h2 { color: var(--cream); }
footer .stars span { position: absolute; color: var(--gold); animation: twinkle 3s infinite; }
footer small { opacity: .7; }

/* reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .letters { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .nav-links { display: none; position: absolute; top: 100%; inset-inline: 0; flex-direction: column; background: var(--cream); padding: 10px 16px 16px; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .menu-btn { display: block; margin-inline-start: auto; }
}
@media (max-width: 800px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 80px; }
  .hero-card { margin-bottom: 0; }
  .hero-tasnim { width: min(260px, 70%); }
  .speech { inset-inline-start: 50%; top: -6%; font-size: .9rem; }
  .levels { grid-template-columns: 1fr; }
  .panels { grid-template-columns: repeat(2, 1fr); }
  .panel { grid-column: span 2 !important; }
  .bubble-txt { font-size: .8rem; }
  .brand span.brand-text { display: none; }
  .friends { grid-template-columns: 1fr 1fr; gap: 12px; }
  .friend { padding: 10px 10px 14px; }
  .friend h3 { font-size: 1.25rem; }
  .friend p { font-size: .85rem; }
  .letters { grid-template-columns: 1fr 1fr; }
  .lvcard .deco { display: none; }
  .road-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .road-svg { min-width: 760px; }
  .speech { inset-inline-start: auto; inset-inline-end: -4%; top: -14%; max-width: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
