:root {
  --paper: #06191d;
  --paper-light: #0a252a;
  --ink: #bdfefa;
  --muted: #6fa8a8;
  --line: rgba(73, 239, 231, 0.42);
  --cyan: #23d8d1;
  --cyan-bright: #bdfefa;
  --cyan-dark: #087f80;
  --warm: #ffcc66;
  --screen: #092e33;
  --header-height: 84px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-top: var(--header-height);
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0%, rgba(35, 216, 209, 0.12), transparent 42%),
    linear-gradient(rgba(35, 216, 209, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 216, 209, 0.045) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 32px 32px, 32px 32px, auto;
  font-family: "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body:has(.coming-soon:target) {
  overflow: hidden;
}

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

button {
  color: inherit;
  font: inherit;
}

.noise {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.28) 4px
  );
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 4vw;
  background: rgba(6, 25, 29, 0.94);
  border-bottom: 3px double var(--cyan);
  box-shadow:
    0 5px 0 #020b0d,
    0 8px 18px rgba(35, 216, 209, 0.15);
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan-bright);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  color: #031013;
  background: var(--cyan);
  border: 2px solid var(--cyan-bright);
  border-radius: 0;
  box-shadow:
    3px 3px 0 var(--cyan-dark),
    0 0 12px rgba(35, 216, 209, 0.7);
  place-items: center;
  letter-spacing: -0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: 18px;
}

.site-nav a {
  transition: opacity 180ms ease;
}

.site-nav a:hover {
  color: var(--cyan-bright);
  text-shadow: 0 0 9px var(--cyan);
  opacity: 1;
}

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  color: #031013;
  background: var(--cyan);
  border: 2px solid var(--cyan-bright);
  box-shadow: 4px 4px 0 var(--cyan-dark);
}

.menu-toggle {
  display: none;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--cyan);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.eyebrow::before {
  margin-right: 8px;
  color: var(--warm);
  content: ">";
}

.eyebrow::after {
  margin-left: 8px;
  color: var(--warm);
  content: "_";
}

.projects-section {
  min-height: calc(100vh - var(--header-height));
  padding: 72px 4vw 100px;
  scroll-margin-top: var(--header-height);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 44px;
}

.section-heading .eyebrow {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  color: var(--cyan-bright);
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(46px, 5vw, 72px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow:
    4px 4px 0 var(--cyan-dark),
    0 0 18px rgba(35, 216, 209, 0.36);
  line-height: 1.1;
}

.project-count {
  margin: 0 0 8px;
  color: var(--muted);
  color: var(--cyan);
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
}

.project-count::before {
  content: "INDEX: ";
}

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 40px;
  padding-top: 18px;
}

.filter-button {
  padding: 7px 15px;
  color: var(--cyan-bright);
  background: #071d21;
  border: 2px solid var(--cyan-dark);
  border-radius: 0;
  box-shadow: 3px 3px 0 #020b0d;
  cursor: pointer;
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: 17px;
  transition:
    color 180ms ease,
    background 180ms ease;
}

.filter-button:hover,
.filter-button.is-active {
  color: #031013;
  background: var(--cyan);
  box-shadow:
    4px 4px 0 var(--cyan-dark),
    0 0 12px rgba(35, 216, 209, 0.45);
  transform: translate(-1px, -1px);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  display: block;
  width: 100%;
  padding: 8px;
  background: #071d21;
  border: 2px solid var(--cyan-dark);
  box-shadow:
    6px 6px 0 #020b0d,
    inset 0 0 0 2px rgba(189, 254, 250, 0.05);
  transition:
    box-shadow 180ms ease,
    transform 180ms ease;
}

.project-card:hover {
  border-color: var(--cyan-bright);
  box-shadow:
    8px 8px 0 var(--cyan-dark),
    0 0 18px rgba(35, 216, 209, 0.4);
  transform: translate(-3px, -3px);
}

.project-card.is-hidden {
  display: none;
}

.project-cover {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  padding: 18px;
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--accent) 72%, #ffffff), var(--accent));
  border: 3px solid #031013;
  box-shadow:
    inset 0 0 0 2px var(--cyan-dark),
    inset 0 0 35px rgba(3, 16, 19, 0.5);
  overflow: hidden;
  place-items: center;
}

