/* Konstantin Mnemo — site styles. One file, no build step. */

/* Fonts: IBM Plex, self-hosted (SIL Open Font License, see fonts/OFL.txt). */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* A black page with white words, the hero on a charcoal wash (see .hero).
     The accent is Devour's burgundy lifted for a dark ground: rose for words, claret for fills. */
  --bg: #000000;
  --surface: #141313;
  --text: #FFFFFF;
  --muted: #A8A2A4;      /* 8.4:1 on --bg, 7.4:1 on --surface */
  --line: #262424;
  --line-strong: #3A3637;
  --accent: #CE8496;     /* 7.4:1 on --bg */
  --accent-hover: #E4A9B7;
  --accent-tint: #2E1A1F;
  --accent-fill: #A04E61;
  --accent-fill-hover: #8E4355;
  --on-accent: #FBF6EC;  /* 5.2:1 on --accent-fill */

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max: 1120px;
  --gutter: 16px;
  --radius: 8px;

  color-scheme: dark;
}

@media (min-width: 640px) {
  :root { --gutter: 32px; }
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p { margin: 0; }

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

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

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

code {
  font-family: var(--mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--accent-fill);
  color: var(--on-accent);
  border-radius: 6px;
  font-weight: 500;
}

.skip-link:focus { top: 12px; color: var(--on-accent); }

/* Small mono label used above headings and in metadata */
.label {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Header */

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

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  padding-block: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

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

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

@media (min-width: 720px) {
  .nav-list { margin: 0 -10px 0 0; }
}

.nav-list a {
  display: inline-block;
  padding: 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-decoration: none;
}

.nav-list a:hover {
  background: var(--accent-tint);
  color: var(--accent-hover);
}

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

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--accent-fill);
  border-radius: 6px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 500;
  text-decoration: none;
}

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

.button-quiet {
  background: transparent;
  color: var(--accent);
}

.button-quiet:hover {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* Home: hero, on a wash a step above the black page */

.hero {
  /* A charcoal wash under the black page, as the app's desk is at night. */
  --wash: #161415;
  padding-block: 64px 72px;
  background: var(--wash);
  /* A hexagonal halftone fading from the top-right corner, as Benday's dots do. Drawn by
     ~/KonstantinMnemo-website-tools/hexes.py (kept outside the site so it isn't published):
     hexes.svg with --more --lit=none, hexes-small.svg with --lit=none. */
  background: url("hexes.svg") right top / 1040px auto no-repeat, var(--wash);
}

@media (max-width: 639px) {
  /* On a phone only the corner shows: the smaller field, at a size that stays above the text. */
  .hero { background-image: url("hexes-small.svg"); background-size: 440px auto; }
}

.hero + .section { border-top: 0; }

.hero h1 {
  max-width: 17ch;
  font-size: clamp(2.125rem, 1.45rem + 3.4vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lede {
  max-width: 46ch;
  margin-top: 24px;
  color: var(--muted);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.55;
}

@media (min-width: 860px) {
  .hero { padding-block: 120px 112px; }
}

/* Home: sections */

.section {
  border-top: 1px solid var(--line);
  padding-block: 56px;
}

@media (min-width: 860px) {
  .section { padding-block: 96px; }
}

.section-grid {
  display: grid;
  gap: 24px 48px;
}

@media (min-width: 860px) {
  .section-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); }
}

.section-head h2 { font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.125rem); }

/* The short lines beside a section's heading run the column's width, as the cards and tables
   under them do, and wrap without leaving a word alone on the last line. */
.section-intro {
  margin-bottom: 32px;
  text-wrap: pretty;
  color: var(--muted);
}

.text-block > * + * { margin-top: 16px; }
.text-block p { text-wrap: pretty; }

/* App cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.card h3 { font-size: 1.25rem; }

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
  font-size: 0.9375rem;
}

.card-meta a {
  display: inline-block;
  padding-block: 6px;
}

.card-play { font-weight: 500; }

.status {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.empty { color: var(--muted); }

/* Definition lists: business details, contact */

.facts {
  margin: 0;
  border-top: 1px solid var(--line);
}

.facts > div {
  display: grid;
  gap: 2px 24px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 640px) {
  .facts > div { grid-template-columns: 13rem minmax(0, 1fr); }
}

.facts dt {
  padding-top: 0.2em;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.facts dd { margin: 0; }

.subhead {
  margin: 40px 0 16px;
  font-size: 1.125rem;
}

.contact-main {
  font-size: 1.1875rem;
  font-weight: 500;
}

/* Legal pages */

.page-head { padding-block: 56px 40px; }

.page-head h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
  letter-spacing: -0.02em;
}

.page-meta {
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.legal {
  display: grid;
  gap: 40px 64px;
  padding-bottom: 96px;
}

@media (min-width: 960px) {
  .legal { grid-template-columns: 15rem minmax(0, 1fr); }
  .toc {
    position: sticky;
    top: 24px;
    align-self: start;
  }
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  padding: 6px 0 6px 16px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.prose { max-width: 68ch; }

.prose h2 {
  margin: 56px 0 16px;
  font-size: 1.5rem;
}

.prose > h2:first-child,
.prose > section:first-child > h2 { margin-top: 0; }

.prose h3 {
  margin: 32px 0 8px;
  font-size: 1.125rem;
}

.prose p,
.prose ul,
.prose ol { margin: 0 0 16px; }

.prose ul,
.prose ol { padding-left: 1.25rem; }

.prose li + li { margin-top: 6px; }

.note {
  margin-bottom: 40px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

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

.note .label { margin-bottom: 8px; }

.table-scroll {
  overflow-x: auto;
  margin: 0 0 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

caption {
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: left;
}

th,
td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th[scope="col"] {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td code { display: block; margin-top: 2px; color: var(--muted); }

/* 404 */

.not-found {
  padding-block: 96px 120px;
}

.not-found h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
  letter-spacing: -0.02em;
}

/* Spaced as the home page's hero: the words 24px under the heading, the buttons 40px under them (.actions). */
.not-found p:not(.label):not(.actions) { margin-top: 24px; max-width: 50ch; color: var(--muted); }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 48px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer-inner {
  display: grid;
  gap: 24px 48px;
}

@media (min-width: 860px) {
  .footer-inner { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}

.footer-legal p + p { margin-top: 4px; }

.footer-name {
  color: var(--text);
  font-weight: 600;
}

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

@media (min-width: 860px) {
  .footer-nav ul { justify-content: flex-end; }
}

.footer-nav a {
  display: inline-block;
  padding-block: 6px;
}

.copyright {
  grid-column: 1 / -1;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8125rem;
}
