/* 히어로 아래: 이 사이트에서 하는 일 셋(용어 보기 · 말로 찾기 · 문장 조합기).
   히어로가 GNB 아래 붙어 있는 동안 이 구역이 둥근 판으로 올라와 덮는다(hero.css).
   카드 안 그림은 코드로 그린 작은 화면 조각이다. 히어로보다 가볍게: 어두운 카드 + 흰 화면 하나 + 파랑 하나. */

.ways { padding: clamp(80px, 12vh, 140px) clamp(16px, 4vw, 48px) clamp(72px, 10vh, 120px); }
.ways-head { max-width: 1280px; margin: 0 auto; text-align: center; }
.ways-kick { font-size: 14px; font-weight: 700; letter-spacing: .02em; color: var(--d-mute); }
.ways-head h2 { margin-top: 14px; font-size: clamp(34px, 4.4vw, 60px); font-weight: 800; letter-spacing: -.045em; line-height: 1.15; color: var(--d-text); }

.ways-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); max-width: 1280px; margin: clamp(40px, 6vh, 64px) auto 0; padding: 0; list-style: none; }
.way a {
  position: relative; display: grid; height: 100%; overflow: hidden; text-decoration: none; color: var(--d-text);
  border: 1px solid var(--d-line); border-radius: 28px; background: linear-gradient(180deg, #141922, #0d1117);
  transition: transform .45s var(--ease), border-color .3s var(--ease), box-shadow .45s var(--ease);
}
.way a:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, .24); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.way a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.way-vis {
  position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden;
  background: radial-gradient(70% 60% at 50% 42%, rgba(84, 156, 255, .14), transparent 72%);
  font-size: clamp(11px, 1vw, 14px);
}
.way-tx { padding: 4px 84px 28px 28px; }
.way-tx h3 { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.way-tx p { margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--d-mute); }
.way-go {
  position: absolute; right: 22px; bottom: 26px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); font-size: 18px; transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.way a:hover .way-go { background: #fff; color: #07090d; transform: translateX(2px); }

/* 1 용어 보기: 작은 화면의 라운드가 0 → 12 → 24px로 바뀌고, 아래 칩이 지금 값을 보여 준다 */
.way-vis-term { align-content: center; gap: 1.1em; }
.wv-screen { display: grid; gap: .55em; width: 46%; padding: 1em; background: #fff; border-radius: 26px; box-shadow: 0 1.4em 3em rgba(0, 0, 0, .35); animation: wv-round 6s infinite; }
.wv-img { display: block; aspect-ratio: 16 / 9; border-radius: inherit; background: linear-gradient(150deg, #e9d3b5, #a8714a); }
.wv-line { display: block; height: .7em; width: 80%; border-radius: 99px; background: #d9dee5; }
.wv-line.s { width: 52%; background: #e9edf2; }
.wv-btn { display: block; height: 2.2em; margin-top: .3em; border-radius: inherit; background: var(--blue); }
@keyframes wv-round { 0%, 30% { border-radius: 0; } 33%, 63% { border-radius: 12px; } 66%, 96% { border-radius: 26px; } 100% { border-radius: 0; } }
.wv-chip { display: inline-flex; align-items: center; gap: .5em; padding: .45em .95em; border-radius: 999px; background: rgba(7, 9, 13, .78); border: 1px solid rgba(255, 255, 255, .16); font-size: 1em; white-space: nowrap; }
.wv-chip b { font-weight: 700; color: var(--d-mute); }
.wv-val { display: inline-grid; }   /* 값 셋을 한 자리에 겹쳐 두고 차례로 보인다(칩 너비는 가장 긴 값에 맞춰짐) */
.wv-val em { grid-area: 1 / 1; font-style: normal; font-weight: 800; color: #8fbcff; font-variant-numeric: tabular-nums; opacity: 0; animation: wv-pick 6s infinite; }
.wv-val em:nth-child(2) { animation-delay: -4s; }
.wv-val em:nth-child(3) { animation-delay: -2s; }
@keyframes wv-pick { 0%, 30% { opacity: 1; } 33%, 100% { opacity: 0; } }

/* 2 말로 찾기: 입력칸에 문장이 써지고, 맞는 용어 셋이 차례로 뜬다 */
.way-vis-ask { align-content: center; gap: 1.2em; }
.wv-ask { display: flex; align-items: center; width: 74%; min-height: 3.2em; padding: 0 1.2em; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .07); font-size: 1.1em; }
.wv-type { display: inline-block; overflow: hidden; white-space: nowrap; width: 7.3em; border-right: 2px solid #8fbcff; padding-right: 2px; animation: wv-type 6s steps(9) infinite, wv-caret .8s step-end infinite; }
@keyframes wv-type { 0% { width: 0; } 35%, 88% { width: 7.3em; } 96%, 100% { width: 0; } }
@keyframes wv-caret { 50% { border-color: transparent; } }
.wv-hits { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em; width: 80%; }
.wv-hits i { padding: .45em .9em; border-radius: 999px; font-style: normal; font-weight: 700; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: var(--d-text); animation: wv-hit 6s infinite both; }
.wv-hits i:first-child { background: rgba(49, 130, 246, .22); border-color: rgba(84, 156, 255, .6); color: #cfe2ff; }
.wv-hits i:nth-child(2) { animation-delay: .25s; }
.wv-hits i:nth-child(3) { animation-delay: .5s; }
@keyframes wv-hit { 0%, 40% { opacity: 0; transform: translateY(.5em); } 48%, 86% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; transform: none; } }

/* 3 문장 조합기: 블록 셋이 차례로 쌓이고, 아래 주황 문장이 자란다 */
.way-vis-compose { align-content: center; gap: 1em; }
.wv-stack { display: grid; gap: .45em; width: 56%; padding: .7em; border-radius: 14px; background: #fff; box-shadow: 0 1.4em 3em rgba(0, 0, 0, .35); }
.wv-stack i { display: block; border-radius: 6px; animation: wv-drop 6s infinite both; }
.wv-stack .n { height: 1.1em; background: #e9edf2; }
.wv-stack .h { height: 3.6em; background: linear-gradient(120deg, #f2f4f6 55%, #e9d3b5 55%); animation-delay: .35s; }
.wv-stack .c { height: 2.4em; background: linear-gradient(90deg, #dfe6ef 0 31%, transparent 31% 34.5%, #dfe6ef 34.5% 65.5%, transparent 65.5% 69%, #dfe6ef 69%); animation-delay: .7s; }
@keyframes wv-drop { 0%, 6% { opacity: 0; transform: translateY(-.8em); } 14%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
.wv-say { display: grid; gap: .4em; width: 62%; padding: .8em 1em; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); }
.wv-say b { font-size: .85em; font-weight: 800; color: #ff9b54; }
.wv-say i { display: block; height: .6em; border-radius: 99px; background: rgba(255, 255, 255, .55); transform-origin: left; animation: wv-grow 6s infinite both; animation-delay: 1s; }
.wv-say i.s { width: 64%; background: rgba(255, 255, 255, .3); animation-delay: 1.3s; }
@keyframes wv-grow { 0%, 12% { transform: scaleX(0); } 30%, 88% { transform: scaleX(1); } 96%, 100% { transform: scaleX(0); } }

/* 제목 줄: 줄마다 가림막(.wl) 안에서 글자가 아래에서 올라온다. --o는 줄 순서(머리말 0 · 제목 1·2 · 작은 글 3) */
.wl { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.wl > span { display: block; will-change: transform; }
.ways-sub { margin-top: 10px; font-size: 15px; color: var(--d-mute); }

/* 들어올 때(휴대폰 · 움직임 줄이기가 아닌 좁은 화면 · 스크립트만 있을 때): 한 번 재생.
   hero.js가 .is-ready를 붙인 뒤에만 숨겨 두므로 스크립트가 없으면 그냥 보인다 */
.ways.is-ready .wl > span { transform: translateY(105%); transition: transform 1.1s cubic-bezier(.16, 1, .3, 1) calc(var(--o) * .09s); }
.ways.is-ready .way { opacity: 0; transform: translateY(56px) scale(.97); transition: opacity 1s cubic-bezier(.16, 1, .3, 1) calc(.3s + var(--i) * .09s), transform 1.1s cubic-bezier(.16, 1, .3, 1) calc(.3s + var(--i) * .09s); }
.ways.is-in .wl > span { transform: none; }
.ways.is-in .way { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .ways-list { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .way-vis { aspect-ratio: 16 / 9; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .wv-screen, .wv-val em, .wv-type, .wv-hits i, .wv-stack i, .wv-say i { animation: none; }
  .wv-screen { border-radius: 12px; }
  .wv-val em:nth-child(2) { opacity: 1; }
  .ways.is-ready .wl > span, .ways.is-ready .way { opacity: 1; transform: none; transition: none; }
}

/* ── 부품 모자이크: 칸 = 그림 한 장(배경까지 그림에 들어 있음). 이름은 올리거나 고르면 보인다 */
.ways { --a: 0; --c: 0; --m: 0; }
.ways-tiles { margin: 0; padding: 0; list-style: none; }
.mtile a { position: relative; display: block; overflow: hidden; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .08); background: #141923; transition: border-color .25s var(--ease); }
.mtile img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.mtile a:hover { border-color: rgba(255, 255, 255, .24); }
.mtile a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.mtile-name {
  position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(7, 9, 13, .72);
  font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; opacity: 0; transform: translateY(4px); transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.mtile a:hover .mtile-name, .mtile a:focus-visible .mtile-name { opacity: 1; transform: none; }

/* 정적 배치(휴대폰 · 움직임 줄이기 · 스크립트 없음): 카드 아래 한 줄로 */
.ways:not(.is-scrolly) .ways-tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; max-width: 1280px; margin: 28px auto 0; }
@media (max-width: 900px) {
  .ways:not(.is-scrolly) .ways-tiles { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; max-width: none; margin: 20px calc(-1 * clamp(16px, 4vw, 48px)) 0; padding: 0 clamp(16px, 4vw, 48px) 6px; }
  .ways:not(.is-scrolly) .mtile { flex: 0 0 38%; scroll-snap-align: start; }
  .mtile-name { opacity: 1; transform: none; }
}

/* 넓은 화면: 이 구역이 GNB 아래 잠깐 붙어 있는 동안(--m 0→1, hero.js) 제목은 흐려지고,
   카드는 가운데로 작아지며, 칸 16개가 카드 뒤에서 자기 자리(--x, --y)로 퍼진다. 칸마다 나오는 때(--k)가 조금씩 다르다 */
.ways.is-scrolly { height: calc(100svh - var(--hero-top, 71px) + 150vh); padding: 0; }
.ways.is-scrolly .ways-pin {
  position: sticky; top: var(--hero-top, 71px); height: calc(100svh - var(--hero-top, 71px)); overflow: hidden; container-type: size;
  display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(16px, 4vw, 48px); border-radius: inherit;
}
/* 넓은 화면은 시간이 아니라 스크롤이 움직임을 정한다(hero.js가 부드럽게 따라가며 값을 넘김).
   --a 제목이 드러난 정도 · --c 카드가 올라온 정도 · --m 모자이크로 퍼진 정도. 모두 0→1 */
.ways.is-scrolly .wl > span { --r: clamp(0, (var(--a) - var(--o) * .14) / .58, 1); transform: translateY(calc((1 - var(--r)) * 105%)); transition: none; }
.ways.is-scrolly .way {
  --cc: clamp(0, (var(--c) - var(--i) * .16) / .68, 1);
  opacity: var(--cc); transform: translateY(calc((1 - var(--cc)) * 16cqh)) scale(calc(.92 + var(--cc) * .08)); transition: none;
}
.ways.is-scrolly .ways-head { opacity: calc(1 - var(--m) * 2.6); transform: translateY(calc(var(--m) * -6cqh)); }
.ways.is-scrolly .ways-list { position: relative; z-index: 2; width: 100%; margin-top: clamp(28px, 4.5cqh, 56px); transform: translateY(calc(var(--m) * var(--lift, 0px))) scale(calc(1 - var(--m) * .34)); }
.ways.is-scrolly .ways-tiles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.ways.is-scrolly .mtile {
  --t: clamp(0, (var(--m) - .15 - var(--k) * .3) / .55, 1);
  position: absolute; left: 50%; top: 50%; width: calc(var(--s) * min(1cqw, 1.75cqh)); pointer-events: auto;
  transform: translate(-50%, -50%) translate(calc(var(--x) * var(--t) * 1cqw), calc(var(--y) * var(--t) * 1cqh)) scale(calc(.5 + var(--t) * .5));
  opacity: var(--t);
}
.ways.is-scrolly:not(.is-mosaic) .mtile { visibility: hidden; }   /* 아직 안 퍼졌을 때는 키보드로도 건너뛰게 */
