:root {
  color-scheme: dark;

  --background: oklch(0.17 0.01 260);
  --foreground: oklch(0.94 0.01 95);
  --text: oklch(0.94 0.01 95 / 0.91);
  --muted: oklch(0.82 0.01 95);
  --primary: oklch(0.88 0.16 95);
  --border: oklch(0.34 0.02 260);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1rem, 1.25vw, 1.03rem);
  line-height: 1.72;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

.shell {
  display: grid;
  grid-template-columns: 8.75rem minmax(0, 40rem);
  column-gap: clamp(3rem, 6vw, 5rem);
  width: min(100% - 2.5rem, 60rem);
  margin-inline: auto;
  padding-block: clamp(5rem, 15vh, 8.5rem) 3rem;
}

/* The portrait is a planet with Saturn-style rings. Both rings are the same
   tilted ellipse: one sits behind the portrait, and a copy clipped to its
   lower half sits in front, so the ring wraps around the planet. The side
   margin keeps the ring's left edge in line with the text. */
.avatar {
  --ring: radial-gradient(
    closest-side,
    transparent 66%,
    oklch(0.84 0.08 85 / 0.45) 69%,
    oklch(0.76 0.09 78 / 0.7) 76%,
    oklch(0.76 0.09 78 / 0.2) 78%,
    oklch(0.82 0.07 85 / 0.5) 80%,
    oklch(0.76 0.05 80 / 0.2) 93%,
    transparent 100%
  );

  position: relative;
  isolation: isolate;
  display: block;
  inline-size: 4.6rem;
  block-size: 4.6rem;
  margin-inline: 1.5rem;
  rotate: -1.5deg;
  transition:
    rotate 180ms ease,
    translate 180ms ease;
}

.avatar::before,
.avatar::after {
  content: "";
  position: absolute;
  inset: 14% -37.5%;
  border-radius: 50%;
  background: var(--ring);
  rotate: -16deg;
  translate: 0 0.3rem;
  pointer-events: none;
}

.avatar::before {
  z-index: -1;
  clip-path: inset(0 0 50% 0);
}

.avatar::after {
  clip-path: inset(50% 0 0 0);
}

.avatar img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  border: 3px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 0 1.5rem oklch(0.88 0.16 95 / 0.12);
  object-fit: cover;
}

.avatar:hover {
  rotate: 4deg;
  translate: -1px -2px;
}

.avatar:active {
  rotate: 0deg;
  translate: 2px 2px;
}

h1 {
  margin: 0 0 clamp(4rem, 10vh, 5.8rem);
  color: var(--foreground);
  font-size: clamp(1.12rem, 1.8vw, 1.32rem);
  line-height: 1.1;
  text-transform: uppercase;
}

p {
  margin: 0;
}

p + p {
  margin-top: 1.25rem;
}

/* Bike photos fan out on hover or focus. On touch, a tap focuses the button
   and a tap anywhere else closes it. */
.tour {
  position: relative;
}

.tour button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-weight: 700;
  text-align: start;
  text-decoration: underline 2px var(--primary);
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.tour button:hover {
  color: var(--primary);
}

.peek {
  --size: 15rem;
  --spread: 7.25rem;

  position: absolute;
  bottom: 1.55em;
  left: 50%;
  inline-size: var(--size);
  block-size: var(--size);
  margin-left: calc(var(--size) / -2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

/* Bridges the gap between the link and the photos so moving the cursor
   up onto a photo never drops the hover. */
.peek::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  block-size: 0.6em;
}

.peek img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  padding: 0.4rem;
  border-radius: 0.6rem;
  background: var(--background);
  box-shadow:
    0 0 0 2px var(--border),
    0 0.9rem 2rem oklch(0 0 0 / 0.34);
  object-fit: cover;
  scale: 0.86;
  translate: 0 0.85rem;
  transition:
    rotate 420ms cubic-bezier(0.22, 1.4, 0.36, 1),
    scale 420ms cubic-bezier(0.22, 1.4, 0.36, 1),
    translate 420ms cubic-bezier(0.22, 1.4, 0.36, 1);
}

