:root {
  --bg: #1e1e2e;
  --ink: #cdd6f4;
  --muted: #a6adc8;
  --line: #45475a;
  --green: #a6e3a1;
  --red: #f38ba8;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 64px 24px;
}

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

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

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  z-index: 1000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loader__brand {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.loader__count {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.loader__progress {
  width: 120px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}

.loader__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.12s linear;
}

.loader--done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Custom cursor ---------- */
@media (hover: hover) and (pointer: fine) {
  body,
  a,
  button {
    cursor: none !important;
  }

  body.native-cursor,
  body.native-cursor a,
  body.native-cursor button {
    cursor: auto !important;
  }
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 2000;
  transform: translate(-50%, -50%);
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(205, 214, 244, 0.3);
  pointer-events: none;
  z-index: 1999;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
}

.cursor-ring.is-hover {
  width: 48px;
  height: 48px;
  border-color: var(--ink);
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

.page {
  width: 100%;
  max-width: 520px;
}

.head {
  margin-bottom: 56px;
}

/* ---------- Status ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-green 2.4s ease-out infinite;
}

.status.is-busy .status__dot {
  background: var(--red);
  animation: pulse-red 2.4s ease-out infinite;
}

.status__text {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.head__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.clocks {
  display: flex;
  gap: 28px;
}

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.clock__label {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.clock__time {
  font-size: 0.95rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

@keyframes pulse-green {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(166, 227, 161, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(166, 227, 161, 0);
  }
}

@keyframes pulse-red {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(243, 139, 168, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(243, 139, 168, 0);
  }
}

/* ---------- Name ---------- */
.name {
  font-size: clamp(3rem, 11vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-top: 24px;
}

.name__period {
  color: var(--muted);
}

.bio {
  color: var(--muted);
  margin-top: 16px;
  max-width: 420px;
}

/* ---------- Links ---------- */
.links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 30px 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.5s var(--ease-out), background 0.5s var(--ease-out);
}

.link:hover {
  padding-left: 30px;
  background: rgba(205, 214, 244, 0.03);
}

.link__icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--muted);
  transition: color 0.3s ease;
}

.link:hover .link__icon {
  color: var(--ink);
}

.link__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.link__label {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform 0.5s var(--ease-out);
}

.link:hover .link__label {
  transform: translateX(6px);
}

.link__meta {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.link__arrow {
  margin-left: 10px;
  opacity: 0;
  transform: translateX(-10px);
  color: var(--muted);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.link:hover .link__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- Folders ---------- */
.folders {
  display: flex;
  gap: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.folder {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  text-align: left;
}

.folder::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}

.folder:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.folder__label {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform 0.4s var(--ease-out);
}

.folder:hover .folder__label {
  transform: translateX(4px);
}

.folder__arrow {
  font-size: 1.1rem;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}

.folder:hover .folder__arrow {
  opacity: 1;
  transform: translateX(0);
}

body.is-locked {
  overflow: hidden;
}

/* ---------- Flyout ---------- */
.flyout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 27, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0.5s var(--ease-out);
  z-index: 800;
}

.flyout-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.flyout {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  background: #181825;
  color: var(--ink);
  border-left: 1px solid var(--line);
  z-index: 900;
  transform: translateX(100%);
  transition: transform 0.65s var(--ease-out);
  will-change: transform;
  visibility: hidden;
}

.flyout.is-open {
  transform: translateX(0);
  visibility: visible;
}

.flyout__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 32px 40px;
}

