/* Leopard Gecko: Survival, the public site. Colours and type follow the game (Docs/STYLE.md, UI/UITheme.swift):
   the night by default, and a field-guide page when the device is in light mode. System fonts only. */

:root {
  color-scheme: dark light;
  --bg: #0a0b15;
  --bg-top: #12142a;
  --surface: #15172a;
  --stroke: rgba(255, 255, 255, 0.09);
  --separator: rgba(255, 255, 255, 0.08);
  --text: #f3e9d6;
  --text-dim: #c2b6a0;
  --text-faint: #8e8572;
  --accent: #f4b83e;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Every pair here keeps at least 4.5:1 against all three backgrounds. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f0e4;
    --bg-top: #efe6d3;
    --surface: #fffcf5;
    --stroke: rgba(21, 23, 42, 0.12);
    --separator: rgba(21, 23, 42, 0.1);
    --text: #15172a;
    --text-dim: #4a4538;
    --text-faint: #655d4c;
    --accent: #8a5300;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg) linear-gradient(var(--bg-top), var(--bg) 36rem) no-repeat;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 16px 48px;
}

@media (min-width: 700px) {
  .wrap { padding: 0 24px 64px; }
}

/* Links */

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

a:hover { text-decoration-thickness: 2px; }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  padding-top: 12px;
  border-bottom: 1px solid var(--separator);
}

.brand {
  padding: 10px 0;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 24px;
}

/* The home page has no brand link: its wordmark is the page. */
.site-header-nav-only { justify-content: flex-end; }

.site-nav a {
  display: inline-block;
  padding: 10px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
}

.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); }

/* Type */

h1, h2, h3 { color: var(--text); }

h1 {
  margin: 48px 0 4px;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  margin: 40px 0 8px;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
}

h3 {
  margin: 32px 0 4px;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

p { margin: 0 0 16px; }

strong { color: var(--text); font-weight: 600; }

ul {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

li { margin-bottom: 8px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  color: var(--text);
}

.meta {
  margin-bottom: 32px;
  font-size: 0.9375rem;
  color: var(--text-faint);
}

/* A panel: one level of box, as in the game. */

.panel {
  margin: 0 0 24px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 16px;
}

@media (min-width: 700px) {
  .panel { padding: 16px 24px; }
}

.panel h2 { margin-top: 0; }
.panel p:last-child { margin-bottom: 0; }

.email {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Home page */

.hero { padding-top: 48px; }

.app-icon {
  display: block;
  width: 88px;
  height: 88px;
  margin-bottom: 24px;
  border-radius: 20px;
}

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 9vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
}

.wordmark .survival {
  display: block;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.27em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Read by screen readers only: the colon between the two lines of the wordmark. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.place {
  margin: 12px 0 32px;
  font-size: 0.9375rem;
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--text);
}

.facts {
  margin: 32px 0;
  padding: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 4px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--separator);
}

.facts div:last-child { border-bottom: 1px solid var(--separator); }

.facts dt {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.facts dd { margin: 0; }

@media (max-width: 480px) {
  .facts div { grid-template-columns: 1fr; }
}

.links {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

@media (min-width: 600px) {
  .links { grid-template-columns: 1fr 1fr; }
}

.links .panel { margin: 0; }

.links h2 {
  margin: 0 0 4px;
  font-size: 1.0625rem;
}

.links h2 a {
  color: var(--text);
  text-decoration: none;
}

.links h2 a:hover { text-decoration: underline; }

.links p { font-size: 0.9375rem; }

/* Footer */

.site-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--separator);
  font-size: 0.875rem;
  color: var(--text-faint);
}

.site-footer p { margin: 0; }
.site-footer a { color: inherit; }
