/*
  Shared base for catosaur.xyz, mods.catosaur.xyz and asciicity.catosaur.xyz.
  Each subdomain has its own document root, so this file is copied into
  site/, mods/ and asciicity/ before upload. Edit it here, then run
  scripts/sync-shared.ps1.
*/

@font-face {
  font-family: "Minecraft";
  src: url("assets/fonts/Minecraft.otf") format("opentype");
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Dark pink system: wine-black base, deep pink band, hot pink accent. */
  --bg: #140910;
  --surface: #22101a;
  --surface-2: #2e1522;
  --band: #7a1747;
  --pink: #ff85be;
  --ink: #1a0711;
  --tile: #f6d3e4;
  --line: #a45c80;
  --text: #fbeaf2;
  --muted: #d9b3c6;

  --font-pixel: "Minecraft", ui-monospace, monospace;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-code: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --gutter: 16px;
  --max: 1120px;
  --step: 4px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--font-pixel);
  font-weight: normal;
  line-height: 1.15;
  margin: 0;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.5vw, 4rem);
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
}

p {
  margin: 0;
}

a {
  color: var(--pink);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

pre {
  margin: 0;
  background: var(--surface-2);
  border: 2px solid var(--line);
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  overflow-wrap: normal;
}

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--pink);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 600;
}

.skip-link:focus {
  top: 8px;
}

/* Header: the deep pink band is the page's "dark pink" signature. */
.band {
  background: var(--band);
}

.band .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 10px;
}

.wordmark {
  font-family: var(--font-pixel);
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.wordmark span {
  color: var(--pink);
}

.wordmark:hover {
  text-decoration: underline;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  text-decoration: underline;
}

.band :focus-visible {
  outline-color: var(--tile);
}

/* Buttons: square corners and a hard offset shadow echo the pixel type. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--pink);
  background: var(--pink);
  color: var(--ink);
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--band);
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--band);
  text-decoration: none;
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--band);
}

.btn-quiet {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.btn-quiet:hover {
  border-color: var(--pink);
  box-shadow: none;
  transform: none;
}

.btn-quiet:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.footer {
  border-top: 2px solid var(--surface-2);
  margin-top: clamp(48px, 8vw, 96px);
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding-block: 20px 28px;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
