:root {
  --bg: #ffffff;
  --text: #101010;
  --muted: #666666;
  --line: #ded8cf;
  --panel: #f6f2eb;
  --lemon-icing: #F6EBC8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
  --transition: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Space Grotesk", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.screen {
  position: fixed;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  background: var(--bg);
}

.screen.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Landing Screen */
#landing-screen {
  display: grid;
  place-items: center;
  padding: 24px;
  background: #ffffff;
  z-index: 100;
}

.intro-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.intro-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background-color: var(--lemon-icing);
  width: min(400px, 80vw);
  aspect-ratio: 1;
  border-radius: 999px;
  box-shadow: 0 40px 100px rgba(246, 235, 200, 0.4);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  cursor: pointer;
}

.intro-button:hover {
  transform: scale(1.05);
  box-shadow: 0 60px 120px rgba(246, 235, 200, 0.6);
}

.intro-hint {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.skip-button {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: underline;
  margin-top: 12px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.skip-button:hover {
  opacity: 1;
}

.brand-small {
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(16, 16, 16, 0.5);
  font-weight: 500;
}

.brand-main {
  font-family: "Instrument Serif", serif;
  font-size: clamp(48px, 8vw, 84px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--text);
}

/* Lego Container */
.lego-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  min-height: 0;
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.lego-canvas-wrapper {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: white;
  padding: 20px;
}

#lego-canvas {
  max-width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

.lego-actions {
  display: flex;
  gap: 16px;
}

.action-btn {
  padding: 14px 32px;
  border-radius: 999px;
  background: var(--text);
  color: white;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.action-btn.secondary {
  background: var(--panel);
  color: var(--text);
}

/* Gallery Screen */
#gallery-screen {
  display: flex;
  flex-direction: column;
  padding: 40px;
  transform: translateY(20px);
}

#gallery-screen.visible {
  transform: translateY(0);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.back-link {
  font-size: 13px;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.3s ease;
}

.back-link:hover {
  color: var(--text);
}

.category-selector {
  display: flex;
  gap: 8px;
  background: #f5f5f5;
  padding: 4px;
  border-radius: 999px;
}

.category-button {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 10px 24px;
  border-radius: 999px;
  color: var(--muted);
  transition: all 0.3s ease;
}

.category-button.active {
  background: white;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Slider */
.slider-container {
  flex: 1;
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.slider-track {
  display: flex;
  height: 100%;
  transition: transform var(--transition);
  align-items: center;
}

.slide {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.slide-content {
  position: relative;
  width: min(500px, 85vw);
  aspect-ratio: 1;
  border-radius: 48px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #f0f0f0;
}

.slide-image {
  width: 100%;
  height: 100%;
}

.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Glass Overlay */
.glass-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
  z-index: 5;
}

.glass-overlay:hover {
  background: rgba(255, 255, 255, 0.1);
}

.glass-overlay.active {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.overlay-hint {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: white;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: opacity 0.4s ease;
}

.glass-overlay.active .overlay-hint {
  opacity: 0;
}

.prompt-display {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  pointer-events: none;
}

.glass-overlay.active .prompt-display {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.prompt-text-inside {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.5);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.slider-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
  padding: 0 10px;
}

.nav-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  pointer-events: auto;
  transition: all 0.3s ease;
  color: var(--text);
}

.nav-btn:hover {
  transform: scale(1.1);
  background: var(--text);
  color: white;
}

/* Footer Details */
.prompt-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.prompt-info {
  max-width: 700px;
}

.prompt-category {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.prompt-headline {
  font-family: "Instrument Serif", serif;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  font-weight: 400;
  margin-bottom: 16px;
}

.prompt-description {
  font-size: 15px;
  line-height: 1.6;
  color: #444;
  font-style: italic;
}

.prompt-counter {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 42px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 300;
  letter-spacing: -0.05em;
}

.prompt-total {
  font-size: 18px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  #gallery-screen {
    padding: 24px;
  }

  .site-header {
    margin-bottom: 24px;
  }

  .slide {
    padding: 0;
  }

  .slider-controls {
    display: none;
  }

  .prompt-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .prompt-counter {
    font-size: 32px;
  }
}
