:root {
  color-scheme: dark;
  --ink: #fffdf6;
  --blue: #9dc6ec;
  --yellow: #ffdb5c;
  --card: rgba(217, 217, 217, 0.2);
  --stage-scale: 1;
  --stage-left: 0px;
  --stage-top: 0px;
  --scroll-height: 1700px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  position: relative;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color: var(--ink);
  background: transparent;
  isolation: isolate;
}

button,
a {
  font: inherit;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(2, 7, 11, 0.18), rgba(2, 7, 11, 0.18)),
    url("assets/background.png") center / cover no-repeat,
    #02070b;
  pointer-events: none;
}

body:has(.project-overlay[open]) {
  overflow: hidden;
}

.scroll-shell {
  position: relative;
  min-height: 100svh;
  height: var(--scroll-height);
}

.site-shell {
  position: fixed;
  top: var(--stage-top);
  left: var(--stage-left);
  width: 1768px;
  height: 982px;
  margin: 0;
  overflow: hidden;
  background: #02070b;
  transform: scale(var(--stage-scale));
  transform-origin: top left;
  user-select: none;
}

.site-shell::before {
  content: "";
  position: absolute;
  left: -304px;
  top: -50px;
  width: 2411px;
  height: 1082px;
  background: url("assets/figma-space-bg.png") 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}

.intro {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.intro-copy {
  position: static;
}

.eyebrow {
  position: absolute;
  left: 111px;
  top: 151px;
  margin: 0;
  color: var(--blue);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 30px;
  font-style: italic;
  font-weight: 900;
  line-height: normal;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

h1 {
  position: absolute;
  left: 111px;
  top: 201px;
  width: 1401px;
  margin: 0;
  color: var(--ink);
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-size: 80px;
  font-style: italic;
  font-weight: 900;
  line-height: normal;
  letter-spacing: 0;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.planet-chip {
  position: absolute;
  left: 1297px;
  top: 232px;
  width: 131px;
  height: 69px;
  background: url("assets/figma-planet-chip.png") center / cover no-repeat;
  box-shadow: 0 4px 13.4px rgba(0, 0, 0, 0.25);
}

.project-board {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.project-track {
  position: absolute;
  inset: 0;
  transform: translate3d(var(--cards-shift, 0px), 0, 0);
  will-change: transform;
}

.project-card {
  position: absolute;
  width: 360.5px;
  height: 375.352px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 26%, rgba(255, 255, 255, 0.02) 48%, transparent 68%),
    linear-gradient(145deg, rgba(231, 238, 240, 0.04), rgba(98, 114, 122, 0.04)),
    rgba(217, 217, 217, 0.048);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  cursor: pointer;
  pointer-events: auto;
  transform-origin: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 18px 22px 42px rgba(255, 255, 255, 0.035),
    inset 0 -22px 42px rgba(5, 11, 15, 0.14),
    0 18px 42px rgba(0, 0, 0, 0.14),
    0 0 26px rgba(157, 198, 236, 0.08);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 18% 60%, rgba(255, 222, 184, 0.1), transparent 0 7%, transparent 24%),
    radial-gradient(circle at 58% 42%, rgba(255, 255, 255, 0.09), transparent 0 5%, transparent 23%),
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.14), transparent 0 3%, transparent 16%),
    radial-gradient(circle at 72% 78%, rgba(255, 255, 255, 0.04), transparent 0 4%, transparent 18%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 34%, rgba(10, 18, 24, 0.1));
  opacity: 0.68;
  pointer-events: none;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.18) 0 0.9px, transparent 1.2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.11) 0 0.8px, transparent 1.1px),
    radial-gradient(circle, rgba(5, 10, 14, 0.18) 0 0.7px, transparent 1px);
  background-position: 10px 18px, 37px 51px, 21px 33px;
  background-size: 48px 54px, 67px 59px, 39px 44px;
  opacity: 0.2;
  mix-blend-mode: screen;
  pointer-events: none;
}

