/* Shared stylesheet for Meridian's content pages (/spaces, /faq, /compare …).
   index.html keeps its own inline CSS: it is a single hero screen with its own
   layout, and the tokens below are the ones it defines, kept in step by hand. */

:root {
  --bg: #191327;
  --ink: #ffffff;
  --ink-soft: #b0a8c4;
  --ink-faint: #7d7492;
  --accent: #7a5af8;
  --accent-light: #b49cff;
  --line: rgba(255, 255, 255, 0.10);
  --card: rgba(255, 255, 255, 0.04);
}

* { margin: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: var(--accent-light); }

/* ---------- Header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(25, 19, 39, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head-in {
  max-width: 62rem;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
  flex: none;
}
.brand svg { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.92rem;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent-light); font-weight: 600; }
.head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.head-cta {
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  color: #14101f;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.head-cta:hover { filter: brightness(1.08); }
.head-discord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(88, 101, 242, 0.7);
  background: rgba(88, 101, 242, 0.16);
  color: #c7ceff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.head-discord:hover { border-color: #5865f2; background: rgba(88, 101, 242, 0.3); }
.head-discord svg { width: 19px; height: 15px; flex: none; }
/* The nav is seven items wide, so the header needs ~925px to stay on one row.
   Below 60rem the Discord button keeps its mark and drops its label and the nav
   tightens its gaps — together worth about 80px, which carries one row down to
   roughly 850px before anything wraps. */
@media (max-width: 60rem) {
  .head-discord { padding: 9px 12px; }
  .head-discord span { display: none; }
  .site-nav { gap: 4px 11px; font-size: 0.88rem; }
}
/* Once it can no longer fit on one line (measured: below ~850px), put the nav on
   its own full-width row under the brand and the buttons, rather than letting the
   buttons be the thing that drops. One wrapped arrangement, not two. */
@media (max-width: 53rem) {
  .head-actions { margin-left: 0; order: 3; }
  .site-nav { order: 4; width: 100%; }
}

/* ---------- Article ---------- */

main { flex: 1; }

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px;
}

.hero {
  padding: 56px 16px 8px;
  background: radial-gradient(ellipse 620px 360px at 50% 0%, #241b3e 0%, var(--bg) 72%);
}
.hero .wrap { padding: 0; }
.eyebrow {
  color: var(--accent-light);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  font-size: clamp(1.9rem, 5.4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 10px 0 14px;
  text-wrap: balance;
}
.standfirst {
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}

article { padding: 28px 0 8px; }
article h2 {
  font-size: clamp(1.3rem, 3.4vw, 1.6rem);
  letter-spacing: -0.015em;
  margin: 40px 0 12px;
  text-wrap: balance;
}
article h3 {
  font-size: 1.06rem;
  margin: 26px 0 8px;
  color: var(--ink);
}
article p { color: var(--ink-soft); margin: 0 0 14px; text-wrap: pretty; }
article ul { color: var(--ink-soft); margin: 0 0 16px; padding-left: 1.15rem; }
article li { margin-bottom: 8px; }
article li::marker { color: var(--accent-light); }
article strong { color: var(--ink); font-weight: 600; }
article code {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.lede {
  color: var(--ink) !important;
  font-size: 1.06rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 0 0 16px;
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.note {
  border-left: 3px solid var(--accent);
  background: rgba(122, 90, 248, 0.10);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.note strong { color: var(--ink); }

/* ---------- Screenshots ---------- */

/* Phone captures sit side by side on a desktop and stay side by side on a phone,
   because the point of a pair is the comparison between them. */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 16px;
  margin: 0 0 20px;
}
.shots figure { margin: 0; }
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #0f0b1a;
}
.shots figcaption {
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 0.85rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.shots figcaption b { color: var(--ink-soft); font-weight: 600; }

/* A lone capture would stretch to the full text measure and tower over the
   page, so cap it at roughly the width one sits at in a pair. */
.shots.one { grid-template-columns: minmax(0, 15rem); justify-content: center; }
@media (max-width: 30rem) { .shots.one { grid-template-columns: minmax(0, 1fr); } }


/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 18px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  min-width: 34rem;
}
th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft);
}
th { color: var(--ink); font-weight: 600; white-space: nowrap; }
tbody th { font-weight: 500; white-space: normal; }

/* Most of this site's traffic is on a phone, where a 34rem table means a lot of
   sideways dragging. Tighten it rather than let it stay that wide. */
@media (max-width: 34rem) {
  table { min-width: 26rem; font-size: 0.86rem; }
  th, td { padding: 9px 9px; }
}
td.yes { color: #8fe3b0; }
td.no { color: var(--ink-faint); }

/* ---------- FAQ accordions ---------- */

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq details[open] { border-color: rgba(180, 156, 255, 0.35); }
.faq summary {
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--accent-light);
  font-size: 1.2rem;
  font-weight: 400;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 18px 16px; color: var(--ink-soft); }
.faq .a p:last-child { margin-bottom: 0; }

/* ---------- Changelog ---------- */

.release {
  border-left: 2px solid var(--line);
  padding: 0 0 4px 20px;
  margin-left: 6px;
  position: relative;
}
.release::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 10px var(--accent-light);
}
.release:not(:first-of-type)::before {
  background: var(--ink-faint);
  box-shadow: none;
}
.release h2 {
  margin: 0 0 4px;
  font-size: 1.16rem;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.release .when { color: var(--ink-faint); font-size: 0.85rem; font-weight: 400; }
.release ul { margin-top: 8px; }

/* ---------- CTA + related ---------- */

.cta-block {
  margin: 44px 0 8px;
  padding: 26px 22px;
  border: 1px solid rgba(180, 156, 255, 0.28);
  border-radius: 20px;
  background: rgba(122, 90, 248, 0.10);
  text-align: center;
}
.cta-block h2 { margin: 0 0 8px; font-size: 1.3rem; }
.cta-block p { margin-bottom: 18px; }
.cta {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  color: #14101f;
  font-weight: 700;
  text-decoration: none;
}
.cta:hover { filter: brightness(1.08); }
.cta-sub { display: block; margin-top: 12px; font-size: 0.86rem; color: var(--ink-faint); }

.related { margin: 40px 0 0; }
.related h2 { font-size: 1.05rem; margin-bottom: 12px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 10px;
}
.related-grid a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}
.related-grid a:hover { border-color: rgba(180, 156, 255, 0.45); }
.related-grid span { display: block; color: var(--ink-faint); font-weight: 400; font-size: 0.85rem; margin-top: 3px; }

