/* =============================================
   THE PRODUCT DOJO - CYBER-ZEN DESIGN SYSTEM
   ============================================= */

/* === CSS Custom Properties === */
:root {
  /* Colors */
  --primary: #db143c;
  --primary-glow: rgba(219, 20, 60, 0.4);
  --primary-dim: rgba(219, 20, 60, 0.1);

  --bg-void: #050505;
  --bg-dark: #181112;
  --bg-surface: #211618;
  --bg-elevated: #24181a;

  --text-white: #ffffff;
  --text-muted: #b99da2;
  --text-dim: #888888;
  --border-subtle: #39282c;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Noto Sans', sans-serif;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  background-color: var(--bg-dark);
  color: var(--text-white);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--primary);
  color: white;
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-void);
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* === Glass Navigation === */
.glass-nav {
  background: rgba(24, 17, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* === Cyber Grid Background === */
.cyber-grid {
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* === Glow Effects === */
.glow-text {
  text-shadow: 0 0 20px rgba(219, 20, 60, 0.3);
}

.glow-box {
  box-shadow: 0 0 30px var(--primary-glow);
}

.glow-border {
  box-shadow: 0 0 15px var(--primary-glow), inset 0 0 15px rgba(219, 20, 60, 0.1);
}

/* === Hero Yin-Yang Container === */
.yin-yang-container {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.yin-yang-sphere {
  background: radial-gradient(circle at 30% 30%, #2a2a2a 0%, #000000 70%);
  box-shadow:
    inset -10px -10px 40px rgba(0, 0, 0, 0.8),
    0 0 30px rgba(219, 20, 60, 0.2);
  transition: transform 0.1s ease-out, box-shadow 0.3s ease;
}

.yin-yang-sphere:hover {
  box-shadow:
    inset -10px -10px 40px rgba(0, 0, 0, 0.8),
    0 0 50px rgba(219, 20, 60, 0.4);
}

.yin-yang-sphere.ignite {
  box-shadow:
    inset -10px -10px 40px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(219, 20, 60, 0.8);
}

.yin-yang-sphere.pulse-white {
  box-shadow:
    inset -10px -10px 40px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(255, 255, 255, 0.5);
}

/* === Pipeline Layout === */
.pipeline-lane {
  position: relative;
  min-height: 450px;
}

/* Guide Lines - horizontal dashed rails */
.guide-line {
  position: absolute;
  height: 1px;
  width: 100%;
  border-top: 1px dashed rgba(219, 20, 60, 0.25);
  pointer-events: none;
  z-index: 1;
}

.guide-line::after {
  content: '';
  position: absolute;
  right: 0;
  top: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(219, 20, 60, 0.35);
  box-shadow: 0 0 6px rgba(219, 20, 60, 0.3);
}

.guide-line-left::after {
  right: 0;
}

.guide-line-right::after {
  left: 0;
  right: auto;
}

/* === Pipeline Icon Cards (Ideas) === */
.pipeline-icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 56px;
  height: 62px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.pipeline-icon-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-display);
  font-weight: 600;
}

/* === Product UI Cards (Output) === */
.product-ui-card {
  width: 130px;
  padding: 8px;
  background: rgba(15, 15, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}

.product-ui-label {
  margin-top: 5px;
  text-align: center;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(219, 20, 60, 0.7);
  font-weight: 600;
  font-family: var(--font-display);
}

/* === Pipeline Item States (JS-Driven via inline styles) === */
.pipeline-idea,
.pipeline-product {
  position: relative;
  z-index: 5;
  opacity: 0;
  will-change: transform, opacity;
}

/* Transition classes toggled by JS */
.pipeline-idea.moving,
.pipeline-product.moving {
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

.pipeline-idea.fast,
.pipeline-product.fast {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

/* No transition for instant reset */
.pipeline-idea.no-transition,
.pipeline-product.no-transition {
  transition: none !important;
}

/* Glow when active */
.pipeline-idea.glowing .pipeline-icon-card {
  border-color: rgba(219, 20, 60, 0.4);
  box-shadow: 0 0 15px rgba(219, 20, 60, 0.3);
}

.pipeline-product.glowing .product-ui-card {
  border-color: rgba(219, 20, 60, 0.3);
  box-shadow: 0 0 15px rgba(219, 20, 60, 0.12);
}

/* Engine pulse when processing */
.yin-yang-container.processing .yin-yang-sphere {
  box-shadow: 0 0 80px rgba(219, 20, 60, 0.4);
  border-color: rgba(219, 20, 60, 0.5);
}

/* Pipeline port animations */
.pipeline-port-in,
.pipeline-port-out {
  transition: opacity 0.3s ease, width 0.3s ease;
  opacity: 0.3;
}

.pipeline-port-in.active {
  opacity: 1;
  width: 24px;
}

.pipeline-port-out.active {
  opacity: 1;
  width: 24px;
}

/* Base slow spin for engine rings */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-reverse-slow {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0deg);
  }
}

.animate-spin-slow {
  animation: spin-slow 15s linear infinite;
}

.animate-spin-reverse-slow {
  animation: spin-reverse-slow 20s linear infinite;
}

/* === Split Screen Parallax === */
.split-section {
  position: relative;
}

.split-left,
.split-right {
  transition: transform 0.1s ease-out;
}

/* === Project Cards - Hover to Ignite === */
.project-card {
  transition: all 0.4s var(--ease-smooth);
  filter: grayscale(100%);
}

.project-card:hover {
  filter: grayscale(0%);
  box-shadow: 0 0 30px var(--primary-glow);
  border-color: var(--primary);
  transform: translateY(-4px);
}

.project-card .card-image {
  transition: transform 0.5s var(--ease-smooth), filter 0.5s var(--ease-smooth);
}

.project-card:hover .card-image {
  transform: scale(1.05);
}

.project-card .ignite-overlay {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.project-card:hover .ignite-overlay {
  opacity: 1;
}

/* === Code Flicker Animation === */
@keyframes code-flicker {

  0%,
  100% {
    opacity: 1;
  }

  10% {
    opacity: 0.8;
  }

  20% {
    opacity: 1;
  }

  30% {
    opacity: 0.9;
  }

  40% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }

  60% {
    opacity: 1;
  }
}

.code-flicker {
  animation: code-flicker 0.5s ease-in-out;
}

/* === Forge Heartbeat Pulse === */
@keyframes forge-pulse {

  0%,
  100% {
    opacity: 0.05;
    transform: scale(1);
  }

  50% {
    opacity: 0.15;
    transform: scale(1.05);
  }
}

.forge-heartbeat {
  animation: forge-pulse 4s ease-in-out infinite;
}

/* === Float Animation === */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* === Kinetic Text Assembly === */
@keyframes assemble {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    filter: blur(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.kinetic-text {
  animation: assemble 1s var(--ease-smooth) forwards;
}

.kinetic-text.delay-1 {
  animation-delay: 0.1s;
  opacity: 0;
}

.kinetic-text.delay-2 {
  animation-delay: 0.2s;
  opacity: 0;
}

.kinetic-text.delay-3 {
  animation-delay: 0.3s;
  opacity: 0;
}

/* === Scroll Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-smooth), transform 0.8s var(--ease-smooth);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Form Animations === */
.form-field .underline {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--primary);
  transition: width 0.3s var(--ease-smooth);
}

.form-field:focus-within .underline,
.form-field:hover .underline {
  width: 100%;
}

/* Form vanish animation */
@keyframes vanish {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.95) translateY(-10px);
  }

  100% {
    opacity: 0;
    transform: scale(0.8) translateY(-30px);
    filter: blur(5px);
  }
}

.form-vanish {
  animation: vanish 0.6s var(--ease-smooth) forwards;
}

/* === Digital Smoke === */
.digital-smoke {
  background: radial-gradient(circle, rgba(219, 20, 60, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
}

/* === Shoji Slide Transition === */
.shoji-left,
.shoji-right {
  position: fixed;
  top: 0;
  width: 50%;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 9999;
  transition: transform 0.8s var(--ease-smooth);
}

.shoji-left {
  left: 0;
  transform: translateX(-100%);
}

.shoji-right {
  right: 0;
  transform: translateX(100%);
}

.shoji-active .shoji-left {
  transform: translateX(0);
}

.shoji-active .shoji-right {
  transform: translateX(0);
}

/* === Button Styles === */
.btn-primary {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  box-shadow: 0 0 15px rgba(219, 20, 60, 0.4);
}

.btn-primary:hover {
  background: #ff1a4d;
  box-shadow: 0 0 25px rgba(219, 20, 60, 0.6);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

/* === Service Cards === */
.service-card {
  background: rgba(26, 26, 26, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.3s var(--ease-smooth);
}

.service-card:hover {
  border-color: rgba(219, 20, 60, 0.5);
  transform: translateY(-4px);
}

.service-card .icon-wrapper {
  background: #2a2a2a;
  color: var(--primary);
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s var(--ease-smooth);
}

.service-card:hover .icon-wrapper {
  background: var(--primary);
  color: white;
}

/* === Timeline Steps === */
.timeline-step {
  position: relative;
  padding-left: 3rem;
}

.timeline-step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 2rem;
  bottom: -2rem;
  width: 2px;
  background: var(--border-subtle);
}

.timeline-step:last-child::before {
  display: none;
}

.timeline-step .step-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid var(--border-subtle);
  background: var(--bg-dark);
  color: var(--text-muted);
  transition: all 0.3s var(--ease-smooth);
}

.timeline-step.active .step-marker {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 15px rgba(219, 20, 60, 0.5);
}

/* === Scroll Form Container === */
.scroll-container {
  background: var(--bg-void);
  border-left: 1px solid rgba(219, 20, 60, 0.2);
  border-right: 1px solid rgba(219, 20, 60, 0.2);
  position: relative;
  transition: transform 0.5s var(--ease-smooth);
}

.scroll-container:hover {
  transform: translateY(-8px);
}

.scroll-handle {
  height: 12px;
  background: linear-gradient(to right, #111, #333, #111);
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
}

.scroll-handle-bottom {
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8);
}

/* === Hanko Submit Button === */
.hanko-btn {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  box-shadow: 0 0 15px rgba(219, 20, 60, 0.4);
  position: relative;
}

.hanko-btn::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(219, 20, 60, 0.5);
  border-radius: 50%;
  transition: border-color 0.3s;
}

.hanko-btn:hover {
  background: var(--primary);
  box-shadow: 0 0 30px rgba(219, 20, 60, 0.6);
  transform: scale(1.1);
}

.hanko-btn:hover::before {
  border-color: rgba(255, 255, 255, 0.3);
}

.hanko-btn .material-symbols-outlined {
  color: var(--primary);
  font-size: 2rem;
  transition: color 0.3s;
}

.hanko-btn:hover .material-symbols-outlined {
  color: white;
}

/* === Mobile Nav Overlay === */
#mobile-nav.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 1024px) {
  .split-section {
    flex-direction: column;
  }

  .split-left,
  .split-right {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }

  .nav-links {
    display: none;
  }
}

/* === Touch Device Overrides === */
@media (hover: none) {
  .project-card {
    filter: grayscale(0%);
  }

  .project-card .ignite-overlay {
    opacity: 0;
  }
}

/* === Reduce Motion === */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* === Case Study Pages === */
.case-hero {
  min-height: 70vh;
}

.no-underline {
  text-decoration: none !important;
  color: inherit;
}

.project-card.no-underline:hover h4,
.project-card.no-underline:hover p,
.project-card.no-underline:hover span {
  text-decoration: none;
}