/* D59 home #/ — approved design C (landing-d41 3621bed) on the operational shell.
   Every rule is scoped to .home-c (or body[data-route=home]) because this sheet stays loaded after leaving home.
   Colours are Aquila semantic tokens only; motion uses springs.css. */

body[data-route=home] { background: var(--aq-surface); }
body[data-route=home] #global-search { visibility: hidden; }
body[data-route=home] #view { max-width: none; padding-inline: 0; }

/* ux-p5: index.html carries the home first screen (#hc-boot); web/boot.js names the route before the first paint.
   The same shell rules hold until app.js names the route itself, so adopting it moves nothing. */
html:not([data-boot=home]) #hc-boot { display: none; }
html[data-boot=home] body:not([data-route]) { background: var(--aq-surface); }
html[data-boot=home] body:not([data-route]) #global-search,
html[data-boot=home] body:not([data-route]) .topbar-search { visibility: hidden; }
html[data-boot=home] body:not([data-route]) #view { max-width: none; padding-inline: 0; }
/* The static title and town are painted in place, without the entrance delay (the title is the first thing to read); a picture that loads while faded out or still rising counts as unpainted or
   smaller, and the first screen would then wait for home.js to repaint it. */
#hc-boot .town-enter,
#hc-boot .blur-title .w { animation: none; }
/* Adopted in place: the words and the town already came in once. */
.home-c.is-booted .blur-title .w,
.home-c.is-booted .town-enter { animation: none; }

/* Shell bar and mobile tab heights; home.js measures the real values into these. */
.home-c {
  --hc-top: 65px;
  --hc-bottom: 0px;
  position: relative;
}

@media (max-width: 767px), (pointer: coarse) and (max-height: 500px) {
  .home-c {
    --hc-top: calc(56px + env(safe-area-inset-top));
    --hc-bottom: calc(64px + env(safe-area-inset-bottom));
  }
}

/* Shell defaults the design does not use */
.home-c a {
  color: inherit;
  text-decoration: none;
}

.home-c button,
.home-c input {
  min-height: 0;
}

.home-c button {
  cursor: pointer;
}

.home-c .s-town img,
.home-c .rv img,
.home-c .detail img {
  max-width: none;
}


/* ───────── 기본 ───────── */

.home-c {
  background: var(--aq-surface);
  color: var(--aq-fg);
  font-family: var(--aq-font);
  word-break: keep-all;
}

/* 화면에서는 숨기고 화면낭독기에는 읽힌다. 1px 상자에 가두지 않아 글자가 상자를 넘치지 않는다. */
.home-c .sr-only {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  white-space: nowrap;
  clip-path: inset(50%);
  pointer-events: none;
}

.home-c {
  --pad: clamp(16px, 4vw, 64px);
  --mx: 0;
  --my: 0;
}

/* 스크롤 진행도. 숫자로 등록해야 스크롤 타임라인에서 보간된다. */
@property --hc-p {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

/* ───────── 초점 ───────── */

.home-c a:focus-visible {
  outline: 2px solid var(--aq-ring);
  outline-offset: 3px;
}

/* ───────── 스크롤 장면 ───────── */

.home-c .story {
  position: relative;
  height: 300vh;
}

/*
  구간표 (CSS와 app.js가 같은 경계를 쓴다)
  t1 0.00–0.30  동네가 올라와 화면을 채움, 제목·검색은 흐려지며 사라짐
  t2 0.30–0.50  핀이 순서대로 떨어짐 (핀마다 --th에서 0.05 동안)
  t3 0.50–0.78  결과 패널이 옆에서 들어오고 동네는 왼쪽으로 밀림
  t4 0.78–1.00  시작 버튼 블록이 올라옴
*/
.home-c .stage {
  --t1: clamp(0, calc(var(--hc-p) / 0.3), 1);
  --t3: clamp(0, calc((var(--hc-p) - 0.5) / 0.28), 1);
  --t4: clamp(0, calc((var(--hc-p) - 0.78) / 0.22), 1);
  --zs0: 0.92;
  /* ux-p6: 확대 끝값은 상한(--zs-cap)과 화면 맞춤값(--zs-fit, home.js fitZoom) 중 작은 쪽. 동네 위쪽·핀이 무대 밖으로 잘리지 않는다. */
  --zs-cap: 1.5;
  --zs1: min(var(--zs-cap), var(--zs-fit, 1));
  --zs: calc(var(--zs0) + var(--t1) * (var(--zs1) - var(--zs0)));
  --town-w: min(840px, 62vw);
  --town-y0: 50%;
  /* ux-p9 2회차: 패널은 화면 밖(자기 폭 + 여백 + 그림자)에서 불투명하게 들어온다. 반쯤 투명한 판이 도시 위에 비치지 않는다. */
  --panel-from: translateX(calc((1 - var(--t3)) * (100% + var(--pad) + 48px)));
  position: sticky;
  top: var(--hc-top);
  height: calc(100svh - var(--hc-top) - var(--hc-bottom));
  min-height: 560px;
  overflow: hidden;
  background: var(--aq-surface);
}

/* 큰 제목: 스크롤하면 위로 밀리며 흐려진다 */
.home-c .s-title {
  position: absolute;
  z-index: 3;
  top: clamp(32px, calc(13svh - 64px), 64px);
  left: var(--pad);
  right: var(--pad);
  transform: translateY(calc(var(--t1) * -40%));
  opacity: calc(1 - var(--t1) * 1.6);
  filter: blur(calc(var(--t1) * 8px));
}

.home-c .blur-title {
  font-size: clamp(44px, 7.5vw, 136px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.home-c .blur-title .line {
  display: inline;
}

.home-c .blur-title .line + .line::before {
  content: ' ';
}

.home-c .blur-title .line:last-child .w {
  color: var(--aq-accent);
}

/* 움직임 1: 어절별 블러-인 */
.home-c .blur-title .w {
  display: inline-block;
  white-space: pre;
  animation: hc-word-in var(--spring-smooth-duration) var(--spring-smooth) both;
  animation-delay: calc(var(--i) * 70ms + 120ms);
}

@keyframes hc-word-in {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

.home-c .blur-follow {
  animation: hc-word-in var(--spring-smooth-duration) var(--spring-smooth) both;
  animation-delay: 420ms;
}

.home-c .s-search {
  position: absolute;
  z-index: 3;
  top: calc(clamp(32px, calc(13svh - 64px), 64px) + clamp(52px, 7.5vw, 142px) + 20px);
  left: var(--pad);
  right: var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(560px, 55%));
  grid-template-areas:
    "lede search"
    ". note"
    ". examples";
  column-gap: 48px;
  align-items: center;
  opacity: calc(1 - var(--t1) * 2.2);
  transform: translateY(calc(var(--t1) * -60px));
}

.home-c .lede {
  grid-area: lede;
  max-width: 30em;
  font-size: 18px;
  line-height: 1.6;
  color: var(--aq-fg-secondary);
}

/* ───────── 검색창 ───────── */

.home-c .search {
  grid-area: search;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 5px 5px 5px 20px;
  background: var(--aq-surface);
  border: 1px solid var(--aq-border);
  border-radius: var(--aq-radius-full);
  box-shadow: var(--aq-shadow-md);
}

.home-c .search:focus-within {
  border-color: var(--aq-ring);
  box-shadow: 0 0 0 2px var(--aq-ring), var(--aq-shadow-md);
}

.home-c .field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.home-c .field input {
  width: 100%;
  height: 48px;
  border: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
  color: var(--aq-fg);
  outline: none;
}

.home-c .field input::placeholder {
  color: var(--aq-fg-muted);
  font-weight: 500;
}

.home-c .field input::-webkit-search-cancel-button {
  display: none;
}

.home-c .mirror {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  pointer-events: none;
  font-size: 17px;
  font-weight: 600;
  white-space: pre;
}

.home-c .mirror-text {
  color: transparent;
}

.home-c .caret {
  width: 2px;
  height: 22px;
  margin-left: 1px;
  background: var(--aq-accent);
  animation: hc-blink 1s steps(1) infinite;
}

.home-c .search.is-demo .mirror {
  display: flex;
}

@keyframes hc-blink {
  50% {
    opacity: 0;
  }
}

.home-c .search button {
  flex: none;
  height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--aq-radius-full);
  background: var(--aq-accent);
  color: var(--aq-accent-fg);
  font-size: 16px;
  font-weight: 700;
}

.home-c .search button:focus-visible {
  outline: 2px solid var(--aq-ring-strong);
  outline-offset: 2px;
}

.home-c .note {
  grid-area: note;
  margin-top: 10px;
  padding-left: 20px;
  font-size: 14px;
  /* 검색창 그림자 위에 놓여 muted 회색은 4.5:1이 안 나온다 */
  color: var(--aq-fg-secondary);
}

/* 예시 검색어: 규모가 다른 네 학교 */
.home-c .examples {
  grid-area: examples;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-left: 12px;
}

.home-c .examples-label {
  margin-right: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--aq-fg-secondary);
}

.home-c .hc-chip {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--aq-border);
  border-radius: var(--aq-radius-full);
  background: var(--aq-surface);
  color: var(--aq-fg);
  font-size: 15px;
  font-weight: 600;
  transition: border-color 200ms var(--spring-glide), transform 200ms var(--spring-glide);
}

.home-c .hc-chip:hover {
  border-color: var(--aq-accent);
}

.home-c .hc-chip:active {
  transform: scale(0.97);
}

