@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* ==========================================================================
   Mickey King — shared stylesheet
   Font: Space Mono (matches the mono/terminal type in the Figma design)
   ========================================================================== */

:root {
  --bg: #ffffff;
  --text: #141414;
  --pill-gray: #9a9a9a;
  --pill-gray-text: #ffffff;
  --pill-yellow: #f2ecab;
  --pill-outline-border: #141414;
  --font-mono: 'Reddit Mono', 'IBM Plex Mono', 'Courier New', monospace;

  --scene-max-width: 1600px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 300;
  text-transform: uppercase;
  min-height: 100vh;
  overflow-x: hidden;
}

@media (min-width: 761px) {
  body:not(.project-page) {
    height: 100vh;
    overflow-y: hidden;
  }
}

body,
body * {
  cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="48" viewBox="0 0 24 24"><g fill="none" stroke="%23FF0000" stroke-width="1.75"><circle cx="12" cy="12" r="8.5"></circle><path d="M1 12h5M18 12h5M12 6V1.04M12 23v-4.96M11.95 11.95h.1v.1h-.1z"></path></g></svg>'), auto;
}

/* Keep native cursor behavior on video players so timeline controls remain
  precise while preserving the decorative cursor elsewhere on the page. */
body.project-page video,
body.project-page video *,
body.project-page video::-webkit-media-controls,
body.project-page video::-webkit-media-controls-enclosure,
body.project-page video::-webkit-media-controls-panel {
  cursor: auto !important;
}

