/*
 * Gemlo — gemlo.nookpages.com. One stylesheet for every page: no web fonts, scripts or third-party files.
 * Colours come from Gemlo's art direction (apps/gemlo/docs/art-direction.md): the amethyst #7A3CF0, neutrals tinted
 * toward it, a deep ink (not black) in dark mode, and the holo band (cyan, violet, pink, gold) only on the home page's
 * card, as in the app's lock. Text pairs meet WCAG AA (4.5:1 or more) in both modes: the amethyst is 5.6:1 on white
 * and links use the darker #6a2fe0; in dark mode links and marks use the lifted #b08cff (7:1 on the ink). Type is the
 * system's own (SF Pro and Hiragino on Apple devices); the app's Bricolage Grotesque headings aren't loaded here (no
 * web fonts). The mark is M5's app icon (apps/gemlo/assets/expo.icon: its brackets, gem and holo layers on the icon's
 * ink), drawn inline in each page's header and in favicon.svg: change them together with the icon.
 */

:root {
  color-scheme: light dark;

  --bg: #faf8ff;
  --surface: #ffffff;
  --amethyst-muted: #efe8ff;
  --text: #0e0b17;
  --text-secondary: #5a5568;
  --link: #6a2fe0;
  --link-hover: #4f1fb3;
  --accent: #7a3cf0;
  --accent-hover: #6328d6;
  --on-accent: #ffffff;
  --marker: #7a3cf0;
  --tick: #7a3cf0;
  --border: #e0dbea;
  --focus: #7a3cf0;

  /* The icon's deep ink, the same in both modes: the home page's panel and the mark's tile. */
  --ink-top: #1f1538;
  --ink-bottom: #120c22;
  --ink-glow: #3a2470;
  --ink-edge: transparent;
  --gem-light: #a98bff;
  --on-ink: #f6f3ff;
  --on-ink-secondary: #cbc3de;
  --bracket: #efe9ff;
  --shadow: 0 18px 40px rgb(18 12 34 / 0.28);

  --font-sans:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Noto Sans JP", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 42rem;
  --wide: 64rem;
  --gutter: 1rem;
  --radius: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0b1a;
    --surface: #1a1429;
    --amethyst-muted: #2a1d4a;
    --text: #f6f3ff;
    --text-secondary: #b3abc6;
    --link: #b08cff;
    --link-hover: #cdb6ff;
    --accent: #7a3cf0;
    --accent-hover: #8c55f5;
    --on-accent: #ffffff;
    --marker: #b08cff;
    --tick: #b08cff;
    --border: #2c2440;
    --focus: #b08cff;
    --ink-edge: #3a2d5c;
    --shadow: 0 18px 44px rgb(0 0 0 / 0.45);
  }
}

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }
}

/* Base */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.45rem, 1.3rem + 0.8vw, 1.85rem);
  margin: 3rem 0 0.75rem;
  scroll-margin-top: 1.5rem;
}

h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
  scroll-margin-top: 1.5rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

p {
  text-wrap: pretty;
}

ul,
ol {
  padding-left: 1.4rem;
}

li {
  margin-top: 0.4rem;
}

li:first-child {
  margin-top: 0;
}

li::marker {
  color: var(--marker);
}

