/* ==========================================================
   Homepage intro – bracket draw-in + mask reveal + badge wipe
   web-craftsman.com
   Load AFTER css/main.css:
   <link rel="stylesheet" href="css/home-intro.css?v=1">
   ========================================================== */

/* frame that holds the brackets */
section[data-id="home"] .home-page-block {
  position: relative;
  display: block;
  width: min(700px, 100%);
  margin-inline: auto;
  padding: 36px 56px 40px;
}
section[data-id="home"] .text-rotation .item { text-align: center; }

/* 1. brackets draw in: across first, then down */
section[data-id="home"] .home-page-block::before,
section[data-id="home"] .home-page-block::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 0 solid #222;
  animation: hi-bracket 1s cubic-bezier(.7, 0, .2, 1) .2s forwards;
}
section[data-id="home"] .home-page-block::before {
  top: 0;
  left: 0;
  border-top-width: 2px;
  border-left-width: 2px;
}
section[data-id="home"] .home-page-block::after {
  bottom: 0;
  right: 0;
  border-bottom-width: 2px;
  border-right-width: 2px;
}
@keyframes hi-bracket {
  0%   { width: 0;    height: 0; }
  50%  { width: 52px; height: 0; }
  100% { width: 52px; height: 52px; }
}

/* 2. name slides up from behind an invisible line */
section[data-id="home"] .home-page-block h2 {
  clip-path: inset(0 0 100% 0);
  transform: translateY(30%);
  animation: hi-mask .9s cubic-bezier(.2, .7, .2, 1) .9s forwards;
}
@keyframes hi-mask {
  to { clip-path: inset(0 0 -15% 0); transform: none; }
}

/* 3. a black bar wipes across and the subtitle becomes a badge */
section[data-id="home"] .home-page-description {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  line-height: 1.3;
  color: transparent;
  background: linear-gradient(#222, #222) left / 0% 100% no-repeat;
  animation:
    hi-wipe .6s cubic-bezier(.7, 0, .2, 1) 1.6s forwards,
    hi-text .01s 2.1s forwards;
}
section[data-id="home"] .home-page-description i { color: inherit; }
section[data-id="home"] .home-page-description br { display: none; }   /* keeps the phonetic line on one row */
@keyframes hi-wipe { to { background-size: 100% 100%; } }
@keyframes hi-text { to { color: #fff; } }

/* no motion for people who ask for it */
@media (prefers-reduced-motion: reduce) {
  section[data-id="home"] .home-page-block::before,
  section[data-id="home"] .home-page-block::after,
  section[data-id="home"] .home-page-block h2,
  section[data-id="home"] .home-page-description {
    animation-duration: .01s;
    animation-delay: 0s;
  }
}

@media (max-width: 640px) {
  section[data-id="home"] .home-page-block { padding: 28px 24px 32px; }
}