.tour:hover .peek,
.tour:focus-within .peek {
  opacity: 1;
  pointer-events: auto;
}

.tour:hover .peek img:first-child,
.tour:focus-within .peek img:first-child {
  rotate: -7deg;
  scale: 1;
  translate: calc(var(--spread) * -1) 0;
}

.tour:hover .peek img:last-child,
.tour:focus-within .peek img:last-child {
  rotate: 5deg;
  scale: 1;
  translate: var(--spread) 0;
}

.peek img:hover {
  z-index: 1;
  rotate: 0deg !important;
  scale: 1.06 !important;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: clamp(5rem, 13vh, 8rem);
  color: var(--muted);
  font-size: 0.88rem;
}

/* Padding gives each icon a 44px tap target; the negative margin keeps
   the row aligned with the text edge. */
footer nav {
  display: flex;
  margin: -0.75rem;
}

footer a {
  padding: 0.75rem;
  color: inherit;
}

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

footer svg {
  display: block;
  inline-size: 1.25rem;
  block-size: 1.25rem;
}

/* Twinkling stars, borrowed from the breathe project. Each layer is one 1px
   dot whose box-shadow list draws its stars across the viewport. Layers
   twinkle on offset timings, so no two groups fade together. */
.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.stars i {
  position: absolute;
  top: 0;
  left: 0;
  inline-size: 1px;
  block-size: 1px;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
}

.stars i:nth-child(2) {
  animation-duration: 3.4s;
  animation-delay: -0.7s;
}

.stars i:nth-child(3) {
  animation-duration: 3.8s;
  animation-delay: -1.5s;
}

.stars i:nth-child(4) {
  animation-duration: 4.2s;
  animation-delay: -2.2s;
}

.stars i:nth-child(5) {
  animation-duration: 4.6s;
  animation-delay: -3s;
}

@keyframes twinkle {
  50% {
    opacity: 0.3;
  }
}

.stars i:nth-child(1) {
  box-shadow:
    94.7vw 45.9vh 0 0.71px #fff,
    14.0vw 18.2vh 0 0.69px #fff,
    1.1vw 26.7vh 0 0.56px #fff,
    47.2vw 94.4vh 0 0.43px #fff,
    57.9vw 9.8vh 0 0.16px #fff,
    87.0vw 58.2vh 0 0.50px #fff,
    59.7vw 11.3vh 0 0.61px #fff,
    85.4vw 57.6vh 0 0.02px #fff,
    46.8vw 11.1vh 0 0.50px #fff,
    37.0vw 72.3vh 0 0.21px #fff,
    78.5vw 8.3vh 0 0.12px #fff,
    13.3vw 90.4vh 0 0.51px #fff,
    95.2vw 83.6vh 0 0.66px #fff,
    5.1vw 57.3vh 0 0.45px #fff,
    52.7vw 2.5vh 0 0.43px #fff,
    49.6vw 3.2vh 0 0.30px #fff;
}

.stars i:nth-child(2) {
  box-shadow:
    45.1vw 81.7vh 0 0.36px #fff,
    83.0vw 68.1vh 0 0.34px #fff,
    21.9vw 31.4vh 0 0.14px #fff,
    40.7vw 5.7vh 0 0.18px #fff,
    82.3vw 62.9vh 0 0.69px #fff,
    2.9vw 65.5vh 0 0.34px #fff,
    14.0vw 72.6vh 0 0.46px #fff,
    19.9vw 28.4vh 0 0.28px #fff,
    94.8vw 92.2vh 0 0.16px #fff,
    88.7vw 11.7vh 0 0.52px #fff,
    54.3vw 54.5vh 0 0.30px #fff,
    17.9vw 35.2vh 0 0.02px #fff,
    64.3vw 81.9vh 0 0.31px #fff,
    38.2vw 28.3vh 0 0.55px #fff,
    73.4vw 87.1vh 0 0.10px #fff,
    26.0vw 81.5vh 0 0.51px #fff;
}

