/* Duste Games shared styles */
:root {
  --night: #0b1238;
  --navy: #16226a;
  --navy-2: #1d2c80;
  --blue: #4a72ff;
  --red: #f0384f;
  --red-deep: #c21d3b;
  --purple: #7b3ce2;
  --plum: #2b1460;
  --cream: #f6e9d2;
  --cream-2: #eedcbc;
  --ink: #1d1433;
  --ink-soft: #4b3f5e;
  --line: rgba(246, 233, 210, 0.14);
  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --header-h: 68px;
  --wrap: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html { scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--cream); color: var(--ink); padding: 10px 14px; border-radius: 10px; font-weight: 700; text-decoration: none;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

/* Display type */
.display {
  font-weight: 900;
  font-style: italic;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.01em;
  line-height: 0.95;
  margin: 0;
}

/* ---------- Header ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 41;
  background: rgba(11, 18, 56, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background .3s, box-shadow .3s;
}
.site-header.scrolled {
  background: rgba(11, 18, 56, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 30px; width: auto; }
.header-links { display: flex; align-items: center; gap: 6px; }
.header-links a {
  text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 14px; border-radius: 999px; opacity: .82;
  transition: opacity .2s, background .2s;
}
.header-links a:hover { opacity: 1; background: rgba(246, 233, 210, .08); }
.header-links a[aria-current="page"] { opacity: 1; background: rgba(246, 233, 210, .1); }
@media (max-width: 760px) { .header-links { display: none; } }

.menu-btn {
  width: 48px; height: 48px; border-radius: 16px; border: 0; cursor: pointer;
  background: var(--red); display: grid; place-items: center; position: relative;
  box-shadow: 0 4px 0 var(--red-deep);
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
.menu-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-deep); }
.menu-btn span { position: absolute; left: 14px; right: 14px; height: 3px; border-radius: 3px; background: var(--cream); transition: transform .35s var(--ease-out), opacity .2s; }
.menu-btn span:nth-child(1) { transform: translateY(-6px); }
.menu-btn span:nth-child(3) { transform: translateY(6px); right: 20px; }
.menu-open .menu-btn span:nth-child(1) { transform: rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: rotate(-45deg); right: 14px; }

/* ---------- Slide-out menu ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(6, 8, 30, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .35s;
}
.drawer {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--plum);
  background-image:
    radial-gradient(120% 60% at 100% 0%, rgba(240, 56, 79, .35), transparent 60%),
    radial-gradient(90% 60% at 0% 100%, rgba(74, 114, 255, .28), transparent 60%);
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 26px calc(env(safe-area-inset-bottom, 0px) + 26px);
  display: flex; flex-direction: column;
  transform: translateX(104%);
  transition: transform .55s var(--ease-out);
  border-radius: 28px 0 0 28px;
  box-shadow: -30px 0 80px rgba(0, 0, 0, .4);
  overflow-y: auto;
}
.menu-open .drawer { transform: none; }
.menu-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-top { display: flex; justify-content: space-between; align-items: center; height: 50px; margin-bottom: 28px; }
.drawer-top img { height: 26px; width: auto; }
.drawer-close {
  width: 48px; height: 48px; border-radius: 16px; border: 1px solid var(--line); background: rgba(246, 233, 210, .06); cursor: pointer;
  display: grid; place-items: center;
}
.drawer nav { display: flex; flex-direction: column; gap: 4px; }
.drawer nav a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  text-decoration: none;
  font-weight: 900; font-style: italic; font-variation-settings: "wdth" 125;
  font-size: clamp(34px, 9vw, 48px); line-height: 1.05;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateX(40px);
  transition: opacity .4s, transform .55s var(--ease-out), color .2s;
}
.drawer nav a small { font-style: normal; font-weight: 500; font-size: 14px; font-variation-settings: "wdth" 100; opacity: .6; }
.drawer nav a:hover, .drawer nav a[aria-current="page"] { color: var(--red); }
.menu-open .drawer nav a { opacity: 1; transform: none; }
.menu-open .drawer nav a:nth-child(1) { transition-delay: .08s; }
.menu-open .drawer nav a:nth-child(2) { transition-delay: .13s; }
.menu-open .drawer nav a:nth-child(3) { transition-delay: .18s; }
.menu-open .drawer nav a:nth-child(4) { transition-delay: .23s; }
.menu-open .drawer nav a:nth-child(5) { transition-delay: .28s; }
.drawer-foot { margin-top: auto; padding-top: 32px; font-size: 14px; opacity: .7; }
.drawer-foot a { font-weight: 600; }
body.menu-open { overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--red); --btn-edge: var(--red-deep); --btn-fg: var(--cream);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px;
  border: 0; border-radius: 18px; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 800; font-size: 17px; text-decoration: none;
  box-shadow: 0 5px 0 var(--btn-edge);
  transition: transform .15s var(--ease-out), box-shadow .15s, filter .2s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--btn-edge); }
.btn.cream { --btn-bg: var(--cream); --btn-edge: #c9b48f; --btn-fg: var(--ink); }
.btn.purple { --btn-bg: var(--purple); --btn-edge: #4e1fa3; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px rgba(246, 233, 210, .3); }
.btn.ghost:active { transform: translateY(2px); }

/* ---------- Footer ---------- */
.site-footer { padding: 56px 0 40px; border-top: 1px solid var(--line); margin-top: 0; }
.site-footer .wrap { display: grid; gap: 28px; grid-template-columns: 1fr auto; align-items: end; }
.site-footer img { height: 34px; width: auto; margin-bottom: 14px; }
.site-footer p { margin: 0; opacity: .6; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { text-decoration: none; font-weight: 600; opacity: .8; }
.footer-links a:hover { opacity: 1; color: var(--red); }
@media (max-width: 640px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---------- Page heads (legal + contact) ---------- */
.page-head {
  position: relative; overflow: hidden;
  padding: 56px 0 120px;
  background:
    radial-gradient(70% 90% at 85% 10%, rgba(123, 60, 226, .45), transparent 65%),
    radial-gradient(60% 80% at 0% 100%, rgba(240, 56, 79, .32), transparent 60%),
    linear-gradient(180deg, var(--night), var(--navy));
  margin-top: calc(-1 * var(--header-h));
  padding-top: calc(var(--header-h) + 56px);
}
.page-head::after { content: ""; position: absolute; inset: auto 0 0; height: 140px; background: linear-gradient(180deg, transparent, var(--night)); pointer-events: none; }
.page-head .wrap { position: relative; z-index: 1; }
.page-head h1 { font-size: clamp(48px, 11vw, 112px); }
.page-head p { margin: 18px 0 0; max-width: 56ch; opacity: .8; font-size: 18px; }
.page-head .stamp {
  display: inline-block; margin-top: 22px; padding: 8px 14px; border-radius: 12px;
  background: rgba(246, 233, 210, .1); font-weight: 600; font-size: 14px;
}

/* ---------- Legal layout ---------- */
.progress {
  position: fixed; left: 0; top: 0; height: 4px; width: 100%; z-index: 50;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--red), var(--purple), var(--blue));
  margin-top: env(safe-area-inset-top, 0px);
}
.legal {
  position: relative; z-index: 2;
  margin-top: -80px; margin-bottom: 72px;
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start;
}
.toc {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 16px);
  background: rgba(43, 20, 96, .78); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 22px; padding: 18px 14px;
  max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto;
}
.toc summary { list-style: none; font-weight: 800; cursor: pointer; padding: 4px 8px 10px; display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary svg { transition: transform .3s; }
.toc[open] summary svg { transform: rotate(180deg); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block; text-decoration: none; font-size: 14px; line-height: 1.35; padding: 8px 10px; border-radius: 10px; opacity: .72;
  transition: background .2s, opacity .2s, color .2s;
}
.toc a:hover { opacity: 1; background: rgba(246, 233, 210, .07); }
.toc a.active { opacity: 1; background: var(--red); color: var(--cream); }

.sheet {
  background: var(--cream); color: var(--ink);
  border-radius: 28px;
  padding: clamp(26px, 5vw, 64px);
  box-shadow: 0 30px 80px rgba(3, 5, 25, .45);
}
.sheet > :first-child { margin-top: 0; }
.sheet .lede { font-size: 19px; color: var(--ink-soft); margin: 0 0 8px; max-width: 64ch; }
.sheet h2 {
  font-weight: 900; font-style: italic; font-variation-settings: "wdth" 115;
  font-size: clamp(24px, 3.4vw, 32px); line-height: 1.1;
  margin: 56px 0 14px; color: var(--ink);
  display: flex; gap: 14px; align-items: baseline;
}
.sheet h2 .n {
  flex: none; display: inline-grid; place-items: center; min-width: 42px; height: 34px; padding: 0 8px;
  border-radius: 10px; background: var(--ink); color: var(--cream); font-size: 17px; font-style: normal;
  font-variation-settings: "wdth" 100; transform: translateY(-3px);
}
.sheet h3 { font-weight: 800; font-size: 19px; margin: 30px 0 8px; }
.sheet h4 { font-weight: 700; font-size: 17px; margin: 22px 0 6px; color: var(--plum); }
.sheet p, .sheet li { max-width: 72ch; }
.sheet p { margin: 0 0 14px; }
.sheet ul { padding-left: 1.2em; margin: 0 0 16px; }
.sheet li { margin-bottom: 8px; }
.sheet li::marker { color: var(--red); }
.sheet a { color: var(--red-deep); font-weight: 600; text-underline-offset: 3px; }
.sheet strong { font-weight: 750; }
.sheet .callout {
  margin: 0 0 8px; padding: 18px 20px; border-radius: 18px;
  background: var(--cream-2); border-left: 6px solid var(--purple);
}
.sheet .callout p:last-child { margin: 0; }

@media (max-width: 900px) {
  .legal { grid-template-columns: 1fr; gap: 14px; margin-top: -84px; }
  .toc { position: relative; top: 0; max-height: none; }
  .toc:not([open]) { padding-bottom: 8px; }
}
@media (min-width: 901px) {
  .toc summary svg { display: none; }
  .toc summary { pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}
