/* ==========================================================================
   Voltix Studios — long-form document pages (privacy policy, data deletion)
   Loaded after style.css, which supplies the palette, type scale, header,
   buttons, social components and footer. Everything here is prose furniture:
   the title block, the table of contents, the language switch and the
   readable measure that legal copy needs.
   ========================================================================== */

:root {
  --doc-wrap: 820px;
}

/* Each game's accent, so a policy page still reads as that game's. The values
   match .game--ps and .game--cw in style.css — a document that arrives in the
   wrong colour reads as the wrong game's terms, which is worse here than on a
   marketing page. */
.doc--ps { --accent: #ff5a52; --accent-2: #4a91ea; }
.doc--cw { --accent: #ff8a2b; --accent-2: #ffc04d; }

/* ── title block ─────────────────────────────────────────────────────────── */

.doc-head {
  position: relative;
  padding: clamp(44px, 6vw, 76px) 0 clamp(26px, 3.5vw, 38px);
  isolation: isolate;
  overflow: hidden;
}
.doc-head::before {
  content: "";
  position: absolute;
  inset: -60% -20% auto;
  height: 620px;
  z-index: -1;
  background: radial-gradient(44% 50% at 50% 50%,
              color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%);
}

.doc-head .wrap { max-width: var(--doc-wrap); }

.doc__title {
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  letter-spacing: -.015em;
  margin-bottom: 16px;
}

/* Breadcrumb back to the site — legal pages are often the first page a
   visitor lands on, so they need a way up. */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 22px;
}
.crumbs a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.crumbs a:hover { color: var(--accent); }
.crumbs span[aria-hidden] { opacity: .5; }

/* Key/value strip under the title: app id, developer, effective date.
   The cell separators are the container's background showing through a 1px
   gap, which means an empty cell would show up as a pale block — so the
   column count is pinned to the three entries rather than left to auto-fit. */
.doc-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 28px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--line);
  overflow: hidden;
}
.doc-meta > div {
  background: var(--ink-1);
  padding: 16px 18px;
  min-width: 0;
}
.doc-meta dt {
  font-family: var(--display);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.doc-meta dd {
  margin: 0;
  font-size: .88rem;
  color: var(--text);
  overflow-wrap: anywhere;
}
/* The package name and the contact address are both too long to sit inline
   next to a label in a third of the measure — each gets its own line at a
   size that fits whole, so neither is hyphenated down the middle. */
.doc-meta dd .sub {
  display: block;
  margin-top: 5px;
  font-size: .78rem;
  color: var(--muted);
}
a.sub {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent);
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
a.sub:hover { color: var(--accent-2); text-decoration-color: currentColor; }
.doc-meta code {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  /* sized so the 31-character package name clears a third of the measure in
     one piece — a reverse-DNS id broken across two lines reads as two ids */
  font-size: .68rem;
  letter-spacing: -.01em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 3px 7px;
}

/* Three columns need the full 820px measure to hold the package name whole.
   Below that the strip stacks rather than squeezing — two columns would leave
   a fourth cell empty, and an empty cell here shows up as a pale block. */
@media (max-width: 860px) {
  .doc-meta { grid-template-columns: 1fr; }
}

/* ── language switch ─────────────────────────────────────────────────────── */

.lang {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
  margin-bottom: 24px;
}
.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--display);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] {
  color: #05070e;
  background: linear-gradient(100deg, var(--volt), var(--volt-2));
}

/* Without JS the switch is meaningless and both languages stay on the page —
   which is the correct fallback for a document Play has to be able to read.
   `data-doclang` is set by an inline snippet in <head>, so the chosen language
   is already the only one painted on the first frame. */
.lang { display: none; }
.js .lang { display: inline-flex; }
html[data-doclang="en"] [data-lang="es"],
html[data-doclang="es"] [data-lang="en"] { display: none; }

/* ── body copy ───────────────────────────────────────────────────────────── */

.doc {
  padding: 0 0 clamp(56px, 7vw, 90px);
}
.doc .wrap { max-width: var(--doc-wrap); }

.doc p,
.doc li {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.75;
}
.doc a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
.doc a:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}
.doc strong { color: var(--text); font-weight: 600; }

/* In-game screen names are set in the display face and small caps-ish, so
   SETTINGS → DELETE MY DATA reads as a UI path rather than shouting. */
.doc em.ui,
.doc .ui {
  font-style: normal;
  font-family: var(--display);
  font-weight: 600;
  font-size: .86em;
  letter-spacing: .1em;
  color: var(--text);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}

.doc h2 {
  font-size: 1.32rem;
  margin: clamp(38px, 4.5vw, 52px) 0 14px;
  scroll-margin-top: 96px;
}
.doc h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-bottom: 15px;
}

.doc ul {
  margin: 0 0 1em;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.doc ul li {
  position: relative;
  padding-left: 26px;
}
.doc ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .72em;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
}

/* ── table of contents ───────────────────────────────────────────────────── */

.toc {
  margin: 34px 0 0;
  padding: 22px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
}
.toc__title {
  font-family: var(--display);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 32px;
  font-size: .92rem;
}
.toc li {
  break-inside: avoid;
  margin-bottom: 9px;
}
.toc a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.toc a:hover { color: var(--accent); }

@media (max-width: 620px) {
  .toc ol { columns: 1; }
}

/* ── callout ─────────────────────────────────────────────────────────────── */

/* Used for the two routes to deletion — the thing a player actually came for
   should not be a paragraph among paragraphs. */
.routes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 26px 0 8px;
}
.route {
  padding: 22px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
}
.route--primary {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: 0 20px 50px -30px color-mix(in srgb, var(--accent) 70%, transparent);
}
.route h3 {
  font-size: 1.02rem;
  margin-bottom: 4px;
}
.route__badge {
  display: inline-block;
  font-family: var(--display);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.route p {
  margin: 0 0 .8em;
  font-size: .94rem;
  color: var(--muted);
}
.route p:last-child { margin-bottom: 0; }

/* ── note ────────────────────────────────────────────────────────────────── */

.note {
  margin: 30px 0 0;
  padding: 16px 20px;
  border-left: 2px solid color-mix(in srgb, var(--volt) 50%, transparent);
  background: rgba(255, 255, 255, .022);
  border-radius: 0 10px 10px 0;
}
.note p {
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
}

/* ── cross-link to the sibling document ──────────────────────────────────── */

.doc-next {
  margin-top: clamp(44px, 5.5vw, 62px);
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.doc-next p {
  margin: 0;
  font-size: .92rem;
  color: var(--muted);
}
