@font-face {
  font-family: "JetBrains Mono";
  src: url("/jetbrainsmono-subset.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Light only, on purpose: one calm surface for every visitor. */
  color-scheme: light;
  --bg: #f7f7f5;
  --fg: #16161a;
  --muted: #5a5a62;
  --hairline: #e7e7e2;
  --accent: #5b53e0;

  --blob-1: #8189c9;  /* muted indigo */
  --blob-2: #9b8ac4;  /* muted violet */
  --blob-3: #7fa9b5;  /* muted teal   */
  /* The whole wash reads as a faint tint; raise this if you want more colour. */
  --blob-opacity: 0.09;
  --blob-blur: 72px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;      /* fallback for browsers without dvh */
  min-height: 100dvh;     /* excludes collapsing mobile browser chrome */
  display: grid;
  place-items: center;
  padding:
    max(2rem, env(safe-area-inset-top))
    max(1.25rem, env(safe-area-inset-right))
    max(2rem, env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Drifting colour wash behind the content. Fixed, so it is out of grid flow. */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Thin the wash out behind the centre so the type never sits on heavy colour. */
  -webkit-mask-image: radial-gradient(ellipse 62% 48% at 50% 45%, rgba(0, 0, 0, 0.25), #000 72%);
  mask-image: radial-gradient(ellipse 62% 48% at 50% 45%, rgba(0, 0, 0, 0.25), #000 72%);
}

.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(var(--blob-blur));
  opacity: var(--blob-opacity);
  will-change: transform;
}

.aurora span:nth-child(1) {
  width: 55vmax;
  height: 55vmax;
  top: -18vmax;
  left: -14vmax;
  background: var(--blob-1);
}

.aurora span:nth-child(2) {
  width: 48vmax;
  height: 48vmax;
  right: -16vmax;
  bottom: -18vmax;
  background: var(--blob-2);
}

.aurora span:nth-child(3) {
  width: 34vmax;
  height: 34vmax;
  top: 42%;
  right: 12%;
  background: var(--blob-3);
}

main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 8vh, 3.5rem);
  /* Centering sizes this to max-content; cap it so children can actually wrap. */
  max-width: 100%;
}

.name {
  margin: 0;
  max-width: 100%;
  font-size: clamp(1.6rem, 7.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-align: center;
  text-wrap: balance;
  /* Only bites past ~300% zoom, where breaking the name beats a horizontal scrollbar. */
  overflow-wrap: anywhere;
}

.links {
  display: flex;
  align-items: stretch;
  justify-content: center;
  /* Never overflows: below ~320px the three would wrap rather than scroll. */
  flex-wrap: wrap;
  gap: clamp(0.125rem, 1vw, 0.5rem);
}

.links a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 48px;
  /* Padding and type scale with the viewport so all three hold one row on a phone. */
  padding: 0.75rem clamp(0.4rem, 2.2vw, 1rem);
  border-radius: 10px;
  color: var(--muted);
  font-size: clamp(0.8rem, 1.9vw + 0.36rem, 0.95rem);
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.links svg {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
}

.links a:hover,
.links a:focus-visible {
  color: var(--accent);
  background-color: var(--hairline);
}

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

@media (prefers-reduced-motion: no-preference) {
  .name,
  .links a {
    animation: rise 0.4s cubic-bezier(0.2, 0.6, 0.3, 1) both;
  }

  .links a:nth-child(1) { animation-delay: 0.08s; }
  .links a:nth-child(2) { animation-delay: 0.14s; }
  .links a:nth-child(3) { animation-delay: 0.20s; }

  @keyframes rise {
    from {
      opacity: 0;
      translate: 0 8px;
    }
  }

  /* Long, offset loops so the blobs never visibly sync up. */
  .aurora span:nth-child(1) { animation: drift-a 26s ease-in-out infinite; }
  .aurora span:nth-child(2) { animation: drift-b 32s ease-in-out infinite; }
  .aurora span:nth-child(3) { animation: drift-c 22s ease-in-out infinite; }

  @keyframes drift-a {
    0%, 100% { translate: 0 0;        scale: 1;    }
    50%      { translate: 9vw 7vh;    scale: 1.15; }
  }

  @keyframes drift-b {
    0%, 100% { translate: 0 0;        scale: 1.1;  }
    50%      { translate: -8vw -6vh;  scale: 0.95; }
  }

  @keyframes drift-c {
    0%, 100% { translate: 0 0;        scale: 0.95; }
    50%      { translate: -6vw 8vh;   scale: 1.2;  }
  }
}