.project-card:hover,
.project-card:focus-visible {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 28%, rgba(255, 255, 255, 0.03) 52%, transparent 70%),
    linear-gradient(145deg, rgba(241, 247, 249, 0.06), rgba(134, 149, 156, 0.055)),
    rgba(217, 217, 217, 0.065);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 18px 22px 42px rgba(255, 255, 255, 0.045),
    inset 0 -22px 42px rgba(5, 11, 15, 0.16),
    0 20px 48px rgba(0, 0, 0, 0.2),
    0 0 32px rgba(157, 198, 236, 0.11);
  outline: none;
}

.project-card strong,
.project-card span:last-child,
.card-index {
  position: absolute;
  z-index: 1;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-style: italic;
  font-weight: 900;
  line-height: normal;
  letter-spacing: 0;
}

.project-card strong {
  left: 41px;
  top: 64px;
  margin: 0;
  color: var(--ink);
  font-size: 36px;
  white-space: nowrap;
}

.project-card span:last-child {
  left: 45px;
  top: 174px;
  display: block;
  width: 269px;
  color: var(--ink);
  font-size: 30px;
}

.card-index {
  right: 24px;
  bottom: 31px;
  color: var(--yellow);
  font-size: 24px;
  white-space: nowrap;
}

.card-one {
  left: 93px;
  top: 512px;
  transform: rotate(-5.18deg);
}

.card-one:hover,
.card-one:focus-visible {
  transform: translateY(-10px) rotate(-5.18deg);
}

.card-two {
  left: 509px;
  top: 503px;
  transform: rotate(1.73deg);
}

.card-two:hover,
.card-two:focus-visible {
  transform: translateY(-10px) rotate(1.73deg);
}

.card-three {
  left: 904px;
  top: 498px;
  transform: rotate(-6.74deg);
}

.card-three strong {
  left: 40px;
  top: 64px;
}

.card-three span:last-child {
  left: 45px;
  top: 144px;
}

.card-three:hover,
.card-three:focus-visible {
  transform: translateY(-10px) rotate(-6.74deg);
}

.card-four {
  left: 1303px;
  top: 503px;
  transform: rotate(1.73deg);
}

.card-four strong {
  left: 54px;
  top: 52px;
}

.card-four span:last-child {
  left: 50px;
  top: 155px;
}

.card-four:hover,
.card-four:focus-visible {
  transform: translateY(-10px) rotate(1.73deg);
}

.project-overlay {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-28px);
  transition: opacity 220ms ease, transform 260ms ease;
}

.project-overlay[open] {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.project-overlay::backdrop {
  background: rgba(2, 7, 11, 0.34);
  backdrop-filter: blur(8px) saturate(1.08);
}

.project-modal {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100svh;
  padding: 28px;
}

.overlay-close {
  position: absolute;
  top: 30px;
  right: 30px;
  z-index: 5;
  border: 1px solid rgba(235, 239, 232, 0.42);
  border-radius: 999px;
  padding: 9px 15px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  background: rgba(8, 14, 19, 0.46);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 24px rgba(0, 0, 0, 0.26);
  cursor: pointer;
}

.project-detail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 18px;
  width: min(1360px, calc(100vw - 56px));
  height: min(780px, calc(100svh - 56px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 24%, rgba(255, 255, 255, 0.025) 48%, transparent 70%),
    linear-gradient(145deg, rgba(231, 238, 240, 0.055), rgba(98, 114, 122, 0.045)),
    rgba(217, 217, 217, 0.055);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 24px 28px 56px rgba(255, 255, 255, 0.035),
    inset 0 -28px 56px rgba(5, 11, 15, 0.16),
    0 34px 90px rgba(0, 0, 0, 0.34),
    0 0 42px rgba(157, 198, 236, 0.08);
  transform-origin: center;
  animation: modal-card-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.17) 0 0.9px, transparent 1.2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.1) 0 0.8px, transparent 1.1px),
    radial-gradient(circle, rgba(5, 10, 14, 0.18) 0 0.7px, transparent 1px);
  background-position: 10px 18px, 37px 51px, 21px 33px;
  background-size: 48px 54px, 67px 59px, 39px 44px;
  opacity: 0.18;
  mix-blend-mode: screen;
  pointer-events: none;
}