.home-c .hc-chip:focus-visible,
.home-c .rv button:focus-visible,
.home-c .rv a:focus-visible,
.home-c .detail button:focus-visible,
.home-c .detail a:focus-visible {
  outline: 2px solid var(--aq-ring);
  outline-offset: 2px;
}

.home-c .search.is-loading button {
  opacity: 0.7;
}

.home-c .hero-error {
  grid-area: note;
  margin-top: 10px;
  padding-left: 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--aq-fg);
}

/* ───────── 동네 그림 ───────── */

/* 하나의 도시(ux-p9): 실시간 3D 하나(town3d.js, three.js). 캔버스(.s-town3d)가 무대 전체를 덮고, 매 프레임 동네 상자(.town-idle)의
   화면 위치·크기(스크롤 확대·올라옴·시차)에 카메라를 맞춰 기기 픽셀 배율로 다시 그린다. 늘린 그림이 없어 어떤 스크롤에서도 선명하고,
   한 격자·한 장면이라 이어 붙인 자리(이음새)가 없다. 위쪽 흐림 → 글 뒤 순백(var(--aq-surface))은 합성 패스가 그린다(home.js fitVeil이 칩 아래 끝을 잰다).
   동네 상자에는 포스터(같은 장면·같은 카메라를 미리 그린 그림: 첫 화면·폴백·다이브 잔상)와 이름표만 남는다. */
.home-c .s-town3d {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms var(--spring-smooth);
}

.home-c[data-town3d="ready"] .s-town3d {
  opacity: 1;
}

/* 포스터 가장자리는 흰 바탕으로 녹는다(마스크는 알파만 쓴다). 3D가 뜨면 같은 그림 아래로 사라진다. */
.home-c .town-idle > img {
  -webkit-mask-image: radial-gradient(closest-side, var(--aq-surface) 74%, transparent);
  mask-image: radial-gradient(closest-side, var(--aq-surface) 74%, transparent);
  transition: opacity 600ms var(--spring-smooth) 160ms;
}

.home-c[data-town3d="ready"] .town-idle > img {
  opacity: 0;
}

/* 3D가 없으면(로딩 중·WebGL 불가·컨텍스트 소실) 포스터를 원래 크기보다 키우지 않는다. 3D에서는 떠다님을 멈춘다(렌더를 쉬게). */
.home-c:not([data-town3d="ready"]) .stage {
  --zs1: var(--zs0);
}

.home-c[data-town3d="ready"] .town-idle {
  animation: none;
}

.home-c .s-town {
  position: absolute;
  z-index: 1;
  left: calc(50% - var(--town-w) / 2);
  top: calc(50% - var(--town-w) * 0.393);
  width: var(--town-w);
  transform-origin: 55% 58%;
  transform:
    translateX(calc(var(--t3) * -18%))
    translateY(calc((1 - var(--t1)) * var(--town-y0)))
    scale(var(--zs));
}

/* 포인터 시차 ±10px */
.home-c .town-par {
  transform: translate3d(calc(var(--mx) * 10px), calc(var(--my) * 10px), 0);
  transition: transform 600ms var(--spring-smooth);
}

/* 첫 등장: 아래에서 스프링으로 올라온다 */
.home-c .town-enter {
  animation: hc-town-in var(--spring-snappy-duration) var(--spring-snappy) both;
  animation-delay: 400ms;
}

@keyframes hc-town-in {
  from {
    opacity: 0;
    transform: translateY(22%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 느린 떠다님: 위아래 6px, 24s alternate. ux-p6: 확대(scale)는 스크롤 줌과 겹쳐 위쪽을 잘라서 뺐다. */
.home-c .town-idle {
  position: relative;
  animation: hc-drift 24s ease-in-out infinite alternate;
}

@keyframes hc-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(0, -6px, 0);
  }
}

.home-c .town-idle img {
  width: 100%;
  height: auto;
}

/* ───────── 핀: 진행도에 따라 하나씩 떨어진다 ───────── */

.home-c .pins {
  position: absolute;
  inset: 0;
}

/* 핀 레이어는 동네(±10px)보다 4px 더 움직여 합계 ±14px */
.home-c .pins {
  transform: translate3d(calc(var(--mx) * 4px), calc(var(--my) * 4px), 0);
}

.home-c .pin {
  --u: clamp(0, calc((var(--hc-p) - var(--th)) / 0.05), 1);
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
  opacity: var(--u);
  /* 동네가 커져도 핀은 같은 크기로 보이게 역배율 */
  transform: translateY(calc((1 - var(--u)) * -64px)) scale(calc(1 / var(--zs)));
  transform-origin: 0 0;
}

.home-c .pin-bounce {
  position: absolute;
  left: 0;
  top: 0;
}

/* 착지하면 스프링으로 한 번 튕긴다 (app.js가 .landed를 붙인다) */
.home-c .pin.landed .pin-bounce {
  animation: hc-pin-land var(--spring-snappy-duration) var(--spring-snappy) both;
}

@keyframes hc-pin-land {
  from {
    transform: translateY(-18px);
  }
  to {
    transform: none;
  }
}

.home-c .pin-tag {
  position: absolute;
  left: 22px;
  top: -40px;
  padding: 5px 11px;
  border-radius: var(--aq-radius-full);
  background: var(--aq-surface);
  box-shadow: var(--aq-shadow-md);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.home-c .pin-tag.small {
  left: 14px;
  top: -14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--aq-fg-secondary);
}

/* ───────── 첫 화면 미리보기 카드 ───────── */

.home-c .s-peek {
  position: absolute;
  z-index: 4;
  left: calc(50% + var(--town-w) * 0.18);
  bottom: clamp(56px, 14svh, 140px);
  opacity: calc(1 - var(--t1) * 2.5);
  transform: translateY(calc(var(--t1) * -80px));
}

.home-c .peek-body {
  padding: 14px 18px;
  border-radius: var(--aq-radius-card);
  background: color-mix(in srgb, var(--aq-surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--aq-surface) 70%, transparent);
  box-shadow: var(--aq-shadow-lg);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  animation: hc-peek-in var(--spring-snappy-duration) var(--spring-snappy) both;
  animation-delay: 700ms;
}

@keyframes hc-peek-in {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.home-c .peek-body.hc-bump {
  animation: hc-bump var(--spring-snappy-duration) var(--spring-snappy);
}

.home-c .peek-cond {
  font-size: 13px;
  font-weight: 700;
  color: var(--aq-accent-strong);
}

.home-c .peek-line {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--aq-fg-secondary);
  white-space: nowrap;
}

.home-c .peek-line strong {
  color: var(--aq-fg);
  font-weight: 800;
}

.home-c .state-mini .mini-preview,
.home-c .state-mini[data-state="preview"] .mini-example {
  display: none;
}

.home-c .state-mini[data-state="preview"] .mini-preview {
  display: inline;
}

/* ───────── 유리질 결과 패널 ───────── */

.home-c .s-panel {
  position: absolute;
  z-index: 4;
  right: var(--pad);
  top: calc(50% - 230px);
  width: min(420px, calc(100% - 2 * var(--pad)));
  border-radius: var(--aq-radius-card);
  background: color-mix(in srgb, var(--aq-surface) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--aq-surface) 70%, transparent);
  box-shadow: var(--aq-shadow-xl);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  opacity: clamp(0, calc(var(--t3) * 12), 1);
  transform: var(--panel-from) scale(calc(1 - var(--t4) * 0.04));
  transform-origin: 100% 0;
}

.home-c .panel-body.hc-bump {
  animation: hc-bump var(--spring-snappy-duration) var(--spring-snappy);
}

@keyframes hc-bump {
  from {
    opacity: 0.6;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.home-c .panel-row {
  padding: 18px 22px;
}

.home-c .panel-row + .panel-row {
  border-top: 1px solid color-mix(in srgb, var(--aq-fg) 8%, transparent);
}

.home-c .label {
  font-size: 13px;
  font-weight: 700;
  color: var(--aq-fg-secondary);
}

.home-c .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.home-c .chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--aq-radius-full);
  background: var(--aq-accent-subtle);
  color: var(--aq-accent-strong);
  font-size: 15px;
  font-weight: 700;
}

.home-c .chip:empty {
  display: none;
}

.home-c .result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.home-c .result-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-c .result-dist {
  flex: none;
  font-size: 18px;
  font-weight: 800;
  color: var(--aq-accent-strong);
  font-variant-numeric: tabular-nums;
}

.home-c .result-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.home-c .badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--aq-radius-xs);
  background: var(--aq-accent-subtle);
  color: var(--aq-accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.home-c .course {
  font-size: 14px;
  font-weight: 600;
  color: var(--aq-fg-secondary);
}

.home-c .state .state-preview,
.home-c .state[data-state="preview"] .state-example {
  display: none;
}

.home-c .state[data-state="preview"] .state-preview {
  display: block;
}

.home-c .skeleton {
  display: block;
  height: 12px;
  margin-top: 12px;
  border-radius: var(--aq-radius-full);
  background: color-mix(in srgb, var(--aq-fg) 10%, transparent);
  animation: hc-breathe 1.6s ease-in-out infinite alternate;
}

.home-c .skeleton.short {
  width: 58%;
  margin-top: 8px;
}

@keyframes hc-breathe {
  to {
    opacity: 0.45;
  }
}

.home-c .explain {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.home-c .sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--aq-fg-secondary);
}

