/* ==========================================================================
   Bisu — Pre-Launch Developer & Automation Gate Page (Light & Bright Theme)
   ========================================================================== */

:root {
  --bg-base: #f8fafc;
  --bg-radial-1: rgba(99, 102, 241, 0.12);
  --bg-radial-2: rgba(56, 189, 248, 0.12);
  --bg-radial-3: rgba(139, 92, 246, 0.09);

  --surface-glass: rgba(255, 255, 255, 0.86);
  --border-subtle: rgba(148, 163, 184, 0.28);
  --border-accent: rgba(99, 102, 241, 0.45);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-indigo: #4f46e5;
  --accent-violet: #7c3aed;
  --accent-cyan: #0284c7;
  --accent-emerald: #10b981;

  --font-display: 'Space Grotesk', 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-sans: 'Pretendard Variable', 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Ambient Light Background Layers */
.ambient-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(62% 54% at 50% 48%, var(--bg-radial-1) 0%, transparent 72%),
    radial-gradient(46% 42% at 18% 20%, var(--bg-radial-3) 0%, transparent 74%),
    radial-gradient(44% 40% at 84% 78%, var(--bg-radial-2) 0%, transparent 74%),
    linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
}

.scanline-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 55%, rgba(226, 232, 240, 0.45) 100%);
  opacity: 0.7;
}

/* Fullscreen Interactive Canvas */
#bisu-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

/* Main Viewport Layout */
.viewport-shell {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  height: 100dvh;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  pointer-events: none;
}

/* Minimal Top & Bottom Telemetry Bars */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  opacity: 0;
  animation: fadeSlideIn 0.8s var(--ease-expo) 0.15s forwards;
}

.hud-footer {
  animation-delay: 0.9s;
}

.hud-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-divider {
  width: 1px;
  height: 10px;
  background: var(--border-subtle);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  animation: statusPulse 2.4s ease-in-out infinite;
}

/* Centerpiece Gate Stage */
.gate-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

/* Center Focus Card (airy frosted glass over canvas traces) */
.logo-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(2.25rem, 5vw, 3.5rem) clamp(2rem, 6vw, 4.75rem);
  border-radius: 24px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.78) 68%,
    rgba(255, 255, 255, 0.35) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 24px 64px -18px rgba(79, 70, 229, 0.12),
    0 8px 24px -10px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
}

/* Precision Architectural Corner Brackets */
.reticle {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(79, 70, 229, 0.3);
  border-style: solid;
  pointer-events: none;
  opacity: 0;
  transition: border-color 0.4s ease, transform 0.5s var(--ease-expo);
}

.reticle--tl {
  top: 0;
  left: 0;
  border-width: 1.5px 0 0 1.5px;
  border-top-left-radius: 6px;
  animation: reticleInTL 0.9s var(--ease-expo) 0.2s forwards;
}

.reticle--tr {
  top: 0;
  right: 0;
  border-width: 1.5px 1.5px 0 0;
  border-top-right-radius: 6px;
  animation: reticleInTR 0.9s var(--ease-expo) 0.2s forwards;
}

.reticle--bl {
  bottom: 0;
  left: 0;
  border-width: 0 0 1.5px 1.5px;
  border-bottom-left-radius: 6px;
  animation: reticleInBL 0.9s var(--ease-expo) 0.2s forwards;
}

.reticle--br {
  bottom: 0;
  right: 0;
  border-width: 0 1.5px 1.5px 0;
  border-bottom-right-radius: 6px;
  animation: reticleInBR 0.9s var(--ease-expo) 0.2s forwards;
}

.logo-frame:hover .reticle {
  border-color: rgba(79, 70, 229, 0.65);
}

.logo-frame:hover .reticle--tl { transform: translate(-3px, -3px); }
.logo-frame:hover .reticle--tr { transform: translate(3px, -3px); }
.logo-frame:hover .reticle--bl { transform: translate(-3px, 3px); }
.logo-frame:hover .reticle--br { transform: translate(3px, 3px); }

/* Eyebrow Technical Tag */
.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.36rem 0.95rem;
  margin-bottom: 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(238, 242, 255, 0.85);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent-indigo);
  text-transform: uppercase;
  opacity: 0;
  animation: fadeSlideIn 0.8s var(--ease-expo) 0.25s forwards;
}

.eyebrow-badge .prompt-glyph {
  color: var(--accent-violet);
  font-weight: 700;
}

/* ==========================================================================
   Animated "Bisu" Wordmark — Precision Kinetic Typography
   ========================================================================== */
.brand-lockup {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  cursor: default;
}