.embed-card {
  position: relative;
  --frame-scale: 1;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.embed-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: #f6f0ea;
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.58),
    0 18px 44px rgba(0, 0, 0, 0.24);
}

.scanline {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 30%, rgba(255, 255, 255, 0.04) 64%, transparent 74%),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
}

.screen-idle,
.screen-loader,
.project-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.screen-idle,
.screen-loader {
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #d6edf3;
  pointer-events: none;
}

.screen-idle span,
.screen-loader strong {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.screen-idle strong {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(22px, 3.3vw, 42px);
  font-style: italic;
  font-weight: 900;
}

.screen-loader {
  z-index: 7;
  opacity: 0;
  background: transparent;
  transition: opacity 180ms ease;
}

.screen-loader span {
  justify-self: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(8, 14, 19, 0.16);
  border-top-color: rgba(255, 219, 92, 0.95);
  border-right-color: rgba(157, 198, 236, 0.86);
  border-radius: 50%;
  background: rgba(255, 253, 246, 0.28);
  box-shadow:
    0 0 0 10px rgba(255, 253, 246, 0.18),
    0 0 20px rgba(157, 198, 236, 0.24);
  animation: loader-spin 820ms linear infinite;
}

.screen-loader strong {
  display: none;
}

.project-frame {
  z-index: 5;
  border: 0;
  opacity: 0;
  background: #f6f0ea;
  pointer-events: auto;
  transform: scale(var(--frame-scale));
  transform-origin: top left;
  transition: opacity 260ms ease;
}

.embed-card[data-state="playing"] .project-frame {
  width: calc(100% / var(--frame-scale));
  height: calc(100% / var(--frame-scale));
}

.embed-card[data-state="playing"] .project-frame {
  opacity: 1;
}

.embed-card[data-state="playing"] .screen-idle {
  opacity: 0;
}

.embed-card[data-loading="true"] .screen-loader {
  opacity: 1;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.project-side {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 48px;
  min-width: 0;
  padding-top: 20px;
}

.now-playing {
  width: 100%;
  margin-top: 0;
  text-align: left;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.now-playing span {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.now-playing h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-size: clamp(24px, 2.4vw, 34px);
  font-style: italic;
  font-weight: 900;
  line-height: 1;
}

.now-playing p {
  margin: 0 auto;
  max-width: 430px;
  color: #b9c4c9;
  line-height: 1.45;
}

.project-rail {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: none;
}

.project-rail::-webkit-scrollbar {
  display: none;
}

.rail-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 118px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 32%),
    rgba(217, 217, 217, 0.045);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.rail-card span {
  color: var(--yellow);
  font-size: 14px;
  font-style: italic;
  font-weight: 900;
}

.rail-card strong {
  font-size: 22px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
}

.rail-card small {
  color: rgba(255, 253, 246, 0.7);
  font-size: 13px;
  font-style: italic;
  font-weight: 800;
  line-height: 1.2;
}

.rail-card:hover,
.rail-card:focus-visible {
  border-color: rgba(255, 219, 92, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 32%),
    rgba(217, 217, 217, 0.075);
  outline: none;
}

.rail-card.is-active {
  border-color: rgba(255, 219, 92, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 32%),
    rgba(217, 217, 217, 0.055);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(255, 219, 92, 0.18),
    0 0 22px rgba(255, 219, 92, 0.18);
  outline: none;
}

@keyframes modal-card-in {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.94) rotate(-1deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@media (max-width: 700px) {
  .project-modal {
    padding: 54px 10px 14px;
  }

  .project-detail {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    width: calc(100vw - 20px);
    height: calc(100svh - 72px);
    padding: 12px;
    border-radius: 20px;
  }

  .project-side {
    gap: 18px;
  }

  .now-playing h2 {
    font-size: 24px;
  }

  .project-rail {
    grid-template-columns: repeat(4, minmax(158px, 1fr));
    grid-auto-flow: column;
    overflow-x: auto;
  }

  .rail-card {
    min-height: 94px;
    padding: 13px;
  }

  .rail-card strong {
    font-size: 18px;
  }
}
