/* ==========================================================================
   EDUBOOK — V3 "The Command Center" (غرفة القيادة)
   Light, crisp, airy glassmorphism · live bento widgets · AR-first RTL
   ========================================================================== */

:root {
  /* palette */
  --paper: #F6F5FB;
  --paper-2: #EEECF7;
  --glass-bg: rgba(255, 255, 255, .65);
  --glass-border: rgba(83, 68, 139, .14);
  --brand: #53448B;
  --brand-deep: #3A2F63;
  --brand-tint: #E9E5F7;
  --green: #4BB969;
  --green-deep: #2E8C4C;
  --green-tint: #DFF3E6;
  --ink: #241F3A;
  --ink-soft: #5D5878;
  --amber: #F4B95F;
  --amber-deep: #96600F;
  --amber-tint: #FCEFDB;
  --rose: #E4708A;
  --rose-deep: #B23A57;
  --rose-tint: #FADFE6;

  /* per-role accent (overridden on [data-role]) */
  --accent: var(--brand);
  --accent-deep: var(--brand-deep);
  --accent-tint: var(--brand-tint);

  /* type */
  --font-display: "Baloo Bhaijaan 2", "Rubik", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Rubik", "Segoe UI", Tahoma, Arial, sans-serif;

  /* misc */
  --radius: 22px;
  --radius-sm: 14px;
  --shadow-soft: 0 8px 30px rgba(58, 47, 99, .08), 0 2px 8px rgba(58, 47, 99, .05);
  --shadow-lift: 0 18px 50px rgba(58, 47, 99, .14), 0 4px 14px rgba(58, 47, 99, .08);
  --header-h: 72px;
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--brand);
  line-height: 1.25;
  margin: 0 0 .5em;
  font-weight: 800;
}
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--brand-tint); color: var(--brand-deep); }

.container {
  width: min(1200px, 100% - 2.5rem);
  margin-inline: auto;
}
.container-narrow { width: min(860px, 100% - 2.5rem); }

.section { padding-block: clamp(2.75rem, 5vw, 4.5rem); position: relative; }

/* ---------- background scene ---------- */
.bg-scene {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.bg-blob {
  position: absolute;
  width: 55vmax; height: 55vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
}
.blob-violet {
  background: radial-gradient(circle, rgba(233,229,247,.9), rgba(233,229,247,0) 65%);
  inset-block-start: -18vmax; inset-inline-end: -14vmax;
  animation: blobDrift 26s ease-in-out infinite alternate;
}
.blob-green {
  background: radial-gradient(circle, rgba(223,243,230,.85), rgba(223,243,230,0) 65%);
  inset-block-end: -22vmax; inset-inline-start: -16vmax;
  animation: blobDrift 32s ease-in-out infinite alternate-reverse;
}
@keyframes blobDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, 6vmax, 0) scale(1.12); }
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(83,68,139,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83,68,139,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, black 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, black 30%, transparent 78%);
}
.bg-noise {
  position: absolute; inset: 0;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .33 0 0 0 0 .27 0 0 0 0 .55 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- glass helpers ---------- */
.glass, .glass-card, .widget {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}
.glass-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 2rem;
}
.glass-mini {
  background: rgba(255,255,255,.8);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  inset-block-start: .75rem; inset-inline-start: .75rem;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  transform: translateY(-300%);
  transition: transform .25s;
}
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 700;
  border: none;
  border-radius: 999px;
  text-align: center;
  transition: transform .25s var(--ease-spring), box-shadow .25s, background .25s;
  will-change: transform;
}
.btn-lg { padding: .95rem 2.1rem; font-size: 1.08rem; }
.btn-sm { padding: .5rem 1.3rem; font-size: .95rem; }
/* primary CTA — violet-first brand button (header + hero + closing band) */
.btn-primary {
  background: linear-gradient(135deg, #6E5BB8, var(--brand));
  color: #fff;
  box-shadow: 0 6px 18px rgba(83,68,139,.32);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #7C69C6, #5E4E9C);
  box-shadow: 0 10px 26px rgba(83,68,139,.42);
}
/* on the dark violet closing band, add an edge so the violet button stays legible */
.cta-band .btn-primary {
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 12px 30px rgba(20,12,45,.35);
}
.cta-band .btn-primary:hover { box-shadow: 0 16px 38px rgba(20,12,45,.45); }
.btn-green {
  background: var(--green);
  color: #103A1E;
  box-shadow: 0 6px 18px rgba(75,185,105,.35);
}
.btn-green:hover { background: #57C476; box-shadow: 0 10px 26px rgba(75,185,105,.45); }
.btn-violet {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(83,68,139,.3);
}
.btn-violet:hover { background: var(--brand-deep); }
.btn-ghost {
  background: rgba(255,255,255,.55);
  border: 1.5px solid var(--glass-border);
  color: var(--brand);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: var(--brand); transform: translateY(-2px); }
.text-link {
  font-weight: 600;
  color: var(--brand);
  border-block-end: 2px solid var(--brand-tint);
  padding-block-end: 2px;
  transition: border-color .2s, color .2s;
}
.text-link:hover { color: var(--brand-deep); border-color: var(--brand); }
.center-cta { text-align: center; margin-block-start: 2.5rem; }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  inset-block-start: 0; inset-inline: 0;
  z-index: 100;
  padding: .8rem clamp(.75rem, 2.5vw, 2rem) 0;
  transition: padding .3s;
}
.header-inner {
  max-width: 1240px;
  margin-inline: auto;
  height: var(--header-h);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-inline: clamp(1rem, 2.5vw, 1.75rem);
  transition: height .3s, box-shadow .3s;
}
.site-header.scrolled .header-inner { height: 60px; box-shadow: var(--shadow-lift); }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img { width: clamp(104px, 11vw, 132px); height: auto; }
.main-nav {
  display: flex;
  gap: clamp(.25rem, 1vw, .75rem);
  /* A fixed gap, not `auto` — auto absorbed all the slack and left a large
     dead space between the logo and the first link. The actions group still
     uses `auto` below, so it stays pinned to the far end. */
  margin-inline-start: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
}
.main-nav a {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: .35rem .65rem;
  border-radius: 999px;
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--brand); background: var(--brand-tint); }
.header-actions {
  display: flex; align-items: center; gap: .6rem;
  margin-inline-start: auto;
  flex-shrink: 0;
}
/* Push the actions group to the far end of the bar.
   This used to be `0`, which was fine while .main-nav carried
   `margin-inline-start: auto` and shunted nav+actions to the end together.
   Once the nav switched to a fixed margin (to tighten the logo gap) nothing
   pushed the group any more and it stranded ~225px short of the edge. */
