/* door-tap-me.css v1 (Claude, 1 Dec 2026) · sorahseong.com home, touch screens (phones and iPads), Classic and Forest.
   Goes with door-tap-me.js. Laptops and desktops used with a mouse are not changed.

   1. The ball. A little yellow ball (like the Menu button) drops onto the first door and hops door to door,
      tong, tong, tong; where it lands, a ring in that door's colour spreads. Then it rests, fades and starts again
      (4.2s). It shows only while the doors are on screen, and goes away while a door is tapped and open.
      Nothing shows with the site's Motion off or with reduced motion.
   2. The elephant's "Select a door to enter" balloon goes away on touch screens (the words stay for screen readers),
      only once the ball is ready (door-tap-me.js adds .has-door-ball).
   3. iPads (681px and up, touch): a tapped door now looks the way it does on phones. It fills with its colour and
      opens a little, and "Tap again to enter" (Forest: "Tap to enter") shows under its name. Before, the door stayed
      white while its lines turned white, so it looked empty, and there was no cue. */

.door-ball { display: none; }

@media (hover: none) and (pointer: coarse) {
  .door-ball { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; z-index: 6; }
  .door-ball svg { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
  .door-ball-dot { fill: #ffe14d; stroke: #17151f; transform-box: fill-box; transform-origin: 50% 100%; }
  .door-ball-ring { fill: none; opacity: 0; transform-box: fill-box; transform-origin: center; }

  /* 2. The balloon: words for screen readers only, no cloud, no bubbles. */
  body.home-view:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors.has-door-ball > #chic-door-hint {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important;
    background: none !important; border: 0 !important; animation: none !important; opacity: 1 !important;
  }
  body.home-view:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors.has-door-ball > #chic-door-hint::before,
  body.home-view:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors.has-door-ball > #chic-door-hint::after,
  body.home-view:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors.has-door-ball > #chic-door-hint > .door-universal-hint::before,
  body.home-view:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors.has-door-ball > #chic-door-hint > .door-universal-hint::after {
    display: none !important; animation: none !important;
  }
}

/* 1. The ball moves only with motion allowed, the doors on screen, and no door tapped open. */
@media (hover: none) and (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  body.home-view.motion-enabled[data-site-scene="plain"] .chic-doors.has-door-ball.doors-ready.thought-revealed:not(.doors-static, .doors-offscreen):not(:has(.chic-door:is(.touch-armed, .is-entering))) > .door-ball {
    display: block;
  }
  .door-ball .door-ball-x { animation: door-ball-x 4.2s linear infinite; }
  .door-ball .door-ball-y { animation: door-ball-y 4.2s infinite; }
  .door-ball .door-ball-dot { animation: door-ball-dot 4.2s infinite; }
  .door-ball .door-ball-ring { animation: door-ball-ring 4.2s infinite; }
  .door-ball .door-ball-ring-1 { animation-delay: .336s; }
  .door-ball .door-ball-ring-2 { animation-delay: 1.008s; }
  .door-ball .door-ball-ring-3 { animation-delay: 1.68s; }
}
@media (max-width: 680px) and (hover: none) and (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  body.home-view.motion-enabled[data-site-scene="forest"] .chic-doors.has-door-ball.doors-ready.thought-revealed:not(.doors-static, .doors-offscreen):not(:has(.chic-door:is(.touch-armed, .is-entering))) > .door-ball {
    display: block;
  }
}
/* door-ball-x and door-ball-y (where the doors are) come from door-tap-me.js. */
@keyframes door-ball-dot {
  0% { opacity: 0; transform: none; }
  3% { opacity: 1; }
  7.4%, 9.6%, 23.4%, 25.6%, 39.4%, 41.6% { transform: none; }
  8.2%, 24.2%, 40.2% { transform: scale(1.32, .7); }
  72% { opacity: 1; transform: none; }
  79%, 100% { opacity: 0; transform: none; }
}
@keyframes door-ball-ring {
  0% { opacity: .9; transform: scale(.5); }
  10% { opacity: 0; transform: scale(2.2); }
  100% { opacity: 0; transform: scale(2.2); }
}

/* 3. iPads (touch, 681px and up): a tapped door looks as it does on phones. */
@media (min-width: 681px) and (hover: none) and (pointer: coarse) {
  body:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors .chic-door.touch-armed:not(.is-entering) .door-leaf {
    transform: rotateY(-38deg); background-color: var(--door-color); border-color: var(--door-color);
  }
  body:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors .chic-door.touch-armed .door-light { opacity: .65; }
  body:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors .chic-door.touch-armed .door-handle { background: #fff; }
  body.home-view:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors .chic-door.touch-armed > .door-tap-cue {
    display: block; position: absolute; left: 50%; transform: translateX(-50%); width: max-content; margin-top: 4px;
    font: 11px/1.3 Arial, Helvetica, sans-serif; text-align: center; white-space: nowrap; pointer-events: none; z-index: 3;
  }
  /* Lift the name and the cue a little, so the cue keeps clear of the line under the doors. */
  body.home-view:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors .chic-door.touch-armed > :is(.door-label, .door-tap-cue) { translate: 0 -5px; }
  body.home-view[data-site-scene="plain"] .chic-doors .chic-door.touch-armed > .door-tap-cue { color: #111; }
  /* Forest: over the leaves, the words sit on a thin dark pill so they stay readable. */
  body.home-view[data-site-scene="forest"] .chic-doors .chic-door.touch-armed > .door-tap-cue { color: #fff; padding: 2px 8px 3px; border-radius: 10px; background: rgba(11, 23, 39, .66); }
}
@media (prefers-reduced-motion: reduce) {
  body:is([data-site-scene="plain"], [data-site-scene="forest"]) .chic-doors .chic-door.touch-armed .door-leaf { transform: none !important; }
}
