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

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

body {
  background: #faf8f4;
  font-family: 'JetBrains Mono', monospace;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}
body.scrollable { overflow: auto; }

/* --- Custom cursor --- */
.custom-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  will-change: transform;
  transition: width 0.2s ease, height 0.2s ease, margin 0.2s ease;
}
.custom-cursor.hover {
  width: 20.4px; height: 20.4px;
  margin: -10.2px 0 0 -10.2px;
  background: #FF5A2C;
  mix-blend-mode: normal;
}

/* --- Loading screen --- */
.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #faf8f4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}
.loader-overlay.fade-out { opacity: 0; pointer-events: none; }
.loader-spheres {
  position: relative;
  width: 160px; height: 160px;
}
.loader-spheres .sp {
  position: absolute;
  border-radius: 50%;
  background: #1a1a1a;
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.loader-spheres .sp.sp-big { width: 52px; height: 52px; }
.loader-spheres .sp.sp-med {
  width: 38px; height: 38px;
  background: transparent;
  border: 5px solid #1a1a1a;
}
.loader-spheres .sp.sp-sm  { width: 20px; height: 20px; }

/* --- Lab hero --- */
.lab-hero {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  height: min(6vw, 60px);
  width: auto;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.lab-hero.visible { opacity: 1; }
.lab-hero.on-scene {
  mix-blend-mode: difference;
  filter: invert(1);
  transition: opacity 0.5s ease;
}
.lab-hero.in-flow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 12;
  mix-blend-mode: normal;
  filter: none;
  opacity: 1;
  pointer-events: none;
  transition: top 0.4s ease, transform 0.4s ease;
}
.lab-hero.in-flow.pinned-top {
  top: 16px;
  transform: translate(-50%, 0);
  height: min(3vw, 30px);
}

/* --- Triangle overlay --- */
#triangleOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 6;
  display: none;
  will-change: opacity;
}