.main-nav + .header-actions { margin-inline-start: auto; }
.lang-toggle {
  background: var(--brand-tint);
  color: var(--brand);
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  padding: .45rem 1rem;
  transition: background .2s, color .2s, transform .2s;
}
.lang-toggle:hover { background: var(--brand); color: #fff; transform: translateY(-1px); }

/* ---------- header auth actions (login / create account) ---------- */
.nav-auth { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.nav-login {
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: .45rem .95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s;
}
.nav-login:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
.nav-register {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  padding: .5rem 1.05rem;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.nav-register:hover { background: var(--brand-deep, var(--brand)); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.mobile-nav .mob-register { background: var(--brand); color: #fff; font-weight: 700; text-align: center; }
.mobile-nav .mob-register:hover { background: var(--brand); color: #fff; opacity: .92; }
.mobile-nav .mob-cta { background: var(--brand-tint); color: var(--brand); font-weight: 700; text-align: center; }
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: transparent;
  border: none;
  border-radius: 12px;
}
.nav-burger span {
  display: block; height: 2px; width: 22px;
  margin-inline: auto;
  background: var(--brand);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav[hidden] { display: none; }
.mobile-nav {
  margin: .5rem auto 0;
  max-width: 1240px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 1rem;
  display: grid;
  gap: .25rem;
}
.mobile-nav a {
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--ink);
}
.mobile-nav a:hover { background: var(--brand-tint); color: var(--brand); }

/* ---------- section heads ---------- */
.section-head { max-width: 760px; margin-inline: auto; text-align: center; margin-block-end: clamp(1.6rem, 3.5vw, 2.6rem); }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .02em;
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid rgba(83,68,139,.18);
  border-radius: 999px;
  padding: .3rem 1rem;
  margin-block-end: 1rem;
}
.section-title { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
.section-sub { color: var(--ink-soft); font-size: 1.05rem; margin-inline: auto; max-width: 640px; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  min-height: min(100svh, 800px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: calc(var(--header-h) + 3rem) 2rem;
  position: relative;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: .35rem 1.1rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--brand);
  box-shadow: var(--shadow-soft);
}
.hero-eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(75,185,105,.5);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(75,185,105,.5); }
  70% { box-shadow: 0 0 0 9px rgba(75,185,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(75,185,105,0); }
}
.hero-headline {
  font-size: clamp(1.9rem, 4.3vw, 3.3rem);
  line-height: 1.4;
  margin-block: 1.1rem .9rem;
  color: var(--brand-deep);
}
.hero-rotator {
  display: inline-grid;
  grid-auto-flow: column;
  vertical-align: bottom;
  color: var(--brand);
  position: relative;
  perspective: 900px;
  /* room below the baseline so descenders + underline aren't clipped by the 3D layer */
  padding-block-end: .22em;
  margin-block-end: -.14em;
}
.hero-rotator > span.rot-item {
  grid-area: 1 / 1;
  white-space: nowrap;
  will-change: transform, opacity, filter;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  /* the promoted layer rasterizes to this box — pad it so Arabic descenders paint fully */
  padding-block-end: .22em;
  background: linear-gradient(96deg, var(--brand) 0%, #6E5BB8 55%, var(--brand-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-rotator .underline-swash {
  position: absolute;
  inset-inline: 0; inset-block-end: .04em;
  height: .12em;
  background: linear-gradient(90deg, rgba(110,91,184,.15), rgba(110,91,184,.5), rgba(75,185,105,.4));
  border-radius: 999px;
  z-index: -1;
  transform: scaleX(0);
}
.hero-sub { color: var(--ink-soft); font-size: clamp(1rem, 1.4vw, 1.13rem); max-width: 56ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .9rem; margin-block-start: 1.75rem; }
.hero-hint { margin-block-start: 1.4rem; font-size: .85rem; color: var(--ink-soft); opacity: .8; }

/* phone mockup */
.hero-phone-wrap { position: relative; display: flex; justify-content: center; }
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  z-index: 0;
}
.orb-a {
  width: 260px; height: 260px;
  background: rgba(83,68,139,.18);
  inset-block-start: -8%; inset-inline-start: 2%;
  animation: blobDrift 18s ease-in-out infinite alternate;
}
.orb-b {
  width: 200px; height: 200px;
  background: rgba(75,185,105,.2);
  inset-block-end: -4%; inset-inline-end: 4%;
  animation: blobDrift 22s ease-in-out infinite alternate-reverse;
}
.hero-app {
  position: relative;
  z-index: 2;
  display: block;
  width: min(560px, 92%);
  height: auto;
  filter: drop-shadow(0 34px 60px rgba(58,47,99,.28));
  transform: translateZ(0);
}
.hero-app-glow {
  position: absolute;
  z-index: 1;
  inset: 6% 8%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(83,68,139,.20), rgba(75,185,105,.10) 60%, transparent 80%);
  filter: blur(46px);
  animation: blobDrift 20s ease-in-out infinite alternate;
}
.phone {
  position: relative;
  z-index: 1;
  width: min(300px, 74vw);
  transform: rotate(calc(var(--tilt, -4deg)));
}
.phone-frame {
  background: linear-gradient(160deg, #4A3D7C, var(--brand-deep));
  border-radius: 44px;
  padding: 12px;
  box-shadow:
    0 32px 70px rgba(58,47,99,.32),
    inset 0 1px 2px rgba(255,255,255,.35);
}
.phone-notch {
  position: absolute;
  inset-block-start: 22px;
  left: 50%; /* physical centering, direction-independent */
  transform: translateX(-50%);
  width: 96px; height: 22px;
  background: var(--brand-deep);
  border-radius: 999px;
  z-index: 3;
}
.phone-screen {
  position: relative;
  background: linear-gradient(180deg, #FBFAFF, var(--paper-2));
  border-radius: 34px;
  overflow: hidden;
  aspect-ratio: 9 / 18.6;
  padding: 52px 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.phone-status {
  position: absolute;
  inset-block-start: 0; inset-inline: 0;
  height: 46px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 18px 4px;
  font-size: .62rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.ps-brand { color: var(--brand); font-family: var(--font-display); font-weight: 700; font-size: .72rem; }
.phone-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: .66rem;
  font-weight: 500;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(58,47,99,.12);
  transform: translateY(-64px);
  opacity: 0;
}
.phone-toast .pt-ico {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--brand-tint);
  color: var(--brand);
}
.phone-toast .pt-ico svg { width: 13px; height: 13px; }
.phone-toast strong { display: block; font-size: .68rem; line-height: 1.3; }
.phone-toast span { color: var(--ink-soft); font-size: .6rem; }
.phone-card {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 3px 10px rgba(58,47,99,.07);
}
.p-feed .pf-top { display: flex; align-items: center; gap: 7px; margin-block-end: 7px; }
.p-feed .pf-ava {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--green));
  flex-shrink: 0;
}
.p-feed .pf-name { font-size: .64rem; font-weight: 600; line-height: 1.25; }
.p-feed .pf-name span { display: block; font-weight: 400; color: var(--ink-soft); font-size: .56rem; }
.p-feed .pf-line { height: 6px; border-radius: 3px; background: var(--paper-2); margin-block: 5px; }
.p-feed .pf-line.short { width: 62%; }
.p-feed .pf-actions {
  display: flex; gap: 12px;
  margin-block-start: 8px;
  font-size: .6rem; color: var(--ink-soft);
  align-items: center;
}
.p-feed .pf-actions svg { width: 11px; height: 11px; }
.p-feed .pf-actions .liked { color: var(--rose-deep); }
.p-feed .pf-actions span { display: inline-flex; align-items: center; gap: 3px; }
.p-chart { display: flex; flex-direction: column; gap: 6px; }
.p-chart .pc-title { font-size: .62rem; font-weight: 600; color: var(--brand); }
.p-chart .pc-bars { display: flex; align-items: flex-end; gap: 6px; height: 44px; }
.p-chart .pc-bars i {
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--brand), #7A6BB5);
  transform-origin: bottom;
  animation: barBreath 2.6s ease-in-out infinite;
}
.p-chart .pc-bars i:nth-child(2n) { background: linear-gradient(180deg, var(--green), #7BCF95); }
.p-chart .pc-bars i:nth-child(1) { height: 60%; animation-delay: 0s; }
.p-chart .pc-bars i:nth-child(2) { height: 85%; animation-delay: .3s; }
.p-chart .pc-bars i:nth-child(3) { height: 45%; animation-delay: .6s; }
.p-chart .pc-bars i:nth-child(4) { height: 95%; animation-delay: .9s; }
.p-chart .pc-bars i:nth-child(5) { height: 70%; animation-delay: 1.2s; }
@keyframes barBreath {
  0%, 100% { transform: scaleY(.92); }
  50% { transform: scaleY(1); }
}
.p-chat { display: flex; flex-direction: column; gap: 6px; }
.p-chat .pm {
  max-width: 78%;
  padding: 5px 9px;
  border-radius: 11px;
  font-size: .6rem;
  line-height: 1.45;
}
.p-chat .pm.in {
  align-self: flex-start;
  background: var(--paper-2);
  border-start-start-radius: 4px;
}
.p-chat .pm.out {
  align-self: flex-end;
  background: var(--brand-tint);
  color: var(--brand-deep);
  border-start-end-radius: 4px;
}
.p-chat .pm.dots { display: inline-flex; gap: 3px; align-items: center; padding-block: 8px; }
.p-chat .pm.dots i {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-soft);
  animation: typingDot 1.2s infinite;
}
.p-chat .pm.dots i:nth-child(2) { animation-delay: .18s; }
.p-chat .pm.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-3px); opacity: 1; }
}
.phone-dock {
  margin-block-start: auto;
  display: flex;
  justify-content: space-around;
  padding: 8px 6px 2px;
}
.phone-dock span {
  width: 30px; height: 30px;
  border-radius: 10px;
  background: rgba(83,68,139,.1);
}
.phone-dock span:first-child { background: var(--brand); }
.hero-scrolldown {
  position: absolute;
  inset-block-end: 1.4rem; inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--glass-border);
  border-radius: 999px;
  display: flex; justify-content: center;
}
.hero-scrolldown span {
  width: 4px; height: 9px;
  margin-block-start: 7px;
  border-radius: 4px;
  background: var(--brand);
  animation: scrollNudge 1.8s infinite;
}
@keyframes scrollNudge {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* morph clones */
.morph-clone {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  will-change: transform, opacity;
}

/* ==========================================================================
   ROLE SWITCHER + BENTO
   ========================================================================== */
.role-switcher-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin-block-end: 1.5rem;
}
.role-switcher {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow-lift);
  gap: 2px;
}
.switch-thumb {
  position: absolute;
  inset-block: 6px;
  left: 0; /* physical: JS translates by offsetLeft in both directions */
  width: 0;
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(83,68,139,.4);
  will-change: transform, width;
}
.role-btn {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: .6rem clamp(.85rem, 2.2vw, 1.5rem);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(.85rem, 1.5vw, 1rem);
  color: var(--ink-soft);
  transition: color .3s;
  white-space: nowrap;
  min-height: 44px;
}
.role-btn[aria-selected="true"] { color: #fff; }
.role-btn:not([aria-selected="true"]):hover { color: var(--brand); }
.switch-hint { font-size: .82rem; color: var(--ink-soft); margin: 0; opacity: .85; }

/* bento grid */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "feed  feed  chat  chart"
    "feed  feed  chat  chart"
    "sched sched sched storage"
    "cert  cert  secur storage";
  grid-auto-rows: minmax(158px, auto);
  gap: 1.1rem;
}
.w-feed { grid-area: feed; }
.w-chat { grid-area: chat; }
.w-chart { grid-area: chart; }
.w-sched { grid-area: sched; }
.w-storage { grid-area: storage; }
.w-cert { grid-area: cert; }
.w-secur { grid-area: secur; }

