@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&family=Archivo+Narrow:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-tap-highlight-color: transparent; }
*:focus,
*:focus-visible,
*:active {
  outline: none;
}

.lil-gui .title {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.lil-gui {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

.lil-gui .title,
.lil-gui .controller {
  background: rgba(0, 0, 0, 0.18) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 0;
  margin: 6px;
}

.lil-gui .title {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.lil-gui {
  width: 360px !important;
  min-width: 360px !important;
  max-width: 360px !important;
}

@media (max-width: 720px) {
  .lil-gui {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
  }
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "SF Mono", Monaco, "Courier New", monospace;
  background: #000;
  -webkit-user-select: none;
  user-select: none;
}

@media (hover: none) and (pointer: coarse) {
  *, *::before, *::after {
    -webkit-tap-highlight-color: transparent;
  }

  .data-card,
  .card-header,
  .paper-panel,
  .nav-btn,
  .mode-btn,
  .res-link,
  .simple-card,
  .simple-card-link,
  .about-close,
  #image-close,
  #project-image-close {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
  }

  .data-card,
  .card-header,
  .paper-panel,
  .simple-card,
  .simple-card-header {
    -webkit-user-select: none;
    user-select: none;
  }
}

button,
a {
  -webkit-appearance: none;
  appearance: none;
}

#shader-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.6) 100%);
}

.landing {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* Logo */
.logo-section {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  z-index: 1000;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4em;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 6px;
}

.tagline {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
}

/* Main container */
.main-container {
  position: relative;
  width: min(900px, 95vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Card Stack Container */
.stack-container {
  position: relative;
  width: 100%;
  height: 340px;
  perspective: 2000px;
  perspective-origin: 50% 30%;
}

.card-stack {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

:root {
  --accent: #66c6ff;
  --chipBorder: rgba(255, 255, 255, 0.22);
  --textBacking: rgba(0, 0, 0, 0.32);
  --text: rgba(255, 255, 255, 0.92);
  --textDim: rgba(255, 255, 255, 0.72);
}

.chamfer { clip-path: none; }

/* ArchiveCard — invisible frame, content blurs bg */
.data-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  max-width: 800px;
  height: 260px;
  margin-left: -50%;
  margin-top: -130px;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
  isolation: isolate;
  will-change: transform, opacity;
  backface-visibility: hidden;
  opacity: 0;
  pointer-events: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.data-card::before,
.data-card::after { content: none; }

/* Active — front and center, shifted up */
.data-card.active {
  transform: translateZ(80px) translateY(-20px) scale(1);
  opacity: 1;
  pointer-events: auto;
  z-index: 50;
}

/* Next card (below) */
.data-card.next-1 {
  transform: translateZ(-30px) translateY(155px) scale(0.88);
  opacity: 0.65;
  z-index: 40;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  filter: blur(1.4px);
}
.data-card.next-2 {
  transform: translateZ(-60px) translateY(200px) scale(0.80);
  opacity: 0.40;
  z-index: 30;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  filter: blur(2px);
}

/* Previous card (above) */
.data-card.prev-1 {
  transform: translateZ(-30px) translateY(-175px) scale(0.88);
  opacity: 0.65;
  z-index: 40;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  filter: blur(1.4px);
}
.data-card.prev-2 {
  transform: translateZ(-60px) translateY(-215px) scale(0.80);
  opacity: 0.40;
  z-index: 30;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  filter: blur(2px);
}

.data-card.hidden {
  transform: translateZ(-120px) translateY(260px) scale(0.7);
  opacity: 0;
  z-index: 0;
}

/* Ghost cards: fade body content */
.data-card.next-1 .card-body,
.data-card.prev-1 .card-body { opacity: 0.30; }
.data-card.next-2 .card-body,
.data-card.prev-2 .card-body { opacity: 0.35; }

/* Ghost cards: dim header text */
.data-card.next-1 .card-header,
.data-card.prev-1 .card-header { opacity: 0.85; }
.data-card.next-2 .card-header,
.data-card.prev-2 .card-header { opacity: 0.60; }

/* HeaderStrip — thin glass bar */
.card-header {
  height: 42px;
  min-height: 42px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(60px) saturate(160%);
  -webkit-backdrop-filter: blur(60px) saturate(160%);
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.card-header-content {
  width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.card-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.card-index {
  font-family: "SF Mono", Monaco, "Courier New", monospace;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
}

.card-title {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-counter {
  font-family: "SF Mono", Monaco, "Courier New", monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.22em;
}

/* Body */
.card-body {
  padding: 0;
  flex: 1;
  background: transparent;
  position: relative;
  z-index: 1;
}

/* Glass panel — blurs the shader behind it */
.paper-panel {
  height: 100%;
  background: rgba(255, 255, 255, 0.10);
  border: none;
  border-top: none;
  border-radius: 0;
  backdrop-filter: blur(60px) saturate(160%);
  -webkit-backdrop-filter: blur(60px) saturate(160%);
  transform: translate3d(0, 0, 0);
  will-change: backdrop-filter;
  backface-visibility: hidden;
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.paper-panel::after { content: none; }

.card-desc {
  font-family: "SF Mono", Monaco, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 16px;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

.card-desc::before { content: none; }

/* Resource chips */
.resource-links {
  display: flex;
  gap: 10px;
  margin-top: auto;
  position: relative;
  z-index: 1;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  justify-content: flex-end;
  width: 100%;
}

body[data-resource-links="left"] .resource-links {
  justify-content: flex-start;
}

.resource-links.align-left {
  justify-content: flex-start;
}

.resource-links.align-right {
  justify-content: flex-end;
}

.res-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--chipBorder);
  border-radius: 0;
  font-family: "SF Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--textDim);
  cursor: pointer;
  transition: all 0.15s ease;
}

.res-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.95);
}

.res-link svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

/* Corner brackets — wider spacing */
.edge-mark {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.5;
}

.edge-mark::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
}

.edge-mark::after {
  content: '';
  position: absolute;
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.28);
}

.edge-mark.tl { top: -10px; left: -10px; }
.edge-mark.tl::before { top: 0; left: 0; }
.edge-mark.tl::after { top: 0; left: 0; }

.edge-mark.tr { top: -10px; right: -10px; }
.edge-mark.tr::before { top: 0; right: 0; }
.edge-mark.tr::after { top: 0; right: 0; }

.edge-mark.bl { bottom: -10px; left: -10px; }
.edge-mark.bl::before { bottom: 0; left: 0; }
.edge-mark.bl::after { bottom: 0; left: 0; }

.edge-mark.br { bottom: -10px; right: -10px; }
.edge-mark.br::before { bottom: 0; right: 0; }
.edge-mark.br::after { bottom: 0; right: 0; }

/* Navigation - Below the stack */
.nav-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-top: 80px;
  padding: 20px;
  position: relative;
}

/* Corner frame around nav */
.nav-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.nav-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: rgba(255,255,255,0.2);
  border-style: solid;
}

.nav-corner.tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.nav-corner.tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.nav-corner.bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.nav-corner.br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

/* Modal corner markers */
.about-modal-wrapper {
  position: relative;
  padding: 12px;
  max-width: 560px;
  width: 90vw;
}

.modal-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: rgba(255,255,255,0.3);
  border-style: solid;
}

.modal-corner.tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.modal-corner.tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.modal-corner.bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.modal-corner.br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  font-family: "SF Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(102, 198, 255, 0.12);
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.nav-counter {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4);
  min-width: 80px;
  text-align: center;
}

