/*
 * 採用情報のモニターの場面（page-recruit.php の .rc-dive。動きは assets/js/recruit.js）。
 * スクロールすると画面がいったん止まり、線画のモニターが近づいてくる。中の言葉を朱の線で消して打ち直す。
 * 設計図の印が四方から集まり、朱のカギ形がモニターの四隅にはまる。
 * 動きを減らす設定では止めずに、書き換えたあとの言葉だけを出す。
 */

.rc-dive { position: relative; height: 320vh; }
.rc-dive__pin { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; place-items: center;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 48px 48px; }

/* モニター：画面の高さが 74vh を超えない幅（16:9）。--s で大きさを変える */
.rc-dive__monitor { position: relative; width: min(1100px, 86vw, 131vh); transform: scale(var(--s, 1)); }
.rc-dive__screen { position: relative; container-type: inline-size; aspect-ratio: 16 / 9; display: grid; place-content: center stretch; gap: 2.4cqi; padding-inline: 4cqi; text-align: center; border: 1px solid rgba(255, 255, 255, .7);
  background-image: linear-gradient(90deg, transparent calc(50% - .5px), rgba(255, 255, 255, .12) calc(50% - .5px) calc(50% + .5px), transparent 0), linear-gradient(transparent calc(50% - .5px), rgba(255, 255, 255, .12) calc(50% - .5px) calc(50% + .5px), transparent 0); }
.rc-dive__screen::before { content: ""; position: absolute; inset: 2.2cqi; border: 1px dashed rgba(255, 255, 255, .22); pointer-events: none; }
.rc-dive__dim { position: absolute; left: 0; right: 0; top: -3.2cqi; padding-bottom: 4px; border-bottom: 1px solid var(--accent); font-family: var(--font-mono); font-size: max(10px, 1.1cqi); letter-spacing: .1em; color: var(--accent); }
.rc-dive__note { font-family: var(--font-mono); font-size: max(10px, 1.3cqi); letter-spacing: .15em; color: rgba(255, 255, 255, .55); }
/* 言葉：モニターの幅に合わせた大きさで、必ず1行 */
.rc-dive__word { white-space: nowrap; font-size: 6.2cqi; font-weight: 700; letter-spacing: .06em; line-height: 1.3; }
.rc-dive__typed { position: relative; }
.rc-dive__typed.is-struck::after { content: ""; position: absolute; left: -.1em; right: -.1em; top: 54%; height: max(2px, .35cqi); background: var(--accent); transform-origin: left; animation: rc-strike .35s var(--ease-out) both; }
@keyframes rc-strike { from { transform: scaleX(0); } }
.rc-dive__caret { display: inline-block; width: max(1px, .25cqi); height: .95em; margin: 0 .04em; vertical-align: -.08em; background: var(--accent); animation: rc-blink 1s steps(1) infinite; }
@keyframes rc-blink { 50% { opacity: 0; } }
/* 朱の言葉：スマホでも読める大きさ（14px 以上）。入りきらないときは「、」のところで改行する */
.rc-dive__result { font-size: max(14px, 2.8cqi); font-weight: 500; line-height: 1.6; letter-spacing: .08em; color: var(--accent); transition: opacity .5s; }
.rc-dive__result span { display: inline-block; white-space: nowrap; }
.rc-dive.is-live .rc-dive__result:not(.on) { opacity: 0; }
/* 台（モニターが大きくなると画面の外へ出る） */
.rc-dive__stand { position: absolute; left: 48%; top: 100%; width: 4%; aspect-ratio: 1 / 2; border-left: 1px solid rgba(255, 255, 255, .5); border-right: 1px solid rgba(255, 255, 255, .5); }
.rc-dive__stand::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 600%; height: 1px; transform: translateX(-50%); background: rgba(255, 255, 255, .5); }

/* 設計図の印と、四隅の朱のカギ形（位置と濃さは recruit.js が決める） */
.rc-dive__mark { position: absolute; left: 50%; top: 50%; font-family: var(--font-mono); font-size: clamp(16px, 2.2vw, 30px); white-space: nowrap; color: rgba(255, 255, 255, .55); opacity: 0; pointer-events: none; }
.rc-dive__corner { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border: 0 solid var(--accent); opacity: 0; pointer-events: none; }
.rc-dive.is-live .rc-dive__corner { opacity: 1; }
.rc-dive__corner.is-tl { border-width: 2px 0 0 2px; }
.rc-dive__corner.is-tr { border-width: 2px 2px 0 0; }
.rc-dive__corner.is-bl { border-width: 0 0 2px 2px; }
.rc-dive__corner.is-br { border-width: 0 2px 2px 0; }

@media (max-width: 960px) {
  .rc-dive { height: 280vh; }
}
/* 動きを減らす設定・JavaScript が動かないとき：止めずに、書き換えたあとの言葉を出す */
.rc-dive:not(.is-live) { height: auto; }
.rc-dive:not(.is-live) .rc-dive__pin { position: static; height: auto; padding-block: clamp(64px, 10vw, 120px); }
.rc-dive:not(.is-live) .rc-dive__caret { display: none; }