.home-c .total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.home-c .total strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-c .total span {
  font-size: 13px;
  color: var(--aq-fg-secondary);
}

/* ───────── 마지막 장면: 시작 버튼 ───────── */

.home-c .s-cta {
  position: absolute;
  z-index: 5;
  left: var(--pad);
  bottom: clamp(32px, 8svh, 80px);
  width: min(460px, calc(100% - 2 * var(--pad)));
  padding: 24px 26px;
  border-radius: var(--aq-radius-card);
  background: color-mix(in srgb, var(--aq-surface) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--aq-surface) 70%, transparent);
  box-shadow: var(--aq-shadow-xl);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  opacity: var(--t4);
  transform: translateY(calc((1 - var(--t4)) * 40px));
  visibility: hidden;
}

.home-c .stage.show-cta .s-cta {
  visibility: visible;
}

.home-c .cta-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.home-c .cta {
  border: 0;
  display: inline-flex;
  align-items: center;
  height: 54px;
  margin-top: 16px;
  padding: 0 26px;
  border-radius: var(--aq-radius-full);
  background: var(--aq-accent);
  color: var(--aq-accent-fg);
  font-size: 17px;
  font-weight: 700;
}

.home-c .cta-sub {
  margin-top: 12px;
  font-size: 14px;
  color: var(--aq-fg-secondary);
}

/* ───────── 기능 구역 ───────── */

.home-c .features {
  position: relative;
  background: var(--aq-surface);
  padding: clamp(72px, 10vw, 128px) var(--pad) clamp(64px, 8vw, 104px);
}

.home-c .features h2 {
  max-width: 1200px;
  margin: 0 auto;
  font-size: clamp(30px, 3.6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.home-c .feature-grid {
  max-width: 1200px;
  margin: 48px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.home-c .feature {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  border-radius: var(--aq-radius-card);
  background: var(--aq-surface);
  border: 1px solid var(--aq-border-subtle);
}

.home-c .feature img {
  width: auto;
  height: 120px;
  object-fit: contain;
  align-self: flex-start;
}

.home-c .feature h3 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-c .feature p {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--aq-fg-secondary);
}

/* ───────── 모바일 ───────── */

@media (max-width: 720px) {
  .home-c .stage {
    --town-w: 112vw;
    --town-y0: 62%;
    --zs0: 0.9;
    --zs-cap: 1.6;
    --panel-from: translateY(calc((1 - var(--t3)) * (100% + 64px)));
  }

  .home-c .s-title {
    top: 28px;
  }

  .home-c .blur-title {
    font-size: 15vw;
    line-height: 1.08;
    white-space: normal;
  }

  .home-c .blur-title .line {
    display: block;
  }

  .home-c .blur-title .line + .line::before {
    content: none;
  }

  .home-c .s-search {
    top: calc(28px + 32.4vw + 16px);
    display: block;
  }

  .home-c .lede {
    font-size: 16px;
  }

  .home-c .search {
    margin-top: 16px;
    padding-left: 12px;
  }

  .home-c .search button {
    padding: 0 12px;
  }

  .home-c .field input::placeholder {
    font-size: 14px;
  }

  .home-c .note {
    padding-left: 0;
  }

  .home-c .s-peek {
    left: auto;
    right: var(--pad);
    bottom: 24px;
    /* fixed width: the typing demo swaps results here, so the card must not resize */
    width: min(300px, calc(100% - 2 * var(--pad)));
  }

  .home-c .peek-line {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-c .s-panel {
    top: auto;
    bottom: 16px;
    left: var(--pad);
    right: var(--pad);
    width: auto;
    transform-origin: 50% 100%;
  }

  .home-c .panel-row {
    padding: 14px 16px;
  }

  .home-c .s-cta {
    top: 20px;
    bottom: auto;
    padding: 18px;
  }

  .home-c .cta-title {
    font-size: 20px;
  }

  .home-c .cta {
    height: 48px;
    margin-top: 12px;
  }

  .home-c .cta-sub {
    display: none;
  }

  .home-c .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* ───────── 동작 줄이기: 장면을 세로로 정지 배치 ───────── */

@media (prefers-reduced-motion: reduce) {
  .home-c *,
.home-c *::before,
.home-c *::after {
    animation: none !important;
    transition: none !important;
  }

  .home-c .story {
    height: auto;
  }

  .home-c .stage {
    --hc-p: 1;
    position: relative;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 32px var(--pad) 48px;
    overflow: visible;
  }

  .home-c .s-peek,
  .home-c .s-town3d {
    display: none;
  }

  .home-c .s-title,
.home-c .s-search,
.home-c .s-town,
.home-c .s-panel,
.home-c .s-cta {
    position: relative;
    inset: auto;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: auto;
    max-width: 100%;
    opacity: 1;
    filter: none;
    transform: none;
    visibility: visible;
  }

  .home-c .blur-title {
    white-space: normal;
  }

  .home-c .s-town {
    width: min(840px, 100%);
    align-self: center;
  }

  .home-c .pin {
    opacity: 1;
    transform: none;
  }

  .home-c .s-panel {
    width: min(420px, 100%);
  }

  .home-c .s-cta {
    width: min(460px, 100%);
  }
}

/* ═════════ 6차: 검색 결과 장면 ═════════
  흐름: 동네 그림 사각형(--clip-from)에서 화면 전체로 차오르고(clip-path),
  카메라(.world)가 0.55배에서 학교로 파고든다(transform). 둘 다 같은 스프링(crisp, 약 3% 넘침).
  그 뒤 건물이 거리순으로 서고(--seq × 40ms), 목록이 옆(모바일은 아래)에서 들어온다. */

.home-c {
  --dive-ms: 760ms;
  --detail-ms: 460ms;
  --flat-ms: 560ms;
}

.home-c .rv {
  --panel-w: min(440px, 38vw);
  --bar-h: 76px;
  position: fixed;
  inset: 0;
  z-index: 700;
  background: var(--aq-surface);
  clip-path: var(--clip-from, inset(0 0 0 0 round 0px));
  transition: clip-path var(--dive-ms) var(--spring-crisp);
}

.home-c .rv[hidden],
.home-c .detail[hidden] {
  display: none;
}

.home-c .rv.is-open {
  clip-path: inset(0px 0px 0px 0px round 0px);
}

.home-c .rv.instant,
.home-c .rv.instant *,
.home-c .detail.instant,
.home-c .detail.instant * {
  transition: none !important;
}

/* 상단 검색 막대 */
.home-c .rv-bar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: var(--panel-w);
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--pad);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 300ms var(--spring-glide) 200ms, transform var(--spring-smooth-duration) var(--spring-smooth) 200ms;
}

.home-c .rv.is-open .rv-bar {
  opacity: 1;
  transform: none;
}

.home-c .rv-back {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--aq-border);
  border-radius: var(--aq-radius-full);
  background: var(--aq-surface);
  color: var(--aq-fg);
}

.home-c .rv-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 4px 4px 4px 18px;
  border: 1px solid var(--aq-border);
  border-radius: var(--aq-radius-full);
  background: var(--aq-surface);
}

.home-c .rv-search:focus-within {
  border-color: var(--aq-ring);
}

.home-c .rv-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--aq-fg);
  outline: none;
}

.home-c .rv-search input::-webkit-search-cancel-button {
  display: none;
}

.home-c .rv-search button {
  flex: none;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--aq-radius-full);
  background: var(--aq-accent);
  color: var(--aq-accent-fg);
  font-size: 15px;
  font-weight: 700;
}

/* 장면 */
.home-c .rv-stage {
  position: absolute;
  inset: 0 var(--panel-w) 0 0;
  overflow: hidden;
  transition: filter 320ms var(--spring-glide), opacity 320ms var(--spring-glide);
}

/* ux-p7: 장면 가장자리는 흰 바탕으로 녹는다(흐림 없음, 색만 흰색으로). 위쪽은 검색 막대 아래까지. */
.home-c .rv-stage::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, var(--aq-bg) 0, color-mix(in srgb, var(--aq-bg) 70%, transparent) calc(var(--bar-h) * 0.7), transparent calc(var(--bar-h) + 56px), transparent calc(100% - 72px), var(--aq-bg)),
    linear-gradient(to right, var(--aq-bg), transparent 64px, transparent calc(100% - 64px), var(--aq-bg));
}

.home-c .rv.detail-open .rv-stage {
  filter: blur(2px);
  opacity: 0.6;
}

.home-c .camera {
  position: absolute;
  left: var(--ox);
  top: var(--oy);
  width: 0;
  height: 0;
}

.home-c .world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  transform: var(--cam-from, none);
  transition: transform var(--dive-ms) var(--spring-crisp);
}

.home-c .rv.is-open .world {
  transform: translate3d(0, 0, 0) scale(1);
}

/* 바닥 평면: 등각(rotateX 60° · rotateZ 45°). 지도로 볼 때 0°로 눕는다. */
.home-c .floor {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform: rotateX(60deg) rotateZ(45deg);
  transition: transform var(--flat-ms) var(--spring-weighty);
}

/* ux-p7: 장면 전체가 하나의 땅. 길 격자(ground.svg, 길 = 타일 가장자리)가 반경 안·밖을 끊김 없이 덮고, 학교 캠퍼스(2×2 블록)와
   작은 공원이 블록 위에 놓인다. 모두 바닥 평면 위라 등각·지도 눕기를 그대로 따른다. 색은 d41 그림 계층(그림 색), UI 토큰 아님. */
