@font-face {
  font-family: "Geist Mono";
  src: url("GeistMono-Regular.woff2") format("woff2");
  font-display: swap;
}

/* Colours used across the page */
:root {
  color-scheme: dark;
  --background: #050505;
  --text: #fafafa;
  --subtle: #a3a3a3;
  --muted: #787878;
  --accent: #22d3ee;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--background);
  color: var(--text);
  font: 1rem/1.5 "Geist Mono", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgb(34 211 238 / 22%);
}

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

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

/* Hidden until a keyboard user presses Tab */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  padding: 8px 12px;
  transform: translateY(-200%);
  background: var(--text);
  color: var(--background);
}

.skip-link:focus {
  transform: none;
}

/* Centre everything on the screen */
main {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding-inline: 1.5rem;
}

.column {
  width: 100%;
  max-width: 20rem;
}

/* Faint cyan circle behind the content */
.glow {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.03;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Name */
header {
  margin-bottom: 4rem;
}

h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.75rem;
}

header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Main links */
.links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a,
.empty {
  display: flex;
  min-height: 3rem;
  align-items: center;
  padding: 0.75rem 0;
}

.links a {
  position: relative;
  justify-content: space-between;
  color: var(--subtle);
  transition: color 200ms var(--ease);
}

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

.arrow {
  color: var(--muted);
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease), color 200ms var(--ease);
}

/* Cyan underline that grows on hover */
.links a::after {
  position: absolute;
  bottom: 0.5rem;
  left: 0;
  width: 0;
  height: 1px;
  background: rgb(34 211 238 / 40%);
  content: "";
  transition: width 300ms cubic-bezier(0, 0, 0.2, 1);
}

.links a:hover,
.links a:focus-visible,
.links a:hover .arrow,
.links a:focus-visible .arrow {
  color: var(--text);
}

.links a:hover .arrow,
.links a:focus-visible .arrow {
  opacity: 1;
  transform: translateX(0.125rem);
}

.links a:hover::after,
.links a:focus-visible::after {
  width: 100%;
}

/* Date shown next to a post title */
.date {
  color: var(--muted);
  font-size: 0.875rem;
}

/* A single post: wider column for reading */
.post {
  max-width: 36rem;
  padding-block: 6rem;
}

.post h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 400;
}

.post article {
  margin-top: 2rem;
  color: var(--subtle);
  line-height: 1.75;
}

.post article a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgb(34 211 238 / 40%);
  text-underline-offset: 0.25rem;
}

/* Social links */
footer {
  display: flex;
  gap: 1.25rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(250 250 250 / 5%);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  line-height: 1.25rem;
}

footer a {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  color: var(--muted);
  transition: color 200ms var(--ease);
}

footer a:hover {
  color: var(--text);
}

/* Fade-in when the page loads, staggered top to bottom */
.enter {
  animation: fade-in-up 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.links li:nth-child(1) { animation-delay: 50ms; }
.links li:nth-child(2) { animation-delay: 100ms; }
.links li:nth-child(3) { animation-delay: 150ms; }
footer.enter { animation-delay: 250ms; }

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