.widget {
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: box-shadow .3s;
  will-change: transform;
}
.widget:hover { box-shadow: var(--shadow-lift); }
.widget-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .65rem;
  margin: -.35rem -.4rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  transition: background .4s;
}
.w-ico {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.75);
  color: var(--accent-deep);
  transition: color .4s;
}
.w-ico svg { width: 17px; height: 17px; }
.w-label {
  font-size: .92rem;
  font-weight: 700;
  color: var(--accent-deep);
  margin: 0;
  line-height: 1.3;
  transition: color .4s;
}
.w-live {
  margin-inline-start: auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: livePulse 2s infinite;
  flex-shrink: 0;
}
.w-badge {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .68rem;
  font-weight: 600;
  color: var(--green-deep);
  background: var(--green-tint);
  padding: .18rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.w-badge svg { width: 11px; height: 11px; }
.widget-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.w-cap {
  margin: .8rem 0 0;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* role accent themes */
.bento[data-role="admin"]   { --accent: var(--brand); --accent-deep: var(--brand-deep); --accent-tint: var(--brand-tint); }
/* teacher theme softened: muted deep-green accent + paler tint so the role doesn't flood the bento in vivid green */
.bento[data-role="teacher"] { --accent: var(--green-deep); --accent-deep: var(--green-deep); --accent-tint: #EAF6EE; }
.bento[data-role="student"] { --accent: var(--amber); --accent-deep: var(--amber-deep); --accent-tint: var(--amber-tint); }
.bento[data-role="parent"]  { --accent: var(--rose); --accent-deep: var(--rose-deep); --accent-tint: var(--rose-tint); }

/* --- feed widget --- */
.feed-list { display: flex; flex-direction: column; gap: .55rem; }
.feed-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(83,68,139,.09);
  border-radius: var(--radius-sm);
  padding: .55rem .75rem;
}
.fi-ico {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-tint);
  color: var(--accent-deep);
}
.fi-ico svg { width: 17px; height: 17px; }
.fi-txt { min-width: 0; flex: 1; }
.fi-txt strong {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fi-txt span { font-size: .72rem; color: var(--ink-soft); }
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: transparent;
  border: 1px solid rgba(83,68,139,.12);
  border-radius: 999px;
  padding: .34rem .7rem;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color .2s, border-color .2s, background .2s;
  min-height: 34px;
}
.like-btn svg { width: 14px; height: 14px; transition: transform .2s; }
.like-btn:hover { border-color: var(--rose); color: var(--rose-deep); }
.like-btn[aria-pressed="true"] {
  color: var(--rose-deep);
  background: var(--rose-tint);
  border-color: transparent;
}
.like-btn[aria-pressed="true"] svg { fill: currentColor; }
.like-btn.pop svg { animation: likePop .45s var(--ease-spring); }
@keyframes likePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.55) rotate(-8deg); }
  100% { transform: scale(1); }
}

