/* Maesic Studio — shared design system (tokens, chrome, animations).
   Page-specific styles live in each page's own <style> block. */

:root {
  --night: #170A36;
  --cream: #FAF1E6;
  --pink: #FF4F8B;
  --purple: #7C4DFF;
  --lime: #C8FF2E;
  --cyan: #38E4FF;

  --line: #2B1860;      /* header/footer borders */
  --panel: #1E0D47;     /* dropdown background */
  --edge: #3A2470;      /* control borders */
  --edge-2: #6B55A8;    /* secondary borders */
  --ink-soft: #CFC3EA;  /* soft body text */
  --ink-mute: #9A8CC0;  /* muted / footer */
  --link-hover: #E4FF94;
  --hover: #2B1860;     /* menu item hover */

  --font-sans: 'Bricolage Grotesque', 'IBM Plex Sans Arabic', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--cream); font-family: var(--font-sans); }
a { color: var(--lime); transition: color .25s ease, opacity .25s ease; }
a:hover { color: var(--link-hover); }

.ms-root { display: flex; flex-direction: column; min-height: 100vh; width: 100%; overflow-x: clip; }

/* ---- RTL ---- */
[dir=rtl] * { letter-spacing: 0 !important; }
[dir=rtl] .ms-tight { line-height: 1.3 !important; }
[dir=rtl] .ms-flip { transform: scaleX(-1); }

/* ---- shared transitions / buttons ---- */
.ms-swap { transition: opacity .3s ease, filter .3s ease, transform .3s cubic-bezier(.2,.8,.2,1); }
.ms-swap.ms-fading { opacity: 0; filter: blur(6px); transform: translateY(8px); }
.ms-btn { transition: translate .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease; }
.ms-btn:hover { translate: 0 -2px; }
.ms-btn:focus-visible, .ms-langopt:focus-visible, .ms-langbtn:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* ---- entrance animations ---- */
@keyframes ms-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.ms-in { animation: ms-in .6s cubic-bezier(.2,.8,.2,1) both; }
.ms-in-2 { animation-delay: .1s; }
.ms-in-3 { animation-delay: .2s; }

/* ---- header ---- */
.ms-header { position: sticky; top: 0; z-index: 50; background: rgba(23,10,54,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.ms-header--plain { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; background: transparent; }
.ms-header-inner { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ms-logo { display: flex; align-items: flex-end; gap: 2px; text-decoration: none; color: var(--cream); }
.ms-logo-word { font-weight: 800; font-size: 28px; letter-spacing: -.04em; line-height: 1; }
.ms-logo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); margin-bottom: 3px; }
.ms-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.ms-navlinks { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.ms-navlink { color: var(--cream); text-decoration: none; padding: 12px 10px; opacity: .8; }
.ms-navlink:hover { opacity: 1; color: var(--cream); }
.ms-cta { color: var(--night); background: var(--lime); text-decoration: none; padding: 12px 20px; border-radius: 999px; font-weight: 700; }

/* ---- language menu ---- */
.ms-lang { position: relative; }
.ms-langbtn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 999px; background: transparent; color: var(--cream); cursor: pointer; font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.ms-chev { transition: transform .25s ease; }
.ms-lang[data-open] .ms-chev { transform: rotate(180deg); }
.ms-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 180px; background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.45); z-index: 70; opacity: 0; transform: translateY(-6px) scale(.97); visibility: hidden; transition: opacity .22s ease, transform .22s cubic-bezier(.2,.8,.2,1), visibility .22s; }
.ms-lang[data-open] .ms-menu { opacity: 1; transform: none; visibility: visible; }
.ms-langopt { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: var(--cream); cursor: pointer; font-family: var(--font-sans); font-size: 15px; font-weight: 600; text-align: start; transition: background-color .2s ease; }
.ms-langopt:hover { background: var(--hover); }
.ms-langopt-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.ms-langopt[aria-checked=true] .ms-langopt-dot { background: var(--lime); }

/* ---- hamburger button (mobile) + icon morph ---- */
.ms-burger { display: none; }
.ms-burger-box { position: relative; width: 20px; height: 14px; }
.ms-burger-box span { position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--cream); transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s ease; }
.ms-burger-box span:nth-child(1) { top: 0; }
.ms-burger-box span:nth-child(2) { top: 6px; }
.ms-burger-box span:nth-child(3) { top: 12px; }
.ms-header[data-menu-open] .ms-burger-box span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ms-header[data-menu-open] .ms-burger-box span:nth-child(2) { opacity: 0; }
.ms-header[data-menu-open] .ms-burger-box span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- mobile: collapse the nav into an animated dropdown panel ---- */
@media (max-width: 760px) {
  .ms-burger { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0; border: 1px solid var(--edge); border-radius: 999px; background: transparent; color: var(--cream); cursor: pointer; }
  .ms-burger:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

  .ms-nav {
    position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 4px;
    margin: 0; padding: 14px 20px 20px;
    background: var(--panel); border-top: 1px solid var(--line);
    border-bottom-left-radius: 22px; border-bottom-right-radius: 22px;
    box-shadow: 0 26px 50px rgba(0,0,0,.5);
    opacity: 0; transform: translateY(-10px); visibility: hidden; pointer-events: none;
    transition: opacity .28s ease, transform .32s cubic-bezier(.2,.8,.2,1), visibility .28s;
  }
  .ms-header[data-menu-open] .ms-nav { opacity: 1; transform: none; visibility: visible; pointer-events: auto; }

  /* staggered entrance of the panel items */
  .ms-nav > * { opacity: 0; transform: translateY(-6px); transition: opacity .25s ease, transform .3s cubic-bezier(.2,.8,.2,1); }
  .ms-header[data-menu-open] .ms-nav > * { opacity: 1; transform: none; }
  .ms-header[data-menu-open] .ms-nav > *:nth-child(1) { transition-delay: .06s; }
  .ms-header[data-menu-open] .ms-nav > *:nth-child(2) { transition-delay: .12s; }
  .ms-header[data-menu-open] .ms-nav > *:nth-child(3) { transition-delay: .18s; }

  .ms-navlinks { flex-direction: column; align-items: stretch; gap: 2px; }
  .ms-navlink { padding: 14px 12px; font-size: 18px; opacity: 1; border-radius: 12px; transition: background-color .2s ease; }
  .ms-navlink:hover { background: var(--hover); color: var(--cream); }

  /* flatten the language dropdown into inline pills inside the panel */
  .ms-lang { position: static; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--edge); }
  .ms-langbtn { display: none; }
  .ms-menu {
    position: static; inset: auto; min-width: 0; z-index: auto;
    background: transparent; border: 0; box-shadow: none; padding: 0;
    opacity: 1; transform: none; visibility: visible;
    display: flex; flex-wrap: wrap; gap: 8px;
  }
  .ms-langopt { width: auto; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--edge); border-radius: 999px; }

  .ms-cta { margin-top: 12px; text-align: center; padding: 15px 20px; }
}

/* ---- footer ---- */
.ms-footer { border-top: 1px solid var(--line); }
.ms-footer-inner { max-width: 1200px; margin: 0 auto; padding: 36px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.ms-footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; }
.ms-footer-copy { max-width: 1200px; margin: 0 auto; padding: 0 24px 28px; font-size: 13px; color: var(--ink-mute); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
