/* Slix.io - site styles.
   One stylesheet for every page. The palette is the game's own World 1 theme
   (see app/src/main/java/com/slixio/game/render/GamePalette.kt: NEON). */

:root {
  --bg: #0b0e1a;
  --bg-deep: #060814;
  --panel: #10142a;
  --panel-2: #151a34;
  --line: #232a4d;
  --ink: #e6ebfa;
  --ink-dim: #a8b3d4;
  --ink-faint: #7c88ad;
  --mint: #3df5c5;
  --pink: #ff4d8f;
  --amber: #ffb020;
  --radius: 14px;
  --wrap: 1080px;
  /* Reading measure for the legal pages. 74ch rendered at ~80 characters a line,
     which is past the point where the eye starts losing its place on a long
     policy; this lands around 72. */
  --read: 68ch;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

/* A faint field of the game's grid behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(61, 245, 197, .10), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(255, 77, 143, .09), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px) 0 0 / 100% 34px,
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px) 0 0 / 34px 100%;
  pointer-events: none;
}

a { color: var(--mint); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #7ffddd; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 4px;
}

img, svg { max-width: 100%; }

/* ---------- layout ---------- */

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.read { max-width: var(--read); }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 14, 26, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .06em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand .mark { width: 28px; height: 28px; flex: none; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 14.5px;
  /* 10px rather than 7px: this is what takes the tap target to 45px, over the
     44px minimum. At 7px it measured 39px, which is a miss on a phone. */
  padding: 10px 11px;
  border-radius: 9px;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--panel-2); }
.site-nav a[aria-current="page"] { color: var(--mint); background: rgba(61, 245, 197, .09); }

/* ---------- hero ---------- */

.hero { padding: 74px 0 54px; text-align: center; }
.hero .mark-big { width: 116px; height: 116px; margin: 0 auto 26px; display: block; }

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 6.4vw, 58px);
  line-height: 1.06;
  letter-spacing: -.02em;
  font-weight: 800;
}
.hero h1 .dot-io { color: var(--mint); }

.tagline {
  margin: 0 auto 30px;
  max-width: 32ch;
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--ink-dim);
  /* Without this the line broke as "...hunters, take / the region." */
  text-wrap: balance;
}

.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(180deg, #4ffdd0, var(--mint));
  color: #052a24;
  box-shadow: 0 10px 34px rgba(61, 245, 197, .22);
}
.btn-primary:hover { color: #052a24; filter: brightness(1.06); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--panel); }
.btn-ghost:hover { color: var(--ink); border-color: #33406f; }

.note { color: var(--ink-faint); font-size: 14px; margin: 16px 0 0; }

/* ---------- sections ---------- */

section { padding: 54px 0; }
h2 {
  font-size: clamp(23px, 3.2vw, 30px);
  line-height: 1.22;
  letter-spacing: -.01em;
  margin: 0 0 8px;
  font-weight: 750;
  text-wrap: balance;
}
h3 { font-size: 19px; margin: 34px 0 8px; font-weight: 700; }
h4 { font-size: 16.5px; margin: 24px 0 6px; font-weight: 700; color: var(--ink); }
.sub { color: var(--ink-dim); margin: 0 0 26px; }

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}

/* Four cards. auto-fit would put three on the first row and leave the fourth
   sitting alone, which reads as a mistake; these steps go 4 -> 2x2 -> 1 and
   never strand one. */
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } }

/* Phone screenshots, taken on a device rather than mocked up. Four across on a wide
   screen; below that they scroll sideways rather than shrinking to thumbnails, because
   a screenshot the reader cannot make out is worth nothing. */
.shots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 0 0 46px;
}
.shots figure { margin: 0; }
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
}
.shots figcaption {
  margin-top: 11px;
  color: var(--ink-faint);
  font-size: 13.5px;
  text-align: center;
  text-wrap: balance;
}

@media (max-width: 860px) {
  .shots {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    margin-inline: -22px;
    padding-inline: 22px;
  }
  .shots figure { flex: 0 0 62%; scroll-snap-align: center; }
}
@media (max-width: 560px) {
  .shots figure { flex-basis: 78%; }
}

.card {
  background: linear-gradient(180deg, var(--panel), rgba(16, 20, 42, .5));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin: 0 0 7px; font-size: 17.5px; }
.card p { margin: 0; color: var(--ink-dim); font-size: 15.5px; line-height: 1.62; }
.card .kicker {
  display: block;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 9px;
  font-weight: 700;
}

/* ---------- legal pages ---------- */

.doc { padding: 52px 0 30px; }
/* Centre the text column. Left-aligned inside a 1080px wrap, a policy page sits
   in the left two thirds of a desktop window with a hole beside it. */
.doc .read { margin-inline: auto; }
.doc h1 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.1;
  margin: 0 0 10px;
  letter-spacing: -.02em;
}
.doc .dates {
  color: var(--ink-faint);
  font-size: 14.5px;
  margin: 0 0 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.doc h2 {
  margin: 46px 0 10px;
  font-size: 23px;
  scroll-margin-top: 84px;
  padding-top: 4px;
}
.doc p, .doc li { color: var(--ink-dim); }
.doc strong { color: var(--ink); font-weight: 650; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 7px 0; }
.doc li > ul { margin-top: 7px; }

.lede {
  font-size: 18.5px;
  color: var(--ink) !important;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--mint);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 22px;
  margin: 0 0 34px;
}

