@import url("mz-menu.css"); /* canonical top-menu (.mz-topbar/.mz-auth) */
@import url("cosmic-rail.css?v=r2"); /* canonical vertical rail (single source — styles .cosmic-rail* here) */
/* cosmic-shell.css — styles for the reusable vanilla cosmic shell
   (js/cosmic-shell.js): background, left rail, and tweaks panel. Mirrors the
   React landing shell so non-React pages match the Music Planet look. */

/* ── Background ─────────────────────────────────────────────────────────── */
.cosmic-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.cosmic-bg-base {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 95% at 50% 12%, var(--bg3), transparent 56%),
    radial-gradient(110% 80% at 50% 118%, var(--bg2), transparent 62%),
    var(--bg);
  transition: background .5s ease;
}
.cosmic-bg-nebula {
  position: absolute; inset: -22%;
  background:
    radial-gradient(52% 58% at 24% 26%, color-mix(in srgb, var(--glow) 30%, transparent), transparent 76%),
    radial-gradient(56% 60% at 80% 80%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 78%),
    radial-gradient(48% 52% at 84% 20%, color-mix(in srgb, var(--accent2) 20%, transparent), transparent 78%);
  filter: blur(54px); opacity: .5;
}
.has-cosmic-shell[data-motion="1"] .cosmic-bg-nebula { animation: cosmic-nebula 38s ease-in-out infinite alternate; }
@keyframes cosmic-nebula { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(2.5%, -2%, 0) scale(1.08); } }
.cosmic-light .cosmic-bg-nebula { opacity: .4; }
.cosmic-bg-stars { position: absolute; inset: 0; color: #fff; }
.cosmic-bg-stars span { position: absolute; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px color-mix(in srgb, currentColor 70%, transparent); }
.has-cosmic-shell[data-motion="1"] .cosmic-bg-stars.twinkle span { animation: cosmic-twinkle linear infinite; }
@keyframes cosmic-twinkle { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
.cosmic-light .cosmic-bg-stars { color: var(--accent); opacity: .3; }
.cosmic-bg-grain { position: absolute; inset: 0; mix-blend-mode: overlay; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E"); }
.cosmic-bg-vignette { position: absolute; inset: 0;
  background: radial-gradient(115% 100% at 50% 42%, transparent 52%, color-mix(in srgb, var(--bg) 92%, black) 100%); }

/* ── Rail ────────────────────────────────────────────────────────────────────
   The vertical rail (.cosmic-rail*) is styled by the single-source css/cosmic-rail.css
   (imported at the top of this file). Do NOT redeclare it here. */

/* ── Tweaks panel + FAB ─────────────────────────────────────────────────── */
.cosmic-fab { position: fixed; right: 18px; bottom: 18px; z-index: 6600; width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 72%, transparent); color: var(--ink); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); display: grid; place-items: center; cursor: pointer; box-shadow: 0 12px 34px -16px rgba(0,0,0,.6); }
.cosmic-fab svg { width: 20px; height: 20px; }
.cosmic-panel { position: fixed; right: 18px; bottom: 18px; z-index: 6600; width: 268px; max-height: calc(100dvh - 36px); display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg2) 80%, transparent); color: var(--ink); -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -24px rgba(0,0,0,.6); font: 12px/1.4 var(--font-body, system-ui, sans-serif); overflow: hidden; }
.cosmic-panel-h { display: flex; align-items: center; justify-content: space-between; padding: 13px 12px 11px 16px; border-bottom: 1px solid var(--line); }
.cosmic-panel-h b { font-family: var(--font-display); font-style: var(--display-style); font-size: 16px; font-weight: 600; }
.cosmic-x { border: 0; background: transparent; color: var(--sub); width: 26px; height: 26px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.cosmic-x:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.cosmic-x svg { width: 16px; height: 16px; }
.cosmic-panel-b { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.cosmic-sect { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--sub); opacity: .85; }
.cosmic-sw { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.cosmic-chip { height: 30px; border-radius: 9px; border: 0; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); transition: transform .12s ease, box-shadow .12s ease; }
.cosmic-chip:hover { transform: translateY(-1px); }
.cosmic-chip.on { box-shadow: 0 0 0 2px var(--ink), 0 2px 8px rgba(0,0,0,.25); }
.cosmic-seg { display: flex; gap: 3px; padding: 3px; border-radius: 11px; background: color-mix(in srgb, var(--ink) 9%, transparent); }
.cosmic-seg button { flex: 1; border: 0; background: transparent; cursor: pointer; font: inherit; font-weight: 600; color: var(--sub); padding: 7px 6px; border-radius: 8px; transition: .15s ease; }
.cosmic-seg button.on { background: color-mix(in srgb, var(--bg) 60%, transparent); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.cosmic-row { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.cosmic-row.h { flex-direction: row; align-items: center; justify-content: space-between; }
.cosmic-field { appearance: none; width: 100%; height: 34px; padding: 0 12px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-weight: 500; background: color-mix(in srgb, var(--bg) 50%, transparent); color: var(--ink); outline: none; }
.cosmic-field option { color: #111; }
.cosmic-toggle { position: relative; width: 38px; height: 22px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 22%, transparent); cursor: pointer; padding: 0; transition: background .15s; }
.cosmic-toggle.on { background: var(--accent); }
.cosmic-toggle i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.cosmic-toggle.on i { transform: translateX(16px); }

/* ── Content offset for the rail ────────────────────────────────────────── */
.has-cosmic-shell body { margin: 0; }   /* kill the UA's 8px body margin so the shell origin matches VR */
.has-cosmic-shell .cosmic-shell-content { position: relative; z-index: 1; padding-left: 66px; }
/* Tool pages: ONE centered column holding topbar + hero + body + footer, offset for
   the rail — byte-for-byte the geometry of VR's `.shell` (.app .shell padding-left:92px,
   max-width:1080px, margin:0 auto). This is what makes the top menu/brand/hero sit in
   the IDENTICAL position on every cosmic-tool page. */
.has-cosmic-shell .cosmic-shell-content.cosmic-tool { box-sizing: border-box; max-width: 1080px; margin: 0 auto; padding: 22px 24px 80px; padding-left: 92px; }

/* Touch / narrow screens: the rail becomes a slide-out drawer (no hover there).
   It starts off-screen; the burger slides it in over a scrim, with labels shown. */
/* Touch / narrow screens: matches VR exactly — a 56px icon rail stays visible, and the
   burger EXPANDS it to a labelled drawer over a scrim (VR's rail-mobile.js behaviour). */
@media (hover: none), (max-width: 760px) {
  /* rail mobile behaviour (.cosmic-rail*) lives in cosmic-rail.css */
  .has-cosmic-shell .cosmic-shell-content { padding-left: 56px; }
  .has-cosmic-shell .cosmic-shell-content.cosmic-tool { max-width: none; margin: 0; padding: 16px 16px 60px; padding-left: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .cosmic-bg-nebula, .cosmic-bg-stars span { animation: none !important; }
}

/* ── Shared cosmic top-header + hero + simple footer ────────────────────────
   php/cosmic-header.php + the .mz-hero markup + php/cosmic-footer.php. Mirrors
   the React MzHero/mz-topbar look (mz-ui.jsx) EXACTLY so converted non-React
   pages are visually identical to the tool pages. Everything is prefixed with
   .has-cosmic-shell so it wins over page CSS (e.g. ear-training.css's
   .app-container / Inter / underlined-link rules). */
.has-cosmic-shell {
  --hero-serif: var(--font-display);
  --hero-ink: var(--ink);
  --hero-sub: var(--sub);
  --hero-accent: var(--accent);
  --hero-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --hero-line: color-mix(in srgb, var(--accent) 38%, transparent);
}
/* Top header */
.has-cosmic-shell .mz-topbar { position: relative; z-index: 1; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; padding: 6px 2px 0; margin: 0 0 30px; }
.has-cosmic-shell .mz-brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.has-cosmic-shell .mz-brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--cta, var(--accent)); color: var(--accent-ink, #fff); border: 0; flex: 0 0 auto;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 55%, transparent); }
.has-cosmic-shell .mz-brand-mark svg { width: 19px; height: 19px; }
.has-cosmic-shell .mz-brand-name { font-family: var(--font-body); font-weight: 600; font-size: 16.5px;
  letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.has-cosmic-shell .mz-brand-name em { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--accent); }
.has-cosmic-shell .mz-nav { display: flex; align-items: center; gap: 6px; }
.has-cosmic-shell .mz-nav-link { color: var(--sub); text-decoration: none; font-family: var(--font-body);
  font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 9px; transition: color .15s, background .15s; }
.has-cosmic-shell .mz-nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.has-cosmic-shell .mz-theme-toggle { appearance: none; cursor: pointer; width: 40px; height: 40px; border-radius: 11px;
  flex: 0 0 auto; display: grid; place-items: center; color: var(--sub); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); transition: color .15s, border-color .15s; }
.has-cosmic-shell .mz-theme-toggle svg { width: 18px; height: 18px; }
.has-cosmic-shell .mz-theme-toggle:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
/* Hero — verbatim from mz-ui.jsx MZ_HERO_CSS, prefixed for specificity */
.has-cosmic-shell .mz-hero { text-align: center; margin: 18px auto 36px; max-width: 760px;
  display: flex; flex-direction: column; align-items: center; }
.has-cosmic-shell .mz-hero .eyebrow { display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--hero-accent); background: var(--hero-soft); border: 1px solid var(--hero-line);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 18px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.has-cosmic-shell .mz-hero .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--hero-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hero-accent) 22%, transparent); }
.has-cosmic-shell .mz-hero h1 { margin: 0 0 14px; font-family: var(--font-body);
  font-size: clamp(34px, 6vw, 56px); line-height: 1.04; letter-spacing: -.03em; font-weight: 600;
  color: var(--hero-ink); text-wrap: balance; }
.has-cosmic-shell .mz-hero h1 em { font-family: var(--hero-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.has-cosmic-shell .mz-hero p { margin: 0 auto; max-width: 560px; color: var(--hero-sub);
  font-family: var(--font-body); font-size: 16.5px; line-height: 1.6; text-wrap: pretty; }
/* Simple footer */
.has-cosmic-shell .mz-footer { position: relative; z-index: 1; margin: 56px 0 0;
  padding: 22px 2px 40px; border-top: 1px solid var(--line); }
.has-cosmic-shell .mz-footer-line { color: var(--ink-3, var(--sub)); font-family: var(--font-body);
  font-size: 13.5px; letter-spacing: .01em; }
@media (max-width: 760px) {
  .has-cosmic-shell .mz-topbar .mz-nav-link { display: none; }
}