/* --- chat widget --- */
.chat-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .5rem;
  overflow: hidden;
}
.chat-msg {
  max-width: 88%;
  padding: .5rem .85rem;
  border-radius: 15px;
  font-size: .82rem;
  line-height: 1.55;
}
.chat-msg .cm-who {
  display: block;
  font-size: .66rem;
  font-weight: 700;
  color: var(--accent-deep);
  margin-block-end: .1rem;
}
.chat-msg.in {
  align-self: flex-start;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(83,68,139,.1);
  border-start-start-radius: 5px;
}
.chat-msg.out {
  align-self: flex-end;
  background: var(--accent-tint);
  color: var(--ink);
  border-start-end-radius: 5px;
}
.chat-msg.typing { display: inline-flex; gap: 4px; padding-block: .75rem; }
.chat-msg.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-soft);
  animation: typingDot 1.2s infinite;
}
.chat-msg.typing i:nth-child(2) { animation-delay: .18s; }
.chat-msg.typing i:nth-child(3) { animation-delay: .36s; }
.chat-input {
  margin-block-start: .65rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(83,68,139,.12);
  border-radius: 999px;
  padding: .4rem .5rem .4rem 1rem;
}
[dir="rtl"] .chat-input { padding: .4rem 1rem .4rem .5rem; }
.chat-input span { flex: 1; font-size: .78rem; color: var(--ink-soft); opacity: .7; }
.chat-input i {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.chat-input i svg { width: 14px; height: 14px; }
[dir="rtl"] .chat-input i svg { transform: scaleX(-1); }

/* --- chart widget --- */
.chart-top { display: flex; align-items: baseline; gap: .5rem; margin-block-end: .4rem; }
.chart-big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--accent-deep);
  line-height: 1;
  transition: color .4s;
}
.chart-unit { font-size: .78rem; color: var(--ink-soft); font-weight: 500; }
.chart-svg-wrap { flex: 1; min-height: 0; display: flex; }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-svg .bar {
  fill: url(#barGrad);
  rx: 5;
  transform-box: fill-box;
  transform-origin: bottom;
}
.chart-svg .bar-label {
  font-family: var(--font-body);
  font-size: 8.5px;
  fill: var(--ink-soft);
  text-anchor: middle;
}
.chart-svg .bar-val {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  fill: var(--accent-deep);
  text-anchor: middle;
}
.chart-svg .trend {
  fill: none;
  stroke: var(--green-deep);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-svg .grid-line { stroke: rgba(83,68,139,.09); stroke-width: 1; stroke-dasharray: 3 4; }

/* --- schedule widget --- */
.sched-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .45rem;
}
.sched-day {
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent-deep);
  text-align: center;
  padding-block: .15rem;
  transition: color .4s;
}
.sched-cell {
  border-radius: 9px;
  padding: .32rem .3rem;
  font-size: .68rem;
  font-weight: 600;
  text-align: center;
  background: var(--cell-bg, var(--paper-2));
  color: var(--cell-fg, var(--ink-soft));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform-origin: center;
  min-height: 27px;
}
.sched-cell.free { background: transparent; border: 1px dashed rgba(83,68,139,.16); }