.home-c .ground {
  position: absolute;
  left: var(--gx0);
  top: var(--gy0);
  width: var(--gw);
  height: var(--gh);
  background: url('/assets/d41/ground.svg') var(--gox) var(--goy) / var(--gp) var(--gp) repeat;
  pointer-events: none;
}

.home-c .campus,
.home-c .park,
.home-c .shade {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.home-c .campus {
  background: url('/assets/d41/campus.svg') center / 100% 100% no-repeat;
}

.home-c .park {
  background: url('/assets/d41/park.svg') center / 100% 100% no-repeat;
}

/* 접지 그림자: 받침 가운데 아래 둥근 그림자(바닥 평면이라 화면에서는 2:1 타원). 빛이 왼쪽 위에서 오므로 살짝 오른쪽으로. */
.home-c .shade {
  margin-left: calc(var(--s) * 0.05);
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--aq-fg) 18%, transparent), color-mix(in srgb, var(--aq-fg) 7%, transparent) 62%, transparent);
  opacity: 0;
  transition: opacity 220ms var(--spring-glide) calc(var(--seq, 0) * 40ms + 380ms + var(--hc-late, 0ms));
}

.home-c .shade-bg {
  background: radial-gradient(closest-side, color-mix(in srgb, var(--aq-fg) 9%, transparent), color-mix(in srgb, var(--aq-fg) 3%, transparent) 62%, transparent);
  transition-delay: 200ms;
}

.home-c .rv.is-open .shade-bg,
.home-c .rv.is-open.is-ready .shade {
  opacity: 1;
}

.home-c .ground,
.home-c .campus,
.home-c .park {
  opacity: 0;
  transition: opacity 400ms var(--spring-glide) 120ms;
}

.home-c .rv.is-open .ground,
.home-c .rv.is-open .campus,
.home-c .rv.is-open .park {
  opacity: 1;
}

/* 반경: 땅 위에 그린 표시일 뿐(옅은 채색 + 얇은 선). 별도의 판이 아니다. */
.home-c .ring-area,
.home-c .ring {
  position: absolute;
  left: calc(var(--r) * -1);
  top: calc(var(--r) * -1);
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
  border-radius: 50%;
  pointer-events: none;
}

.home-c .ring-area {
  background: color-mix(in srgb, var(--aq-accent) 7%, transparent);
  opacity: 0;
  transition: opacity 400ms var(--spring-glide) 120ms;
}

.home-c .rv.is-open .ring-area {
  opacity: 1;
}

.home-c .ring {
  border: 2px solid color-mix(in srgb, var(--aq-accent) 45%, transparent);
  transform: scale(var(--ring-from, 1));
  opacity: 0;
  transition: transform var(--dive-ms) var(--spring-smooth) 240ms, opacity 300ms var(--spring-glide) 240ms;
}

.home-c .ring-base {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--aq-fg) 28%, transparent);
}

.home-c .rv.is-open .ring {
  transform: scale(1);
  opacity: 1;
}

/* 넓은 반경: 바깥 링이 늦게, 크게 퍼진다 */
.home-c .rv[data-template="wide"] .ring-actual {
  transition-delay: 520ms;
  transition-duration: 900ms;
}

/* 반경 밖 배경 도시(ux-p6): 실제 학원이 아닌 장식. 무채색 그림(밝기·채도는 그림에 구움), 핀·이름표·호버 없음, 누를 수 없음.
   자기 쌓임 맥락(z-index 0)이라 실제 건물(z 2000+)은 늘 이 층 위에 그려진다. */
.home-c .backdrop {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms var(--spring-glide) 200ms;
}

.home-c .rv.is-open .backdrop {
  opacity: 1;
}

.home-c .rv.is-flat .backdrop {
  opacity: 0;
  transition-delay: 0ms;
}

.home-c .backdrop img {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z);
  width: var(--w);
  height: auto;
  transform: translate(-50%, -80%);
  pointer-events: none;
  user-select: none;
}

/* 건물 */
.home-c .blds {
  position: absolute;
  left: 0;
  top: 0;
  transition: opacity 340ms var(--spring-glide), transform var(--flat-ms) var(--spring-weighty);
}

.home-c .bld img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.home-c .bld {
  --lift: 0px;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z);
  width: var(--w);
  padding: 0;
  border: 0;
  background: none;
  transform: translate(-50%, calc(-80% + var(--lift)));
  transition: transform 240ms var(--spring-glide);
  -webkit-tap-highlight-color: transparent;
}

/* 누를 자리(ux-p6): 그림 상자 전체가 아니라 건물 몸통(가운데 72%×78%), 작은 건물도 44px 이상.
   home-scene.js HIT와 같은 값이라 배치가 누를 자리끼리 겹치지 않게 놓는다. 그림 상자의 투명한 모서리는 누르지 않는다. */
.home-c .bld {
  pointer-events: none;
}

.home-c .bld::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(72%, 44px);
  height: max(78%, 44px);
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.home-c .bld > img {
  opacity: 0;
  transform: translateY(16px) scale(0.94);
  transform-origin: 50% 90%;
  transition:
    opacity 220ms var(--spring-glide) calc(var(--seq) * 40ms + 360ms + var(--hc-late, 0ms)),
    transform var(--spring-crisp-duration) var(--spring-crisp) calc(var(--seq) * 40ms + 360ms + var(--hc-late, 0ms));
}

.home-c .bld-school > img {
  transition-delay: calc(220ms + var(--hc-late, 0ms));
}

.home-c .rv.is-open.is-ready .bld > img {
  opacity: 1;
  transform: none;
}

.home-c .bld.hot,
.home-c .bld:hover,
.home-c .bld:focus-visible {
  --lift: -6px;
}

/* 이름표: 불투명 흰 칩. 건물 위 별도 층. 목록 상위 몇 곳만 늘 보이고 나머지는 강조될 때만 */
.home-c .tags {
  position: absolute;
  z-index: 3000;
  left: 0;
  top: 0;
  transition: opacity 200ms var(--spring-glide);
}

.home-c .tag {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 5px 11px;
  border: 1px solid var(--aq-border);
  border-radius: var(--aq-radius-full);
  background: var(--aq-surface);
  color: var(--aq-fg-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, calc(-100% + 2px - var(--nudge, 0px)));
  transition: opacity 200ms var(--spring-glide), transform 240ms var(--spring-glide);
  pointer-events: none;
}

/* 붐비는 지붕에서 위로 비켜 선 이름표: 자기 건물까지 가는 1px 선 */
.home-c .tag.nudged::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: calc(var(--nudge, 0px) + 4px);
  background: var(--aq-border-strong);
}

.home-c .tag strong {
  color: var(--aq-fg);
  font-weight: 700;
}

.home-c .rv.is-open.is-ready .tag.labelled {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 6px - var(--nudge, 0px)));
  transition-delay: calc(var(--seq) * 40ms + 420ms + var(--hc-late, 0ms));
}

.home-c .rv.is-open.is-ready .tag.hot {
  z-index: 1;
  opacity: 1;
  border-color: var(--aq-accent);
  transform: translate(-50%, calc(-100% - 12px - var(--nudge, 0px)));
  transition-delay: 0ms;
}

/* 지붕 위에 자리가 없으면 그림 옆·대각·아래 빈자리에 선다(ux-p7 3회차): 자리 중심에 맞춰 놓고, 강조될 때 4px 떠오른다 */
.home-c .tag.free {
  transform: translate(-50%, calc(-50% + 8px));
}

.home-c .rv.is-open.is-ready .tag.labelled.free {
  transform: translate(-50%, -50%);
}

.home-c .rv.is-open.is-ready .tag.free.hot {
  transform: translate(-50%, calc(-50% - 4px));
}

/* 건물에서 떨어진 이름표의 연결선: 이름표 가장자리에서 건물 그림의 가장 가까운 점까지 1px */
.home-c .lead {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--len);
  height: 1px;
  background: var(--aq-border-strong);
  transform: rotate(var(--ang));
  transform-origin: 0 50%;
  opacity: 0;
  transition: opacity 200ms var(--spring-glide);
  pointer-events: none;
}

.home-c .rv.is-open.is-ready .lead {
  opacity: 1;
  transition-delay: calc(var(--seq) * 40ms + 420ms + var(--hc-late, 0ms));
}

.home-c .rv.is-open.is-ready .lead.hot {
  background: var(--aq-accent);
  transition-delay: 0ms;
}

.home-c .tag-school {
  padding: 7px 14px;
  border-color: transparent;
  background: var(--aq-accent);
  color: var(--aq-accent-fg);
  font-size: 15px;
  font-weight: 800;
}

.home-c .rv.is-open.is-ready .tag-school {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 6px));
  transition-delay: calc(300ms + var(--hc-late, 0ms));
}

.home-c .count {
  position: absolute;
  top: 2%;
  right: 4%;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border: 2px solid var(--aq-surface);
  border-radius: var(--aq-radius-full);
  background: var(--aq-fg);
  color: var(--aq-surface);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 200ms var(--spring-glide) calc(var(--seq) * 40ms + 480ms + var(--hc-late, 0ms)), transform var(--spring-crisp-duration) var(--spring-crisp) calc(var(--seq) * 40ms + 480ms + var(--hc-late, 0ms));
}

.home-c .rv.is-open.is-ready .count {
  opacity: 1;
  transform: none;
}

.home-c .bld-cluster.hot .count {
  background: var(--aq-accent);
}