.flyout__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.flyout__index {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.flyout__close {
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

.flyout__close:hover {
  opacity: 1;
}

.flyout__body {
  flex: 1;
  overflow-y: auto;
  padding: 40px 24px 40px 0;
  scrollbar-width: thin;
  scrollbar-color: #45475a transparent;
}

.flyout__body::-webkit-scrollbar {
  width: 6px;
}

.flyout__body::-webkit-scrollbar-thumb {
  background: #45475a;
  border-radius: 3px;
}

.flyout__body::-webkit-scrollbar-track {
  background: transparent;
}

.flyout__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.flyout__text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 420px;
}

.flyout__ext {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.flyout__ext:hover {
  border-color: #585b70;
  background: rgba(205, 214, 244, 0.03);
}

.flyout__ext-arrow {
  color: var(--muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}

.flyout__ext:hover .flyout__ext-arrow {
  opacity: 1;
  transform: translateX(0);
}

.flyout__subhead {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 36px 0 16px;
}

.flyout__heading {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 44px 0 20px;
  padding-top: 28px;
}

.flyout__heading:first-of-type {
  margin-top: 0;
  padding-top: 0;
}

.specs {
  list-style: none;
}

.specs li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.specs__label {
  color: var(--muted);
  flex: none;
}

.specs__value {
  color: var(--ink);
  text-align: right;
}

.specs__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
  color: var(--ink);
}

/* Flyout content stagger */
.flyout__head,
.flyout__body > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.flyout.is-open .flyout__head,
.flyout.is-open .flyout__body > * {
  opacity: 1;
  transform: translateY(0);
}

.flyout.is-open .flyout__head {
  transition-delay: 0.3s;
}

.flyout.is-open .flyout__body > *:nth-child(1) {
  transition-delay: 0.4s;
}
.flyout.is-open .flyout__body > *:nth-child(2) {
  transition-delay: 0.46s;
}
.flyout.is-open .flyout__body > *:nth-child(3) {
  transition-delay: 0.52s;
}
.flyout.is-open .flyout__body > *:nth-child(4) {
  transition-delay: 0.58s;
}
.flyout.is-open .flyout__body > *:nth-child(5) {
  transition-delay: 0.64s;
}
.flyout.is-open .flyout__body > *:nth-child(6) {
  transition-delay: 0.7s;
}
.flyout.is-open .flyout__body > *:nth-child(7) {
  transition-delay: 0.76s;
}
.flyout.is-open .flyout__body > *:nth-child(8) {
  transition-delay: 0.82s;
}
.flyout.is-open .flyout__body > *:nth-child(n + 9) {
  transition-delay: 0.88s;
}

/* ---------- Spotify ---------- */
.spotify {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 40px;
  transition: border-color 0.4s var(--ease-out), background 0.4s var(--ease-out);
}

.spotify:hover {
  border-color: #585b70;
  background: rgba(205, 214, 244, 0.03);
}

.spotify__link {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
}

.spotify__info {
  min-width: 0;
  flex: 1;
}

.spotify__status {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.spotify__song {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify__artist {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  flex: none;
}

.equalizer__bar {
  width: 3px;
  height: 100%;
  border-radius: 1px;
  background: var(--green);
  transform-origin: bottom;
  animation: eq 1.1s ease-in-out infinite;
}

.equalizer__bar:nth-child(2) {
  animation-delay: 0.15s;
}
.equalizer__bar:nth-child(3) {
  animation-delay: 0.3s;
}
.equalizer__bar:nth-child(4) {
  animation-delay: 0.45s;
}
.equalizer__bar:nth-child(5) {
  animation-delay: 0.6s;
}

.equalizer.is-paused .equalizer__bar {
  animation: none;
  transform: scaleY(0.25);
  background: var(--line);
}

@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.25);
  }
  50% {
    transform: scaleY(1);
  }
}

/* ---------- Footer ---------- */
.mail {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mail__link {
  transition: color 0.3s ease;
}

.mail__link:hover {
  color: var(--ink);
}

.mail__copy {
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out),
    color 0.3s ease, border-color 0.3s ease;
}

.mail:hover .mail__copy {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.mail__copy:hover {
  color: var(--ink);
  border-color: #585b70;
}

.mail__copy.is-copied {
  color: var(--green);
  border-color: var(--green);
}

.foot__settings {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.foot__settings:hover {
  color: var(--ink);
}

.foot__gear {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0;
  transform: rotate(0deg);
  transition: opacity 0.3s ease, transform 0.6s var(--ease-out);
}

.foot__settings:hover .foot__gear {
  opacity: 1;
  transform: rotate(60deg);
}

/* ---------- Settings ---------- */
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.setting__name {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.setting__desc {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #313244;
  border: 0;
  cursor: pointer;
  transition: background 0.3s ease;
  flex: none;
}

.switch.is-on {
  background: var(--green);
}

.switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  transition: transform 0.3s var(--ease-out);
}

.switch.is-on .switch__knob {
  transform: translateX(20px);
}

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Load animation ---------- */
.fade {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.8s var(--ease-out) forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.head > .fade:nth-child(1) {
  animation-delay: 0.05s;
}
.head > .fade:nth-child(2) {
  animation-delay: 0.12s;
}
.head > .fade:nth-child(3) {
  animation-delay: 0.19s;
}
.spotify.fade {
  animation-delay: 0.26s;
}
.links > .fade:nth-child(1) {
  animation-delay: 0.28s;
}
.links > .fade:nth-child(2) {
  animation-delay: 0.34s;
}
.links > .fade:nth-child(3) {
  animation-delay: 0.4s;
}
.links > .fade:nth-child(4) {
  animation-delay: 0.46s;
}
.folders > .fade:nth-child(1) {
  animation-delay: 0.52s;
}
.folders > .fade:nth-child(2) {
  animation-delay: 0.58s;
}
.foot > .fade:nth-child(1) {
  animation-delay: 0.68s;
}
.foot > .fade:nth-child(2) {
  animation-delay: 0.74s;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  body {
    padding: 48px 20px;
    place-items: start center;
  }

  .head {
    margin-bottom: 40px;
  }

  .link {
    gap: 10px;
    padding: 24px 16px;
  }

  .link:hover {
    padding-left: 22px;
  }

  .link__meta {
    display: none;
  }

  .flyout__inner {
    padding: 24px 24px;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .mail__copy {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .foot__gear {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .loader__count {
    display: none;
  }

  .status__dot {
    animation: none;
  }

  .equalizer__bar {
    animation: none;
  }

  .flyout {
    transition: none;
  }

  .flyout__head,
  .flyout__body > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
