/* =========================================================
   ESMAZ Labs: styles
   1) Design tokens (colors, fonts)  2) Base  3) Layout  4) Components
   Uses CSS *logical* properties (inline-start/end) so RTL (Arabic) just works.
   Light/dark: tokens change under  html[data-theme="dark"].
   ========================================================= */

/* ---------- 1) TOKENS ---------- */
:root {
  --green: #00FF66;
  --green-deep: #00B848;
  --yellow: #FFD60A;  --yellow-deep: #D9A800;
  --pink: #FF4D8D;    --pink-deep: #C93A70;
  --sky: #2EC4FF;     --sky-deep: #1A94CC;
  --ink: #23272F;

  /* light theme */
  --bg: #FFFFFF;
  --bg-alt: #F4F6F9;
  --surface: #FFFFFF;
  --text: #23272F;
  --muted: #4A5160;
  --line: #23272F;           /* sticker outline */
  --shadow: rgba(35, 39, 47, .18);
  --link: #007A33;           /* readable green on white */
  --hero-glow: rgba(0, 255, 102, .18);

  --font-head: "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --radius: 22px;
  --wrap: 1120px;
}
html[data-theme="dark"] {
  --bg: #15181D;
  --bg-alt: #1B1F26;
  --surface: #1F242C;
  --text: #F2F4F7;
  --muted: #B6BDC9;
  --line: #0B0D10;
  --shadow: rgba(0, 0, 0, .45);
  --link: #00FF66;
  --hero-glow: rgba(0, 255, 102, .10);
}
html[lang="ar"] {
  --font-head: "Cairo", "Baloo 2", system-ui, sans-serif;
  --font-body: "Cairo", "Nunito", system-ui, sans-serif;
}

/* ---------- 2) BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 18px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 12px; }

/* Show only the logo that matches the theme */
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: inline-block; }

