:root {
  color-scheme: dark;
  --bg: #01040f;
  --ink: #7dd3fc;
  --ink-strong: #38bdf8;
  --ink-soft: #0ea5e9;
  --link: #ffffff;
  --muted: #93c5fd;
  --signal: #38bdf8;
  --spotify: #1ed760;
  --spotify-dim: #116b3a;
  --warning: #fbbf24;
  --panel: #04111f;
  --skin: #f1c7a8;
  --beard: #171717;
  --selection-bg: #7dd3fc;
  --selection-ink: #020617;
  --measure: 700px;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-color: #0ea5e9 #020817;
  scrollbar-width: thin;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #020817;
  border-left: 1px solid rgba(125, 211, 252, 0.14);
}

::-webkit-scrollbar-thumb {
  min-height: 48px;
  border: 3px solid #020817;
  border-radius: 999px;
  background: #0ea5e9;
  box-shadow:
    inset 0 0 0 1px rgba(248, 250, 252, 0.24),
    0 0 12px rgba(56, 189, 248, 0.22);
}

::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-corner {
  background: #020817;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-ink);
}

.page {
  width: min(100% - 2rem, var(--measure));
  margin: 2rem auto;
  padding: 1rem 0 3rem;
}

.identity {
  padding-top: 0.5rem;
}

.identity-grid {
  display: grid;
  grid-template-columns: [avatar] 232px [spotify] minmax(260px, 1fr);
  grid-template-areas:
    "avatar spotify"
    "copy copy";
  gap: 1.2rem 1.4rem;
  align-items: center;
}

.identity-avatar {
  grid-area: avatar;
  display: grid;
  width: 232px;
  height: 224px;
  place-items: end center;
}

.identity-copy {
  grid-area: copy;
}

.avatar {
  --avatar-size: 220px;
  --avatar-frame-size: 224px;
  --eye-x: 0px;
  --eye-y: 0px;
  position: relative;
  isolation: isolate;
  display: block;
  width: var(--avatar-size);
  height: var(--avatar-size);
  margin: 0;
  cursor: crosshair;
  outline: none;
}

.avatar:focus-visible {
  filter: drop-shadow(0 0 18px rgba(125, 211, 252, 0.6));
}

.avatar--pixel::before {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 0;
  width: var(--avatar-frame-size);
  height: var(--avatar-frame-size);
  border: 2px solid rgba(125, 211, 252, 0.16);
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(14, 165, 233, 0.08),
    0 0 24px rgba(14, 165, 233, 0.08);
  content: "";
  transform: translateX(-50%);
}

.avatar-portrait {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.28));
}

.avatar-eye-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.avatar-eye {
  --pupil-size: 5px;
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85) 0 1.3px, transparent 1.6px),
    radial-gradient(ellipse at 50% 52%, rgba(248, 250, 252, 0.82) 0 58%, rgba(226, 232, 240, 0.5) 72%, transparent 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 1px rgba(15, 23, 42, 0.18);
  transform-origin: center;
  transition:
    transform 120ms ease,
    background 120ms ease;
}

.avatar-eye::after {
  position: absolute;
  left: calc(50% - var(--pupil-size) / 2);
  top: calc(50% - var(--pupil-size) / 2);
  width: var(--pupil-size);
  height: var(--pupil-size);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 32%, rgba(248, 250, 252, 0.95) 0 1px, transparent 1.2px),
    #020617;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.7);
  content: "";
  transform: translate(var(--eye-x), var(--eye-y));
  transform-origin: center;
  transition:
    opacity 120ms ease,
    transform 80ms ease;
}

.avatar-eye-left {
  left: 26.05%;
  top: 38.65%;
  width: 8.7%;
  height: 5.4%;
}

.avatar-eye-right {
  left: 41.65%;
  top: 38.65%;
  width: 9.8%;
  height: 5.6%;
}

.avatar.is-blinking .avatar-eye {
  background: #020617;
  transform: scaleY(0.16);
}

.avatar.is-blinking .avatar-eye::after {
  opacity: 0;
}

h1,
h2,
h3,
p,
ul {
  margin: 1rem 0;
}

h1 {
  color: var(--ink-strong);
  font-size: 2rem;
  line-height: 1.2;
}

