/* ===== Variables ===== */
:root {
  --bg-deep: #060910;
  --bg-darker: #04060b;
  --text-silver: #c0c7d4;
  --text-silver-dim: rgba(192, 199, 212, 0.5);
  --accent-sky: #7ec8e3;
  --c-sain: #e8edf5;
  --c-kobi: #e04040;
  --c-yune: #f5c542;
  --c-tyan: #3b82f6;

  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Noto Sans KR', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* ===== Resets & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-silver);
  font-family: var(--font-sans);
  font-weight: 300;
  overflow-x: hidden;
  line-height: 1.6;
}

* {
  cursor: none !important;
}

#cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-silver);
  pointer-events: none;
  z-index: 100001;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

#cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(192, 199, 212, 0.3);
  pointer-events: none;
  z-index: 100000;
  transform: translate(-50%, -50%);
  transition: left 0.08s ease, top 0.08s ease;
}

#custom-cursor {
  position: fixed;
  top: 0; left: 0;
  font-size: 30px;
  pointer-events: none;
  z-index: 99999;
  filter: grayscale(100%) opacity(0.5);
  will-change: transform;
}

/* Disable custom cursor and reset default on touch devices (Mobile/Tablet) */
@media (hover: none) and (pointer: coarse) {
  #custom-cursor,
  #cursor-dot,
  #cursor-ring {
    display: none !important;
  }
  * {
    cursor: auto !important;
  }
}

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

/* ===== Typography ===== */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(192, 199, 212, 0.9);
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: 2px;
}

/* ===== Particles ===== */
#particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  background: var(--text-silver);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 8px 3px rgba(192, 199, 212, 0.6), 0 0 20px 6px rgba(126, 200, 227, 0.25), 0 0 40px 10px rgba(126, 200, 227, 0.08);
  animation: floatUp infinite linear;
}
@keyframes floatUp {
  0% { transform: translateY(40px) scale(0.5); opacity: 0; }
  20% { opacity: 0.6; }
  80% { opacity: 0.4; }
  100% { transform: translateY(-80px) scale(1.5); opacity: 0; }
}

/* ===== Hero Section ===== */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.orbit-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65vw;
  height: 65vw;
  max-width: 900px;
  max-height: 900px;
  pointer-events: none;
  z-index: 0;
}

.orbit-line {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(126, 200, 227, 0.3);
  transform: translate(-50%, -50%);
}

.orbit-1 {
  width: 100%;
  height: 100%;
  animation: spin 60s linear infinite;
  box-shadow: inset 0 0 50px rgba(126, 200, 227, 0.1), 0 0 50px rgba(126, 200, 227, 0.1);
}

.orbit-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.dot-sain { top: 0; left: 50%; background: var(--c-sain); box-shadow: 0 0 15px 3px var(--c-sain); }
.dot-kobi { top: 50%; left: 100%; background: var(--c-kobi); box-shadow: 0 0 15px 3px var(--c-kobi); }
.dot-yune { top: 100%; left: 50%; background: var(--c-yune); box-shadow: 0 0 15px 3px var(--c-yune); }
.dot-tyan { top: 50%; left: 0; background: var(--c-tyan); box-shadow: 0 0 15px 3px var(--c-tyan); }

@keyframes spin {
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero-content {
  text-align: center;
  z-index: 2;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  letter-spacing: 1.5rem;
  margin-left: 1.5rem; /* offset for letter-spacing */
  color: var(--text-silver);
  font-weight: 400;
  margin-bottom: 2rem;
}

.hero-slogan {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-silver);
  font-style: italic;
  font-weight: 300;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-silver-dim), transparent);
  animation: pulse-line 2s infinite ease-in-out;
}
@keyframes pulse-line {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  50.1% { transform: scaleY(1); transform-origin: bottom; opacity: 1;}
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0;}
}

/* ===== Signals Section ===== */
#signals {
  padding: 8rem 2rem;
  position: relative;
  z-index: 2;
}

.signals-arg {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: rgba(192, 199, 212, 0.85);
  text-align: center;
  margin-top: -2rem;
  margin-bottom: 4rem;
  letter-spacing: 0.5rem;
}

.signals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.signal-card {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: visible;
  cursor: pointer;
  
  /* Defaults for uniform face scaling/flipping */
  --img-scale: 1.0;
  --img-flip: 1;
  --img-y: center;
}

.signal-sain { --img-scale: 1.0; --img-y: center; }
.signal-kobi { --img-scale: 1.0; --img-y: center; }
.signal-yune { --img-scale: 1.0; --img-y: center; }
.signal-tyan { --img-scale: 1.0; --img-y: center; }

.card-image {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-darker);
}

.card-image img,
.card-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center var(--img-y);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: brightness(0.6) contrast(1.2);
  transform: scaleX(var(--img-flip)) scale(var(--img-scale));
  display: block;
}