/* 첫 화면 동네 그림의 잔상: 학교 쪽으로 커지며 사라지고 그 아래 실제 결과 장면이 드러난다 */
.home-c .rv-ghost {
  position: absolute;
  z-index: 2;
  height: auto;
  pointer-events: none;
  transform-origin: 55% 60%;
  opacity: 1;
  transition: opacity 420ms var(--spring-glide) 80ms, transform var(--dive-ms) var(--spring-crisp);
}

.home-c .rv.is-open .rv-ghost {
  opacity: 0;
  transform: scale(2.4);
}

.home-c .rv.instant .rv-ghost {
  visibility: hidden;
}

.home-c .rv-legend {
  position: absolute;
  z-index: 2;
  left: var(--pad);
  bottom: 20px;
  padding: 4px 10px;
  border-radius: var(--aq-radius-full);
  background: var(--aq-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--aq-fg-secondary);
  opacity: 0;
  transition: opacity 300ms var(--spring-glide) 900ms;
}

.home-c .rv.is-open .rv-legend {
  opacity: 1;
}

/* 결과 목록 패널 */
.home-c .rv-panel {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--aq-border);
  background: var(--aq-surface);
  transform: translateX(104%);
  transition: transform var(--spring-smooth-duration) var(--spring-smooth) 160ms;
}

.home-c .rv.is-open .rv-panel {
  transform: none;
}

.home-c .sheet-handle {
  display: none;
}

.home-c .rv-head {
  flex: none;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--aq-border-subtle);
}

.home-c .rv-title {
  display: flex;
  margin: 0;
}

.home-c .rv-school {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--aq-fg);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--aq-border-strong);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.home-c .rv-school:hover {
  text-decoration-color: var(--aq-accent);
}

.home-c .rv-cond {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.home-c .rv-cond span,
.home-c .rv-cond strong {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--aq-radius-full);
  font-size: 14px;
}

.home-c .rv-cond span {
  background: var(--aq-surface-sunken);
  color: var(--aq-fg-secondary);
  font-weight: 600;
}

.home-c .rv-cond strong {
  background: var(--aq-accent-subtle);
  color: var(--aq-accent-strong);
  font-weight: 800;
}

/* 해석 안 된 말 안내: 중립 면 한 줄 + 텍스트 버튼 (경고색 아님) */
.home-c .rv-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: var(--aq-radius-el);
  background: var(--aq-surface-sunken);
  font-size: 14px;
  line-height: 1.5;
  color: var(--aq-fg-secondary);
  word-break: keep-all;
}

.home-c .rv-notice[hidden] {
  display: none;
}

.home-c .rv-notice-action {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--aq-accent-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.home-c .rv-widen {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--aq-fg-secondary);
}

.home-c .rv-map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  margin-top: 16px;
  border: 1px solid var(--aq-border-strong);
  border-radius: var(--aq-radius-el);
  background: var(--aq-surface);
  color: var(--aq-fg);
  font-size: 16px;
  font-weight: 700;
}

.home-c .rv-map:hover {
  border-color: var(--aq-accent);
  color: var(--aq-accent-strong);
}

.home-c .rv-body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.home-c .rv-list {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}

.home-c .group {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 16px 24px 6px;
  background: var(--aq-surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--aq-fg-secondary);
}

.home-c .row-wrap {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 240ms var(--spring-glide) calc(var(--i) * 30ms + 320ms + var(--hc-late, 0ms)), transform var(--spring-smooth-duration) var(--spring-smooth) calc(var(--i) * 30ms + 320ms + var(--hc-late, 0ms));
}

.home-c .rv.is-open.is-ready .row-wrap {
  opacity: 1;
  transform: none;
}

.home-c .row {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 7px 24px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--aq-fg);
  transition: background-color 160ms var(--spring-glide);
}

.home-c .row.hot,
.home-c .row:hover {
  background: var(--aq-surface-subtle);
}

.home-c .row.picked {
  background: var(--aq-accent-subtle);
}

.home-c .row-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.home-c .row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
}

/* 여러 관 원: 이름 바로 옆 "· 7개 관". 이름만 말줄임되고 관 수는 늘 보인다 */
.home-c .row-title {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.home-c .row-campus-count {
  flex: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--aq-fg-secondary);
  white-space: nowrap;
}

.home-c .row-dist {
  flex: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--aq-fg-secondary);
  font-variant-numeric: tabular-nums;
}

.home-c .row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--aq-fg-secondary);
}

.home-c .row-top {
  padding-top: 9px;
  padding-bottom: 9px;
}

.home-c .row-top .row-name {
  font-size: 17px;
  font-weight: 700;
  white-space: normal;
}

.home-c .row-top .row-dist {
  font-size: 16px;
  color: var(--aq-accent-strong);
}

.home-c .row-course {
  color: var(--aq-fg);
  font-weight: 600;
}

.home-c .rv .badge {
  height: 22px;
  padding: 0 7px;
  border-radius: var(--aq-radius-xs);
  background: var(--aq-surface-sunken);
  color: var(--aq-fg-secondary);
  font-size: 12px;
}

.home-c .rv .badge-accent {
  background: var(--aq-accent-subtle);
  color: var(--aq-accent-strong);
}

.home-c .row-first {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--aq-fg-secondary);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.home-c .row-first .row-course-school {
  color: var(--aq-fg);
  font-weight: 800;
}

/* 한 원의 여러 관: 카드 아래 구분선 행 목록으로 펼친다(카드 안 카드 아님). 높이는 즉시, 움직임은 opacity·transform만 */
.home-c .row-branch-toggle,
.home-c .row-fold {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 24px 8px;
  border: 0;
  background: none;
  color: var(--aq-accent-strong);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.home-c .row-branch-toggle::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--spring-crisp-duration) var(--spring-crisp);
}

.home-c .row-branch-toggle[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(-135deg);
}

.home-c .row-fold {
  min-height: 52px;
  margin-top: 8px;
  padding-bottom: 0;
  border-top: 1px solid var(--aq-border-subtle);
}

.home-c .row-branches {
  margin: 0 24px 8px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--aq-border-subtle);
}

.home-c .row-branches:not([hidden]),
.home-c .row-folded:not([hidden]) {
  animation: hc-reveal var(--spring-smooth-duration) var(--spring-smooth) both;
}

@keyframes hc-reveal {
  from { opacity: 0; transform: translateY(-6px); }
}

.home-c .row-branches li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--aq-border-subtle);
}

.home-c .row-branch-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--aq-fg);
  overflow-wrap: anywhere;
}

.home-c .row-branch-meta {
  grid-column: 1;
  font-size: 13px;
  color: var(--aq-fg-secondary);
  font-variant-numeric: tabular-nums;
}

.home-c .row-branch-link {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--aq-accent-strong);
}

/* 여러 관 원: 지붕 위 작은 점 배지 "7관" (18px) */
.home-c .count-branches {
  min-width: 0;
  height: 18px;
  padding: 0 6px;
  border-width: 1.5px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.home-c .row-more {
  display: flex;
  align-items: center;
  min-height: 52px;
  margin: 8px 24px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--aq-accent-strong);
}

.home-c .rv-empty {
  padding: 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--aq-fg-secondary);
}

.home-c .rv-note {
  flex: none;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--aq-border-subtle);
  font-size: 13px;
  color: var(--aq-fg-secondary);
}

/* 지도로 보기: 바닥이 평면으로 눕고 건물은 내려앉아 사라진다 */
.home-c .rv.is-flat .floor {
  transform: rotateX(0deg) rotateZ(0deg);
}

.home-c .rv.is-flat .world {
  transform: translate3d(0, 0, 0) scale(0.56);
  transition: transform var(--flat-ms) var(--spring-weighty);
}

.home-c .rv.is-flat .tags {
  opacity: 0;
}

/* ux-p7: 지도로 눕힐 때 땅·공원·그림자는 건물과 함께 사라지고 반경과 점만 눕는다. */
.home-c .rv.is-flat .ground,
.home-c .rv.is-flat .campus,
.home-c .rv.is-flat .park,
.home-c .rv.is-flat .shade {
  opacity: 0;
  transition-delay: 0ms;
}

.home-c .rv.is-flat .blds {
  opacity: 0;
  transform: translateY(18px);
}

.home-c .rv.is-flat .rv-legend {
  opacity: 0;
  transition-delay: 0ms;
}

/* ───────── 상세 시트 ───────── */

.home-c .detail {
  position: fixed;
  inset: 0;
  z-index: 710;
  transition: opacity 240ms var(--spring-glide);
}

.home-c .detail.is-leaving {
  opacity: 0;
}

/* 시트는 화면 전체 크기이고, 보이는 카드는 clip-path가 정한다.
   그래서 화면 어디의 건물·행에서 시작해도 그 사각형에서 카드 자리로 커질 수 있다. */
.home-c .detail-sheet {
  --sheet-to: inset(12px 12px 12px calc(100% - min(460px, calc(100% - 24px)) - 12px) round 18px);
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  clip-path: var(--sheet-from, var(--sheet-to));
  transition: clip-path var(--detail-ms) var(--spring-crisp);
}

.home-c .detail.is-open .detail-sheet {
  clip-path: var(--sheet-to);
}

.home-c .detail-col {
  width: min(460px, calc(100% - 24px));
  min-height: calc(100% - 24px);
  margin: 12px 12px 12px auto;
  border: 1px solid var(--aq-border);
  border-radius: var(--aq-radius-card);
  background: var(--aq-surface);
}