/* --- storage widget --- */
.storage-body { align-items: center; justify-content: center; gap: .6rem; }
.storage-ring-wrap { position: relative; width: min(132px, 100%); margin-inline: auto; }
.storage-ring { width: 100%; height: auto; transform: rotate(-90deg); }
.storage-ring .track { fill: none; stroke: rgba(83,68,139,.1); stroke-width: 9; }
.storage-ring .fill {
  fill: none;
  stroke: url(#storGrad);
  stroke-width: 9;
  stroke-linecap: round;
}
.storage-center {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.55rem;
  color: var(--brand);
}
.storage-center .inf {
  font-size: 2.5rem;
  color: var(--green-deep);
  line-height: 1;
}
.storage-files { display: flex; justify-content: center; gap: .35rem; margin-block-start: .5rem; }
.storage-files i {
  width: 22px; height: 26px;
  border-radius: 5px 9px 5px 5px;
  background: var(--accent-tint);
  border: 1px solid rgba(83,68,139,.12);
  animation: fileBob 2.4s ease-in-out infinite;
}
.storage-files i:nth-child(2) { animation-delay: .3s; }
.storage-files i:nth-child(3) { animation-delay: .6s; }
.storage-files i:nth-child(4) { animation-delay: .9s; }
@keyframes fileBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* --- certificate widget --- */
.cert-stage { flex: 1; perspective: 900px; display: flex; }
.cert-flip {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  position: relative;
  min-height: 118px;
  border-radius: var(--radius-sm);
}
.cert-3d {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform .7s var(--ease-spring);
}
.cert-flip[aria-pressed="true"] .cert-3d { transform: rotateY(180deg); }
.cert-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cert-front {
  background:
    linear-gradient(135deg, rgba(233,229,247,.5), rgba(255,255,255,.9)),
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(83,68,139,.03) 9px 10px);
  border: 1.5px solid var(--brand-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: .9rem 1.1rem;
}
.cert-front::before {
  content: "";
  position: absolute; inset: 5px;
  border: 1px dashed rgba(83,68,139,.25);
  border-radius: 10px;
  pointer-events: none;
}
.cert-seal {
  width: 46px; height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #61CE80, var(--green-deep));
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(46,140,76,.4);
}
.cert-seal svg { width: 22px; height: 22px; }
.cert-txt { text-align: start; min-width: 0; }
.cert-txt .ct-kicker {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--brand);
  text-transform: uppercase;
}
.cert-txt .ct-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--brand-deep);
  line-height: 1.3;
}
.cert-txt .ct-sub { font-size: .72rem; color: var(--ink-soft); }
.cert-hint {
  position: absolute;
  inset-block-end: .45rem; inset-inline-end: .7rem;
  font-size: .62rem;
  font-weight: 600;
  color: var(--brand);
  background: rgba(255,255,255,.85);
  padding: .1rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--brand-tint);
}
.cert-back {
  background: linear-gradient(150deg, var(--brand), var(--brand-deep));
  color: #fff;
  transform: rotateY(180deg);
  padding: .8rem 1.1rem;
  display: flex;
  flex-direction: column;
}
.cert-back .cb-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-block-end: .45rem;
}
.cert-back .cb-title svg { width: 15px; height: 15px; color: var(--amber); }
.cert-back ol {
  margin: 0; padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .78rem;
}
.cert-back li {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.cert-back li .rank {
  width: 20px; height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  font-size: .66rem;
  font-weight: 700;
}
.cert-back li:first-child .rank { background: var(--amber); color: #4A3405; }
.cert-back li .stars { margin-inline-start: auto; color: var(--amber); font-size: .66rem; letter-spacing: .1em; }

/* --- security widget --- */
.secur-body { align-items: center; justify-content: center; gap: .5rem; }
.secur-scene { position: relative; width: 108px; height: 108px; margin-inline: auto; }
.secur-ring {
  position: absolute; inset: 0;
  border: 1.5px dashed rgba(83,68,139,.3);
  border-radius: 50%;
  animation: securSpin 14s linear infinite;
}
.secur-ring::before, .secur-ring::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  inset-block-start: -5px; inset-inline-start: 50%;
  box-shadow: 0 0 8px rgba(75,185,105,.8);
}
.secur-ring::after {
  background: var(--accent);
  inset-block-start: auto; inset-block-end: -5px;
  box-shadow: 0 0 8px rgba(83,68,139,.6);
}
@keyframes securSpin { to { transform: rotate(360deg); } }
.secur-shield {
  position: absolute; inset: 22px;
  display: grid; place-items: center;
  background: var(--accent-tint);
  border-radius: 50%;
  color: var(--accent-deep);
  transition: background .4s, color .4s;
}
.secur-shield svg { width: 30px; height: 30px; }
.secur-stream {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-block-start: .3rem;
}
.secur-stream i {
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--brand-tint);
  animation: bitBlink 1.6s infinite;
}
.secur-stream i:nth-child(odd) { background: var(--green-tint); }
.secur-stream i:nth-child(1) { animation-delay: 0s; }
.secur-stream i:nth-child(2) { animation-delay: .15s; }
.secur-stream i:nth-child(3) { animation-delay: .3s; }
.secur-stream i:nth-child(4) { animation-delay: .45s; }
.secur-stream i:nth-child(5) { animation-delay: .6s; }
.secur-stream i:nth-child(6) { animation-delay: .75s; }
.secur-stream i:nth-child(7) { animation-delay: .9s; }
.secur-stream i:nth-child(8) { animation-delay: 1.05s; }
@keyframes bitBlink {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); background: var(--green); }
}
.secur-caption {
  font-size: .72rem;
  text-align: center;
  color: var(--ink-soft);
  margin: .4rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about-body { max-width: 720px; }
.about-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 900px;
  margin-inline: auto;
}
.about-card { position: relative; padding-block-start: 2.4rem; }
.about-card h3 { font-size: 1.3rem; }
.about-card p { color: var(--ink-soft); margin: 0; }
.ac-ico {
  position: absolute;
  inset-block-start: -22px; inset-inline-start: 1.8rem;
  width: 48px; height: 48px;
  border-radius: 15px;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.ac-ico svg { width: 22px; height: 22px; }
#missionCard .ac-ico { background: linear-gradient(140deg, var(--brand), var(--brand-deep)); }
#visionCard .ac-ico { background: linear-gradient(140deg, var(--green), var(--green-deep)); }

/* ==========================================================================
   FEATURES RAIL
   ========================================================================== */
.feature-rail {
  display: flex;
  gap: .9rem;
  align-items: stretch;
}
.feature-chip {
  flex: 1 1 0;
  min-width: 0;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.3rem;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: flex-grow .55s var(--ease-spring), box-shadow .3s, border-color .3s, background .3s;
  overflow: hidden;
}
.feature-chip:hover, .feature-chip:focus-visible, .feature-chip.expanded {
  flex-grow: 2.4;
  box-shadow: var(--shadow-lift);
  border-color: rgba(83,68,139,.28);
  background: rgba(255,255,255,.82);
}
.fc-ico {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--brand-tint);
  color: var(--brand);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .3s, color .3s, transform .4s var(--ease-spring);
}
.fc-ico svg { width: 21px; height: 21px; }
.feature-chip:hover .fc-ico, .feature-chip.expanded .fc-ico {
  background: var(--brand);
  color: #fff;
  transform: rotate(-6deg) scale(1.08);
}
.fc-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--brand-deep);
  line-height: 1.4;
  margin: 0;
}
.fc-body-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .5s var(--ease-spring);
}
.feature-chip:hover .fc-body-wrap,
.feature-chip:focus-visible .fc-body-wrap,
.feature-chip.expanded .fc-body-wrap { grid-template-rows: 1fr; }
.fc-body {
  overflow: hidden;
  font-size: .86rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0;
  opacity: 0;
  transition: opacity .4s .1s;
}
.feature-chip:hover .fc-body,
.feature-chip:focus-visible .fc-body,
.feature-chip.expanded .fc-body { opacity: 1; }
.fc-num {
  margin-block-start: auto;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .82rem;
  color: var(--brand);
}

