/* Self-hosted (latin subset, from Google Fonts; licenses in fonts/), so
   the pond doesn't wait on a third-party stylesheet to start. */
@font-face {
  font-family: "Fjalla One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/fjalla-one-400.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/lato-300.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lato-400.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/lato-700.woff2") format("woff2");
}

:root {
  --paper: #f7f5f0;
  --ink: #141414;
  --muted: #b8b5ae;
  --mid: #666;
  --accent: #ffb82b;
  --water: #2a6f97;
  --bar: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f0f10;
    --ink: #f1eee6;
    --muted: #5d5b57;
    --mid: #a8a49b;
    --water: #0f3149;
  }
}

@media (max-width: 600px) {
  :root {
    --bar: 4px;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Lato", sans-serif;
  font-weight: 300;
}

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1,
h2 {
  font-family: "Fjalla One", sans-serif;
  font-weight: 400;
  margin: 0;
}

/* Header */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 1rem 2rem;
}

.title {
  display: flex;
  align-items: baseline;
}

.word-one {
  font-size: 2.5rem;
}

.word-two {
  font-size: 1.5rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  overflow: auto;
  padding: 1rem 0;
}

.nav a {
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.5s;
}

.nav a:hover,
.nav a.current {
  color: var(--mid);
}

.nav a.current {
  border-bottom: 2px solid var(--accent);
}

/* Links */

.content {
  display: flex;
  padding: 5vw;
}

.main-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
  font-size: 4rem;
  font-family: "Fjalla One", sans-serif;
}

.main-links a {
  position: relative;
  z-index: 0;
}

.main-links a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 100%;
  height: var(--bar);
  background-color: var(--accent);
  z-index: -1;
  transition: all 0.3s ease-in-out;
}

.main-links a:hover::before,
.main-links a:focus-visible::before {
  bottom: 0;
  height: 100%;
}

@media (max-width: 600px) {
  .main-links {
    font-size: 2rem;
  }
}

/* When the GPU effect is running it draws all of the text, underlines and
   hover states itself; the DOM stays for layout, hit-testing and a11y. */

html.fx-on,
html.fx-on body {
  background: var(--water);
}

html.fx-on .page,
html.fx-on .nav a {
  color: transparent;
}

html.fx-on .nav a.current {
  border-bottom-color: transparent;
}

html.fx-on .main-links a::before {
  visibility: hidden;
}

html.fx-on ::selection {
  background: rgba(255, 184, 43, 0.35);
}

/* Dev menu */

.dev-menu {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--mid);
}

.dev-menu label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.dev-menu input {
  accent-color: var(--accent);
  margin: 0;
}

.dev-menu label:has(input:disabled) {
  opacity: 0.45;
  cursor: default;
}

.dev-menu a {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
}

.dev-fps {
  font-variant-numeric: tabular-nums;
  min-width: 3.5em;
  color: var(--ink);
}

/* /pond: just a small fps meter; clicking it hides it. A faint frosted
   tint of the water with pale text, so it sits in the pond. */
.dev-mini {
  right: 0.25rem;
  bottom: 0.25rem;
  padding: 0.2rem 0.45rem;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}

.dev-mini .dev-fps {
  min-width: 0;
  color: rgba(239, 233, 218, 0.6);
}

/* ?debug overlays the DOM text so glyph alignment can be checked. */
html.fx-debug.fx-on .page,
html.fx-debug.fx-on .nav a {
  color: rgba(255, 0, 80, 0.45);
}