.home-c .detail-close {
  position: sticky;
  z-index: 2;
  top: 12px;
  float: right;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 12px 12px 0 0;
  border: 1px solid var(--aq-border);
  border-radius: var(--aq-radius-full);
  background: var(--aq-surface);
  color: var(--aq-fg);
}

.home-c .detail-art {
  display: flex;
  justify-content: center;
  padding: 28px 24px 4px;
}

.home-c .detail-art img {
  width: 200px;
  height: auto;
  transform-origin: 0 0;
  transform: var(--art-from, none);
  transition: transform var(--detail-ms) var(--spring-crisp);
}

.home-c .detail.is-open .detail-art img {
  transform: none;
}

.home-c .detail-body {
  padding: 8px 28px 32px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 220ms var(--spring-glide), transform var(--detail-ms) var(--spring-crisp);
}

.home-c .detail.is-open .detail-body {
  opacity: 1;
  transform: none;
  transition-delay: 60ms;
}

.home-c .detail-from {
  font-size: 14px;
  font-weight: 700;
  color: var(--aq-accent-strong);
}

.home-c .detail-body h2 {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.home-c .facts {
  margin-top: 18px;
  border-top: 1px solid var(--aq-border-subtle);
}

.home-c .facts div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--aq-border-subtle);
  font-size: 15px;
  line-height: 1.5;
}

.home-c .facts dt {
  color: var(--aq-fg-secondary);
  font-weight: 600;
}

.home-c .facts dd {
  margin: 0;
  font-weight: 600;
}

.home-c .detail-sub {
  margin-top: 26px;
  font-size: 17px;
  font-weight: 800;
}

.home-c .offers,
.home-c .subjects {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.home-c .offers li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--aq-border-subtle);
}

.home-c .offers strong {
  font-size: 15px;
  font-weight: 700;
}

.home-c .offers span {
  grid-column: 1;
  font-size: 13px;
  color: var(--aq-fg-secondary);
}

.home-c .offers a {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--aq-accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-c .detail-empty {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--aq-fg-secondary);
}

.home-c .row-people {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin: 0 24px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--aq-fg-secondary);
  word-break: keep-all;
}

.home-c .row-wrap > .row-meta { margin: 4px 24px 10px; }
.home-c .row-people span, .home-c .detail-people strong, .home-c .offer-person strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-c .instructor-photo, .unified-result-content .instructor-photo {
  display: inline-flex;
  flex: 0 0 auto;
}
.home-c .instructor-photo img, .unified-result-content .instructor-photo img {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--aq-border);
  border-radius: 50%;
}
.home-c .offer-person {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.home-c .offers .offer-person a { grid-column: auto; grid-row: auto; }
.home-c .offers .offer-person .instructor-photo { min-height: 0; padding: 0; }

/* 공식 채널: 서비스 이름 + 바깥 화살표. 상표 로고 없음. */
.home-c .detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.home-c .detail-ext {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--aq-radius-full);
  background: var(--aq-surface-sunken);
  color: var(--aq-fg);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms var(--spring-glide);
}

.home-c .detail-ext:hover {
  background: var(--aq-accent-subtle);
  color: var(--aq-accent-strong);
}

.home-c .detail-ext svg,
.home-c .detail-src svg {
  flex: none;
}

.home-c .detail-people {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.home-c .detail-people li {
  display: flex;
  align-items: center;
  gap: 0 8px;
  min-height: 48px;
  border-bottom: 1px solid var(--aq-border-subtle);
}

.home-c .detail-people strong {
  font-size: 15px;
  font-weight: 700;
}

.home-c .detail-people span {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--aq-fg-secondary);
  font-variant-numeric: tabular-nums;
}

.home-c .detail-src {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 44px;
  font-weight: 700;
  color: var(--aq-accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-c .detail-people-more summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  color: var(--aq-accent-strong);
  cursor: pointer;
}

.home-c .detail-note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--aq-fg-secondary);
}

.home-c .detail-big {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin-top: 16px;
  font-size: 20px;
  font-weight: 700;
}

.home-c .detail-big strong {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--aq-accent-strong);
  font-variant-numeric: tabular-nums;
}

.home-c .detail-big span {
  flex-basis: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--aq-fg-secondary);
}

.home-c .subjects li {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--aq-border-subtle);
  font-size: 15px;
  font-weight: 600;
}

.home-c .subjects li.is-current strong {
  color: var(--aq-accent-strong);
}

.home-c .detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.home-c .detail-actions a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: var(--aq-radius-el);
  font-size: 16px;
  font-weight: 700;
}

.home-c .detail-link {
  border: 1px solid var(--aq-border-strong);
  color: var(--aq-fg);
}

.home-c .detail-map {
  background: var(--aq-accent);
  color: var(--aq-accent-fg);
}

/* The blue preset's stronger accent keeps its white labels above 4.5:1. */
html.aq-preset-toss-v2 .home-c :is(.search button, .rv-search button, .cta, .tag-school, .detail-map, .bld-cluster.hot .count) {
  background: var(--aq-accent-strong);
}

/* ───────── 모바일: 장면 아래 결과 시트(끌어 올리면 전체) ───────── */

@media (max-width: 720px) {
  .home-c .examples {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-top: 12px;
    padding: 0 0 4px;
    scrollbar-width: none;
  }

  .home-c .examples-label {
    display: none;
  }

  .home-c .hc-chip {
    flex: none;
  }

  .home-c .hero-error {
    padding-left: 0;
  }

  .home-c .rv {
    --bar-h: 64px;
    --stage-h: 35dvh;
  }

  .home-c .rv-bar {
    right: 0;
    padding: 0 16px;
    gap: 8px;
  }

  .home-c .rv-back {
    width: 44px;
    height: 44px;
  }

  .home-c .rv-search {
    padding-left: 14px;
  }

  .home-c .rv-search {
    height: 52px;
  }

  .home-c .rv-search button {
    height: 44px;
    padding: 0 14px;
  }

  .home-c .rv-stage {
    inset: 0 0 auto 0;
    height: var(--stage-h);
  }

  .home-c .rv-legend {
    display: none;
  }

  .home-c .tag {
    padding: 4px 9px;
    font-size: 12px;
  }

  .home-c .tag-school {
    font-size: 13px;
  }

  .home-c .rv-panel {
    --snap-y: calc(var(--stage-h) - var(--bar-h));
    top: auto;
    left: 0;
    width: auto;
    height: calc(100dvh - var(--bar-h));
    border-left: 0;
    border-top: 1px solid var(--aq-border);
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }

  .home-c .rv.is-open .rv-panel {
    transform: translateY(var(--drag, var(--snap-y)));
  }

  .home-c .rv.is-open .rv-panel[data-snap="full"] {
    --snap-y: 0px;
  }

  .home-c .rv-panel.dragging {
    transition: none;
  }

  .home-c .sheet-handle {
    display: grid;
    place-items: center;
    flex: none;
    min-height: 44px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    touch-action: none;
    cursor: grab;
  }

  .home-c .sheet-handle:focus-visible {
    outline: 3px solid var(--aq-ring);
    outline-offset: -4px;
  }

  .home-c .sheet-handle span {
    width: 40px;
    height: 5px;
    border-radius: var(--aq-radius-full);
    background: var(--aq-border-strong);
  }

  .home-c .rv-head {
    padding: 0 16px 14px;
    touch-action: none;
  }

  .home-c .rv-school {
    font-size: 22px;
  }

  .home-c .rv-cond {
    margin-top: 8px;
  }

  .home-c .rv-map {
    height: 46px;
    margin-top: 12px;
  }

  .home-c .group {
    padding: 14px 16px 6px;
  }

  .home-c .row {
    padding: 10px 16px;
  }

  .home-c .row-more {
    margin: 8px 16px 0;
  }

  .home-c .row-branch-toggle,
  .home-c .row-fold {
    padding-inline: 16px;
  }

  .home-c .row-branches {
    margin-inline: 16px;
  }

  .home-c .rv-note {
    padding: 10px 16px 14px;
  }

  .home-c .detail-sheet {
    --sheet-to: inset(6dvh 0px 0px 0px round 18px);
  }

  .home-c .detail-col {
    width: auto;
    min-height: 94dvh;
    margin: 6dvh 0 0;
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }

  .home-c .detail-art {
    padding-top: 20px;
  }

  .home-c .detail-art img {
    width: 160px;
  }

  .home-c .detail-body {
    padding: 8px 20px 28px;
  }

  .home-c .detail-body h2 {
    font-size: 23px;
  }
}

/* ═════════ 운영: 스켈레톤 · 빈 상태 · 출처 ═════════
  The skeleton holds the same places as the result: building silhouettes on the
  same ring, list bars in the same rows. Data arrival fades it out while the real
  buildings and rows rise in (.is-ready), so nothing moves. */

@keyframes hc-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

.home-c .hc-skel,
.home-c .sk-bld {
  background-color: var(--aq-surface-sunken);
  background-image: linear-gradient(100deg, transparent 40%, var(--aq-surface-subtle) 50%, transparent 60%);
  background-size: 300% 100%;
  animation: hc-shimmer 1.6s linear infinite;
}

.home-c .hc-skel {
  display: inline-block;
  vertical-align: middle;
  width: 6em;
  height: 1em;
  border-radius: var(--aq-radius-full);
}

.home-c .sk-w8 {
  width: 8em;
}

.home-c .sk-w12 {
  width: 12em;
  height: 20px;
}

.home-c .sk-w16 {
  width: min(24em, 100%);
}