/* ==========================================================================
   WHY
   ========================================================================== */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.why-card {
  position: relative;
  border-radius: var(--radius);
  padding: 2rem 1.8rem 1.8rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform .35s var(--ease-spring), box-shadow .3s;
}
.why-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.why-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 4.6rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--brand-tint);
  position: absolute;
  inset-block-start: .6rem; inset-inline-end: 1rem;
  transition: -webkit-text-stroke-color .3s;
  pointer-events: none;
}
.why-card:hover .why-num { -webkit-text-stroke-color: var(--brand); }
.why-card h3 {
  font-size: 1.22rem;
  max-width: 78%;
  min-height: 3.2em;
  display: flex;
  align-items: flex-end;
}
.why-card ul { display: flex; flex-direction: column; gap: .8rem; margin-block-start: 1rem; }
.why-card li {
  position: relative;
  padding-inline-start: 1.6rem;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.why-card li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; inset-block-start: .5em;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--green-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E8C4C' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat;
}

/* ==========================================================================
   STATS
   ========================================================================== */
.stats { padding-block: clamp(1.5rem, 3vw, 2.5rem); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}
.stat-tile {
  text-align: center;
  border-radius: var(--radius);
  padding: 1.9rem 1rem 1.6rem;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  transition: transform .35s var(--ease-spring);
}
.stat-tile:hover { transform: translateY(-5px); }
.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--brand);
  line-height: 1.1;
  direction: ltr;
  unicode-bidi: isolate;
}
.stat-value .plus { color: var(--green-deep); }
.stat-label { color: var(--ink-soft); font-weight: 500; margin: .3rem 0 0; }