h2 {
  margin-top: 3rem;
  color: var(--ink-strong);
  font-size: 1rem;
  line-height: 1.35;
}

h2 [data-section-flash-target] {
  display: inline-block;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

a:hover,
a:focus-visible {
  color: var(--selection-ink);
  background: var(--link);
  outline: 0;
  text-decoration: none;
}

ul {
  padding-left: 2.4rem;
}

li {
  margin: 0.4rem 0;
}

.intro {
  color: var(--link);
}

.line,
li span,
p span {
  color: var(--muted);
}

.statement {
  margin: 1.8rem 0;
  color: var(--ink-soft);
  text-align: center;
}

.section-flash {
  animation: sectionFlash 820ms steps(1, end);
}

@keyframes sectionFlash {
  0%,
  32%,
  64% {
    background: var(--signal);
    color: var(--selection-ink);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.24);
  }

  16%,
  48%,
  80%,
  100% {
    background: transparent;
    color: var(--ink-strong);
    box-shadow: none;
  }
}

.spotify {
  position: relative;
  grid-area: spotify;
  min-height: 176px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-radius: 8px;
  background: #031120;
  box-shadow:
    0 0 0 1px rgba(30, 215, 96, 0.08),
    0 20px 38px rgba(0, 0, 0, 0.28);
  padding: 1rem;
}

.spotify::before {
  position: absolute;
  inset: 0;
  background: rgba(125, 211, 252, 0.035);
  content: "";
  pointer-events: none;
}

.spotify-artwork,
.spotify-copy {
  position: relative;
  z-index: 1;
}

.spotify {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
}

.spotify-artwork {
  width: 82px;
  aspect-ratio: 1;
  border: 1px solid rgba(30, 215, 96, 0.35);
  border-radius: 8px;
  background: radial-gradient(circle, rgba(30, 215, 96, 0.22), rgba(2, 6, 23, 0.92) 64%);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.12);
}

.spotify-artwork img,
.spotify-record {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border-radius: 6px;
}

.spotify-artwork img {
  display: block;
  object-fit: cover;
}

.spotify-artwork img[hidden] {
  display: none;
}

.spotify-artwork:has(img:not([hidden])) .spotify-record {
  display: none;
}

.spotify-record {
  border: 1px solid rgba(125, 211, 252, 0.34);
  background:
    radial-gradient(circle at center, #020617 0 8px, rgba(30, 215, 96, 0.75) 8px 11px, #020617 11px 15px, rgba(125, 211, 252, 0.16) 15px 16px, transparent 17px),
    repeating-radial-gradient(circle, rgba(125, 211, 252, 0.16) 0 1px, transparent 1px 6px);
}

.spotify-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.spotify h2 {
  margin: 0;
}

.spotify-track {
  margin: 0.45rem 0 0.15rem;
  color: var(--link);
  font-size: 1.05rem;
  line-height: 1.25;
}

.spotify-artists {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
}

.spotify-progress {
  height: 4px;
  margin-top: 0.75rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.16);
}

.spotify-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--spotify), var(--ink-strong));
  transition: width 260ms ease;
}

.spotify a {
  display: inline-block;
  margin-top: 0.65rem;
  color: var(--spotify);
}

.spotify a[hidden] {
  display: none;
}

.spotify-pulse {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.65);
}

.spotify[data-spotify-status="playing"] .spotify-pulse {
  background: var(--spotify);
  box-shadow: 0 0 16px rgba(30, 215, 96, 0.8);
  animation: spotifyPulse 1.2s ease-in-out infinite;
}

.spotify[data-spotify-status="paused"] .spotify-pulse,
.spotify[data-spotify-status="idle"] .spotify-pulse {
  background: var(--ink-soft);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.45);
}