@media (hover: hover) and (pointer: fine) {
  .about-page .avatar:hover,
  .about-page .avatar:hover * {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 24 24"><path fill="none" stroke="%23FF0000" stroke-linecap="round" stroke-width="1.75" d="m3 3 18 18M21 3 3 21"></path></svg>'), auto;
  }
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- utility nav (small, unobtrusive, sits above the scene) ---------- */

.site-utility-nav {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 50;
  display: flex;
  gap: 18px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-utility-nav a {
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.site-utility-nav a:hover,
.site-utility-nav a:focus-visible,
.site-utility-nav a[aria-current="page"] {
  opacity: 1;
}

/* ---------- pill buttons / badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 300;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border: none;
}

.pill--gray {
  background: var(--pill-gray);
  color: var(--pill-gray-text);
  padding: 1.1em 1.8em;
  font-size: clamp(14px, 1.4vw, 20px);
}

.mickey-pill {
  padding: 0.825em 1.35em;
  font-size: clamp(10.5px, 1.05vw, 15px);
  background: rgba(38, 38, 38, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f4f4f4;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pill--yellow {
  background: var(--pill-yellow);
  color: var(--text);
  padding: 1.1em 1.8em;
  font-size: clamp(14px, 1.4vw, 20px);
}

.pill--outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--pill-outline-border);
  padding: 0.9em 1.5em;
  font-size: clamp(12px, 1.1vw, 16px);
  font-weight: 300;
}

/* ---------- the floating "scene" (positioned objects on a blank canvas) ---------- */

.scene {
  position: relative;
  width: 100%;
  max-width: var(--scene-max-width);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
}

.floater {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  padding: 0;
  animation: bob 6s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  transition: transform 0.25s ease;
}

.floater img {
  width: 100%;
  pointer-events: none;
}

.floater:hover,
.floater:focus-visible {
  transform: translate(-50%, -50%) scale(1.08) rotate(-2deg);
}

.floater:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 6px;
  border-radius: 8px;
}

.floater--label {
  animation: none;
}

.floating-player {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(440px, calc(100vw - 24px));
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-radius: 5px;
  border: none;
  background: transparent;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  z-index: 120;
  pointer-events: auto;
  user-select: none;
  overflow: visible;
}

.floating-player,
.floating-player * {
  pointer-events: auto;
  cursor: default;
}

.floating-player.is-open {
  display: flex;
}

.floating-player__header {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.floating-player__title {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.92);
}

@media (max-width: 760px) {
  .floating-player__title {
    font-size: 18px;
    letter-spacing: 0.10em;
  }
}

.floating-player__video {
  width: 100%;
  background: #0f0f0f;
  aspect-ratio: 16 / 9;
  pointer-events: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.floating-player__image {
  display: block;
  width: 100%;
  max-height: min(72vh, 720px);
  background: #0f0f0f;
  object-fit: contain;
}

.floating-player__image[hidden],
.floating-player__video[hidden] {
  display: none;
}

.floating-player__media {
  position: relative;
  display: block;
  overflow: hidden;
}

.floating-player__cta {
  position: absolute;
  left: -128px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 14;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 114px;
  padding: 0.62em 1.16em;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(180, 20, 20, 0.82);
  color: #ffffff;
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  cursor: pointer;
}

.floating-player__cta[hidden] {
  display: none;
}

.floating-player__overlay {
  display: none;
}

.floating-player__controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 20px 10px;
}

.floating-player__options {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0;
}

.floating-player__options--left {
  justify-content: flex-start;
}

.floating-player__options--center {
  justify-content: center;
  gap: 6px;
}

.floating-player__options--right {
  justify-content: flex-end;
}

.floating-player__btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #efefef;
  border-radius: 3px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.floating-player__btn svg {
  width: 19px;
  height: 19px;
  stroke: #fff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.floating-player__btn:hover svg {
  stroke: #fff;
}

.floating-player__btn:active {
  transform: scale(0.9);
}

.floating-player__btn .icon-pause,
.floating-player__btn .icon-muted {
  display: none;
}

.floating-player__btn[data-player-action="play"][data-state="playing"] .icon-pause {
  display: block;
}

.floating-player__btn[data-player-action="play"][data-state="playing"] .icon-play {
  display: none;
}

.floating-player__btn[data-player-action="mute"][data-state="muted"] .icon-muted {
  display: block;
}

.floating-player__btn[data-player-action="mute"][data-state="muted"] .icon-volume {
  display: none;
}

.floating-player__volume {
  width: 75px;
  max-width: 75px;
  height: 4px;
  margin-left: 3px;
  accent-color: #0078ff;
  cursor: ew-resize;
}

.floating-player__timer {
  display: inline-flex;
  align-items: center;
  margin-left: 15px;
  gap: 5px;
  color: #efefef;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

.avatar {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  transform: translate(-50%, -50%);
  transition: transform 180ms ease;
  animation: bob 7s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.avatar img,
.avatar__image {
  width: 100%;
  display: block;
}

.avatar__stack {
  position: relative;
  width: 100%;
}

.avatar__image--alt {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.avatar__image--base {
  opacity: 1;
}

.avatar.is-transitioning .avatar__image--alt,
.avatar:active .avatar__image--alt {
  opacity: 1;
}

.avatar.is-transitioning .avatar__image--base,
.avatar:active .avatar__image--base {
  opacity: 0;
}

/* Keep RUN avatar stable on incidental presses; only scripted transition should swap frames. */
.avatar--delayed-nav:active .avatar__image--alt {
  opacity: 0;
}

.avatar--delayed-nav:active .avatar__image--base {
  opacity: 1;
}

.avatar:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 6px;
  border-radius: 8px;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-12px); }
}

@keyframes bob-icon {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* nav pill sits inside the scene but shouldn't bob as far / should always be reachable */
.nav-pill {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  z-index: 5;
}

/* ---------- about page text block ---------- */

.bio {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  transform: translate(-50%, -50%);
  font-size: clamp(14px, 1.5vw, 20px);
  line-height: 1.65;
}

.bio strong {
  font-weight: 300;
}

.bio p {
  margin: 0 0 1em 0;
}

.bio p:last-child {
  margin-bottom: 0;
}

/* hobby row: icon + outline label pill, paired together */
.hobby {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 18px;
}

.hobby img {
  width: var(--icon-w, 90px);
  animation: bob 6s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.about-page .pill--yellow,
.about-page .pill--outline {
  width: 154px;
  justify-content: center;
  font-size: clamp(10px, 1vw, 14px);
  padding: 0.77em 1.26em;
}

.about-page .hobby {
  display: grid;
  grid-template-columns: 140px auto;
  column-gap: 18px;
  align-items: center;
}

.about-page .hobby img {
  width: calc(var(--icon-w, 90px) * 1.75);
  max-width: none;
  justify-self: center;
  animation: bob-icon 6s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.about-page .mickey-pill {
  cursor: default;
}

/* Align yellow header pill with the hobby label pill column (not the icon column). */
.about-page .pill--yellow.nav-pill {
  transform: translate(calc(-50% + 79px), -50%);
}

/* ---------- project pages ---------- */

.project-page {
  min-height: 100vh;
  position: relative;
  padding: 40px 24px 56px;
  overflow-x: hidden;
}

.project-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.project-title {
  margin: 0;
  font-size: clamp(20px, 3vw, 36px);
  letter-spacing: 0.06em;
}

.project-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65em 1.1em;
  border-radius: 999px;
  border: 1px solid rgba(20, 20, 20, 0.35);
  background: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.page-back {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 166px;
  transform: none;
  transition: transform 180ms ease;
  z-index: 55;
}

.page-back img {
  width: 100%;
  pointer-events: none;
}

.page-back:hover {
  transform: scale(1.06) rotate(-2deg);
}

.page-back:focus-visible {
  transform: scale(1.08) rotate(-2deg);
}

.about-page .floater--label {
  position: absolute;
  left: 14px;
  top: 14px;
  width: 166px !important;
  transform: none !important;
  z-index: 70;
}

.about-page .bio {
  text-align: left;
  font-size: clamp(10px, 0.92vw, 13px);
  line-height: 1.45;
}

.bio__spec {
  margin: 0;
  font-family: 'Reddit Mono', var(--font-mono);
  font-size: 1em;
  line-height: 1.45;
  letter-spacing: 0.03em;
  white-space: pre;
}

.page-back:focus-visible {
  border: 1px solid rgba(255, 255, 255, 0.28);
  outline-offset: 6px;
  border-radius: 8px;
}

.project-video-wrap {
  border-radius: 20px;
  border: 1px solid rgba(20, 20, 20, 0.25);
  overflow: hidden;
  background: #0f0f0f;
}

.project-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(70vh, 760px);
  object-fit: contain;
  background: #0f0f0f;
}

.project-note {
  margin: 0;
  font-size: clamp(11px, 1.3vw, 14px);
  opacity: 0.75;
  letter-spacing: 0.03em;
}

@media (min-width: 761px) {
  .project-page {
    height: 100vh;
    overflow: hidden;
    overflow-x: hidden;
    overscroll-behavior: none;
  }

  .project-shell {
    height: calc(100vh - 96px);
    margin-top: 42px;
    gap: 14px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .project-horizontal {
    display: flex;
    flex-direction: column;
    gap: 34px;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    width: 100%;
    min-height: 0;
    padding: 14px 2px 26px;
    scrollbar-width: thin;
    scroll-behavior: smooth;
  }

  .project-horizontal::-webkit-scrollbar {
    width: 8px;
  }

  .project-horizontal::-webkit-scrollbar-thumb {
    background: rgba(18, 18, 18, 0.22);
    border-radius: 999px;
  }

  .project-horizontal > .project-video-wrap,
  .project-horizontal > .project-asset {
    width: min(92vw, 1180px);
    max-width: 100%;
    --focus-scale: 0.66;
    --focus-lift: 0px;
    --focus-shadow-alpha: 0.14;
    transform: translateY(var(--focus-lift)) scale(var(--focus-scale));
    transform-origin: center center;
    opacity: 0.62;
    will-change: transform, opacity;
    box-shadow: 0 14px 40px rgba(0, 0, 0, var(--focus-shadow-alpha));
    transition: transform 280ms ease, opacity 280ms ease, box-shadow 240ms ease;
  }

  .project-scroll-spacer {
    width: 100%;
    min-height: clamp(140px, 18vh, 240px);
    flex: 0 0 auto;
    pointer-events: none;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .floater,
  .avatar,
  .hobby img {
    animation: none;
  }
}

/* ---------- small screens: drop the free-floating layout for a simple stack ---------- */

@media (max-width: 760px) {
  .site-utility-nav {
    top: 14px;
    right: 16px;
  }

  .scene {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 90px 20px 60px;
    overflow-x: hidden;
  }

  .about-page .scene {
    padding-top: 48px;
    gap: 18px;
  }

  .floater,
  .avatar,
  .bio,
  .hobby,
  .nav-pill {
    position: static;
    transform: none !important;
    width: auto;
    text-align: center;
  }

  .floater img,
  .avatar img {
    width: 130px;
    margin: 0 auto;
  }

  .avatar img {
    width: 220px;
  }

  .avatar--delayed-nav img,
  .avatar--delayed-nav .avatar__image {
    width: 100%;
    max-width: none;
  }

  .avatar--delayed-nav .avatar__stack {
    width: 100%;
  }

  .avatar--delayed-nav {
    align-self: center;
    width: min(82vw, 420px) !important;
    margin-left: 22px;
    margin-top: 8px;
  }

  .avatar--delayed-nav .avatar__image--alt {
    transform: translate(-30%, 18%) scale(1.92);
    transform-origin: center;
  }

  .floater[aria-label="Open Invisalign player"] img {
    width: 156px;
  }

  .floater[aria-label="Open BB project"] img {
    width: 156px;
  }

  .floater[aria-label="Open resume PDF"] img {
    width: 156px;
  }

  .floater[aria-label="Open PHARMA player"] img {
    width: 156px;
  }

  .bio {
    order: -1;
  }

  .hobby {
    flex-direction: column;
    gap: 10px;
  }

  .page-back {
    position: absolute;
    left: 10px;
    top: 10px;
    transform: none !important;
    width: 100px;
    margin: 0;
    animation: none;
    z-index: 55;
  }

  .project-page .page-back {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 100px;
    margin: 0;
    z-index: 55;
    transform: none !important;
  }

  .project-page .project-shell {
    margin-top: 72px;
  }

  .floating-player {
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: none;
    border-radius: 0;
    border: none;
    padding: 0;
    gap: 10px;
    align-items: center;
    justify-content: center;
    background: rgba(18, 18, 18, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .floating-player__header {
    top: calc(50% - min(43vw, 220px) - 12px);
    left: 50%;
    transform: translateX(-50%);
    width: min(88vw, 440px);
    justify-content: center;
    text-align: center;
  }

  .floating-player__media {
    width: min(88vw, 440px);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  }

  .floating-player__cta {
    position: static;
    transform: none;
    min-width: 132px;
    margin-top: 8px;
  }

  .floating-player__video {
    border-radius: 0;
    max-height: min(58vh, 300px);
  }

  .floating-player__overlay {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .floating-player__controls {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 6px;
  }

  .floating-player__options--left,
  .floating-player__options--center,
  .floating-player__options--right {
    justify-content: center;
  }

  .floating-player__btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .floating-player__volume {
    width: 96px;
  }

  .about-page .floater--label {
    position: absolute !important;
    left: 10px;
    top: 10px;
    width: 100px;
    margin: 0;
    transform: none !important;
    z-index: 70;
    pointer-events: auto;
  }

  .about-page .avatar {
    align-self: flex-start;
    width: min(98vw, 640px);
    margin-left: -12px;
    margin-top: 88px;
  }

  .about-page .avatar img {
    width: 100%;
  }

  .about-page .mickey-pill {
    align-self: flex-start;
    margin-left: 64px;
    margin-top: 118px;
    margin-bottom: -260px;
    z-index: 6;
  }

  .about-page .bio {
    order: 0;
    align-self: flex-start;
    width: min(84vw, 460px);
    margin: 24px 0 0 42px;
    text-align: left;
    font-size: clamp(11px, 2.6vw, 13px);
  }

  .about-page .hobby {
    margin-top: 22px;
  }

  .about-page .hobby:last-of-type {
    margin-top: -12px;
  }

  .about-page .pill--yellow.nav-pill {
    align-self: flex-start;
    margin-left: 42px;
    margin-top: 38px;
    transform: none !important;
  }

  body:not(.about-page) .mickey-pill {
    align-self: flex-start;
    margin-left: 56px;
    margin-top: 78px;
    margin-bottom: -220px;
    z-index: 6;
  }
}
