/* ============================================
   murijii (無理じい) — style.css
   Chaotic / Vibrant Masonry Infinite Scroll
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  background: #0a0a0f;
  color: #e8e8f0;
  font-family: 'DotGothic16', 'Noto Sans JP', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: #ff2d95;
  color: #000;
}

/* === Particle Background === */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: particle-fall linear infinite;
}

@keyframes particle-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* === Warning Modal === */
.warning-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 15, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: overlay-fade-in 0.5s ease;
}

.warning-overlay.hidden {
  display: none;
}

@keyframes overlay-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.warning-modal {
  background: linear-gradient(135deg, #1a0a20, #0a0a20);
  border: 2px solid rgba(255, 45, 149, 0.4);
  border-radius: 20px;
  padding: 48px 40px;
  max-width: 520px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(255, 45, 149, 0.15), 0 0 120px rgba(0, 204, 255, 0.08);
  animation: modal-bounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-bounce {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.warning-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: warning-pulse 2s ease-in-out infinite;
}

@keyframes warning-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 45, 149, 0.3)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 20px rgba(255, 45, 149, 0.6)); }
}

.warning-title {
  font-size: 36px;
  font-family: 'Zen Dots', 'DotGothic16', monospace;
  background: linear-gradient(90deg, #ff2d95, #aa44ff, #00ccff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.warning-sub {
  font-size: 18px;
  background: linear-gradient(90deg, #00ff88, #ccff00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-top: 4px;
}

.warning-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 45, 149, 0.5), rgba(0, 204, 255, 0.5), transparent);
  margin: 20px 0;
}

.warning-desc {
  font-size: 14px;
  line-height: 1.8;
  color: #c0c0d8;
  margin-bottom: 12px;
}

.warning-desc strong {
  color: #ff2d95;
}

.warning-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 36px;
  font-family: 'DotGothic16', monospace;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, #ff2d95, #aa44ff);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 2px;
  box-shadow: 0 4px 20px rgba(255, 45, 149, 0.3);
}

.warning-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 30px rgba(255, 45, 149, 0.5);
}

.warning-btn:active {
  transform: translateY(0) scale(0.98);
}

.warning-tip {
  margin-top: 20px;
  font-size: 11px;
  color: #666;
  line-height: 1.6;
}

.warning-tip kbd {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-family: 'DotGothic16', monospace;
  font-size: 11px;
}

/* === Header === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(10, 10, 15, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header.hidden { display: none; }

.site-title {
  font-size: 20px;
  font-family: 'Zen Dots', monospace;
  background: linear-gradient(90deg, #ff2d95, #aa44ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-status {
  font-size: 12px;
  color: #666;
}

.header-dot {
  margin: 0 8px;
  color: #333;
}

/* === Masonry Grid === */
#masonry-container {
  column-count: 4;
  column-gap: 14px;
  padding: 24px;
  padding-top: 80px;
  max-width: 1800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* === Items === */
.item {
  break-inside: avoid;
  margin-bottom: 14px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid transparent;
}

.item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

/* Image item */
.item.image-item {
  line-height: 0;
}

.item.image-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 0.3s ease;
}

.item.image-item:hover img {
  filter: brightness(1.1) saturate(1.2);
}

/* === Entry Animations === */
.item.anim-fade-in {
  animation: ca-fade-in 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.item.anim-slide-up {
  animation: ca-slide-up 0.7s ease-out both;
}

.item.anim-rotate-in {
  animation: ca-rotate-in 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.item.anim-scale-in {
  animation: ca-scale-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.item.anim-glitch-in {
  animation: ca-glitch-in 0.5s ease both;
}

@keyframes ca-fade-in {
  0% { opacity: 0; transform: scale(0.5) rotate(-5deg); filter: hue-rotate(180deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); filter: hue-rotate(0deg); }
}

@keyframes ca-slide-up {
  0% { opacity: 0; transform: translateY(80px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ca-rotate-in {
  0% { opacity: 0; transform: rotate(-15deg) scale(0.6); }
  100% { opacity: 1; transform: rotate(0deg) scale(1); }
}

@keyframes ca-scale-in {
  0% { opacity: 0; transform: scale(0.2); }
  50% { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes ca-glitch-in {
  0% { opacity: 0; clip-path: inset(0 0 100% 0); }
  20% { clip-path: inset(0 0 40% 0); transform: translate(-3px, 2px); }
  40% { clip-path: inset(30% 0 20% 0); transform: translate(3px, -1px); }
  60% { clip-path: inset(10% 0 60% 0); transform: translate(-2px, 3px); }
  80% { clip-path: inset(50% 0 10% 0); transform: translate(2px, -2px); }
  100% { opacity: 1; clip-path: inset(0 0 0 0); transform: translate(0, 0); }
}

/* === Sentinel === */
#sentinel {
  height: 1px;
  position: relative;
  z-index: 1;
}

/* === Loading === */
.loading {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  font-size: 12px;
  color: #888;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.loading.hidden { display: none; }

.loading-bar {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 45, 149, 0.3);
  border-top-color: #ff2d95;
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

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

/* === Footer === */
.footer {
  text-align: center;
  padding: 32px 16px 48px;
  font-size: 11px;
  color: #444;
  position: relative;
  z-index: 1;
}

.footer.hidden { display: none; }

/* === Skip invisible image guard === */
.item-load-error {
  display: none;
}

/* === Responsive === */
@media (max-width: 1200px) {
  #masonry-container { column-count: 4; }
}

@media (max-width: 900px) {
  #masonry-container { column-count: 3; column-gap: 10px; padding: 16px; padding-top: 70px; }
  .item { margin-bottom: 10px; border-radius: 10px; }
}

@media (max-width: 600px) {
  #masonry-container { column-count: 2; column-gap: 8px; padding: 12px; padding-top: 64px; }
  .item { margin-bottom: 8px; border-radius: 8px; }
  .warning-modal { padding: 32px 24px; }
  .warning-title { font-size: 28px; }
  .header { padding: 8px 16px; }
  .site-title { font-size: 16px; }
}

@media (max-width: 380px) {
  #masonry-container { column-count: 1; }
}
