/* MajorMind website — brand colors match the app logo (brand/README.md). */
:root {
  --teal: #0e6b62;
  --teal-light: #15a08c;
  --teal-dark: #0a4c46;
  --saffron: #f2a93b;
  --terra: #d0643b;
  --ink: #14212b;
  --muted: #5b6770;
  --cream: #f6f4ef;
  --line: #e4e0d6;
  --white: #ffffff;
  --night: #0c171d;
  --radius: 20px;
  --shadow: 0 18px 50px rgba(20, 33, 43, 0.12);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Noto Kufi Arabic", "Plus Jakarta Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[dir="rtl"], .ar { font-family: var(--font-ar); }
/* Arabic pages: no negative letter-spacing (it breaks joined letters), a bit more line height */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .title { letter-spacing: 0; line-height: 1.35; }

/* language switch (EN · FR · ع) */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.nav.scrolled .lang-switch { background: rgba(20, 33, 43, .06); }
.lang-switch a { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; opacity: .7; }
.lang-switch a[aria-current="page"] { background: var(--white); color: var(--teal); opacity: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.lang-switch a:hover { opacity: 1; }
.lang-switch .ar { font-size: 14px; }

.container { width: min(1120px, 100% - 32px); margin: 0 auto; }
.container.narrow { width: min(760px, 100% - 32px); }
.center { text-align: center; }

/* ---------- buttons, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 26px; border-radius: 14px; border: 0;
  background: var(--teal); color: var(--white); font: 700 16px var(--font);
  text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 24px rgba(14, 107, 98, 0.28);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--teal-light); box-shadow: 0 14px 30px rgba(14, 107, 98, 0.35); }
.btn:focus-visible, .tab:focus-visible, summary:focus-visible { outline: 3px solid var(--saffron); outline-offset: 3px; }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 14px; box-shadow: none; }
.btn-outline { background: transparent; color: var(--teal); border: 2px solid var(--teal); box-shadow: none; }
.btn-outline:hover { background: var(--teal); color: var(--white); }
.btn-light { background: var(--white); color: var(--teal-dark); }
.btn-light:hover { background: var(--cream); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .2px; white-space: nowrap;
}
.badge.live { background: rgba(21, 160, 140, .14); color: var(--teal-dark); }
.badge.soon { background: rgba(242, 169, 59, .18); color: #8a5a10; }

.eyebrow {
  margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--teal);
}
.title { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; letter-spacing: -1px; margin: 0 0 18px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; }
.lead.center { max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(16px, calc((100% - 1120px) / 2));
  transition: background .3s ease, box-shadow .3s ease, color .3s ease;
  color: var(--white);
}
.nav.scrolled { background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); box-shadow: 0 4px 20px rgba(20, 33, 43, .08); color: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 21px; letter-spacing: -.4px; }
.brand b { color: var(--saffron); font-weight: 800; }
.nav.scrolled .brand b, .footer .brand b { color: var(--teal); }
.nav { gap: 18px; }
.nav .brand { margin-inline-end: auto; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a:not(.btn) { text-decoration: none; font-weight: 600; font-size: 15px; opacity: .9; white-space: nowrap; }
.nav-links .btn { white-space: nowrap; }
/* longer French words: tighter menu on laptops */
@media (max-width: 1400px) { :lang(fr) .nav-links { gap: 14px; } :lang(fr) .nav-links a:not(.btn) { font-size: 14px; } }
.nav-links a:not(.btn):hover { opacity: 1; color: var(--saffron); }
.nav.scrolled .nav-links a:not(.btn):hover { color: var(--teal); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 11px; width: 22px; height: 2px; background: currentColor; transition: transform .25s ease; }
.nav-toggle span:first-child { top: 17px; } .nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- 3D story ---------- */
.story { position: relative; height: 380vh; background: #1a2430; }
.story-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#story-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.story-fallback { display: none; position: absolute; inset: 0; place-items: center; }
.story-fallback img { width: 160px; opacity: .9; }
.no-webgl .story-fallback { display: grid; }
.beats { position: absolute; inset: 0; pointer-events: none; }
.beat {
  position: absolute; inset-inline-start: max(24px, calc((100% - 1120px) / 2)); top: 50%;
  width: min(460px, 100% - 48px); transform: translateY(-50%);
  color: var(--white); opacity: 0; transition: none;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .35);
}
.beat h1, .beat h2 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.05; letter-spacing: -1.5px; margin: 0 0 16px; }
.beat p { font-size: clamp(17px, 1.6vw, 20px); margin: 0 0 22px; color: rgba(255, 255, 255, .88); }
.beat .eyebrow { color: var(--saffron); text-shadow: none; }
.beat .btn { pointer-events: auto; }
.story-progress { position: absolute; inset-inline-end: max(20px, calc((100% - 1120px) / 2)); top: 50%; transform: translateY(-50%); display: grid; gap: 10px; }
.story-progress span { width: 8px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, .25); transition: background .3s ease; }
.story-progress span.on { background: var(--saffron); }
.scroll-hint { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); color: rgba(255, 255, 255, .75); font-weight: 600; font-size: 14px; }
.scroll-hint span { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- sections ---------- */
.section { padding: 110px 0; }
.section.alt { background: var(--cream); }
.section.compact { padding: 60px 0; }
.section.dark { background: linear-gradient(160deg, #0f2a30 0%, #0c171d 100%); color: var(--white); }
.section.dark .lead { color: rgba(255, 255, 255, .75); }
.section.dark .eyebrow { color: var(--saffron); }

.cards { display: grid; gap: 22px; margin-top: 44px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.grid { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card h3 { font-size: 20px; margin: 10px 0 8px; letter-spacing: -.3px; }
.card p { margin: 0; color: var(--muted); }
.card-icon { font-size: 34px; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: var(--cream); }
.feature { padding: 24px; }
.feature h3 { font-size: 18px; }

.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.split.reverse { grid-template-columns: 1fr 1.05fr; }
.checks { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; font-size: 17px; }
.checks li { position: relative; padding-inline-start: 36px; }
.checks li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(21, 160, 140, .15); color: var(--teal); display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.note { color: var(--muted); font-size: 15px; margin: 0 0 22px; }

/* ---------- agent ---------- */
.skills { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.skills li { display: flex; gap: 12px; align-items: center; font-size: 16px; color: rgba(255, 255, 255, .9); }
.skills .badge { min-width: 102px; text-align: center; }
.section.dark .badge.live { background: rgba(21, 160, 140, .25); color: #7fe0cf; }
.section.dark .badge.soon { background: rgba(242, 169, 59, .2); color: #ffd28a; }
.agent-card {
  position: relative; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px; padding: 24px; backdrop-filter: blur(6px);
}
.agent-goal { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.agent-goal .you { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--saffron); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.agent-goal p { margin: 0; background: rgba(255, 255, 255, .1); padding: 10px 14px; border-radius: 4px 16px 16px 16px; }
.agent-steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.agent-steps li {
  display: flex; gap: 10px; align-items: center; font-size: 15px; color: rgba(255, 255, 255, .85);
  opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease;
}
.agent-steps li.show { opacity: 1; transform: none; }
.agent-steps .state { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(255, 255, 255, .12); }
.agent-steps li.working .state { border: 2px solid var(--saffron); border-right-color: transparent; background: none; animation: spin .8s linear infinite; }
.agent-steps li.done .state { background: var(--teal-light); color: var(--white); }
.agent-steps li.done .state::after { content: "✓"; }
@keyframes spin { to { transform: rotate(360deg); } }
.agent-result { background: rgba(255, 255, 255, .95); color: var(--ink); border-radius: 16px; padding: 16px; animation: pop .45s ease; }
.result-title { margin: 0 0 10px; font-weight: 800; }
.plan { display: grid; gap: 6px; font-size: 14px; }
.plan div { display: flex; gap: 10px; align-items: baseline; }
.plan b { min-width: 34px; flex-shrink: 0; color: var(--teal); }
[dir="rtl"] .plan b { min-width: 62px; }
.plan em { margin-inline-start: auto; font-style: normal; font-size: 12px; font-weight: 700; color: #8a5a10; background: rgba(242, 169, 59, .2); padding: 1px 8px; border-radius: 999px; }
.agent-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.replay { background: rgba(255, 255, 255, .12); }
.preview-note { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .5); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

/* ---------- demo phone ---------- */
.lang-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.tab {
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--white);
  font: 700 15px var(--font); color: var(--ink); cursor: pointer; transition: all .2s ease;
}
.tab[data-lang="arabic"] { font-family: var(--font-ar); }
.tab:hover { border-color: var(--teal-light); }
.tab.active { background: var(--teal); border-color: var(--teal); color: var(--white); }
.phone {
  justify-self: center; width: min(360px, 100%); height: 560px; background: var(--white);
  border-radius: 36px; border: 10px solid var(--ink); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.phone-top { display: flex; gap: 10px; align-items: center; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.phone-top div { display: grid; line-height: 1.2; }
.phone-top small { color: var(--teal-light); font-weight: 600; }
.chat { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; background: #fbfaf7; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.55; animation: pop .3s ease; white-space: pre-line; }
.msg.student { align-self: flex-end; background: var(--teal); color: var(--white); border-end-end-radius: 4px; }
.msg.teacher { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-end-start-radius: 4px; }
.msg[dir="rtl"] { text-align: right; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }
.phone-input { display: flex; justify-content: space-between; align-items: center; margin: 10px 12px 14px; padding: 12px 16px; border-radius: 999px; background: var(--cream); color: var(--muted); font-size: 14px; }
.phone-input .send { color: var(--teal); font-size: 18px; }

/* ---------- rooms mock ---------- */
.room-mock { background: #111c22; border-radius: 26px; padding: 18px; box-shadow: var(--shadow); color: var(--white); }
.room-head { font-size: 14px; color: rgba(255, 255, 255, .75); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 0 0 rgba(255, 90, 90, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 90, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0); } }
.room-stage { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: radial-gradient(circle at 50% 35%, #1f3d40 0%, #111c22 75%); }
#room-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.room-stage .room-fallback { display: none; position: absolute; inset: 0; padding: 12px; }
.room-stage.no-webgl .room-fallback { display: grid; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { aspect-ratio: 4 / 3; background: #1d2b33; border-radius: 16px; display: grid; place-items: center; position: relative; }
.tile span { position: absolute; inset-inline-start: 12px; bottom: 10px; font-size: 13px; font-weight: 600; }
.tile.ai { background: linear-gradient(145deg, #13453f, #1d2b33); }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font-weight: 800; font-size: 24px; color: var(--ink); transition: box-shadow .2s ease; }
.ai-avatar { background: var(--white); padding: 12px; }
.tile.speaking .avatar { box-shadow: 0 0 0 4px var(--teal-light), 0 0 0 9px rgba(21, 160, 140, .3); }
.room-bar { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
.rb { min-width: 46px; height: 46px; border-radius: 999px; background: #243842; display: grid; place-items: center; }
.rb svg { width: 20px; height: 20px; fill: var(--white); }
.rb.ask { padding: 0 18px; background: var(--saffron); color: var(--ink); font-weight: 800; font-size: 14px; transition: transform .2s ease, box-shadow .2s ease; }
.rb.ask.pressed { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(242, 169, 59, .35), 0 0 24px rgba(242, 169, 59, .6); }
.rb.leave { background: #e5484d; }

/* ---------- quiz mock (our own design) ---------- */
.quiz-mock { background: var(--white); border: 1px solid var(--line); border-radius: 26px; padding: 22px; box-shadow: var(--shadow); }
.quiz-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; }
.quiz-head b { color: var(--ink); letter-spacing: 1px; }
.timer { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer circle { fill: none; stroke: var(--line); stroke-width: 3.5; }
.timer circle.t { stroke: var(--teal-light); stroke-dasharray: 94.25; stroke-dashoffset: 0; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer em { font-style: normal; font-weight: 800; color: var(--ink); font-size: 15px; }
.quiz-q { font-size: 20px; font-weight: 700; margin: 18px 0; line-height: 1.35; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; border: 2px solid var(--line); font-weight: 600; transition: all .3s ease; }
.answer b { width: 30px; height: 30px; border-radius: 9px; background: var(--a); color: var(--white); display: grid; place-items: center; flex: none; }
.answer.correct { border-color: var(--teal-light); background: rgba(21, 160, 140, .1); }
.answer.dim { opacity: .45; }
.quiz-score { display: flex; justify-content: space-between; margin-top: 16px; font-weight: 700; color: var(--muted); }
.points { color: var(--teal); opacity: 0; transform: translateY(6px); transition: all .4s ease; }
.points.show { opacity: 1; transform: none; }

/* ---------- platforms, faq, join, footer ---------- */
.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 8px; }
.platforms span { padding: 12px 26px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-weight: 700; }
details { border-bottom: 1px solid var(--line); padding: 6px 0; }
summary { cursor: pointer; list-style: none; font-size: 18px; font-weight: 700; padding-block: 16px; padding-inline: 0 40px; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; inset-inline-end: 6px; top: 12px; font-size: 26px; color: var(--teal); transition: transform .25s ease; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 18px; color: var(--muted); }
.join { background: linear-gradient(135deg, var(--teal-light), var(--teal-dark)); color: var(--white); }
.join .lead { color: rgba(255, 255, 255, .85); }
.join-logo { margin: 0 auto 22px; background: var(--white); border-radius: 24px; padding: 14px; width: 104px; height: auto; }
.footer { padding: 32px 0; background: var(--night); color: rgba(255, 255, 255, .7); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer .brand { color: var(--white); }
.footer p { margin: 0; font-size: 14px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
/* menu button (☰) when the menu no longer fits on one line */
@media (max-width: 1100px) {
  .nav-toggle { display: block; color: inherit; }
  .lang-switch { order: 1; }
  .nav-toggle { order: 2; }
  .nav-links {
    position: fixed; inset: 68px 12px auto auto; width: min(360px, calc(100% - 24px)); flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--white); color: var(--ink); border-radius: 18px; padding: 12px; box-shadow: var(--shadow);
    opacity: 0; pointer-events: none; transform: translateY(-8px); transition: all .2s ease;
  }
  .nav-links.open { opacity: 1; pointer-events: auto; transform: none; }
  .nav-links a:not(.btn) { padding: 12px; border-radius: 10px; }
  .nav-links .btn { margin-top: 6px; }
}
@media (max-width: 980px) {
  .cards.grid { grid-template-columns: repeat(2, 1fr); }
  .split, .split.reverse { grid-template-columns: 1fr; gap: 44px; }
  .split.reverse .room-mock { order: 2; }
}
@media (max-width: 760px) {
  .section { padding: 80px 0; }
  .cards.three, .cards.grid { grid-template-columns: 1fr; }
  .beats { background: linear-gradient(180deg, transparent 50%, rgba(8, 16, 22, .55) 100%); }
  .beat { top: auto; bottom: 90px; transform: none; }
  .beat h1, .beat h2 { font-size: 36px; }
  .story-progress { inset-inline-end: 14px; }
  .answers { grid-template-columns: 1fr; }
  .agent-card { padding: 18px 16px; }
  .skills .badge { min-width: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint span, .dot-live { animation: none; }
}

/* ---------- privacy & terms pages ---------- */
.legal-page { background: var(--cream); }
.legal-links { display: flex; }
.legal {
  width: min(760px, 100% - 32px); margin: 110px auto 60px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 5vw, 56px);
}
.legal h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -1px; margin: 0 0 6px; }
.legal .updated { color: var(--muted); margin: 0 0 26px; font-size: 14px; }
.legal h2 { font-size: 20px; margin: 30px 0 8px; }
.legal p, .legal li { color: #34424c; }
.legal ul { padding-inline-start: 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--teal); font-weight: 600; }
.footer a { color: inherit; }
@media (max-width: 1100px) { .legal-page .legal-links { position: static; opacity: 1; pointer-events: auto; transform: none; flex-direction: row; box-shadow: none; background: none; padding: 0; } }

/* share-picture capture mode (?preview=og) */
.og-shot .nav, .og-shot .beats, .og-shot .story-progress, .og-shot .scroll-hint { display: none; }
