/* 扛扛開頭畫面（首頁用，配合 js/intro.js、js/kang-anim.js）
   參考 Planetoño：整片強色、正中間的 Logo 動畫、下面一顆鍵盤按鍵、最下面一行小字、四周星星；
   按下開始，底色大圓往按鈕縮小收掉。 */

.kk-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vh, 24px);
  padding: 20px;
  color: var(--ink);
}
.kk-intro-overlay.is-leaving { pointer-events: none; }

/* 底色：一顆超大的朱紅圓，平常蓋滿整個畫面 */
.kk-intro-overlay__bg {
  position: fixed;
  left: var(--cx, 50vw);
  top: var(--cy, 50vh);
  z-index: -1;
  width: var(--d, 300vmax);
  height: var(--d, 300vmax);
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--red);
  transform: scale(1);
}
.kk-intro-overlay.is-leaving .kk-intro-overlay__bg {
  transform: scale(0);
  transition: transform 0.95s cubic-bezier(0.7, 0, 0.25, 1);
}

.kk-intro-overlay__sparkles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

/* 字標：小小一枚放正中間（約畫面寬的四成，最多 420px），像貼紙 */
.kk-intro-overlay__logo {
  position: relative;
  display: grid;
  justify-items: center;
}
.kk-intro-overlay__stage {
  width: min(420px, 68vw);
  aspect-ratio: 660 / 316;
}
.kk-intro-overlay__stage svg { display: block; width: 100%; height: 100%; }
/* 副標：疊在字標右下，燕麥色＋粗黑描邊（參考網站 Logo 下的那行小字）；內嵌動畫也用同一個 */
.kk-intro-overlay__sub,
.kang-inline__sub {
  margin: -0.35em 0 0 18%;
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: clamp(1.5rem, 4.4vw, 2.25rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--oat);
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 4px 0 var(--ink);
  rotate: -4deg;
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.2s ease-out, scale 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.kk-intro-overlay.is-done .kk-intro-overlay__sub,
.kang-inline.is-done .kang-inline__sub { opacity: 1; scale: 1; }

/* 開始鍵放在畫面下方（參考網站的位置），標語在最底 */
.kk-intro-overlay__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(108px, calc(env(safe-area-inset-bottom) + 96px));
  display: flex;
  justify-content: center;
}

/* 開始鍵：字標組好時彈出 */
.kk-intro-overlay__start {
  visibility: hidden;
  opacity: 0;
  scale: 0.85;
  translate: 0 14px;
  transition:
    opacity 0.25s ease-out,
    scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    translate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0s linear 0.25s;
  gap: 0.5em;
}
.kk-intro-overlay__start .latin { font-family: var(--font-latin); font-weight: 800; letter-spacing: 0.06em; }
.kk-intro-overlay.is-ready .kk-intro-overlay__start {
  visibility: visible;
  opacity: 1;
  scale: 1;
  translate: 0 0;
  transition-delay: 0s;
}

.kk-intro-overlay__hint {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
}
/* 朱紅底上的小字一律炭黑（DESIGN.md 對比規則） */
.kk-intro-overlay__hint small {
  color: var(--ink);
  display: block;
  margin-top: 2px;
  font-weight: 500;
  font-size: 0.8125rem;
}

/* 收掉時：內容先淡出，大圓再縮 */
.kk-intro-overlay.is-leaving .kk-intro-overlay__stage,
.kk-intro-overlay.is-leaving .kk-intro-overlay__content,
.kk-intro-overlay.is-leaving .kk-intro-overlay__hint,
.kk-intro-overlay.is-leaving .kk-intro-overlay__sparkles {
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

/* 「關於扛扛」裡的內嵌動畫：跟開頭畫面同一個樣子（朱紅底、四周星星、正中間的貼紙字標＋KangKang） */
.about__anim {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--red);
  color: var(--ink);
  container-type: inline-size;
}
.kang-inline__sparkles { position: absolute; inset: 0; pointer-events: none; }
/* 字標約占框寬的六成，比例跟開頭畫面一樣；字、外框、副標都跟著框的寬度縮放 */
.kang-inline__logo { position: relative; display: grid; justify-items: center; width: 62%; }
.kang-inline__stage { width: 100%; aspect-ratio: 660 / 316; }
.kang-inline__stage svg { display: block; width: 100%; height: 100%; }
.kang-inline__sub {
  font-size: clamp(1rem, 5.3cqi, 2.25rem);
  -webkit-text-stroke-width: 0.17em;
  text-shadow: 0.08em 0.11em 0 var(--ink);
}
.about__replay { margin-top: var(--space-4, 16px); }