/* ---------- Home page ---------- */
/* The home page is the same document shell as every other page — same header,
   same tokens, same footer — with a centred hero in place of an article. */

.home-hero {
  padding: 56px 16px 8px;
  text-align: center;
  background: radial-gradient(ellipse 640px 460px at 50% 18%, #241b3e 0%, var(--bg) 72%);
}
.home-hero .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.mark { width: 88px; height: 88px; border-radius: 22px; display: block; }
.home-hero h1 { margin: 0; }
.tagline {
  font-size: clamp(1.2rem, 4.2vw, 1.5rem);
  font-weight: 600;
  color: var(--accent-light);
  margin: -8px 0 0;
}
.blurb {
  max-width: 34rem;
  color: var(--ink-soft);
  text-wrap: pretty;
  margin: 0;
}

.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}
.cta-alt {
  display: inline-block;
  padding: 13px 30px;
  border: 1px solid var(--accent-light);
  border-radius: 999px;
  color: var(--accent-light);
  font-weight: 700;
  text-decoration: none;
}
.cta-alt:hover { background: rgba(180, 156, 255, 0.12); }
.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 30px;
  border: 1px solid rgba(88, 101, 242, 0.8);
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.18);
  color: #c7ceff;
  font-weight: 700;
  text-decoration: none;
}
.discord-btn:hover { border-color: #5865f2; background: rgba(88, 101, 242, 0.32); }
.discord-mark { width: 21px; height: 16px; flex-shrink: 0; }

.price { color: var(--ink-faint); font-size: 0.9rem; margin: -10px 0 0; }
.apk-note {
  max-width: 32rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin: -12px 0 0;
}
.apk-note a { color: var(--accent-light); }

.updates {
  max-width: 32rem;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(180, 156, 255, 0.28);
  border-radius: 16px;
  background: rgba(122, 90, 248, 0.10);
  text-align: left;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}
.updates p { margin: 0; }
.updates-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--ink);
}
.updates-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 10px var(--accent-light);
}
.updates-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.updates code {
  flex: 1 1 14rem;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-size: 0.82rem;
}
.copy-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-light);
  background: transparent;
  color: var(--accent-light);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.copy-btn:hover { background: rgba(180, 156, 255, 0.12); }

.info-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
/* One of these is a link to /faq and one a button opening a modal — they have to
   be indistinguishable, so the anchor needs the button's box and no underline. */
.info-btn {
  display: inline-block;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.info-btn:hover { color: var(--ink); border-color: var(--accent-light); }

/* The home page's grid of links out to the content pages. Same card as
   .related-grid, laid out wider because there are ten of them. */
.explore { margin: 40px 0 0; }
.explore h2 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  margin: 0 0 16px;
}
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 10px;
}
.explore-grid a {
  display: block;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.45;
}
.explore-grid a:hover { border-color: rgba(180, 156, 255, 0.45); }
.explore-grid span {
  display: block;
  margin-top: 4px;
  color: var(--ink-faint);
  font-weight: 400;
  font-size: 0.86rem;
}

/* ---------- Modal sheets (home page) ---------- */

dialog.sheet {
  /* The universal margin reset above also kills the UA's margin:auto that
     centers a native dialog, leaving it pinned to the corner — restore it. */
  margin: auto;
  width: min(42rem, calc(100vw - 32px));
  max-height: min(84vh, 46rem);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: #221a38;
  color: var(--ink);
  padding: 0;
}
dialog.sheet::backdrop { background: rgba(10, 7, 18, 0.65); backdrop-filter: blur(6px); }
/* Scroll INSIDE the body, not on the dialog: a dialog-level scrollbar cuts
   straight through the rounded corners. [open] guard keeps the UA's
   display:none for closed dialogs intact. */
dialog.sheet[open] { display: flex; flex-direction: column; }
.sheet-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 12px;
}
.sheet-head h2 { font-size: 1.35rem; letter-spacing: -0.01em; margin: 0; }
.sheet-close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-soft);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
}
.sheet-close:hover { color: var(--ink); }
.sheet-body {
  padding: 4px 24px 24px;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 156, 255, 0.35) transparent;
}
.sheet-body::-webkit-scrollbar { width: 8px; }
.sheet-body::-webkit-scrollbar-track { background: transparent; }
.sheet-body::-webkit-scrollbar-thumb {
  background: rgba(180, 156, 255, 0.3);
  border-radius: 999px;
}
.sheet-body::-webkit-scrollbar-thumb:hover { background: rgba(180, 156, 255, 0.55); }
.sheet-body .a code { word-break: break-all; }

/* ---------- Footer ---------- */

footer {
  margin-top: 56px;
  padding: 26px 16px 36px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
  line-height: 1.7;
}
footer a { color: var(--ink-soft); text-decoration: none; }
footer a:hover { color: var(--ink); }
footer .links { margin-bottom: 8px; }
