/*
 * Mystical Door Productions: the look every page on productions.mysticaldoor.com shares, linked
 * from the frame (_frame/head.html), so a page carries no <style> of its own.
 *
 * The tokens are the Help Center's (MysticalDoorSupport, public/css/styles.css), which took them
 * from mysticaldoor.com, so the hub, the game's page and its Help Center read as one place. Keep
 * the names and values identical to theirs: a change there is a change here. No CSS framework,
 * and nothing from another host.
 */

:root {
  color-scheme: dark;
  --bg: #0e0b16;
  --panel: #18131f;
  --panel-2: #221a2c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ece6f3;
  --muted: #b5abc4;
  --gold: #e6bd6a;
  --gold-ink: #1d1405;
  --violet: #c27bff;
  --violet-deep: #7a3fc4;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
/* A column, so that on a short page the footer still sits at the foot of the window. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}
main { flex: 1 0 auto; }
/* Links keep their underline: told apart from the words around them by colour alone, they fail
   WCAG 1.4.1, as the Help Center found. Menus and the wordmark stand on their own and drop it. */
a { color: var(--gold); }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); color: var(--gold); margin: 0 0 0.75rem; }
h3 { font-size: 1.3rem; margin: 0 0 0.4rem; }

/* The frame's first link, shown only when the keyboard reaches it. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- header ---------- */
/* The Help Center's bar: the wordmark on the left, the menu on the right. Wide screens show the
   menu's links in a row; narrow ones get a button that opens them as a popover, which needs no
   script. A closed popover is display:none until the wide-screen rule gives it a display of its
   own. The row starts at 44rem, where the wordmark and the five links fit on one line: at 40rem,
   the other pages' breakpoint, the wordmark wrapped onto two. */