.toc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 0 0 8px;
}
.toc h2 {
  margin: 0 0 12px !important;
  font-size: 12px !important;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 34px; }
.toc li { margin: 5px 0; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.table-scroll {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
table { border-collapse: collapse; width: 100%; min-width: 580px; font-size: 15px; }
/* The label column earns a third of the table. Left to itself it collapsed to
   about a quarter and broke every short question over two lines while the answer
   beside it sat half empty. */
table th:first-child, table td:first-child { width: 32%; }

/* Tables step outside the reading measure on a wide screen. Prose wants ~70
   characters; a three-column table wants room, and squeezing it into the same
   623px was what made the columns fight. */
@media (min-width: 1000px) {
  .doc .table-scroll { width: calc(100% + 140px); margin-inline: -70px; }
}
th, td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel-2); color: var(--ink); font-weight: 700; font-size: 13.5px; letter-spacing: .03em; }
td { color: var(--ink-dim); }
tr:last-child td { border-bottom: 0; }

.callout {
  background: rgba(255, 176, 32, .07);
  border: 1px solid rgba(255, 176, 32, .3);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 22px 0;
}
.callout.mint { background: rgba(61, 245, 197, .06); border-color: rgba(61, 245, 197, .28); }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  color: var(--mint);
  word-break: break-word;
}

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

details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 20px;
  margin: 12px 0;
}
details[open] { padding-bottom: 6px; }
/* Block with an absolutely placed marker, NOT flex with space-between. As a flex
   container every inline child of the summary became a flex item, so a question
   containing a <code> chip was blown apart - chip shoved to the middle, the rest
   of the sentence stranded against the marker. */
summary {
  cursor: pointer;
  display: block;
  position: relative;
  padding: 17px 36px 17px 0;
  font-weight: 650;
  color: var(--ink);
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mint);
  font-size: 21px;
  line-height: 1;
}
details[open] summary::after { content: "\2212"; }
details p, details li { color: var(--ink-dim); font-size: 15.5px; }
details > *:not(summary) { margin-top: 0; }

/* ---------- challenge code ---------- */

.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(30px, 8vw, 52px);
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--mint);
  background: var(--panel);
  border: 1px solid rgba(61, 245, 197, .3);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 0 auto 20px;
  display: inline-block;
  word-break: break-all;
}

/* ---------- footer ---------- */

.site-foot {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  padding: 38px 0 46px;
  font-size: 15px;
}
/* Grid, not flex: wrapping flex columns dropped the fourth one onto a row of its
   own at tablet width. These steps go 4 -> 2x2 -> 1. */
.foot-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px 28px; } }
@media (max-width: 460px) { .foot-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-foot h2 {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
  font-weight: 700;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin: 8px 0; }
.site-foot a { color: var(--ink-dim); text-decoration: none; }
.site-foot a:hover { color: var(--mint); }
.foot-legal { color: var(--ink-faint); font-size: 13.5px; margin: 34px 0 0; }
.foot-brand { max-width: 30ch; color: var(--ink-faint); font-size: 14px; }
.foot-brand .brand { margin-bottom: 10px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--mint);
  color: #052a24;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  z-index: 50;
}
.skip:focus { left: 0; }

@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .hero { padding: 52px 0 40px; }
  .toc ol { columns: 1; }
  .btn { width: 100%; justify-content: center; }
  .cta-row { flex-direction: column; }

  /* The nav wrapped onto three lines and the sticky header ate 129px - a sixth
     of a phone screen, permanently. Brand on one line, all four links on the
     next, and it scrolls away like any other content. */
  .site-head { position: static; }
  .site-head .wrap {
    min-height: 0;
    padding-top: 11px;
    padding-bottom: 11px;
    gap: 8px;
  }
  .brand { margin-right: 0; width: 100%; }
  .site-nav { width: 100%; gap: 2px; flex-wrap: nowrap; }
  .site-nav a { font-size: 13.5px; padding: 11px 8px; }
  .doc h2 { scroll-margin-top: 16px; }
}

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

/* Print. A policy is a document people save as PDF or hand to a lawyer, and the
   dark theme prints as pale grey text on white - browsers drop background
   colours by default but keep the foreground. So: ink on paper, no chrome, and
   link targets spelled out because a printed page cannot be clicked. */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  body::before { display: none; }
  .site-head, .site-foot, .skip, .cta-row, .toc { display: none; }
  .wrap, .read { max-width: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .doc p, .doc li, .doc strong, td, th, h1, h2, h3, h4 { color: #000; }
  .doc h2 { page-break-after: avoid; break-after: avoid; margin-top: 24pt; }
  .lede, .callout, .card, table, .table-scroll {
    background: none;
    border: 1pt solid #999;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .lede { border-left-width: 3pt; }
  th { background: #eee; }
  code, .mono { background: none; border: 0; color: #000; }
  /* Spell out where a link went. */
  .doc a[href^="http"]::after,
  .doc a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  .doc a[href^="/"]::after { content: " (slixio.eazi.click" attr(href) ")"; font-size: 9pt; }
}