.project-cover::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(16, 47, 49, 0.09) 4px
  );
  content: "";
}

.cover-label {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 4px 7px;
  z-index: 3;
  color: #031013;
  background: var(--cyan-bright);
  border: 1px solid #031013;
  font-family: "Press Start 2P", monospace;
  font-size: 6px;
  letter-spacing: 0.08em;
}

.project-meta {
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 0;
}

.project-meta h3 {
  margin: 0 0 6px;
  color: var(--cyan-bright);
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(22px, 1.8vw, 28px);
  font-weight: 400;
  letter-spacing: 0.03em;
}

.project-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.project-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  color: var(--cyan);
  border: 2px solid var(--cyan-dark);
  background: #041316;
  border-radius: 0;
  flex: 0 0 auto;
  font-size: 13px;
  place-items: center;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.project-card:hover .project-arrow {
  color: #031013;
  background: var(--cyan);
  transform: rotate(45deg);
}

.project-card:hover .project-cover > *:not(.cover-label) {
  transform: scale(1.04);
}

.cover-orbit::before,
.cover-orbit::after {
  position: absolute;
  width: 54%;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  content: "";
  transition: transform 500ms ease;
}

.cover-orbit::after {
  width: 28%;
  border-style: dashed;
}

.planet {
  width: 12%;
  aspect-ratio: 1;
  background: var(--warm);
  border: 2px solid var(--ink);
  border-radius: 50%;
  transition: transform 500ms ease;
}

.cover-number {
  position: absolute;
  top: 14px;
  left: 16px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.cover-number::before {
  content: "FILE_";
}

.cover-type {
  justify-items: start;
  align-content: center;
}

.type-line {
  display: block;
  color: var(--paper-light);
  font-size: clamp(42px, 6vw, 80px);
  font-weight: 700;
  letter-spacing: -0.1em;
  line-height: 0.7;
  transition: transform 500ms ease;
}

.type-line:first-child {
  position: absolute;
  top: 5%;
  right: 8%;
  color: transparent;
  -webkit-text-stroke: 1px var(--paper-light);
}

.color-swatch {
  position: absolute;
  width: 29%;
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 50%;
  mix-blend-mode: multiply;
  transition: transform 500ms ease;
}

.color-swatch-one {
  left: 20%;
  background: #23d9d1;
}

.color-swatch-two {
  right: 20%;
  background: #087d7c;
}

.color-swatch-three {
  bottom: 14%;
  background: #e9b872;
}

.sound-bars {
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.7vw, 9px);
  height: 44%;
}

.sound-bars i {
  display: block;
  width: clamp(5px, 0.7vw, 9px);
  height: 30%;
  background: var(--ink);
  animation: pulse 1.3s ease-in-out infinite alternate;
}

.sound-bars i:nth-child(2),
.sound-bars i:nth-child(6) {
  height: 62%;
  animation-delay: -0.4s;
}

.sound-bars i:nth-child(3),
.sound-bars i:nth-child(5) {
  height: 92%;
  animation-delay: -0.8s;
}

.sound-bars i:nth-child(4) {
  height: 45%;
  animation-delay: -0.2s;
}

.cover-grid {
  grid-template-columns: repeat(2, 20%);
  gap: 2px;
}

.grid-shape {
  width: 100%;
  aspect-ratio: 1;
  background: var(--ink);
  transition: transform 500ms ease;
}

.grid-shape:nth-child(2),
.grid-shape:nth-child(3) {
  border-radius: 50%;
}

.grid-shape:nth-child(3) {
  background: var(--paper-light);
}

.clock {
  position: absolute;
  width: 36%;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.clock::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  aspect-ratio: 1;
  background: var(--ink);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.clock-hand {
  position: absolute;
  bottom: 50%;
  left: calc(50% - 1px);
  width: 2px;
  height: 34%;
  background: var(--ink);
  transform-origin: bottom;
  animation: spin 8s linear infinite;
}

.time-digits {
  position: absolute;
  right: 7%;
  bottom: 8%;
  font-family: "DM Mono", monospace;
  font-size: clamp(14px, 2vw, 28px);
}

.empty-state {
  display: none;
  padding: 80px 20px;
  color: var(--muted);
  border: 1px dashed var(--line);
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 4vw;
  color: var(--cyan-bright);
  background: #031013;
  border-top: 3px double var(--cyan);
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
}

.site-footer .brand-mark {
  width: 30px;
  height: 30px;
}

.coming-soon {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  place-items: center;
  transition:
    opacity 200ms ease,
    visibility 200ms ease;
}

.coming-soon:target {
  visibility: visible;
  opacity: 1;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 43, 45, 0.72);
  backdrop-filter: blur(8px);
}