.site-header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(34, 26, 44, 0.9), rgba(14, 11, 22, 0.95));
}
.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  /* The width of the pages' sections, so the wordmark lines up with what is under it. */
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
}
.brand {
  color: #f7f0e1;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  text-shadow: 0 0 22px rgba(194, 123, 255, 0.4);
}
.brand:hover { text-decoration: underline; text-underline-offset: 3px; }
.menu-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(230, 189, 106, 0.45);
  border-radius: 10px;
  background: rgba(24, 19, 31, 0.75);
  color: var(--gold);
  cursor: pointer;
}
.menu {
  position: absolute;
  inset: 4.15rem 1.25rem auto auto;
  min-width: 13rem;
  margin: 0;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.menu a {
  display: block;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}
.menu a:hover { background: var(--panel-2); color: var(--gold); }
.menu a[aria-current] { color: var(--gold); }
@media (min-width: 44rem) {
  .menu-button { display: none; }
  .menu {
    display: flex;
    position: static;
    gap: 1.75rem;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    background: none;
    box-shadow: none;
  }
  .menu a { padding: 0.25rem 0; color: var(--gold); }
  .menu a:hover { background: none; text-decoration: underline; }
  .menu a[aria-current] { text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- home: hero ---------- */
.hero {
  display: grid;
  place-items: center;
  min-height: min(50vh, 480px);
  padding: 3.5rem 1.25rem 3rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(122, 63, 196, 0.35) 0%, rgba(14, 11, 22, 0) 60%),
    var(--bg);
}
.hero-inner { max-width: 44rem; }
/* The kicker is a paragraph above the heading, not part of it, so the heading search engines
   and screen readers announce is the studio's name alone. */
.kicker {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.wordmark {
  margin: 0 0 0.5rem;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  color: var(--gold);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8);
}
.lede { font-size: clamp(1.1rem, 2.3vw, 1.3rem); color: var(--muted); margin: 0 auto; max-width: 36rem; }

/* ---------- sections and product cards ---------- */
section { max-width: 60rem; margin: 0 auto; padding: 4rem 1.25rem; }
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-top: 1.5rem; }
.card {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.card p { margin: 0 0 1rem; color: var(--muted); }
.card p:last-child { margin-bottom: 0; }
/* The product's icon beside its name and status. Icons are drawn at 192 pixels and shown at 64,
   so they stay sharp on a phone's screen; the glow is the Help Center's, round its own icon. */
.card-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.card-head h3 { margin: 0 0 0.35rem; }
.card-icon {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 15px;
  box-shadow: 0 0 18px rgba(194, 123, 255, 0.35);
}
.status {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border: 1px solid rgba(194, 123, 255, 0.5);
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--violet);
}
.card nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* ---------- text pages: about, contact, legal ---------- */
/* One column of reading width. Its h2 is quieter than the home page's section titles, since a
   text page has several. */
.page { width: 100%; max-width: 44rem; margin: 0 auto; padding: 3.5rem 1.25rem 4rem; }
.page h1 { margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 2.6rem); color: var(--gold); }
.page h2 { margin: 2.5rem 0 0.75rem; font-size: 1.5rem; color: var(--text); }
.page h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.page .lead { font-size: 1.15rem; color: var(--muted); }
.page ul { padding-left: 1.25rem; }
.page li { margin-bottom: 0.6rem; }
/* A product per panel, like the home page's cards: the contact and privacy pages. */
.page .product-list { display: grid; gap: 1rem; padding: 0; list-style: none; }
.product-list li {
  margin: 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.page .product-list h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.product-list p { margin: 0.35rem 0 0; color: var(--muted); }
.page .updated { margin-top: 2.5rem; font-size: 0.9rem; color: var(--muted); }

/* ---------- privacy policies ---------- */
/* The Mystical Door's is mysticaldoor.com's markup, copied as it is by tools/policy-mirror.js, so
   these style the classes that page uses: .meta, .summary, code and the policy's own footer. */
.policy .mirror-note { margin: 0 0 2rem; font-size: 0.9rem; color: var(--muted); }
.policy h1 { margin-bottom: 0.25rem; }
.policy h3 { margin: 1.5rem 0 0.4rem; }
.policy .meta { margin-top: 0; font-size: 0.9rem; color: var(--muted); }
.policy .summary {
  margin: 1.75rem 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--violet);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--panel);
}
.policy .summary p { margin: 0; }
.policy .summary p + p { margin-top: 0.75rem; }
.policy code {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--panel-2);
  font-size: 0.9em;
}
.policy footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- news ---------- */
/* One release per entry, written by tools/news.js: its name, date, headline and a link to its
   patch notes. */
.news-item { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.news-item:first-of-type { margin-top: 2rem; }
.page .news-item h2 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.news-item p { margin: 0.35rem 0 0; }
.news-item .news-date { margin-top: 0; font-size: 0.9rem; color: var(--muted); }

/* ---------- press kit ---------- */
/* Facts as a two-column list, and pictures that fill the column and keep their proportions. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 1rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
/* A text page's sections sit in its column: the home page's section rule (its width and padding)
   is for the home page's own. */
.page section { max-width: none; margin: 0; padding: 0; }
.page .press-product { margin-top: 3rem; }
.press h3 { margin: 2rem 0 0.75rem; }
.press-product .one-line { font-size: 1.1rem; }
.press figure { margin: 0; }
.press figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.press figcaption { margin-top: 0.4rem; font-size: 0.9rem; color: var(--muted); }
.press-art { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; }
.press-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; }
@media (max-width: 40rem) {
  .press-art { grid-template-columns: 1fr; }
}

/* ---------- the 404 page ---------- */
.not-found {
  max-width: 32rem;
  margin: 0 auto;
  padding: 5rem 1.25rem;
  text-align: center;
}
.not-found h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: var(--gold);
}
.not-found p { color: var(--muted); margin: 0 0 1.5rem; }
.not-found nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; }

/* ---------- footer ---------- */
.site-footer {
  padding: 2.5rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.75rem; margin-bottom: 0.75rem; }
.site-footer p { margin: 0.25rem 0; }
.site-footer .legal { font-size: 0.8rem; opacity: 0.85; }

@media (max-width: 40rem) {
  section { padding: 3.5rem 1.1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
