:root {
  color-scheme: light;
  --paper: #faf5e9; --paper-2: #f2ead6; --card: #fffdf7; --ink: #1d2b27; --ink-2: #4b5a54; --line: #e2d9c2;
  --board: #1a4a40; --board-deep: #103229; --chalk: #f6f1e3; --chalk-dim: #c3d5cb;
  --saffron: #f0b02f; --saffron-deep: #c98512; --wood: #a86c33; --wood-deep: #7d4f24;
  --s-calcul: #b4630c; --s-operations: #bf4b2a; --s-nombres: #14756f; --s-geometrie: #36519a; --s-mesures: #7b3a6b; --s-francais: #3f7a25;
  --radius: 14px; --shadow: 0 1px 2px rgba(29,43,39,.07), 0 12px 26px -16px rgba(29,43,39,.32);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --lh: 1.65;
}
:root[lang="ar"] { --display: "El Messiri", "Segoe UI", Tahoma, serif; --body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; --lh: 1.9; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/var(--lh) var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--board); text-underline-offset: .18em; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; font-weight: 700; }
:focus-visible { outline: 3px solid var(--saffron-deep); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { inset-inline-start: 12px; }

.frieze { height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12'%3E%3Crect width='48' height='12' fill='%23103229'/%3E%3Cpath d='M12 1l5 5-5 5-5-5z' fill='%23f0b02f'/%3E%3Cpath d='M36 1l5 5-5 5-5-5z' fill='%23bf4b2a'/%3E%3Cpath d='M24 4l2 2-2 2-2-2z' fill='%23f6f1e3'/%3E%3Cpath d='M0 4l2 2-2 2zM48 4l-2 2 2 2z' fill='%23f6f1e3'/%3E%3C/svg%3E"); }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 12px 26px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 800 1.45rem/1 var(--display); }
.brand svg { width: 40px; height: 40px; flex: none; }
.top nav { display: flex; gap: 4px 20px; flex-wrap: wrap; margin-inline-start: auto; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 8px 2px; border-bottom: 2px solid transparent; min-height: 40px; display: inline-flex; align-items: center; }
.top nav a:hover { border-color: var(--line); }
.top nav a[aria-current] { border-color: var(--saffron-deep); }
.langs { display: inline-flex; border: 1.5px solid var(--board); border-radius: 999px; padding: 2px; }
.langs a { min-width: 38px; min-height: 36px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: var(--board); font-weight: 700; font-size: .9rem; text-decoration: none; }
.langs a:hover { background: var(--paper-2); }
.langs a[aria-current] { background: var(--board); color: var(--chalk); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 11px 26px; background: var(--saffron); color: #2a1d05; border-radius: 12px; font-weight: 700; text-decoration: none; box-shadow: 0 3px 0 var(--saffron-deep); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--saffron-deep); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--saffron-deep); }
.btn-ghost { display: inline-flex; align-items: center; min-height: 50px; padding: 11px 8px; color: var(--chalk); font-weight: 500; text-underline-offset: .25em; }

.hero { background-color: var(--board); color: var(--chalk); position: relative; background-image: radial-gradient(ellipse 70% 60% at 22% 10%, rgba(255,255,255,.07), transparent 70%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23f6f1e3' stroke-opacity='.075' stroke-width='1.2'%3E%3Crect x='30' y='30' width='36' height='36'/%3E%3Crect x='30' y='30' width='36' height='36' transform='rotate(45 48 48)'/%3E%3Cpath d='M0 0l14 14M96 0L82 14M0 96l14-14M96 96L82 82'/%3E%3C/g%3E%3C/svg%3E"); }
.hero-in { display: grid; grid-template-columns: 1.02fr 1fr; gap: 44px; align-items: center; padding-block: clamp(36px, 6vw, 72px) clamp(52px, 7vw, 86px); }
.hero h1 { font-size: clamp(2.25rem, 5vw, 3.65rem); letter-spacing: -.015em; font-weight: 800; }
:root[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.35; }
.hero h1 em { font-style: normal; color: var(--saffron); }
.hero .lede { color: var(--chalk-dim); font-size: 1.18rem; margin: 18px 0 24px; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.hero-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--chalk); font-size: .98rem; }
.hero-points li { display: flex; gap: 8px; align-items: center; }
.hero-points li::before { content: ""; width: 9px; height: 9px; background: var(--saffron); transform: rotate(45deg); flex: none; }
.hero-shots { position: relative; padding-bottom: 12%; }
.hero-shots img { border-radius: 8px; border: 8px solid var(--wood); box-shadow: 0 22px 40px -18px rgba(0,0,0,.65); }
.shot-main { width: 92%; margin-inline-start: auto; }
.shot-small { position: absolute; width: 50%; inset-inline-start: 0; bottom: 0; border-width: 6px !important; }
.tray { height: 16px; background: linear-gradient(var(--wood), var(--wood-deep)); position: relative; }
.tray i { position: absolute; bottom: 11px; height: 9px; border-radius: 3px; background: var(--chalk); width: 62px; inset-inline-start: 12%; }
.tray i:nth-child(2) { background: var(--saffron); width: 36px; inset-inline-start: calc(12% + 84px); }
.tray i:nth-child(3) { width: 26px; inset-inline-start: calc(12% + 138px); opacity: .85; }

.block { padding-block: clamp(34px, 5vw, 56px) 0; }
.block > h2, .block-head h2, .how h2 { font-size: clamp(1.55rem, 3vw, 2.05rem); }
.block > h2 { margin-bottom: 20px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.block-head a { font-weight: 700; }

.subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.subject { --c: var(--board); background: var(--c); color: #fff; text-decoration: none; border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 2px; min-height: 132px; transition: transform .14s; }
.subject:hover { transform: translateY(-3px); }
.subject .motif { font: 800 1.7rem/1.25 var(--display); opacity: .92; margin-bottom: auto; white-space: nowrap; unicode-bidi: plaintext; text-align: start; }
.subject strong { font-size: 1.08rem; margin-top: 12px; }
.subject span:last-child { font-size: .93rem; opacity: .9; }
.subjects.big { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); padding-bottom: 12px; }
.s-calcul { --c: var(--s-calcul); } .s-operations { --c: var(--s-operations); } .s-nombres { --c: var(--s-nombres); } .s-geometrie { --c: var(--s-geometrie); } .s-mesures { --c: var(--s-mesures); } .s-francais { --c: var(--s-francais); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .14s; }
.card[hidden] { display: none; }
.card:hover { transform: translateY(-3px); }
.card a { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.thumb { display: block; aspect-ratio: 16/9; background: var(--board); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 1.28rem; }
.short { color: var(--ink-2); font-size: .98rem; line-height: 1.5; }
:root[lang="ar"] .short { line-height: 1.75; }
.meta { margin-top: auto; padding-top: 6px; font-size: .9rem; color: var(--ink-2); font-weight: 500; }
.tag { align-self: flex-start; display: inline-block; font-size: .8rem; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); padding: 2px 10px; border-radius: 999px; }

.how { background: var(--paper-2); margin-top: clamp(38px, 6vw, 64px); padding-block: clamp(32px, 5vw, 52px); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 60px; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: -4px; width: 46px; height: 46px; display: grid; place-items: center; background: var(--board); color: var(--chalk); font: 800 1.35rem/1 var(--display); border-radius: 10px; }
.steps h3 { font-size: 1.18rem; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--ink-2); }

.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.post a { display: flex; flex-direction: column; height: 100%; padding: 18px 20px; color: inherit; text-decoration: none; }
.post h3 { font-size: 1.2rem; margin-bottom: 8px; }
.post p { margin: 0 0 12px; color: var(--ink-2); font-size: .98rem; line-height: 1.55; }
:root[lang="ar"] .post p { line-height: 1.8; }
.post .more { margin-top: auto; font-weight: 700; color: var(--board); }
.post:hover { border-color: var(--board); }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 2px; max-width: 800px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--ink-2); }

.crumbs { padding-top: 14px; font-size: .92rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 0; margin: 0; color: var(--ink-2); }
.crumbs li + li::before { content: "›"; margin-inline-end: 8px; color: var(--ink-2); }
:root[lang="ar"] .crumbs li + li::before { content: "‹"; }
.page-head { padding-block: 16px 22px; display: flex; flex-direction: column; gap: 10px; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.lede { font-size: 1.15rem; color: var(--ink-2); margin: 0; max-width: 46em; }

.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.filters > div { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { display: none; font: inherit; font-size: .95rem; font-weight: 500; min-height: 42px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.js .filters button { display: inline-flex; align-items: center; }
.filters button[aria-pressed="true"] { background: var(--board); border-color: var(--board); color: var(--chalk); }
.empty { color: var(--ink-2); padding-block: 12px; }

.stage { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(240px, 1fr); gap: 24px; align-items: start; }
.stage-frame { position: relative; display: block; border-radius: 10px; border: 10px solid var(--wood); background: var(--board); overflow: hidden; box-shadow: 0 18px 34px -20px rgba(0,0,0,.55); }
.stage-frame img { width: 100%; transition: transform .25s, filter .25s; filter: brightness(.82); }
.stage-frame:hover img { transform: scale(1.015); filter: brightness(.72); }
.stage-cta { position: absolute; inset: 0; margin: auto; width: max-content; height: 66px; display: inline-flex; align-items: center; gap: 12px; padding-inline: 30px; background: var(--saffron); color: #2a1d05; border-radius: 14px; font-weight: 800; font-size: 1.25rem; box-shadow: 0 4px 0 var(--saffron-deep), 0 16px 30px -10px rgba(0,0,0,.6); }
:root[lang="ar"] .stage-cta svg { transform: scaleX(-1); }
.stage-note { font-size: .95rem; color: var(--ink-2); margin: 10px 0 0; }
.facts { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; }
.facts div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-size: .86rem; color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 700; }

.prose { max-width: 760px; padding-top: 12px; }
.prose h2 { font-size: 1.5rem; margin: 30px 0 10px; }
.prose h3 { font-size: 1.2rem; margin: 22px 0 6px; }
.prose p, .prose li { color: #2b3a35; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-inline-start: 1.3em; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 18px 0; padding: 12px 18px; background: var(--paper-2); border-inline-start: 4px solid var(--saffron-deep); border-radius: 6px; }
.article { padding-top: 18px; }
.article h1 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); margin-bottom: 12px; }
.date { font-size: .92rem; color: var(--ink-2); margin-top: 10px; }
.callout { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; margin: 22px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; color: inherit; }
.callout:hover { border-color: var(--board); }
.callout img { border-radius: 8px; }
.callout span { display: flex; flex-direction: column; gap: 3px; }
.callout strong { font-family: var(--display); font-size: 1.2rem; }
.callout span span { color: var(--ink-2); font-size: .97rem; line-height: 1.5; }
.callout em { font-style: normal; font-weight: 700; color: var(--board); }

.ad-slot { margin: 30px auto; min-height: 90px; }
.ad-preview { display: grid; place-items: center; border: 2px dashed var(--saffron-deep); color: var(--saffron-deep); border-radius: 10px; font-weight: 700; }

.foot { margin-top: clamp(44px, 7vw, 76px); background: var(--board-deep); color: var(--chalk-dim); padding-block: 36px 18px; }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.foot h2 { font: 700 1rem/1.3 var(--body); color: var(--chalk); margin-bottom: 8px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { padding: 3px 0; }
.foot a { color: var(--chalk-dim); }
.foot a:hover { color: #fff; }
.foot-brand strong { color: var(--chalk); font: 800 1.3rem/1.2 var(--display); }
.foot-brand p { margin: 8px 0 0; max-width: 32em; }
.credit { font-size: .88rem; border-top: 1px solid rgba(246,241,227,.16); padding-top: 14px; margin-top: 26px; }

.root-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--board); }
.root-card { background: var(--card); border-radius: 16px; padding: 30px; max-width: 540px; text-align: center; box-shadow: 0 24px 50px -24px rgba(0,0,0,.7); }
.root-logo svg { width: 76px; height: 76px; margin-inline: auto; display: block; }
.root-card h1 { font-size: 1.9rem; margin: 10px 0; }
.root-card p { color: var(--ink-2); margin: 8px 0; }
.root-choices { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; gap: 28px; }
  .stage { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .top nav { order: 3; width: 100%; margin-inline-start: 0; justify-content: space-between; }
  .langs { margin-inline-start: auto; }
}
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .stage-cta { height: 54px; font-size: 1.05rem; padding-inline: 20px; }
  .stage-frame { border-width: 6px; }
  .callout { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