/* --- Coming soon / WIP overlay --- */
.coming-soon-overlay {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  pointer-events: none;
  width: 80%;
  max-width: 320px;
}
.coming-soon-overlay.visible {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.coming-soon-card {
  background: rgba(250,248,244,0.88);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid rgba(26,26,26,0);
  overflow: hidden;
  width: 100%;
  max-width: 320px;
  transform-origin: center center;
  transform: scaleY(0.04);
  opacity: 0;
  will-change: transform, opacity;
}
.coming-soon-card.nier-animate {
  animation: nier-card-expand 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.coming-soon-card.nier-collapse {
  animation: nier-card-collapse 0.35s cubic-bezier(0.7, 0, 0.84, 0) both;
}
.coming-soon-header {
  background: rgba(26,26,26,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: rgba(250,248,244,0.85);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(26,26,26,0.12);
  position: relative;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.coming-soon-close {
  background: none;
  border: none;
  color: rgba(250,248,244,0.5);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  cursor: none;
  pointer-events: auto;
  transition: color 0.15s;
}
.coming-soon-close:hover { color: rgba(250,248,244,0.9); }
.nier-animate .coming-soon-header {
  animation: nier-body-reveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}
.coming-soon-header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(250,248,244,0.04) 50%, transparent 50.5%, transparent 100%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0;
}
.nier-animate .coming-soon-header::after {
  animation: nier-scanlines 0.15s steps(2) 0.35s 3;
}
.coming-soon-body {
  padding: 24px 24px 20px;
  opacity: 0;
  transform: translateY(6px);
}
.nier-animate .coming-soon-body {
  animation: nier-body-reveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}
.coming-soon-title {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #1a1a1a;
  margin: 0 0 12px;
}
.coming-soon-text {
  font-size: 10px;
  font-weight: 300;
  color: rgba(26,26,26,0.5);
  letter-spacing: 0.04em;
  line-height: 1.6;
  margin: 0;
}

/* NieR-style keyframes */
@keyframes nier-card-expand {
  0% { transform: scaleY(0.04); opacity: 0; border-color: rgba(26,26,26,0); }
  30% { transform: scaleY(0.04); opacity: 1; border-color: rgba(26,26,26,0.2); }
  100% { transform: scaleY(1); opacity: 1; border-color: rgba(26,26,26,0.12); }
}
@keyframes nier-body-reveal {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes nier-scanlines {
  0% { opacity: 0.6; } 50% { opacity: 0; } 100% { opacity: 0.4; }
}
@keyframes nier-card-collapse {
  0% { transform: scaleY(1); opacity: 1; border-color: rgba(26,26,26,0.12); }
  70% { transform: scaleY(0.04); opacity: 1; border-color: rgba(26,26,26,0.2); }
  100% { transform: scaleY(0.04); opacity: 0; border-color: rgba(26,26,26,0); }
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  padding: 12px 20px;
  gap: 10px;
  pointer-events: none;
  background: rgba(250,248,244,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header > * { pointer-events: auto; }
.monogram { height: 36px; width: auto; }
.logo { height: 15px; width: auto; }
.header-spacer { flex: 1; }

.header-section-svg {
  display: none;
  height: 14px;
  width: auto;
}

/* --- Language dropdown --- */
.lang-dropdown {
  position: relative;
  margin-right: 10px;
}
.lang-current {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: none;
  background: rgba(26,26,26,0.06);
  color: rgba(26,26,26,0.6);
  border: 1px solid rgba(26,26,26,0.08);
  transition: all 0.25s;
}
.lang-current::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 3.5px solid currentColor;
  margin-left: 2px;
  transition: transform 0.2s;
}
.lang-dropdown.open .lang-current::after {
  transform: rotate(180deg);
}
.lang-current:hover {
  color: #1a1a1a;
  background: rgba(26,26,26,0.1);
}
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 100%;
  background: rgba(250,248,244,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(26,26,26,0.1);
  z-index: 100;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.lang-dropdown.open .lang-menu {
  display: flex;
}
.lang-option {
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: none;
  background: transparent;
  color: rgba(26,26,26,0.5);
  border: none;
  text-align: left;
  transition: all 0.15s;
  white-space: nowrap;
}
.lang-option:hover:not(.disabled) {
  color: #1a1a1a;
  background: rgba(26,26,26,0.06);
}
.lang-option.active {
  color: #1a1a1a;
  font-weight: 500;
}
.lang-option.disabled {
  opacity: 0.25;
  pointer-events: none;
  cursor: none;
}
.lang-divider {
  height: 1px;
  background: rgba(26,26,26,0.08);
  margin: 2px 0;
}

/* --- Nav --- */
.nav {
  display: flex;
  gap: 0;
}
.nav a {
  padding: 6px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: none;
  background: rgba(26,26,26,0.06);
  color: rgba(26,26,26,0.4);
  border: none;
  border-left: 1px solid rgba(26,26,26,0.08);
  text-decoration: none;
  transition: all 0.25s;
  position: relative;
}
.nav a:first-child { border-left: none; }
.nav a:hover {
  color: #1a1a1a;
  background: rgba(26,26,26,0.1);
}
.nav a.active {
  background: rgba(26,26,26,0.85);
  color: #faf8f4;
}

/* --- Lab section --- */
.lab-section {
  display: none;
  width: 100%;
  min-height: 100vh;
  padding: 40px 5vw 80px;
  position: relative;
  z-index: 5;
  background: transparent;
}
.lab-section.visible { display: block; }

.lab-spacer {
  height: 100vh;
  pointer-events: none;
}

/* --- Article listing grid --- */
.lab-grid {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lab-card {
  display: block;
  padding: 28px 32px;
  border: 1px solid rgba(26,26,26,0.12);
  background: rgba(250,248,244,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
  color: inherit;
  cursor: none;
  transition: border-color 0.3s;
}
.lab-card:hover { border-color: #FF5A2C; }

.lab-card-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(26,26,26,0.35);
  border-bottom: 1px solid rgba(26,26,26,0.08);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.lab-card-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a1a1a;
  margin-bottom: 10px;
}
.lab-card-desc {
  font-size: 10px;
  font-weight: 300;
  color: rgba(26,26,26,0.5);
  letter-spacing: 0.04em;
  line-height: 1.7;
  margin-bottom: 16px;
}
.lab-card-meta {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(26,26,26,0.3);
  border-top: 1px solid rgba(26,26,26,0.08);
  padding-top: 12px;
}

/* --- Article --- */
.lab-article {
  display: none;
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 80px;
}
.lab-article.visible { display: block; }

.article-back {
  display: inline-block;
  padding: 8px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: rgba(26,26,26,0.4);
  cursor: none;
  transition: color 0.2s;
  margin-bottom: 40px;
}
.article-back:hover { color: #1a1a1a; }

.article-header {
  margin-bottom: 60px;
}
.article-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(26,26,26,0.35);
  border-bottom: 1px solid rgba(26,26,26,0.08);
  padding-bottom: 8px;
  margin-bottom: 24px;
}
.article-title {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1a1a1a;
  line-height: 1.3;
}

.article-section {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(26,26,26,0.06);
}
.article-section:last-child {
  border-bottom: none;
}
.article-section h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1a1a;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(26,26,26,0.08);
}
.article-section p {
  font-size: 11px;
  font-weight: 300;
  color: rgba(26,26,26,0.65);
  letter-spacing: 0.03em;
  line-height: 1.9;
  margin-bottom: 14px;
}
.article-section p:last-child { margin-bottom: 0; }
.article-section p strong {
  font-weight: 500;
  color: rgba(26,26,26,0.8);
}
.article-section p em {
  font-style: italic;
}

.article-section--cta {
  text-align: center;
  padding: 48px 32px;
  background: rgba(26,26,26,0.03);
  border: 1px solid rgba(26,26,26,0.08);
  border-bottom: 1px solid rgba(26,26,26,0.08);
}
.article-section--cta h2 {
  border-bottom: none;
}
.article-section--cta p {
  color: rgba(26,26,26,0.5);
}

/* --- Footer (same as store) --- */
.store-footer {
  background: rgba(26,26,26,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: rgba(250,248,244,0.6);
  margin: 80px -5vw 0;
  padding: 0;
  position: relative;
  z-index: 11;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 200px 0 200px rgba(26,26,26,0.92);
  border-top: 2px solid rgba(250,248,244,0.1);
}
.footer-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 40px 60px;
  border-bottom: 1px solid rgba(250,248,244,0.06);
  box-shadow: 0 1px 0 0 rgba(250,248,244,0.03);
}
.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-logo-wrap .footer-monogram {
  height: 32px; width: auto;
  filter: invert(1);
}
.footer-logo-wrap .footer-logo {
  height: 14px; width: auto;
  filter: invert(1);
}
.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid rgba(250,248,244,0.06);
  box-shadow: 0 1px 0 0 rgba(250,248,244,0.03);
}
.footer-section {
  padding: 40px 40px;
  border-right: 1px solid rgba(250,248,244,0.06);
}
.footer-section:last-child { border-right: none; }
.footer-section h3 {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(250,248,244,0.3);
  margin-bottom: 20px;
  font-weight: 400;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(250,248,244,0.06);
  box-shadow: 0 1px 0 0 rgba(250,248,244,0.03);
}
.footer-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  line-height: 1.6;
}
.footer-info a {
  color: rgba(250,248,244,0.5);
  text-decoration: none;
  transition: color 0.25s;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: none;
}
.footer-info a:hover { color: rgba(250,248,244,0.9); }
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(250,248,244,0.2);
}
.footer-bottom-links {
  display: flex;
  gap: 40px;
}
.footer-bottom-links a {
  color: rgba(250,248,244,0.2);
  text-decoration: none;
  transition: color 0.25s;
  cursor: none;
}
.footer-bottom-links a:hover { color: rgba(250,248,244,0.7); }
.back-to-top {
  color: rgba(250,248,244,0.3);
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 0.12em;
  transition: all 0.25s;
  cursor: none;
}
.back-to-top:hover {
  transform: translateY(-2px);
  color: rgba(250,248,244,0.7);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-content { grid-template-columns: 1fr; }
  .footer-section {
    border-right: none;
    border-bottom: 1px solid rgba(250,248,244,0.08);
  }
  .footer-section:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
  * { cursor: auto; }
  .custom-cursor { display: none; }
  .header .monogram,
  .header .logo { display: none !important; }
  .header-section-svg {
    display: inline-block;
  }

  .lab-hero { display: none !important; }

  .header {
    padding: 10px 12px;
    gap: 6px;
  }

  .lang-dropdown {
    margin-right: 6px;
  }
  .lang-current {
    padding: 5px 8px;
    font-size: 8px;
  }

  .lab-section {
    padding: 80px 16px 0;
  }

  .lab-card {
    padding: 20px 20px;
  }

  .article-title {
    font-size: 20px;
  }

  .article-section h2 {
    font-size: 11px;
  }

  .footer-main { padding: 60px 20px 80px; }
  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    padding: 40px 20px;
  }
  .footer-bottom-links { gap: 20px; }
}
