/* ----------------------------------------
   GOKIDDO – HERO TWO-COLUMN LAYOUT
---------------------------------------- */
.project-hero .container {
  display: flex;
  align-items: flex-end;
  gap: clamp(2rem, 4vw, 4rem);
}

.gk-hero-text {
  flex: 1;
  min-width: 0;
}

.gk-game {
  flex-shrink: 0;
  width: clamp(260px, 34vw, 380px);
  border-left: 1px solid var(--color-border);
  padding-left: clamp(1.5rem, 3vw, 2.5rem);
  opacity: 0;
  transform: translateY(20px);
  --gk-safe: #4a8f5c;
  --gk-slow: #d98c2b;
  --gk-brake: var(--color-accent);
}

/* ----------------------------------------
   SCENE (walker + obstacle + ground)
---------------------------------------- */
.gk-scene {
  position: relative;
  width: 100%;
  min-height: 150px;
  overflow: hidden;
}

.gk-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  height: 1px;
  background: var(--color-border);
}

/* ---- Walker ---- */
.gk-walker {
  position: absolute;
  left: 4%;
  bottom: 0;
  width: clamp(150px, 20vw, 190px);
  color: var(--color-text);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12));
  user-select: none;
  -webkit-user-select: none;
}

.gk-walker-svg {
  width: 100%;
  display: block;
}

.gk-wheel {
  transform-box: fill-box;
  transform-origin: center;
  animation: gk-spin 0.5s linear infinite;
  animation-play-state: paused;
}

.gk-brake-light {
  fill: var(--color-border);
  transition: fill 0.3s ease, filter 0.3s ease;
}

.gk-sensor-eye {
  fill: var(--gk-safe);
  transition: fill 0.3s ease;
}

.gk-ping {
  fill: none;
  stroke: var(--gk-safe);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: gk-ping 1.6s ease-out infinite;
  transition: stroke 0.3s ease;
}

#gkPing2 { animation-delay: 0.5s; }
#gkPing3 { animation-delay: 1s; }

/* ---- Motion lines (fade with speed) ---- */
.gk-motion-lines {
  position: absolute;
  left: 2%;
  bottom: 18%;
  width: 26%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gk-motion-lines span {
  height: 2px;
  background: var(--color-text-secondary);
  border-radius: 1px;
  animation: gk-motion-flow 0.5s linear infinite;
}

.gk-motion-lines span:nth-child(1) { width: 60%; }
.gk-motion-lines span:nth-child(2) { width: 100%; }
.gk-motion-lines span:nth-child(3) { width: 40%; }

/* ---- Obstacle (draggable toy) ---- */
.gk-obstacle {
  position: absolute;
  bottom: 6px;
  width: clamp(46px, 7vw, 60px);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.18));
}

.gk-obstacle:active {
  cursor: grabbing;
}

.gk-obstacle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 12px;
}

.gk-obstacle.dragging .gk-obstacle-svg {
  transform: scale(1.06);
}

.gk-obstacle-svg {
  width: 100%;
  display: block;
  transition: transform 0.2s ease;
}

.gk-obstacle-body {
  fill: var(--color-accent-soft);
  stroke: var(--color-accent);
  stroke-width: 2;
}

.gk-obstacle-star {
  fill: var(--color-accent);
}

/* ----------------------------------------
   READOUTS
---------------------------------------- */
.gk-readout-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 14px;
}

.gk-readout {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gk-readout-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.gk-readout-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.gk-speed-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-border);
  overflow: hidden;
}

.gk-speed-fill {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: var(--gk-safe);
  transition: width 0.15s ease, background 0.3s ease;
}

/* ----------------------------------------
   STATUS + CAPTION
---------------------------------------- */
.gk-status {
  margin-top: 12px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-text);
  min-height: 1.3em;
}

.gk-caption {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  animation: gk-pulse 2.5s ease-in-out infinite;
}

/* ----------------------------------------
   STATE VARIANTS
---------------------------------------- */
.gk-game[data-state="safe"] .gk-sensor-eye,
.gk-game[data-state="safe"] .gk-ping {
  fill: var(--gk-safe);
  stroke: var(--gk-safe);
}
.gk-game[data-state="safe"] .gk-speed-fill {
  background: var(--gk-safe);
}

.gk-game[data-state="slow"] .gk-sensor-eye,
.gk-game[data-state="slow"] .gk-ping {
  fill: var(--gk-slow);
  stroke: var(--gk-slow);
}
.gk-game[data-state="slow"] .gk-speed-fill {
  background: var(--gk-slow);
}

.gk-game[data-state="brake"] .gk-sensor-eye,
.gk-game[data-state="brake"] .gk-ping,
.gk-game[data-state="stopped"] .gk-sensor-eye,
.gk-game[data-state="stopped"] .gk-ping {
  fill: var(--gk-brake);
  stroke: var(--gk-brake);
}
.gk-game[data-state="brake"] .gk-speed-fill,
.gk-game[data-state="stopped"] .gk-speed-fill {
  background: var(--gk-brake);
}

.gk-game[data-state="brake"] .gk-brake-light,
.gk-game[data-state="stopped"] .gk-brake-light {
  fill: var(--gk-brake);
  filter: drop-shadow(0 0 4px var(--gk-brake));
}

.gk-game[data-state="stopped"] .gk-brake-light {
  animation: gk-blink 0.6s ease-in-out infinite;
}

/* ----------------------------------------
   KEYFRAMES
---------------------------------------- */
@keyframes gk-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes gk-ping {
  0% { transform: scale(0.4); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

@keyframes gk-motion-flow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.25; }
}

@keyframes gk-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes gk-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ----------------------------------------
   RESPONSIVE
---------------------------------------- */
@media (max-width: 900px) {
  .project-hero .container {
    flex-direction: column;
    align-items: stretch;
  }

  .gk-game {
    width: 100%;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
    margin-top: 1rem;
  }

  .gk-scene {
    min-height: 130px;
  }
}

@media (max-width: 480px) {
  .gk-walker {
    width: clamp(120px, 34vw, 150px);
  }

  .gk-obstacle {
    width: 44px;
  }

  .gk-readout-row {
    gap: 1rem;
  }
}