.home-c .sk-pill {
  width: 64px;
  height: 30px;
}

.home-c .sk-pill.wide {
  width: 52px;
}

.home-c .chips .sk-pill {
  height: 32px;
}

.home-c .sk-title {
  width: 7em;
  height: 26px;
}

.home-c .skel {
  position: absolute;
  left: 0;
  top: 0;
  transition: opacity 220ms var(--spring-smooth);
}

.home-c .rv.is-ready .skel,
.home-c .rv.is-ready .rv-skel-list {
  opacity: 0;
}

/* Silhouette = the building picture used as a mask, so the shape matches what arrives. */
.home-c .sk-bld {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z);
  width: var(--w);
  aspect-ratio: 1 / var(--a);
  transform: translate(-50%, -80%);
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
  pointer-events: none;
}

.home-c .rv-skel-list {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding-top: 8px;
  pointer-events: none;
  transition: opacity 220ms var(--spring-smooth);
}

.home-c .sk-row {
  display: grid;
  align-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 24px;
}

.home-c .sk-name {
  width: 46%;
  height: 14px;
}

.home-c .sk-name.long {
  width: 64%;
}

.home-c .sk-meta {
  width: 30%;
  height: 11px;
}

.home-c .rv-school:disabled {
  cursor: default;
  text-decoration: none;
}

.home-c .rv-map[aria-disabled="true"] {
  pointer-events: none;
  color: var(--aq-fg-secondary);
}

.home-c .pin-tag:empty {
  display: none;
}

.home-c .rv-others {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--aq-fg-secondary);
}

.home-c .rv-others a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--aq-accent-strong);
  font-weight: 700;
}

.home-c .rv-list .aq-empty {
  padding: 32px 24px;
  text-align: left;
}

.home-c .rv-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.home-c .home-c-source {
  max-width: 1200px;
  margin: 48px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--aq-border-subtle);
  font-size: 13px;
  line-height: 1.7;
  color: var(--aq-fg-secondary);
}

@media (max-width: 720px) {
  .home-c .sk-row {
    padding: 0 16px;
  }

  .home-c .rv-list .aq-empty {
    padding: 24px 16px;
  }
}

/* Mid widths: the panel is narrow, so a long one-word academy name would split mid-word (G8). Keep it on one line. */
@media (min-width: 721px) and (max-width: 1023px) {
  .home-c .row-top .row-name {
    white-space: nowrap;
  }
}

/* ═════════ landing-v2: 승인 동네 그림 첫 화면 + 2.5D 스크롤 장면 ═════════
   첫 화면은 승인 그림(두 타일)을 그대로 보인다. 움직임이 허용되면(home.js data-scene="scroll") 같은 그림에서 오려 낸 층
   (web/assets/landing-layers, tools/landing/layers.py)을 타일 위에 겹쳐, 멈춰 있을 때는 원본과 같은 픽셀로 보이고 스크롤하면
   ① 0–30% 동네 전체 → ② 30–70% 파란 지붕 학교 쪽 ×1.8 확대(앞 블록이 더 빨리), 제목·검색은 작아지며 위로 → ③ 70–90% 핀 낙하·결과 카드.
   home.js가 --t1·--t2·--t3(0–1, 부드러운 곡선)과 --sx·--sy·--lift(px)를 넣는다. 움직임은 transform·opacity만 쓴다.
   이 블록은 위쪽 옛 장면 규칙(.home-c .stage …)보다 구체적인 선택자(.home-c .story …)로 덮어쓴다. */

.home-c .story {
  height: auto;
}

.home-c .story .stage {
  --gut: 16px;
  --side: max(var(--gut), calc((100% - 1440px) / 2 + var(--gut)));
  /* 같은 여백을 그림 상자 안에서 쓸 때(퍼센트 기준이 달라 vw로) */
  --side-vw: max(var(--gut), calc((100vw - 1440px) / 2 + var(--gut)));
  --t1: 0;
  --t2: 0;
  --t3: 0;
  --sx: 0px;
  --sy: 0px;
  --lift: 0px;
  --hc-layout: stack;
  position: relative;
  top: auto;
  height: calc(100svh - var(--hc-top) - var(--hc-bottom));
  min-height: 520px;
  overflow: clip;
  container-type: size;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px var(--side) 12px;
  background: var(--aq-surface);
}

.home-c .story .s-copy {
  position: relative;
  z-index: 3;
  flex: none;
  transform-origin: 0 0;
}

.home-c .story .s-title,
.home-c .story .s-search,
.home-c .story .s-town {
  position: relative;
  inset: auto;
  top: auto;
  left: auto;
  right: auto;
  width: auto;
  transform: none;
  opacity: 1;
  filter: none;
}

.home-c .story .s-search {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 12px;
}

.home-c .story .blur-title {
  font-size: clamp(32px, 10.4vw, 44px);
  line-height: 1.12;
  white-space: normal;
}

.home-c .story .blur-title .line {
  display: block;
}

.home-c .story .blur-title .line + .line::before {
  content: none;
}

/* 뒤따르는 글은 처음부터 보인다(정적 첫 화면을 넘겨받을 때 깜박이지 않고, 스크롤 투명도를 막지 않게). */
.home-c .story .blur-follow {
  animation: none;
}

.home-c .story .lede {
  max-width: 34em;
  font-size: 15px;
  line-height: 1.55;
}

.home-c .story .search {
  margin-top: 16px;
  padding-left: 16px;
}

.home-c .story .search button {
  padding: 0 18px;
}

/* 예시 칩: 늘 한 줄. 좁으면 옆으로 넘긴다. */
.home-c .story .examples {
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 12px;
  padding-left: 0;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.home-c .story .examples::-webkit-scrollbar {
  display: none;
}

.home-c .story .examples-label {
  display: none;
}

.home-c .story .hc-chip {
  flex: none;
  white-space: nowrap;
}

.home-c .story .note {
  margin-top: 8px;
  padding-left: 4px;
  font-size: 13px;
}

/* 그림 자리: 남은 높이를 쓰고 그림은 그 안에 비율대로 들어간다(흰 상자 없음, 글보다 아래 층). */
.home-c .story .s-town {
  z-index: 1;
  align-self: stretch;
  flex: 1 1 0;
  min-height: 0;
  container-type: size;
}

.home-c .story .town-par {
  --tw: min(100cqw, 100cqh * 1024 / 1100);
  width: var(--tw);
  margin-inline: auto;
  transform-origin: 57.617% 48.182%;
  transform: none;
  transition: none;
}

.home-c .story .town-enter,
.home-c .story .town-idle {
  transform: none;
  animation: none;
}

.home-c .story .town-idle {
  aspect-ratio: 1024 / 1100;
}

.home-c .story .town-idle .hc-boot-town img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  opacity: 1;
  -webkit-mask-image: none;
  mask-image: none;
}

/* 그림 바탕(253–254)을 페이지 흰색(255)으로 올리는 막. 동네 자체 픽셀은 그대로(tools/landing/layers.py).
   바깥 6px도 흰색으로 덮어, 소수점 위치에서 그림 가장자리 줄이 반쯤 비쳐 옅은 테두리가 생기지 않게 한다. */
.home-c .town-idle .town-white {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  opacity: 1;
  box-shadow: 0 0 0 6px var(--aq-surface);
  pointer-events: none;
  -webkit-mask-image: none;
  mask-image: none;
}

.home-c .story .pins,
.home-c .story .s-town3d,
.home-c .story .s-peek,
.home-c .story .s-panel,
.home-c .story .s-cta,
.home-c .story .town-layers,
.home-c .story .s-result,
.home-c .rv-ghost {
  display: none;
}