.brand-wordmark {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-size: clamp(4.25rem, 12vw, 8.75rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.char-slot {
  position: relative;
  display: inline-block;
  padding: 0.06em 0.02em;
}

/* Ghost CAD Wireframe Layer (snaps into registration) */
.char-wire {
  position: absolute;
  inset: 0.06em 0.02em;
  color: transparent;
  -webkit-text-stroke: 1.35px rgba(99, 102, 241, 0.42);
  opacity: 0;
  transform: translate(8px, -8px);
  animation: wireRegister 1.15s var(--ease-expo) calc(0.28s + var(--idx) * 0.09s) forwards;
  pointer-events: none;
  transition: transform 0.45s var(--ease-expo), -webkit-text-stroke-color 0.45s ease, opacity 0.45s ease;
}

/* Solid Precision Foreground Layer with Specular Sheen */
.char-solid {
  position: relative;
  display: inline-block;
  background: linear-gradient(
    115deg,
    #0f172a 0%,
    #1e1b4b 28%,
    #4f46e5 46%,
    #0ea5e9 52%,
    #312e81 58%,
    #0f172a 100%
  );
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 24px rgba(79, 70, 229, 0.14));
  clip-path: inset(100% 0 0 0);
  transform: translateY(36%);
  opacity: 0;
  animation:
    glyphReveal 0.95s var(--ease-expo) calc(0.32s + var(--idx) * 0.09s) forwards,
    specularSweep 6.5s ease-in-out calc(1.6s + var(--idx) * 0.06s) infinite;
  transition: transform 0.35s var(--ease-expo), filter 0.35s ease;
}

/* Interactive Hover Precision Shift */
.brand-lockup:hover .char-wire {
  opacity: 0.85;
  transform: translate(-3px, 3px);
  -webkit-text-stroke-color: rgba(14, 165, 233, 0.65);
}

.brand-lockup:hover .char-solid {
  filter: drop-shadow(0 12px 30px rgba(79, 70, 229, 0.24));
}

/* Developer Cursor / Terminal Accent Dot after "Bisu" */
.brand-cursor {
  display: inline-block;
  width: clamp(10px, 1.4vw, 16px);
  height: clamp(10px, 1.4vw, 16px);
  margin-left: clamp(6px, 1vw, 12px);
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent-indigo), #38bdf8);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.42);
  transform: translateY(-0.08em) scale(0);
  animation:
    cursorSpawn 0.6s var(--ease-expo) 0.85s forwards,
    cursorBlink 2.2s ease-in-out 1.5s infinite;
}

/* Animated Circuit Underline Trace */
.brand-underline {
  position: relative;
  width: min(280px, 68vw);
  height: 2px;
  margin-top: 1.1rem;
  background: rgba(148, 163, 184, 0.22);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.6s ease 0.75s forwards;
}

.brand-underline::after {
  content: '';
  position: absolute;
  top: 0;
  left: -45%;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-indigo), #0ea5e9, transparent);
  animation: traceFlow 3.2s cubic-bezier(0.4, 0, 0.2, 1) 0.9s infinite;
}

/* Concise Subtitle & Capability Chips */
.brand-subtitle {
  margin-top: 1.35rem;
  font-size: clamp(0.95rem, 1.8vw, 1.125rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  line-height: 1.6;
  opacity: 0;
  animation: fadeSlideIn 0.85s var(--ease-expo) 0.75s forwards;
}

.brand-subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

.brand-sub-en {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.capability-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.6rem;
  opacity: 0;
  animation: fadeSlideIn 0.85s var(--ease-expo) 0.92s forwards;
}

.cap-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.44rem 0.9rem;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-glass);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: #334155;
  letter-spacing: 0.02em;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease-expo), box-shadow 0.25s ease;
}

.cap-chip:hover {
  border-color: var(--border-accent);
  color: var(--accent-indigo);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
}

.cap-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-indigo);
  flex-shrink: 0;
}

/* ==========================================================================
   Keyframe Choreography
   ========================================================================== */
@keyframes glyphReveal {
  0% {
    clip-path: inset(100% 0 0 0);
    transform: translateY(36%);
    opacity: 0;
  }
  100% {
    clip-path: inset(-12% -12% -12% -12%);
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes wireRegister {
  0% {
    opacity: 0;
    transform: translate(10px, -10px);
  }
  45% {
    opacity: 0.8;
    transform: translate(3px, -3px);
  }
  100% {
    opacity: 0.18;
    transform: translate(0, 0);
  }
}

@keyframes specularSweep {
  0%, 55% {
    background-position: 100% 0;
  }
  85%, 100% {
    background-position: 0% 0;
  }
}

@keyframes cursorSpawn {
  0% {
    transform: translateY(-0.08em) scale(0);
    opacity: 0;
  }
  100% {
    transform: translateY(-0.08em) scale(1);
    opacity: 1;
  }
}

@keyframes cursorBlink {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
  }
  50% {
    opacity: 0.45;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
  }
}

@keyframes traceFlow {
  0% {
    left: -45%;
  }
  100% {
    left: 100%;
  }
}

@keyframes reticleInTL {
  0% { opacity: 0; transform: translate(14px, 14px); }
  100% { opacity: 1; transform: translate(0, 0); }
}

@keyframes reticleInTR {
  0% { opacity: 0; transform: translate(-14px, 14px); }
  100% { opacity: 1; transform: translate(0, 0); }
}

@keyframes reticleInBL {
  0% { opacity: 0; transform: translate(14px, -14px); }
  100% { opacity: 1; transform: translate(0, 0); }
}

@keyframes reticleInBR {
  0% { opacity: 0; transform: translate(-14px, -14px); }
  100% { opacity: 1; transform: translate(0, 0); }
}

@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes statusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

/* ==========================================================================
   Responsive & Reduced Motion
   ========================================================================== */
@media (max-width: 640px) {
  .hud-bar {
    font-size: 0.65rem;
  }

  .hud-hide-sm {
    display: none;
  }

  .logo-frame {
    padding: 2rem 1.25rem;
  }

  .eyebrow-badge {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
  }

  .capability-strip {
    gap: 0.45rem;
  }

  .cap-chip {
    padding: 0.36rem 0.68rem;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .char-solid {
    clip-path: none;
    transform: none;
    opacity: 1;
  }

  .char-wire,
  .reticle,
  .hud-bar,
  .eyebrow-badge,
  .brand-subtitle,
  .capability-strip,
  .brand-underline {
    opacity: 1;
    transform: none;
  }

  .brand-cursor {
    transform: translateY(-0.08em) scale(1);
    opacity: 1;
  }
}