.spotify[data-spotify-status="setup_required"] .spotify-pulse,
.spotify[data-spotify-status="unavailable"] .spotify-pulse,
.spotify[data-spotify-status="rate_limited"] .spotify-pulse,
.spotify[data-spotify-status="stale"] .spotify-pulse {
  background: var(--warning);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

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

.contact-dock {
  position: fixed;
  right: clamp(0.85rem, 2.5vw, 1.35rem);
  bottom: clamp(0.85rem, 2.5vw, 1.35rem);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  pointer-events: none;
}

.contact-nudge {
  max-width: 12rem;
  margin: 0;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 8px;
  background: rgba(3, 17, 32, 0.92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.45rem 0.6rem;
  pointer-events: none;
  transform: translateY(0);
  transition:
    opacity 80ms ease,
    transform 80ms ease;
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.contact-dock.has-seen-contact-hover .contact-nudge,
.contact-dock:has(.contact-button:hover) .contact-nudge,
.contact-dock:focus-within .contact-nudge {
  opacity: 0;
  transform: translateY(0.35rem);
  visibility: hidden;
}

.contact-button {
  position: relative;
  display: grid;
  width: 3.6rem;
  height: 3.6rem;
  border: 1px solid rgba(125, 211, 252, 0.44);
  border-radius: 8px;
  background: #031120;
  box-shadow:
    inset 0 0 0 1px rgba(56, 189, 248, 0.1),
    0 14px 30px rgba(0, 0, 0, 0.34);
  color: #7dd3fc;
  cursor: pointer;
  place-items: center;
  pointer-events: auto;
  text-decoration: none;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.contact-button:hover,
.contact-button:focus-visible {
  border-color: rgba(125, 211, 252, 0.56);
  background: #041425;
  box-shadow:
    inset 0 0 0 1px rgba(56, 189, 248, 0.14),
    0 0 14px rgba(56, 189, 248, 0.12),
    0 14px 30px rgba(0, 0, 0, 0.34);
  color: #8be4ff;
  outline: 0;
  transform: translateY(-1px);
}

.contact-icon {
  display: block;
  width: 2.45rem;
  height: 2.45rem;
  filter: drop-shadow(0 0 5px rgba(34, 223, 255, 0.32));
  image-rendering: pixelated;
  object-fit: contain;
  shape-rendering: crispEdges;
}

.contact-tip {
  position: absolute;
  top: 50%;
  right: calc(100% + 0.7rem);
  width: min(15rem, calc(100vw - 5.25rem));
  border: 1px solid rgba(125, 211, 252, 0.34);
  border-radius: 8px;
  background: rgba(3, 17, 32, 0.96);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  color: var(--link);
  font-size: 0.78rem;
  line-height: 1.25;
  opacity: 0;
  padding: 0.5rem 0.65rem;
  pointer-events: none;
  text-align: left;
  transform: translate(0.4rem, -50%) scale(0.98);
  transform-origin: right center;
  transition:
    visibility 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
  visibility: hidden;
}

.contact-button:hover .contact-tip,
.contact-button:focus-visible .contact-tip {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
  visibility: visible;
}

@keyframes spotifyPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .avatar-eye {
    transition: none;
  }

  .section-flash {
    animation: none;
    background: var(--signal);
    color: var(--selection-ink);
  }

  .contact-button,
  .contact-nudge,
  .contact-tip {
    transition: none;
  }

  .spotify[data-spotify-status="playing"] .spotify-pulse {
    animation: none;
  }
}

@media (max-width: 720px) {
  .identity-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "avatar"
      "spotify"
      "copy";
  }

  .identity-avatar {
    width: 232px;
    height: 224px;
    margin: 0 auto;
  }

  .spotify {
    width: min(100%, 360px);
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  .page {
    width: min(100% - 1.25rem, var(--measure));
    margin-top: 1rem;
    padding-bottom: 2rem;
  }

  .avatar {
    --avatar-size: 180px;
    --avatar-frame-size: 186px;
  }

  .identity-avatar {
    width: 194px;
    height: 186px;
  }

  .spotify {
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 144px;
    padding: 0.85rem;
  }

  .spotify-artwork {
    width: 64px;
  }

  ul {
    padding-left: 1.5rem;
  }

  .statement {
    text-align: left;
  }

  .contact-dock {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .contact-button {
    width: 3.25rem;
    height: 3.25rem;
  }

  .contact-icon {
    width: 2.22rem;
    height: 2.22rem;
  }

  .contact-tip {
    width: min(12.5rem, calc(100vw - 4.75rem));
    font-size: 0.74rem;
  }
}