/* 휴대폰: 그림은 화면 폭 가득 */
@media (max-width: 767px) {
  .home-c .story .examples {
    margin-inline: calc(-1 * var(--gut));
    padding-inline: var(--gut);
  }

  .home-c .story .s-town {
    margin-inline: calc(-1 * var(--gut));
  }

  /* 그림 위·아래 흰 여백(원본 1100줄 중 위 40줄·아래 40줄)은 글 뒤·무대 아래 여백에 걸쳐 그림 본체를 화면 폭 가득 키운다. */
  .home-c .story .stage {
    padding-bottom: 16px;
  }

  .home-c .story .town-par {
    --tw: min(100cqw, 100cqh * 1024 / 1020);
    margin-top: calc(var(--tw) * -40 / 1024);
  }

  /* 같은 안내는 바닥글에 있다. 휴대폰 첫 화면에서는 입력칸 설명으로만 읽힌다. */
  .home-c .story .note {
    position: absolute;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* 태블릿(세로·좁은 가로): 위 글(시안 크기: 제목 56–64px, 검색창 56px, 큰 칩), 아래 그림이 남은 높이를 채운다. */
@media (min-width: 768px) {
  .home-c .story .stage {
    --gut: 24px;
    gap: 24px;
    padding-top: 36px;
  }

  .home-c .story .blur-title {
    font-size: clamp(56px, 6.2vw, 64px);
  }

  .home-c .story .lede {
    margin-top: 4px;
    font-size: 19px;
  }

  .home-c .story .search {
    margin-top: 24px;
    padding: 6px 6px 6px 24px;
  }

  .home-c .story .field input,
  .home-c .story .search button {
    height: 56px;
  }

  .home-c .story .field input,
  .home-c .story .mirror {
    font-size: 18px;
  }

  .home-c .story .search button {
    padding: 0 28px;
    font-size: 18px;
  }

  .home-c .story .examples {
    gap: 10px;
    margin-top: 18px;
  }

  .home-c .story .hc-chip {
    height: 52px;
    padding: 0 24px;
    font-size: 17px;
  }
}

/* 데스크톱(1280 이상, 1024 이상 가로 화면): 왼쪽 5 글 · 오른쪽 7 그림. 그림은 무대 높이를 채우고 오른쪽 여백까지 쓸 수 있다. */
@media (min-width: 1280px), (min-width: 1024px) and (min-aspect-ratio: 5/4) {
  .home-c .story .stage {
    --hc-layout: split;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: 1fr auto 1fr;
    column-gap: clamp(32px, 3.6vw, 72px);
    padding-block: 24px;
  }

  .home-c .story .s-copy {
    grid-column: 1;
    grid-row: 2;
    max-width: 600px;
  }

  .home-c .story .blur-title {
    font-size: clamp(44px, 4.4vw, 88px);
  }

  .home-c .story .lede {
    font-size: clamp(16px, 1.2vw, 21px);
  }

  .home-c .story .s-search {
    margin-top: clamp(16px, 1.6vw, 28px);
  }

  .home-c .story .field input,
  .home-c .story .mirror {
    font-size: clamp(16px, 1.15vw, 19px);
  }

  .home-c .story .field input,
  .home-c .story .search button {
    height: clamp(48px, 3.6vw, 60px);
  }

  .home-c .story .search {
    padding: 5px 5px 5px 20px;
  }

  .home-c .story .search button {
    padding: 0 22px;
    font-size: 16px;
  }

  .home-c .story .lede {
    margin-top: 0;
  }

  .home-c .story .examples {
    gap: 8px;
    margin-top: 16px;
  }

  .home-c .story .hc-chip {
    height: clamp(44px, 3.2vw, 52px);
    padding: 0 clamp(16px, 1.2vw, 22px);
    font-size: clamp(15px, 1.05vw, 17px);
  }

  .home-c .story .s-town {
    grid-column: 2;
    grid-row: 1 / -1;
    max-height: none;
    align-self: stretch;
  }

  .home-c .story .town-par {
    --tw: min(100cqw + var(--side-vw) - 8px, 100cqh * 1024 / 1100, 1100px);
    margin-left: max(0px, (100cqw + var(--side-vw) - 8px - var(--tw)) / 2);
    margin-top: max(0px, (100cqh - var(--tw) * 1100 / 1024) / 2);
  }
}

/* ── 스크롤 장면(움직임 허용) ── */

.home-c[data-scene="scroll"] .story {
  height: calc(300svh - 2 * var(--hc-top));
}

.home-c[data-scene="scroll"] .story .stage {
  position: sticky;
  top: var(--hc-top);
}

/* ② 글은 작아지며 무대 위로. 확대가 끝났을 때 글 밑은 그림의 빈 하늘이다(home.js fitScene이 학교 자리를 그렇게 잡는다).
   반투명 막을 깔지 않는다: 글 뒤로 건물이 반쯤 비치는 일이 없다. */
.home-c[data-scene="scroll"] .story .s-copy {
  transform: translateY(calc(var(--t2) * var(--lift) * -1)) scale(calc(1 - var(--t2) * 0.4));
}

/* 세로로 쌓는 화면(태블릿·휴대폰)은 확대된 동네가 화면 위까지 차서 글 밑에 빈 하늘이 없다: 글은 올라가며 사라지고 ③ 카드가 조건을 보여 준다. */
.home-c[data-scene="scroll"] .story .stage:not(.copy-away) .s-copy {
  opacity: calc(1 - var(--t2) * 1.6);
}

.home-c[data-scene="scroll"] .story .stage.copy-away .s-copy {
  opacity: 0;
  visibility: hidden;
}

.home-c[data-scene="scroll"] .story .lede,
.home-c[data-scene="scroll"] .story .examples,
.home-c[data-scene="scroll"] .story .note {
  opacity: calc(1 - var(--t2) * 4);
}

.home-c[data-scene="scroll"] .story .search {
  opacity: calc(1 - var(--t3) * 1.6);
}

.home-c[data-scene="scroll"] .story .stage.copy-away .s-search {
  visibility: hidden;
}

/* ①은 살짝 떠오르고 ②는 학교를 중심으로 ×1.8, 학교를 무대의 정해진 자리로 데려간다. */
.home-c[data-scene="scroll"] .story .town-par {
  transform:
    translate3d(calc(var(--t2) * var(--sx)), calc(var(--t2) * var(--sy) - var(--t1) * 12px), 0)
    scale(calc(1 + var(--t2) * 0.8));
  will-change: transform;
}

.home-c[data-scene="scroll"][data-layers="ready"] .story .town-layers {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-c[data-scene="scroll"] .story .town-layers img {
  position: absolute;
  max-width: none;
  user-select: none;
}

.home-c[data-scene="scroll"] .story .town-layers .tl-fill,
.home-c[data-scene="scroll"] .story .town-layers .tl-front {
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 앞 블록 밑에 깔린 바닥은 앞 블록이 움직이기 시작할 때만 보인다(멈춰 있을 때 원본과 같은 픽셀). */
.home-c[data-scene="scroll"] .story .tl-fill {
  opacity: clamp(0, calc(var(--t2) * 1000), 1);
}

/* 시차: 앞 블록은 동네보다 6% 더 커진다 */
.home-c[data-scene="scroll"] .story .tl-front {
  transform-origin: 57.617% 48.182%;
  transform: scale(calc(1 + var(--t2) * 0.06));
}

/* ③ 핀이 위에서 떨어진다(스프링). 떨어지는 동안만 핀 아래 지붕을 메운 조각이 보인다. */
.home-c[data-scene="scroll"] .story .tl-patch {
  opacity: 0;
}

.home-c[data-scene="scroll"] .story .stage.pins-drop .tl-pin {
  animation: tl-pin-drop var(--spring-snappy-duration) var(--spring-snappy) both;
  animation-delay: calc(var(--n) * 120ms);
}

.home-c[data-scene="scroll"] .story .stage.pins-drop .tl-patch {
  animation: tl-patch var(--spring-snappy-duration) linear both;
  animation-delay: calc(var(--n) * 120ms);
}

@keyframes tl-pin-drop {
  from { opacity: 0; transform: translateY(-120%); }
  35% { opacity: 1; }
  to { opacity: 1; transform: none; }
}

@keyframes tl-patch {
  from, 85% { opacity: 1; }
  to { opacity: 0; }
}

/* ③ 결과 카드: 실제 공개 자료로 계산한 예시 검색의 첫 세 곳 */
.home-c[data-scene="scroll"] .story .s-result {
  display: block;
  position: absolute;
  z-index: 4;
  left: var(--side);
  right: var(--side);
  bottom: 16px;
  max-width: 440px;
  margin-inline: auto;
  padding: 18px 20px 20px;
  border: 1px solid var(--aq-border-subtle);
  border-radius: var(--aq-radius-card);
  background: var(--aq-surface);
  box-shadow: var(--aq-shadow-xl);
  opacity: var(--t3);
  transform: translateY(calc((1 - var(--t3)) * 48px));
  visibility: hidden;
}

.home-c[data-scene="scroll"] .story .stage.show-result .s-result {
  visibility: visible;
}

.home-c .s-result .res-cond {
  font-size: 15px;
  font-weight: 700;
  color: var(--aq-accent-strong);
}

.home-c .s-result .res-list {
  margin: 10px 0 14px;
  padding: 0;
  list-style: none;
}

.home-c .s-result .res-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  font-size: 16px;
}

.home-c .s-result .res-row + .res-row {
  border-top: 1px solid var(--aq-border-subtle);
}

.home-c .s-result .res-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.home-c .s-result .res-dist {
  flex: none;
  color: var(--aq-fg-secondary);
  font-variant-numeric: tabular-nums;
}

.home-c .s-result .res-empty {
  color: var(--aq-fg-secondary);
}

.home-c .s-result .res-all {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: var(--aq-radius-full);
  background: var(--aq-accent);
  color: var(--aq-accent-fg);
  font-size: 16px;
  font-weight: 700;
}

.home-c .s-result .res-all:focus-visible {
  outline: 2px solid var(--aq-ring-strong);
  outline-offset: 2px;
}

@media (min-width: 1280px), (min-width: 1024px) and (min-aspect-ratio: 5/4) {
  .home-c[data-scene="scroll"] .story .stage:not(.copy-away) .s-copy,
  .home-c[data-scene="scroll"] .story .stage.copy-away .s-copy {
    opacity: 1;
    visibility: visible;
  }

  .home-c[data-scene="scroll"] .story .s-result {
    left: auto;
    top: 50%;
    bottom: auto;
    width: clamp(340px, 28vw, 440px);
    margin: 0;
    padding: 24px;
    transform: translateY(calc(-50% + (1 - var(--t3)) * 48px));
  }
}


/* 확대 중 두 타일이 맞닿는 줄이 비쳐 흰 실선이 생기지 않게, 같은 그림을 타일 뒤에 1px 겹쳐 깐다(멈춰 있을 때는 타일에 가려 보이지 않는다). */
.home-c[data-scene="scroll"] .story .hc-boot-town {
  background:
    url("/assets/landing-town-top.webp") top / 100% calc(50% + 2px) no-repeat,
    url("/assets/landing-town-bottom.webp") bottom / 100% 50% no-repeat;
}