/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */
.tes-featured {
  position: relative;
  max-width: 880px;
  margin-inline: auto;
  padding: clamp(1.8rem, 4vw, 3rem);
  margin-block-end: 2.5rem;
  border-inline-start: 5px solid var(--brand);
}
.tes-featured::before {
  content: "”";
  position: absolute;
  inset-block-start: -6px; inset-inline-end: 1.6rem;
  font-family: var(--font-display);
  font-size: 7rem;
  line-height: 1;
  color: var(--brand-tint);
  pointer-events: none;
}
[dir="ltr"] .tes-featured::before { content: "“"; }
.tes-stars { display: inline-flex; gap: .2rem; color: var(--amber); margin-block-end: .9rem; }
.tes-stars svg { width: 19px; height: 19px; fill: currentColor; }
.tes-quote {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.9;
  color: var(--ink);
  margin-block-end: 1.4rem;
}
.tes-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; }
.tes-ava {
  width: 48px; height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--green));
}
.tes-who strong { display: block; color: var(--brand-deep); font-weight: 600; font-size: .95rem; }
.tes-who span { font-size: .82rem; color: var(--ink-soft); }
.loc-chip {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--green-tint);
  color: var(--green-deep);
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: 999px;
}
.loc-chip svg { width: 13px; height: 13px; }
.tes-viewport { overflow: hidden; }
.tes-track {
  display: flex;
  gap: 1.1rem;
  will-change: transform;
}
.tes-card {
  flex: 0 0 min(360px, 86vw);
  border-radius: var(--radius);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.tes-card .tes-quote {
  font-size: .88rem;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.tes-card .tes-stars svg { width: 15px; height: 15px; }
.tes-card .tes-ava { width: 40px; height: 40px; font-size: .95rem; }
.tes-card .loc-chip { font-size: .72rem; }
.tes-dots {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-block-start: 1.5rem;
}
.tes-dot {
  width: 10px; height: 10px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: var(--brand-tint);
  transition: width .3s var(--ease-spring), background .3s;
}
.tes-dot[aria-current="true"] { width: 30px; background: var(--brand); }
.tes-dot:hover { background: var(--brand-deep); }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list { display: flex; flex-direction: column; gap: .9rem; }
.faq-item {
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: border-color .3s;
}
.faq-item.open { border-color: rgba(83,68,139,.3); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: transparent;
  border: none;
  text-align: start;
  padding: 1.15rem 1.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--brand-deep);
  min-height: 44px;
}
.faq-q .faq-chev {
  margin-inline-start: auto;
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-tint);
  display: grid; place-items: center;
  color: var(--brand);
  transition: transform .4s var(--ease-spring), background .3s, color .3s;
}
.faq-q .faq-chev svg { width: 14px; height: 14px; }
.faq-q[aria-expanded="true"] .faq-chev {
  transform: rotate(180deg);
  background: var(--brand);
  color: #fff;
}
.faq-a-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease-spring);
}
.faq-q[aria-expanded="true"] + .faq-a-wrap { grid-template-rows: 1fr; }
.faq-a { overflow: hidden; }
.faq-a p {
  margin: 0;
  padding: 0 1.4rem 1.3rem;
  color: var(--ink-soft);
  line-height: 1.85;
}

/* ==========================================================================
   BLOG
   ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 980px;
  margin-inline: auto;
}
.blog-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform .35s var(--ease-spring), box-shadow .3s;
  color: var(--ink);
}
.blog-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.blog-visual {
  height: 128px;
  position: relative;
  background: linear-gradient(140deg, var(--brand-tint), rgba(223,243,230,.8));
  overflow: hidden;
}
.blog-visual::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(83,68,139,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83,68,139,.12) 1px, transparent 1px);
  background-size: 26px 26px;
  transform: rotate(-6deg) scale(1.3);
}
.blog-visual span {
  position: absolute;
  inset-block-end: 12px; inset-inline-start: 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--brand);
  background: rgba(255,255,255,.85);
  padding: .1rem .8rem;
  border-radius: 10px;
}
.blog-content { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.blog-content h3 { font-size: 1.08rem; line-height: 1.55; }
.blog-content p { color: var(--ink-soft); font-size: .9rem; flex: 1; }
.blog-read {
  font-weight: 600;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.blog-read svg { width: 15px; height: 15px; transition: transform .25s; }
[dir="rtl"] .blog-read svg { transform: scaleX(-1); }
.blog-card:hover .blog-read svg { transform: translateX(4px); }
[dir="rtl"] .blog-card:hover .blog-read svg { transform: scaleX(-1) translateX(4px); }

/* ==========================================================================
   CTA BAND
   ========================================================================== */
.cta-band {
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-deep) 100%);
  border-radius: var(--radius);
  width: min(1200px, 100% - 2.5rem);
  margin-inline: auto;
  overflow: hidden;
  position: relative;
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}
.cta-silhouettes {
  position: absolute; inset: -60%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke='rgba(255,255,255,.09)' stroke-width='2'%3E%3Crect x='16' y='18' width='92' height='60' rx='12'/%3E%3Cline x1='30' y1='38' x2='94' y2='38'/%3E%3Cline x1='30' y1='54' x2='74' y2='54'/%3E%3Crect x='128' y='18' width='92' height='60' rx='12'/%3E%3Cpath d='M142 66 v-20 M160 66 v-32 M178 66 v-12 M196 66 v-26'/%3E%3Crect x='16' y='100' width='92' height='60' rx='12'/%3E%3Ccircle cx='45' cy='130' r='14'/%3E%3Cline x1='68' y1='124' x2='96' y2='124'/%3E%3Cline x1='68' y1='138' x2='88' y2='138'/%3E%3Crect x='128' y='100' width='92' height='60' rx='12'/%3E%3Cpath d='M174 112 l14 8 v14 c0 12 -14 18 -14 18 s-14 -6 -14 -18 v-14 z'/%3E%3Crect x='16' y='182' width='92' height='40' rx='20'/%3E%3Crect x='128' y='182' width='92' height='40' rx='12'/%3E%3Cline x1='142' y1='196' x2='206' y2='196'/%3E%3Cline x1='142' y1='208' x2='186' y2='208'/%3E%3C/svg%3E");
  background-size: 240px;
  transform: rotate(-8deg);
  animation: silDrift 60s linear infinite;
}
@keyframes silDrift {
  from { transform: rotate(-8deg) translate3d(0,0,0); }
  to   { transform: rotate(-8deg) translate3d(240px, 240px, 0); }
}
.cta-inner { position: relative; text-align: center; max-width: 720px; }
.cta-title { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.cta-body { color: rgba(255,255,255,.82); font-size: 1.08rem; margin-block-end: 2rem; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: clamp(1.8rem, 4vw, 2.8rem);
}
.contact-copy { max-width: 560px; }
.contact-copy .section-title { margin-block-end: .4rem; }
.contact-copy .section-sub { margin: 0; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--paper-2);
  border-block-start: 1px solid var(--glass-border);
  padding-block: 3.5rem 1.5rem;
  margin-block-start: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
  padding-block-end: 2.5rem;
}
.footer-logo { width: 132px; height: auto; margin-block-end: 1rem; }
.footer-about p { color: var(--ink-soft); font-size: .92rem; max-width: 40ch; }
.footer-links { display: flex; flex-direction: column; gap: .55rem; }
.footer-links a {
  color: var(--ink-soft);
  font-size: .95rem;
  width: fit-content;
  transition: color .2s, transform .2s;
}
.footer-links a:hover { color: var(--brand); transform: translateX(calc(4px * var(--dirx, 1))); }
[dir="rtl"] .footer-links a { --dirx: -1; }
.footer-app-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--brand-deep);
  margin-block-end: 1rem;
}
.store-badges { display: flex; flex-direction: column; gap: .7rem; align-items: flex-start; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  background: var(--brand-deep);
  color: #fff;
  border-radius: 14px;
  padding: .55rem 1.1rem;
  min-width: 170px;
  transition: transform .25s var(--ease-spring), background .25s;
}
.store-badge:hover { transform: translateY(-3px); background: var(--brand); }
.store-badge svg { width: 24px; height: 24px; flex-shrink: 0; }
.store-badge .sb-txt { line-height: 1.25; }
.store-badge .sb-small { display: block; font-size: .62rem; opacity: .8; }
.store-badge .sb-big { display: block; font-weight: 600; font-size: .95rem; font-family: var(--font-display); }
.footer-bottom {
  border-block-start: 1px solid var(--glass-border);
  padding-block-start: 1.4rem;
  text-align: center;
}
.footer-bottom p { margin: 0; font-size: .85rem; color: var(--ink-soft); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "feed  feed"
      "feed  feed"
      "chart chat"
      "chart chat"
      "sched sched"
      "storage cert"
      "secur   cert";
  }
  .why-grid { grid-template-columns: 1fr; max-width: 620px; margin-inline: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-rail { flex-direction: column; }
  .feature-chip:hover, .feature-chip:focus-visible, .feature-chip.expanded { flex-grow: 1; }
  .fc-body-wrap { transition-duration: .4s; }
}