.stars i:nth-child(3) {
  box-shadow:
    24.6vw 3.0vh 0 0.64px #fff,
    11.1vw 94.6vh 0 0.09px #fff,
    46.4vw 35.8vh 0 0.47px #fff,
    76.4vw 50.1vh 0 0.24px #fff,
    57.9vw 77.3vh 0 0.52px #fff,
    97.9vw 5.5vh 0 0.56px #fff,
    10.1vw 31.0vh 0 0.30px #fff,
    98.3vw 58.5vh 0 0.00px #fff,
    71.7vw 10.8vh 0 0.39px #fff,
    27.9vw 50.8vh 0 0.48px #fff,
    38.2vw 2.4vh 0 0.59px #fff,
    71.4vw 44.5vh 0 0.28px #fff,
    9.6vw 21.4vh 0 0.71px #fff,
    72.5vw 77.0vh 0 0.49px #fff,
    83.7vw 87.6vh 0 0.56px #fff,
    22.2vw 86.5vh 0 0.59px #fff;
}

.stars i:nth-child(4) {
  box-shadow:
    58.0vw 60.1vh 0 0.25px #fff,
    41.4vw 23.8vh 0 0.15px #fff,
    77.9vw 91.3vh 0 0.61px #fff,
    43.9vw 34.7vh 0 0.28px #fff,
    10.8vw 95.0vh 0 0.47px #fff,
    0.3vw 68.4vh 0 0.66px #fff,
    99.7vw 22.0vh 0 0.49px #fff,
    79.7vw 33.1vh 0 0.23px #fff,
    56.0vw 9.1vh 0 0.02px #fff,
    54.0vw 64.9vh 0 0.07px #fff,
    56.7vw 24.6vh 0 0.11px #fff,
    27.5vw 69.1vh 0 0.43px #fff,
    69.8vw 35.6vh 0 0.15px #fff,
    79.5vw 37.6vh 0 0.58px #fff,
    56.9vw 43.2vh 0 0.31px #fff,
    42.1vw 80.4vh 0 0.12px #fff;
}

.stars i:nth-child(5) {
  box-shadow:
    66.4vw 24.3vh 0 0.37px #fff,
    48.8vw 67.0vh 0 0.56px #fff,
    57.8vw 20.0vh 0 0.18px #fff,
    12.4vw 17.0vh 0 0.62px #fff,
    38.2vw 9.1vh 0 0.56px #fff,
    4.8vw 67.8vh 0 0.12px #fff,
    65.8vw 24.6vh 0 0.58px #fff,
    38.1vw 39.5vh 0 0.34px #fff,
    23.6vw 58.1vh 0 0.27px #fff,
    25.2vw 88.8vh 0 0.16px #fff,
    18.8vw 40.7vh 0 0.23px #fff,
    94.8vw 72.0vh 0 0.32px #fff,
    65.5vw 66.2vh 0 0.60px #fff,
    3.0vw 81.5vh 0 0.01px #fff,
    23.2vw 81.1vh 0 0.42px #fff,
    89.7vw 72.1vh 0 0.09px #fff;
}

/* The two-column layout puts the link near the right edge, so the photos
   need a tighter spread to stay on screen until the page is wide enough. */
@media (max-width: 960px) {
  .peek {
    --size: 11.5rem;
    --spread: 5.5rem;
  }
}

@media (max-width: 720px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.75rem;
    padding-block: 2.5rem 3rem;
  }

  h1 {
    margin-bottom: 2rem;
  }

  .peek {
    --size: 9.5rem;
    --spread: 4.5rem;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 3.5rem;
  }
}

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