strong {
  font-weight: 650;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

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

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.page {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  padding-block: 2.5rem 4rem;
}

.narrow {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  padding-bottom: 3rem;
}

.center {
  text-align: center;
}

.fineprint {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Skip link: hidden until focused */

.skip {
  position: absolute;
  left: var(--gutter);
  top: -10rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.skip:focus {
  top: 0.75rem;
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand svg {
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list li {
  margin-top: 0;
}

.nav-list a {
  display: inline-block;
  padding-block: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--text);
  text-decoration: underline;
}

.nav-list a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

/* English · Español · 日本語: the page's own language as text, the others as links. */
.nav-list .lang {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.75rem 2.25rem;
}

.site-footer p {
  margin: 0;
}

.site-footer .nav-list a {
  font-size: 0.9rem;
  text-decoration: underline;
}

.site-footer .nav-list a:hover {
  color: var(--text);
}

/* The mark, as on the app icon: four brackets around the gem, on the icon's ink in both modes. Its facets keep their
   presentation colours; only the tile and the brackets come from here. */
.mark-tile {
  fill: #160f2c;
}

.mark-bracket {
  stroke: #ede7ff;
}

/* Landing page: a deep-ink panel, the icon's colours, in both modes */

.hero {
  padding-top: 1.5rem;
}

.hero-panel {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: 3rem 1.25rem 2.5rem;
  border: 1px solid var(--ink-edge);
  border-radius: 2rem;
  background:
    radial-gradient(ellipse 50rem 22rem at 50% 0%, var(--ink-glow), transparent 70%),
    linear-gradient(180deg, var(--ink-top), var(--ink-bottom));
  box-shadow: var(--shadow);
  color: var(--on-ink);
  text-align: center;
}

@media (min-width: 48rem) {
  .hero-panel {
    grid-template-columns: 1fr 14rem;
    padding: 3.5rem 3rem 3rem;
    text-align: left;
  }
}

.hero-panel h1,
.hero-panel .lede,
.hero-panel .promise,
.hero-panel .hero-note {
  max-width: 34rem;
  margin-inline: auto;
}

@media (min-width: 48rem) {
  .hero-panel h1,
  .hero-panel .lede,
  .hero-panel .promise,
  .hero-panel .hero-note {
    margin-inline: 0;
  }
}

/* The card in the viewfinder: a blank card (63:88) with the brackets locked on it and one holo band across it. No
   card art and no game marks (art-direction.md › Imagery). Decorative: aria-hidden in the page. */
.hero-card {
  width: 10rem;
  margin: 0 auto;
}

@media (min-width: 48rem) {
  .hero-card {
    width: 13rem;
    grid-column: 2;
    grid-row: 1;
  }
}

.hero-card svg {
  display: block;
  width: 100%;
  height: auto;
}

.card-face {
  fill: #2a1d4a;
  stroke: #4a3780;
}

.card-window {
  fill: #1b1330;
}

.card-line {
  fill: #4a3780;
}

.card-bracket {
  stroke: var(--bracket);
}

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--on-ink-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-panel .lede {
  color: var(--on-ink-secondary);
  font-size: 1.15em;
}

.hero-panel .promise {
  margin-block: 1.5rem 1.75rem;
  color: var(--gem-light);
  font-size: clamp(1.2rem, 1.1rem + 0.6vw, 1.45rem);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}

.hero-panel .hero-note {
  color: var(--on-ink-secondary);
  font-size: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.section {
  padding-block: 1rem;
}

.section-title {
  text-align: center;
}

.section-intro {
  max-width: 36rem;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
  text-align: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.cards > li {
  margin-top: 0;
}

.card {
  padding: 1.25rem 1.4rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
}

.card h3 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.15rem;
}

.card-pro {
  border-color: var(--accent);
  background: var(--amethyst-muted);
  color: var(--text);
}

.card-pro .fineprint {
  color: var(--text);
}

/* A drawn check mark, so screen readers don't announce a symbol. */
.ticks {
  padding-left: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 1.75rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.3em;
  width: 0.4rem;
  height: 0.75rem;
  border: solid var(--tick);
  border-width: 0 0.16rem 0.16rem 0;
  transform: rotate(45deg);
}

.disclaimer {
  max-width: 40rem;
  margin: 2.5rem auto 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
}

/* Policy pages */

.doc-meta {
  color: var(--text-secondary);
}

.summary {
  margin: 2rem 0;
  padding: 1.4rem 1.5rem 0.6rem;
  border-radius: var(--radius);
  background: var(--amethyst-muted);
}

.summary h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.toc {
  margin: 2rem 0 1rem;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
}

.toc h2 {
  margin: 0 0 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
}

.toc li {
  margin-top: 0.15rem;
}

.facts dt {
  margin-top: 1rem;
  font-weight: 650;
}

.facts dd {
  margin: 0.15rem 0 0;
}

.note {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
}

.note > :last-child {
  margin-bottom: 0;
}

.lines {
  padding: 0;
  list-style: none;
}

.lines li {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface);
}

.email {
  font-weight: 600;
}

/* Japanese pages: a little more line height, and no forced balance on headings that break between kana. */
:lang(ja) body {
  line-height: 1.75;
}

:lang(ja) h1,
:lang(ja) h2,
:lang(ja) h3 {
  letter-spacing: 0;
  line-break: strict;
}

/* Printing a policy */

@media print {
  .skip,
  .site-header nav,
  .site-footer nav {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .summary,
  .note,
  .card {
    border: 1px solid #999999;
    background: none;
  }
}
