:root {
  --deck: #dce0e5;
  --cap: #f6f7f9;
  --cap-edge: #b9c0c9;
  --ink: #1e2733;
  --muted: #5a6573;
  --accent: #1f7a70;
  --accent-cap: #1f7a70;
  --accent-legend: #f6f7f9;
  --rule: #c4cad2;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Public Sans", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --deck: #1c2127;
    --cap: #2c333b;
    --cap-edge: #12161a;
    --ink: #e7eaee;
    --muted: #a3acb7;
    --accent: #5cc2b5;
    --accent-cap: #2a8f83;
    --accent-legend: #f1f4f6;
    --rule: #39414b;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--deck);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(40rem, 100% - 2rem); margin-inline: auto; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Hero: the name as a row of keys ---------- */

.hero { padding: clamp(4rem, 14vh, 8rem) 0 clamp(2.5rem, 7vh, 4rem); text-align: center; }

.keys {
  display: inline-flex;
  gap: clamp(0.3rem, 1.2vw, 0.6rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.key {
  --size: clamp(2.5rem, 11vw, 5.5rem);
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: start;
  padding: calc(var(--size) * 0.14) calc(var(--size) * 0.18);
  background: var(--cap);
  border-radius: calc(var(--size) * 0.16);
  box-shadow:
    0 calc(var(--size) * 0.07) 0 var(--cap-edge),
    0 calc(var(--size) * 0.1) calc(var(--size) * 0.12) rgb(0 0 0 / 0.14);
  font-family: var(--display);
  font-weight: 600;
  font-size: calc(var(--size) * 0.36);
  line-height: 1;
  color: var(--ink);
  user-select: none;
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}

/* The one coloured key, like Esc or Return on a real board */
.key--accent { background: var(--accent-cap); color: var(--accent-legend); }

.key:hover,
.key.is-down {
  transform: translateY(calc(var(--size) * 0.05));
  box-shadow:
    0 calc(var(--size) * 0.02) 0 var(--cap-edge),
    0 calc(var(--size) * 0.03) calc(var(--size) * 0.05) rgb(0 0 0 / 0.12);
}

.name {
  margin: 2.25rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.25rem, 3.4vw, 1.6rem);
  letter-spacing: -0.01em;
}

/* ---------- Body copy ---------- */

main.page { padding-bottom: 4rem; }

.intro p { margin: 0 0 1.1rem; max-width: 34em; }
.intro p:first-child { font-size: 1.25rem; line-height: 1.5; }

.contact {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.contact h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
}
.contact p { margin: 0; }

/* ---------- Legal pages ---------- */

.legal { padding: 3.5rem 0 4rem; }
.legal .back {
  display: inline-block;
  margin-bottom: 2rem;
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.legal .back:hover { color: var(--accent); }
.legal h1 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.legal .updated { margin: 0 0 2rem; color: var(--muted); }
.legal h2 {
  margin: 2rem 0 0.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
}
.legal p, .legal li { max-width: 36em; }
.legal ul { padding-left: 1.2rem; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.site-footer p { margin: 0; }
.site-footer nav { margin-top: 0.75rem; display: flex; gap: 1.25rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .key { transition: none; }
}
