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

:root {
  /* Spacing scale: 16 / 24 / 32 px */
  --space-1: 1rem;
  --space-2: 1.5rem;
  --space-3: 2rem;
  --radius-button: 8px;
  --border-button: 2px;
  --shadow-lift: 3px;
  --shadow-lift-hover: 4px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(var(--space-2), env(safe-area-inset-top)) max(var(--space-2), env(safe-area-inset-right))
    max(var(--space-2), env(safe-area-inset-bottom)) max(var(--space-2), env(safe-area-inset-left));
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  color: #2c2c2c;
  background: #f2f1ed;
}

.page {
  width: 100%;
  max-width: 36rem;
  text-align: center;
  padding: var(--space-2) var(--space-1);
}

@media (min-width: 601px) {
  .page {
    padding: var(--space-2);
  }
}

h1 {
  margin: 0 0 var(--space-2);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.bio {
  margin: 0 0 var(--space-3);
  color: #3d3d3d;
  font-size: 0.95rem;
  line-height: 1.78;
}

.bio p {
  margin: 0;
}

.bio p + p {
  margin-top: var(--space-2);
  color: #5a5a5a;
}

.bio p:first-of-type {
  color: #3d3d3d;
  font-weight: 500;
}

.link-groups {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.link-group {
  margin: 0;
}

.link-group:not(:first-child) {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(26, 26, 26, 0.1);
}

.links-heading {
  margin: 0 0 var(--space-1);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(0.72rem, 2.5vw, 0.8125rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #3d3d3d;
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: center;
}

.links li {
  display: flex;
  align-items: center;
}

@media (max-width: 600px) {
  .links {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
  }

  .links li {
    width: 100%;
  }

  .link {
    width: 100%;
  }
}

.link {
  --link-shadow-color: #1a1a1a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius-button);
  border: var(--border-button) solid;
  box-shadow: var(--shadow-lift) var(--shadow-lift) 0 var(--link-shadow-color);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.link:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lift-hover) var(--shadow-lift-hover) 0 var(--link-shadow-color);
}

@media (prefers-reduced-motion: reduce) {
  .link {
    transition: background 0.12s ease, box-shadow 0.12s ease;
  }

  .link:hover {
    transform: none;
  }
}

.link:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  :root {
    --border-button: 1.5px;
    --shadow-lift: 2px;
    --shadow-lift-hover: 3px;
  }

  .page {
    padding: var(--space-3) var(--space-1);
  }
}

.link--linkedin {
  color: #fff;
  background: #0a66c2;
  border-color: #004182;
  --link-shadow-color: #004182;
}

.link--linkedin:hover {
  background: #0966c2;
}

.link--github {
  color: #fff;
  background: #2d333b;
  border-color: #1a1e24;
  --link-shadow-color: #1a1e24;
}

.link--github:hover {
  background: #3d444d;
}

.link--goodreads {
  color: #fff;
  background: #5c4533;
  border-color: #3d2f23;
  --link-shadow-color: #3d2f23;
}

.link--goodreads:hover {
  background: #6d5240;
}

.link--letterboxd {
  color: #fff;
  background: #e07020;
  border-color: #8c4510;
  --link-shadow-color: #8c4510;
}

.link--letterboxd:hover {
  background: #ea7a2a;
}

.link--email {
  color: #fff;
  background: #3d4a5c;
  border-color: #2a3440;
  --link-shadow-color: #2a3440;
}

.link--email:hover {
  background: #4a586e;
}

::selection {
  background: #c4d4f0;
  color: #1a1a1a;
}