/* ---------- 3) HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid color-mix(in srgb, var(--text) 10%, transparent);
}
.header-in { display: flex; align-items: center; gap: 18px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { border-radius: 12px; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; letter-spacing: .2px; }
.brand-name b { color: var(--link); font-weight: 800; }
.nav { display: flex; gap: 6px; margin-inline-start: auto; }
.nav a {
  text-decoration: none; color: var(--text); font-weight: 700; font-size: .98rem;
  padding: 8px 12px; border-radius: 999px; transition: background .15s;
}
.nav a:hover { background: color-mix(in srgb, var(--green) 28%, transparent); }
.tools { display: flex; gap: 8px; align-items: center; }
.tool {
  font: 800 .95rem var(--font-body); color: var(--text); background: var(--surface);
  border: 2.5px solid var(--line); border-radius: 999px; min-height: 44px; padding: 0 16px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 var(--line); transition: transform .1s, box-shadow .1s;
}
.tool:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.tool.icon { width: 44px; padding: 0; }
.i-moon { display: none; }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="dark"] .i-moon { display: block; }
.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font: 800 1.05rem var(--font-body); min-height: 52px; padding: 0 28px; border-radius: 999px;
  border: 3px solid var(--line); box-shadow: 0 6px 0 var(--line);
  transition: transform .1s, box-shadow .1s; cursor: pointer;
}
.btn:active { transform: translateY(6px); box-shadow: 0 0 0 var(--line); }
.btn.primary { background: var(--green); color: var(--ink); }
.btn.ghost { background: var(--surface); color: var(--text); }
.btn.big { min-height: 60px; font-size: 1.2rem; padding: 0 36px; }
@media (hover: hover) { .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--line); } }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-alt); }
.h2 { font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 800; }
.sub { color: var(--muted); font-size: 1.15rem; max-width: 720px; }

/* ---------- HERO ---------- */
.hero {
  padding: 56px 0 84px; text-align: center;
  background:
    radial-gradient(900px 420px at 50% -10%, var(--hero-glow), transparent 70%),
    var(--bg);
}
.hero-in { display: flex; flex-direction: column; align-items: center; }
.eyebrow {
  font-weight: 800; color: var(--muted); letter-spacing: .3px;
  background: var(--surface); border: 2.5px solid var(--line); border-radius: 999px;
  padding: 6px 18px; box-shadow: 0 3px 0 var(--line); font-size: .95rem; margin-bottom: 36px;
}
.blocks { display: flex; gap: clamp(8px, 2vw, 20px); justify-content: center; margin-bottom: 18px; }
.tile {
  --r: 0deg; --edge: var(--green-deep); --bgc: var(--green);
  width: clamp(54px, 13vw, 110px); aspect-ratio: 1; border-radius: 24%;
  display: grid; place-items: center;
  font: 800 clamp(2rem, 7.4vw, 4.6rem)/1 "Baloo 2", system-ui, sans-serif; color: var(--ink);
  background: var(--bgc); border: 3.5px solid var(--ink);
  box-shadow: 0 10px 0 0 var(--edge), 0 10px 0 3.5px var(--ink);
  transform: rotate(var(--r)); will-change: transform;
  animation: drop .9s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: var(--d, 0s);
}
.t1 { --r: -7deg; --bgc: var(--green);  --edge: var(--green-deep); }
.t2 { --r: 5deg;  --bgc: var(--yellow); --edge: var(--yellow-deep); margin-top: -8px; }
.t3 { --r: -4deg; --bgc: var(--pink);   --edge: var(--pink-deep); margin-top: 6px; }
.t4 { --r: 6deg;  --bgc: var(--sky);    --edge: var(--sky-deep); margin-top: -6px; }
.t5 { --r: -6deg; --bgc: var(--green);  --edge: var(--green-deep); margin-top: 4px; }
@keyframes drop {
  0%   { transform: translateY(-90vh) rotate(calc(var(--r) * 4)); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(0) rotate(var(--r)); opacity: 1; }
}
.labs-word {
  font: 800 clamp(1.2rem, 3vw, 1.7rem) var(--font-head); letter-spacing: .6em;
  margin: 26px 0 30px; padding-inline-start: .6em; color: var(--text);
  animation: fade .6s 1.3s both;
}
.spark { color: var(--yellow); letter-spacing: 0; }
.spark.pink { color: var(--pink); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero-title { font-size: clamp(2.4rem, 6.5vw, 4.2rem); font-weight: 800; margin-bottom: .3em; }
.hero-lead { color: var(--muted); font-size: 1.25rem; max-width: 720px; margin-inline: auto; }
.cta-row { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 18px; }

/* ---------- Cards ---------- */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 40px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
.card {
  background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: 0 8px 0 var(--line);
}
.card h3 { font-size: 1.4rem; font-weight: 800; }
.card p { color: var(--muted); margin: 0; font-size: 1.02rem; }
.ico {
  width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center;
  border: 3px solid var(--ink); color: var(--ink); margin-bottom: 18px;
}
.c-green .ico { background: var(--green); }
.c-yellow .ico { background: var(--yellow); }
.c-pink .ico { background: var(--pink); }
.c-sky .ico { background: var(--sky); }

.ai-band {
  margin-top: 54px; display: flex; gap: 28px; align-items: center; justify-content: space-between;
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 30px 34px;
  border: 3px solid var(--line); box-shadow: 0 8px 0 var(--green-deep);
}
html[data-theme="dark"] .ai-band { background: #0F1216; border-color: #2A3039; }
.ai-band h3 { font-size: 1.5rem; color: var(--green); }
.ai-band p { margin: 0; color: #D6DBE4; max-width: 640px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.chips li { background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.25); border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: .95rem; white-space: nowrap; }

/* ---------- Masarat ---------- */
.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.badge {
  display: inline-block; background: var(--yellow); color: var(--ink); font-weight: 800; font-size: .9rem;
  border: 2.5px solid var(--ink); border-radius: 999px; padding: 4px 16px; margin-bottom: 18px;
}
.ar-name { font-family: "Cairo", sans-serif; color: var(--link); margin-inline-start: .2em; }
html[lang="ar"] .ar-name { display: none; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-inline-start: 38px; font-weight: 700; }
.ticks li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 1px; width: 26px; height: 26px; line-height: 22px; text-align: center;
  background: var(--green); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 50%; font-size: .9rem; font-weight: 800;
}
.col-art { display: grid; place-items: center; }
.board {
  width: min(100%, 380px); background: var(--surface); border: 3.5px solid var(--line);
  border-radius: 30px; box-shadow: 0 10px 0 var(--line); padding: 8px; transform: rotate(2deg);
}
.board .dots circle { fill: var(--text); }
.l-green { stroke: var(--green-deep); } .l-pink { stroke: var(--pink); } .l-sky { stroke: var(--sky); }
.bf-green { fill: color-mix(in srgb, var(--green) 38%, transparent); }
.bf-pink { fill: color-mix(in srgb, var(--pink) 34%, transparent); }

/* ---------- Ages ---------- */
.age .num {
  direction: ltr; unicode-bidi: isolate;
  display: inline-block; font: 800 1.6rem var(--font-head); border: 3px solid var(--ink); border-radius: 16px;
  padding: 2px 16px; margin-bottom: 14px; color: var(--ink);
}
.a1 .num { background: var(--green); } .a2 .num { background: var(--yellow); }
.a3 .num { background: var(--pink); }  .a4 .num { background: var(--sky); }

/* ---------- Promises ---------- */
.promise { background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: 0 8px 0 var(--line); }
.promise h3 { font-size: 1.4rem; font-weight: 800; }
.promise p { margin: 0; color: var(--muted); }
.pn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--green); color: var(--ink); border: 3px solid var(--ink); font: 800 1.3rem var(--font-head);
}