/* Below 1100px the bar becomes three cells: burger at the start, logo dead
   centre, language + login + register at the end. `display: contents` lifts
   the children of .header-actions into the same grid so all three can be
   placed independently — previously everything bunched against one edge and
   left a large empty gap on the other. */
@media (max-width: 1100px) {
  .main-nav { display: none; }
  .nav-burger { display: flex; }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .5rem;
  }
  .header-actions { display: contents; }
  /* grid-row: 1 is REQUIRED on all three.
     Grid's sparse auto-placement never moves the cursor backwards, so with a
     column but no row the burger (column 1) could not return to row 1 after
     the logo (2) and actions (3) were placed - it was pushed to a second row
     and rendered below the header pill. */
  .nav-burger { grid-column: 1; grid-row: 1; justify-self: start; }
  .logo       { grid-column: 2; grid-row: 1; justify-self: center; margin: 0; }
  .nav-auth   { grid-column: 3; grid-row: 1; justify-self: end; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero-sub { margin-inline: auto; }
  .hero-ctas { justify-content: center; }
  .hero-phone-wrap { margin-block-start: 1.5rem; }
  .phone { width: min(260px, 70vw); }
  .hero-app { width: min(360px, 88vw); }
}

@media (max-width: 768px) {
  :root { --header-h: 62px; }
  /* sticky switcher below header on mobile (per spec) */
  .role-switcher-wrap {
    position: sticky;
    inset-block-start: calc(var(--header-h) + 8px);
    z-index: 50;
  }
  .role-switcher { width: 100%; justify-content: space-between; overflow-x: auto; }
  .switch-hint { display: none; } /* the cert widget carries the same tap hint */
  .role-btn { padding-inline: .7rem; flex: 1; }
  .hero { min-height: auto; padding-block-end: 4.5rem; }
  .hero-scrolldown { display: none; }
  .contact-card { justify-content: center; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-about p { max-width: none; }
}

@media (max-width: 640px) {
  .bento {
    grid-template-columns: 1fr;
    grid-template-areas:
      "feed" "chat" "chart" "sched" "storage" "cert" "secur";
    grid-auto-rows: auto;
  }
  .widget { min-height: 200px; }
  .w-sched .sched-grid { gap: .3rem; }
  .sched-cell { font-size: .58rem; padding-inline: .12rem; }
  .about-cards { grid-template-columns: 1fr; gap: 2.2rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .stats-grid { gap: .8rem; }
  .stat-tile { padding: 1.3rem .6rem 1.1rem; }
  .btn-lg { padding: .85rem 1.6rem; font-size: 1rem; }
  .tes-featured { border-inline-start-width: 4px; }
  .loc-chip { margin-inline-start: 0; }
}

@media (max-width: 780px) {
  /* Login collapses into the drawer; register stays as the visible action. */
  .nav-login { display: none; }
}

@media (max-width: 560px) {
  /* Phone header is burger + centred logo. Language, login and register all
     live in the drawer, which has room to present them properly instead of
     crushing them into a 44px-tall pill. The empty third grid cell is what
     keeps the logo optically centred. */
  .nav-auth { display: none; }
  .logo img { width: 96px; }
  .header-inner { gap: .5rem; padding-inline: 1rem; }
  .mobile-nav { max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto; }
}

@media (max-width: 400px) {
  .container { width: min(1200px, 100% - 1.6rem); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .role-btn { font-size: .78rem; padding-inline: .45rem; }
  .header-inner { gap: .5rem; }
  .btn-sm { padding: .45rem .85rem; font-size: .85rem; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .15s !important;
  }
  .cta-silhouettes, .bg-blob, .hero-orb { animation: none !important; }
  .hero-scrolldown { display: none; }
}
