/* ---- Tokens ------------------------------------------------------------ */

:root {
  --bg: #fdfdfc;
  --surface: #f4f4f1;
  --text: #1c1c1a;
  --muted: #5f5f59;
  --accent: #1a56c4;
  --border: #e2e2dd;
  --moon: #f2d8a7;
  --ink: #2a2622;

  --wrap: 42rem;
  --gap: clamp(1rem, 0.6rem + 1.6vw, 1.75rem);

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.4rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.65rem + 1.75vw, 2.9rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14141a;
    --surface: #1e1e26;
    --text: #e8e8e4;
    --muted: #a0a09a;
    --accent: #86b0ff;
    --border: #2e2e38;
    --moon: #d8b26a;
    --ink: #f0ece6;
  }
}

/* ---- Base -------------------------------------------------------------- */

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

html {
  -webkit-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-body);
  font-size: var(--step-0);
  line-height: 1.65;
}

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

main.wrap {
  flex: 1;
  padding-block: clamp(2rem, 1.4rem + 2.5vw, 3.5rem);
}

/* ---- Typography -------------------------------------------------------- */

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
  margin-block: 0 0.5em;
}

h1 { font-size: var(--step-3); letter-spacing: -0.02em; }
h2 { font-size: var(--step-2); letter-spacing: -0.01em; margin-block-start: 1.6em; }
h3 { font-size: var(--step-1); margin-block-start: 1.4em; }

p,
ul,
ol {
  margin-block: 0 1.15em;
}

.lead {
  font-size: var(--step-1);
  color: var(--muted);
  text-wrap: pretty;
}

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface);
  border-radius: 4px;
  padding: 0.15em 0.4em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--gap);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

/* ---- Header / footer --------------------------------------------------- */

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

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.15rem;
}

.site-title {
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

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

.nav a {
  color: var(--muted);
  text-decoration: none;
}

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

.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.site-footer {
  border-block-start: 1px solid var(--border);
  padding-block: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

/* ---- Utilities --------------------------------------------------------- */

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
}

.skip-link:focus {
  inset-inline-start: var(--gap);
  inset-block-start: 0.5rem;
  z-index: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
}

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

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

/* ---- Home: hero -------------------------------------------------------- */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap);
  margin-block-end: 0.5rem;
}

.hero__text {
  flex: 1 1 18rem;
}

.hero h1 {
  margin-block-start: 0;
}

.coyote {
  flex: 0 0 auto;
  width: clamp(9rem, 34vw, 13rem);
  height: auto;
  overflow: visible;
}

.coyote__moon {
  fill: var(--moon);
}

.coyote__head {
  fill: var(--ink);
}

/* Eye, nostril and mouth are knocked out of the silhouette. */
.coyote__cut {
  fill: var(--bg);
}

.coyote__mouth {
  fill: none;
  stroke: var(--bg);
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---- Home: app cards --------------------------------------------------- */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--gap);
  list-style: none;
  margin: 0 0 2em;
  padding: 0;
}

.app {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: var(--gap);
}

.app__badge {
  display: inline-block;
  margin: 0 0 0.75em;
  padding: 0.15em 0.6em;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app__name {
  margin-block: 0 0.35em;
  font-size: var(--step-1);
}

.app__desc {
  margin: 0;
  color: var(--muted);
}

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