.nav-counter .current {
  color: rgba(255,255,255,0.95);
  font-weight: 600;
}

/* Scanlines overlay */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.03;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.1) 2px,
    rgba(0,0,0,0.1) 4px
  );
}


/* About Modal - Desktop Software Style */
.about-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.about-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.about-modal {
  background: rgba(10, 10, 15, 0.4);
  backdrop-filter: blur(80px) saturate(200%);
  -webkit-backdrop-filter: blur(80px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 60px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: scale(0.95);
  clip-path: inset(50% 0 50% 0);
  transition: clip-path 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s ease;
}
.about-modal-overlay.active .about-modal {
  transform: scale(1);
  clip-path: inset(0 0 0 0);
}

.about-modal-overlay.closing .about-modal {
  transition: clip-path 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s ease;
  clip-path: inset(50% 0 50% 0);
}

/* Image Modal */
.image-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 520;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.image-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.image-modal-wrapper {
  position: relative;
  padding: 12px;
  width: min(90vw, 980px);
}

.image-modal {
  background: rgba(10, 10, 15, 0.45);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 28px;
  width: 100%;
  position: relative;
  transform: scale(0.97);
  clip-path: inset(50% 0 50% 0);
  transition: clip-path 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s ease;
}

.image-modal-path {
  position: absolute;
  top: 14px;
  right: 52px;
  font-family: "SF Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 236, 210, 0.75);
  text-shadow: 0 0 6px rgba(245, 236, 210, 0.4);
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.image-modal-overlay.active .image-modal {
  transform: scale(1);
  clip-path: inset(0 0 0 0);
}

.image-modal-overlay.closing .image-modal {
  clip-path: inset(50% 0 50% 0);
}

.image-modal-body {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 88vw;
  max-height: 78vh;
  margin: 0 auto;
  padding-top: 24px;
}

.image-frame {
  position: relative;
  padding: 14px 10px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.image-frame-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: rgba(255,255,255,0.45);
  border-style: solid;
}

.image-frame-corner.tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.image-frame-corner.tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.image-frame-corner.bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.image-frame-corner.br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.image-modal-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  object-fit: contain;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.4s ease 0.15s, transform 0.4s ease 0.15s;
}

.image-modal-overlay.active .image-modal-img {
  opacity: 1;
  transform: scale(1);
}

.image-modal-overlay.closing .image-modal-img {
  opacity: 0;
  transform: scale(0.96);
}

.image-modal-caption {
  margin-top: 16px;
  font-family: "SF Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  text-align: center;
}

/* CRT Scanline effect during image modal open/close */
.image-modal::before,
.image-modal::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 0.2px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.45), 0 0 10px rgba(255, 255, 255, 0.25);
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}