.dialog-card {
  position: relative;
  width: min(500px, 100%);
  padding: clamp(34px, 6vw, 64px);
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 4px,
      rgba(16, 47, 49, 0.035) 5px
    ),
    #071d21;
  border: 3px double var(--cyan);
  box-shadow:
    14px 14px 0 #020b0d,
    0 0 28px rgba(35, 216, 209, 0.4);
}

.dialog-card h2 {
  margin: 0 0 18px;
  color: var(--cyan-bright);
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(36px, 5vw, 58px);
  letter-spacing: 0;
}

.dialog-card > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
}

.dialog-close {
  display: inline-block;
  margin-top: 22px;
  padding: 11px 20px;
  color: #031013;
  background: var(--cyan);
  border: 2px solid var(--cyan-bright);
  box-shadow: 3px 3px 0 var(--cyan-dark);
  font-size: 13px;
}

.about-page {
  min-height: calc(100vh - var(--header-height));
  padding: 72px 4vw 100px;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(420px, 1.3fr);
  gap: clamp(48px, 8vw, 130px);
  align-items: start;
  padding-top: 40px;
}

.about-heading h1 {
  margin: 0;
  color: var(--cyan-bright);
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(58px, 8vw, 120px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.94;
  text-shadow:
    5px 5px 0 var(--cyan-dark),
    0 0 22px rgba(35, 216, 209, 0.4);
}

.about-file {
  display: inline-block;
  margin-top: 34px;
  padding: 8px 12px;
  color: var(--warm);
  background: #020b0d;
  border: 1px solid var(--cyan-dark);
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
}

.about-content {
  padding: clamp(28px, 4vw, 54px);
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 4px,
      rgba(16, 47, 49, 0.04) 5px
    ),
    #071d21;
  border: 3px double var(--cyan);
  box-shadow:
    12px 12px 0 #020b0d,
    0 0 24px rgba(35, 216, 209, 0.2);
}

.about-lead {
  margin: 0 0 34px;
  color: var(--cyan-bright);
  font-family: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  font-size: clamp(26px, 2.5vw, 38px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.65;
}

.about-copy {
  color: var(--muted);
  font-size: 15px;
  line-height: 2;
}

.about-signature {
  margin: 38px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.about-back {
  display: inline-block;
  margin-top: 32px;
  padding: 10px 16px;
  color: #031013;
  background: var(--cyan);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 12px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes pulse {
  to {
    height: 100%;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 70px;
  }

  .site-header {
    padding: 0 20px;
  }

  .menu-toggle {
    position: relative;
    z-index: 12;
    display: grid;
    width: 40px;
    height: 40px;
    padding: 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
    place-content: center;
    gap: 6px;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 1px;
    background: var(--ink);
    transition: transform 180ms ease;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }

  .site-nav {
    position: absolute;
    top: 0;
    right: 0;
    display: none;
    width: min(340px, 100%);
    min-height: 100vh;
    padding: 110px 32px;
    background: #071d21;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-left: 3px double var(--cyan);
    box-shadow: -8px 0 0 #020b0d;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 18px 0;
    color: var(--cyan-bright);
    border-bottom: 1px solid var(--cyan-dark);
    font-size: 18px;
  }

  .nav-github {
    color: var(--cyan-bright);
    background: transparent;
  }

  .projects-section {
    padding: 56px 20px 80px;
  }

  .about-page {
    padding: 56px 20px 80px;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .project-cover {
    aspect-ratio: 4 / 3;
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-meta p {
    display: block;
  }

  .site-footer {
    padding: 26px 20px;
  }

  .site-footer > p {
    display: none;
  }
}

@media (max-width: 480px) {
  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 20px;
  }

  .filters {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-button {
    flex: 0 0 auto;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