.signal-card:hover .card-image img,
.signal-card:hover .card-image video {
  filter: brightness(1.2);
  /* Ensures movement is 100% unified regardless of base scale */
  transform: scaleX(var(--img-flip)) scale(calc(var(--img-scale) + 0.05));
}

.dot {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  opacity: 0.6;
}

.sain-dot { background: var(--c-sain); color: var(--c-sain); }
.kobi-dot { background: var(--c-kobi); color: var(--c-kobi); }
.yune-dot { background: var(--c-yune); color: var(--c-yune); }
.tyan-dot { background: var(--c-tyan); color: var(--c-tyan); }

.card-info {
  position: absolute;
  top: 70%;
  left: 0;
  width: 100%;
  padding: 0 1.5rem 1.5rem;
  background: linear-gradient(to top, rgba(6,10,18,0.95) 0%, rgba(6,10,18,0.7) 50%, transparent 100%);
  pointer-events: none;
}

.member-name {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: 1px;
}

.sain-color { color: var(--c-sain); }
.kobi-color { color: var(--c-kobi); }
.yune-color { color: var(--c-yune); }
.tyan-color { color: var(--c-tyan); }

.hover-copy {
  font-size: 0.9rem;
  color: var(--text-silver);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s ease;
  margin: 0.5rem 0 0 0;
  width: 100%;
}

.hover-copy-en {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-silver-dim);
  display: block;
  margin-top: 0.2rem;
}

.signal-card:hover .hover-copy {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Syzygy Field (Lore) ===== */
#syzygy-field {
  padding: 8rem 2rem;
  position: relative;
  z-index: 2;
}

.lore-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.lore-p {
  margin-bottom: 4rem;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-silver);
  word-break: keep-all;
  overflow-wrap: break-word;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

.lore-en {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: rgba(192, 199, 212, 0.6);
  margin-top: 0.5rem;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

.lore-p.visible {
  opacity: 1;
  transform: translateY(0);
}

.bloom-line {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent-sky);
  font-size: 1.4rem;
  margin-top: 6rem;
}

.lore-attitude {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-silver-dim);
  margin-top: 8rem;
  text-align: center;
  letter-spacing: 1px;
}

/* ===== Pre-Release Countdown ===== */
#pre-release {
  padding: 8rem 2rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.track-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 2.2rem;
  color: white;
  letter-spacing: 0.1rem;
  margin-bottom: 0.5rem;
}

.track-subtitle {
  font-size: 0.9rem;
  color: var(--text-silver-dim);
  margin-bottom: 2rem;
  letter-spacing: 1px;
}

.countdown-msg {
  font-family: var(--font-serif);
  color: var(--text-silver);
  font-size: 1.2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.countdown-container {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.time-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-val {
  font-family: var(--font-mono);
  font-size: 4rem;
  color: var(--accent-sky);
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 15px rgba(126, 200, 227, 0.4);
}

.time-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-silver-dim);
  letter-spacing: 2px;
}

.mv-hidden {
  display: none;
}

/* ===== Footer ===== */
#footer {
  padding: 6rem 2rem 4rem;
  text-align: center;
  border-top: 1px solid rgba(126, 200, 227, 0.06);
  position: relative;
  z-index: 2;
}

.sns-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.sns-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-silver);
  letter-spacing: 2px;
  transition: color 0.3s ease;
}

.sns-links a:hover {
  color: white;
}

.footer-copy {
  font-size: 0.9rem;
  color: rgba(192, 199, 212, 0.9);
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.footer-arg {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: rgba(192, 199, 212, 0.8);
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
}

.footer-emoji {
  font-size: 1.5rem;
}

.mobile-br { display: none; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .mobile-br { display: block; }
  .hero-title {
    font-size: 3rem;
  }
  .hero-slogan {
    font-size: 1.1rem;
  }
  .signals-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Mobile: restructure card layout */
  .signal-card {
    aspect-ratio: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }

  .card-image {
    aspect-ratio: 3 / 4;
    position: relative;
    overflow: hidden;
  }

  .card-image video {
    pointer-events: none;
  }

  /* Mobile: name sits below image, not overlaid */
  .card-info {
    position: relative;
    top: auto;
    padding: 0.8rem 1rem;
    background: var(--bg-darker);
    border-top: 1px solid rgba(126, 200, 227, 0.1);
  }

  .member-name {
    font-size: 1rem;
  }

  /* Mobile: hide hover-copy by default (no hover on touch) */
  .hover-copy {
    display: none;
  }

  /* Mobile: tap overlay on image */
  .mobile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 18, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 3;
  }

  .signal-card.tapped .mobile-overlay {
    opacity: 1;
  }

  .mobile-overlay .overlay-quote {
    font-size: 0.95rem;
    color: var(--text-silver);
    line-height: 1.6;
  }

  .mobile-overlay .overlay-quote-en {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-silver-dim);
    display: block;
    margin-top: 0.4rem;
  }
  .countdown-container {
    gap: 1.5rem;
  }
  .time-val {
    font-size: 2.5rem;
  }
  .track-title {
    font-size: 3rem;
  }
}