.image-modal::before {
  top: 50%;
  transform: translateY(-50%);
}

.image-modal::after {
  bottom: 50%;
  transform: translateY(50%);
}

.image-modal-overlay.opening .image-modal::before {
  animation: imageCrtScanlineTop 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.image-modal-overlay.opening .image-modal::after {
  animation: imageCrtScanlineBottom 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.image-modal-overlay.closing .image-modal::before {
  animation: imageCrtScanlineTopClose 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.image-modal-overlay.closing .image-modal::after {
  animation: imageCrtScanlineBottomClose 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes imageCrtScanlineTop {
  0% { opacity: 1; top: 50%; }
  100% { opacity: 0; top: 0%; }
}

@keyframes imageCrtScanlineBottom {
  0% { opacity: 1; bottom: 50%; }
  100% { opacity: 0; bottom: 0%; }
}

@keyframes imageCrtScanlineTopClose {
  0% { opacity: 0; top: 0%; }
  100% { opacity: 1; top: 50%; }
}

@keyframes imageCrtScanlineBottomClose {
  0% { opacity: 0; bottom: 0%; }
  100% { opacity: 1; bottom: 50%; }
}
.about-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}
.about-logo-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.about-logo-img.inverted {
  filter: invert(1) drop-shadow(0 4px 12px rgba(0,0,0,0.3)) !important;
}
.about-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.4em;
  color: rgba(255,255,255,0.9);
}
.about-text {
  font-family: 'SF Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,0.7);
}
.about-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.about-close:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.3);
}
.about-close svg {
  width: 14px;
  height: 14px;
  stroke: rgba(255,255,255,0.5);
  stroke-width: 2;
}
.about-close:hover svg {
  stroke: rgba(255,255,255,0.9);
}

.about-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-family: 'SF Mono', monospace;
  font-size: 11px;
  line-height: 1.8;
  color: rgba(255,255,255,0.5);
}