/* ---------- Roadmap ---------- */
.road { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; position: relative; }
.step { background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: 0 8px 0 var(--line); }
.step h3 { font-size: 1.35rem; font-weight: 800; }
.step p { margin: 0; color: var(--muted); }
.when { display: inline-block; font-weight: 800; border: 2.5px solid var(--ink); border-radius: 999px; padding: 2px 16px; margin-bottom: 12px; color: var(--ink); }
.now .when { background: var(--green); } .next .when { background: var(--yellow); } .later .when { background: var(--sky); }

/* ---------- Contact / Footer ---------- */
.contact { background: var(--green); color: var(--ink); text-align: center; border-top: 3px solid var(--ink); }
.contact .sub { color: #1b3a2a; margin-inline: auto; }
.contact .btn.primary { background: #fff; }
.contact-in { display: flex; flex-direction: column; align-items: center; }
html[data-theme="dark"] .contact { background: #0B3D1E; color: #fff; border-color: #0B0D10; }
html[data-theme="dark"] .contact .sub { color: #C9F3D8; }
html[data-theme="dark"] .contact .btn.primary { background: var(--green); }
.site-footer { background: var(--bg); padding: 40px 0 46px; border-top: 3px solid var(--ink); }
html[data-theme="dark"] .site-footer { border-color: #0B0D10; }
.foot-in { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.fl { height: auto; }
.copy .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.copy { margin: 0; color: var(--muted); font-size: .98rem; }
.totop { font-weight: 800; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 36px; }
  .ai-band { flex-direction: column; align-items: flex-start; }
  .chips { justify-content: flex-start; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none; position: absolute; inset-inline: 0; top: 72px; flex-direction: column; gap: 2px;
    background: var(--bg); border-bottom: 3px solid var(--line); padding: 12px 22px 18px; margin: 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; font-size: 1.1rem; }
  .tools { margin-inline-start: auto; }
}
@media (max-width: 680px) {
  body { font-size: 17px; }
  .section { padding: 60px 0; }
  .grid4, .grid3, .road { grid-template-columns: 1fr; }
  .brand-name { font-size: 1.15rem; }
  .tool { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile, .labs-word { animation: none; }
  * { transition: none !important; }
}