.about-footer-line {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.about-footer-label {
  color: rgba(255,255,255,0.4);
}

.about-footer-value {
  color: rgba(255,255,255,0.7);
}

.about-footer-url {
  margin-top: 8px;
  color: rgba(255,255,255,0.6);
}

.about-footer-copyright {
  margin-top: 16px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Project Image Modal */
.project-image-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.project-image-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.project-image-modal-wrapper {
  position: relative;
  padding: 12px;
  max-width: 90vw;
  max-height: 90vh;
}
.project-image-modal {
  background: rgba(10, 10, 15, 0.4);
  backdrop-filter: blur(80px) saturate(200%);
  -webkit-backdrop-filter: blur(80px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 40px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  clip-path: inset(50% 0 50% 0);
  transition: clip-path 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-image-modal-overlay.active .project-image-modal {
  clip-path: inset(0 0 0 0);
}
.project-image-display {
  max-width: 80vw;
  max-height: 80vh;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease 0.2s, transform 0.3s ease 0.2s;
}
.project-image-modal-overlay.active .project-image-display {
  opacity: 1;
  transform: scale(1);
}
/* CRT Scanline effect during opening */
.project-image-modal::before,
.project-image-modal::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(102, 198, 255, 0.8);
  box-shadow: 0 0 10px rgba(102, 198, 255, 0.8), 0 0 20px rgba(102, 198, 255, 0.4);
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}
.project-image-modal::before {
  top: 50%;
  transform: translateY(-50%);
}
.project-image-modal::after {
  bottom: 50%;
  transform: translateY(50%);
}
.project-image-modal-overlay.opening .project-image-modal::before {
  animation: crtScanlineTop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.project-image-modal-overlay.opening .project-image-modal::after {
  animation: crtScanlineBottom 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes crtScanlineTop {
  0% { opacity: 1; top: 50%; }
  100% { opacity: 0; top: 0%; }
}
@keyframes crtScanlineBottom {
  0% { opacity: 1; bottom: 50%; }
  100% { opacity: 0; bottom: 0%; }
}

/* Mode Toggle */
.mode-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  gap: 8px;
}
.mode-btn {
  padding: 8px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  font-family: 'SF Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}
.mode-btn:hover {
  background: rgba(102, 198, 255, 0.12);
  border-color: rgba(102, 198, 255, 0.4);
  color: #66c6ff;
}
.mode-btn.active {
  background: rgba(102, 198, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* Simple List (Regular Mode) */
.simple-list { display: none; }
body.regular-mode .simple-list { display: block; }
body.regular-mode .stack-container,
body.regular-mode .card-stack,
body.regular-mode .nav-container,
body.regular-mode .vignette,
body.regular-mode .scanlines { display: none !important; }
body.regular-mode .regular-bg { display: block; position: fixed; z-index: -1; background: linear-gradient(180deg, #2a2a4e 0%, #1a1a2e 100%); }
body.regular-mode { overflow: auto; }
body.regular-mode #shader-bg { display: none; }
body.regular-mode .landing { position: relative; padding: 40px 20px; }
body.regular-mode .main-container { width: 100%; max-width: 800px; }
.simple-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); margin: 0 0 20px 0; cursor: pointer; transition: all 0.2s; overflow: hidden; }
.simple-card:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.3); transform: translateX(4px); }
.simple-card-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: rgba(102, 198, 255, 0.15); border-bottom: 1px solid rgba(102, 198, 255, 0.25); }
.simple-card-title { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.95); letter-spacing: 0.2em; text-transform: uppercase; }
.simple-card-index { font-family: 'SF Mono', monospace; font-size: 11px; color: rgba(102, 198, 255, 0.8); font-weight: 600; }
.simple-card-body { padding: 20px; }
.simple-card-desc { font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.7; margin-bottom: 16px; }
.simple-card-links { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.1); justify-content: flex-end; }
body[data-resource-links="left"] .simple-card-links { justify-content: flex-start; }

.simple-card-links.align-left { justify-content: flex-start; }
.simple-card-links.align-right { justify-content: flex-end; }
.simple-card-link { padding: 6px 12px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.65); text-decoration: none; transition: all 0.15s; }
.simple-card-link:hover { background: rgba(102, 198, 255, 0.15); border-color: rgba(102, 198, 255, 0.4); color: rgba(102, 198, 255, 0.9); }

/* Responsive */
@media (max-width: 640px) {
  .stack-container {
    height: 300px;
  }

  .about-modal-wrapper {
    width: min(90vw, 980px);
    max-height: 90vh;
    padding: 12px;
  }

  .about-modal {
    padding: 28px;
    max-height: 80vh;
    overflow-y: auto;
  }

  .data-card {
    height: 220px;
    margin-top: -110px;
  }

  .card-header {
    height: 44px;
  }

  .card-index {
    font-size: 24px;
  }

  .card-title {
    font-size: 16px;
  }

  .card-desc {
    font-size: 12px;
  }

  .nav-container {
    margin-top: 60px;
    gap: 24px;
  }

  .nav-btn {
    padding: 10px 16px;
    font-size: 10px;
  }
}
