/* ── 사이트 맨 위 띠배너(layouts/partials/top-banner.html) ──────────────────────
   멤버십 프로모션 페이지를 뺀 모든 페이지 맨 위에 붙는다. v2.css 를 안 부르는
   블로그·가이드 1,000여 페이지에도 나가야 해서 v2.css 에서 떼어 이 파일 하나로 둔다.
   baseof.html 이 배너를 그릴 때만 이 파일을 부른다. v2 토큰([data-v2] 범위)은 v1
   페이지에 없으므로 값을 여기서 직접 정한다.

   틀은 본진(zuzu-landing) .notification 그대로다 — 높이 42px(위아래 9px +
   화살표 24px), 문구 15px/500, 뱃지 4px 10px · 14px/600 알약.
   채우기는 요금제 멤버십 안내 패널(pricing/membership-notice.html)의 재질이다 —
   xenon 메시 위에 흰 유리 + 정반사 띠. 뱃지는 그 패널처럼 검정 바탕 흰 글씨.
   띠 전체가 하얗게 떠 눈이 부셔 메시는 진하게(0.75·brightness 0.97), 유리는 얇게
   (0.28→0.14) 바꿨고, 색이 쨍해 채도를 메시 0.7·유리 110% 로 눌렀다(패널은 150%).
   블러는 패널(메시 8px·유리 14px)보다 세게 메시 16px·유리 24px 다.
   바탕이 밝아 문구는 잉크, 강조는 색이 아니라 굵기(700)로 준다.
   ≤992px 에서는 좌우 12px 여백, 뱃지 3px 8px · 12px (본진 $md 와 같은 경계). */
.start-top-banner-wrap {
  --tb-ink: #0c1611;
  --tb-canvas: #fbfcfd;
  --tb-ease: cubic-bezier(0.22, 1, 0.36, 1);   /* 열림 — 길게 미끄러져 안착 */
  --tb-ease-fog: cubic-bezier(0.25, 0.46, 0.45, 0.94); /* power2.out — 본진 안개 걷힘 */
}
.start-top-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 9px 0;
  overflow: hidden;
  background: var(--tb-canvas);
  color: var(--tb-ink);
  font-family: inherit;
  text-decoration: none;
}
.start-top-banner:hover,
.start-top-banner:visited { color: var(--tb-ink); text-decoration: none; }

/* ── 재질: 메시 + 유리 ── */
.start-top-banner__glow {
  /* blur 가 가장자리를 바깥의 투명으로 번지게 해 좌우 끝에 흰 띠가 남는다.
     메시를 띠보다 blur 반경 2배(32px) 넓게 깔고 바깥은 .start-top-banner 의 overflow 가 자른다. */
  position: absolute;
  inset: -32px;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.start-top-banner__glow .v2-mesh,
.start-top-banner__glow .v2-mesh__canvas { width: 100%; height: 100%; }
.start-top-banner__glow .v2-mesh {
  opacity: 0.75;
  filter: blur(16px) brightness(0.97) saturate(0.7);
  transition: opacity 0.3s ease;
}
.start-top-banner__glass {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(24px) saturate(110%);
  backdrop-filter: blur(24px) saturate(110%);
  pointer-events: none;
}
.start-top-banner__glass::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    104deg,
    rgba(255, 255, 255, 0) 18%,
    rgba(255, 255, 255, 0.42) 44%,
    rgba(255, 255, 255, 0.12) 58%,
    rgba(255, 255, 255, 0) 76%
  );
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .start-top-banner__glass { background: var(--tb-canvas); }
}

/* ── 글자 ── */
.start-top-banner__track { display: flex; justify-content: center; min-width: 0; }
.start-top-banner__marquee { display: flex; min-width: 0; }
/* 뱃지↔문구 8px. 본진 6px 에서 넓혔다(2026-12-01 지시). */
.start-top-banner__item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.start-top-banner__item--dup { display: none; }
.start-top-banner__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 1.5em;
  background: var(--tb-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 14px;
  letter-spacing: -0.08px;
  white-space: nowrap;
}
.start-top-banner__content {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--tb-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}
.start-top-banner__content * { font-size: inherit; font-weight: inherit; }
.start-top-banner__content strong {
  color: var(--tb-ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.25s ease;
}
.start-top-banner__arrow {
  flex: 0 0 14px;
  color: var(--tb-ink);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ── 호버 — 유리를 걷어 색을 또렷하게, 화살표를 밀고, 강조 문구에 밑줄. ── */
.start-top-banner__glass { transition: opacity 0.25s ease; }
@media (hover: hover) {
  .start-top-banner:hover .start-top-banner__glow .v2-mesh { opacity: 1; }
  .start-top-banner:hover .start-top-banner__glass { opacity: 0.35; }
  .start-top-banner:hover .start-top-banner__arrow { transform: translateX(4px); }
  .start-top-banner:hover .start-top-banner__content strong { text-decoration-color: currentColor; }
}
.start-top-banner:focus-visible { outline: 2px solid var(--tb-ink); outline-offset: -2px; }

@media screen and (max-width: 992px) {
  .start-top-banner { padding: 9px 12px; }
  .start-top-banner__badge { padding: 3px 8px; font-size: 12px; }
}

/* ── ≤480px(휴대폰) 마퀴 ──
   한 줄에 안 들어가 핵심 문구가 «…» 로 잘리던 자리다. 뱃지+문구 두 벌을 이어 붙여
   왼쪽으로 흘린다(-50% 이동 = 한 벌 폭이라 이음매가 없다). 화살표는 오른쪽에 고정하고,
   흐르는 띠의 양 끝은 마스크로 흐려 잘린 티를 지운다. */
@media screen and (max-width: 480px) {
  .start-top-banner { justify-content: flex-start; gap: 8px; }
  .start-top-banner__track {
    flex: 1 1 auto;
    justify-content: flex-start;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  }
  .start-top-banner__marquee {
    flex: none;
    width: max-content;
    animation: start-top-banner-marquee 14s linear infinite;
  }
  .start-top-banner__item { flex: none; padding-right: 32px; }
  .start-top-banner__item--dup { display: flex; }
  .start-top-banner__content { overflow: visible; text-overflow: clip; }
  .start-top-banner__arrow { margin-left: auto; }
}
@keyframes start-top-banner-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ── 고정 ──
   스크롤해도 띠배너는 맨 위에 붙어 있고, GNB(#navbar, sticky top:0)는 그 바로 아래에
   붙는다. GNB 의 top 은 띠가 열리는 동안 0 → 42px 로 같이 움직인다(아래 등장 모션).
   모바일 메뉴를 열면 html.zz-nav-locked 가 body 스크롤을 막아 sticky 가 풀리고 GNB 가
   fixed 로 바뀐다 — 그때 GNB 는 top:0 으로 되돌린다. 드로어(fixed inset:0, #navbar
   안)가 화면 전체를 덮으므로 띠는 그 뒤에 가려진다(z-index 를 GNB 보다 낮게 둔다). */
.start-top-banner-wrap {
  position: sticky;
  top: 0;
  z-index: 999;
}
html:has(.start-top-banner-wrap) #navbar { top: 42px; }
html.zz-nav-locked:has(.start-top-banner-wrap) #navbar { top: 0; }

/* ── 등장 모션 ──
   페이지가 뜬 뒤 약 1.5초에 띠배너가 스르륵 나타난다. 눈에 띄게 하려는 지연이다.
   빈자리를 미리 비워 두는 대신 높이를 0 → 42px 로 열어 페이지를 민다 — 맨 위가
   비어 있으면 덜 그려진 화면처럼 보여서다.

   1) 띠 열림(0.5s → 1.4s) — 처음엔 높이만 열려 띠의 아래 변이 딱딱한 선으로 페이지를
      밀고 내려왔다(«투박하다», 2026-12-01 지적). 그래서 열리는 동안
        · 아래 변을 28px 깃털 마스크로 흐려 경계가 번지며 내려오게 하고(--tb-edge),
        · 메시를 흐림 24px · 투명 → 제 값으로 같이 걷히게 하고,
        · 곡선을 길게 미끄러져 안착하는 쪽(--tb-ease)으로 바꿨다.
      GNB 의 top 도 같은 시간·곡선으로 0 → 42px.
   2) 글자 안개 걷힘(0.8s → 1.7s) — zuzu enterprise(본진) 히어로 title 진입 값 그대로
      (zuzu-landing assets/js/v2-hub/scroll-reveal.js):
      { opacity 0 · y 12 · scale 1.02 · blur 18px } → 0.9s power2.out.
   흐림은 글자 묶음과 메시에만 건다. 배너 전체(<a>)를 흐렸더니 WebGL 캔버스와
   backdrop-filter 유리까지 한 겹 더 합성하느라 프레임이 끊겼다.
   fill 은 backwards — 끝나면 값을 놓아 filter·mask 가 남지 않게 한다. */
@property --tb-edge {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
.start-top-banner-wrap {
  display: grid;
  grid-template-rows: 0fr;
  animation: start-top-banner-open 0.9s var(--tb-ease) 0.5s forwards;
}
.start-top-banner-clip {
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 calc(100% - var(--tb-edge)), transparent);
  mask-image: linear-gradient(#000 calc(100% - var(--tb-edge)), transparent);
  animation: start-top-banner-edge 0.9s var(--tb-ease) 0.5s backwards;
}
.start-top-banner-wrap .start-top-banner__glow {
  animation: start-top-banner-fill 0.9s var(--tb-ease) 0.5s backwards;
}
.start-top-banner-wrap .start-top-banner__glass {
  animation: start-top-banner-fade 0.9s var(--tb-ease) 0.5s backwards;
}
.start-top-banner-wrap .start-top-banner__track,
.start-top-banner-wrap .start-top-banner__arrow {
  animation: start-top-banner-fog 0.9s var(--tb-ease-fog) 0.8s backwards;
}
html:has(.start-top-banner-wrap) #navbar {
  animation: start-top-banner-nav 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s backwards;
}
@keyframes start-top-banner-open { to { grid-template-rows: 1fr; } }
@keyframes start-top-banner-edge { from { --tb-edge: 28px; } to { --tb-edge: 0px; } }
@keyframes start-top-banner-fill { from { opacity: 0; filter: blur(24px); } to { opacity: 1; filter: blur(0px); } }
@keyframes start-top-banner-fade { from { opacity: 0; } }
@keyframes start-top-banner-fog {
  from { opacity: 0; transform: translateY(12px) scale(1.02); filter: blur(18px); }
  to { opacity: 1; transform: none; filter: blur(0px); }
}
@keyframes start-top-banner-nav { from { top: 0; } }

/* 움직임을 줄인 사용자에게는 처음부터 펼쳐 두고, 마퀴도 멈춰 첫 벌만 «…» 로 자른다. */
@media (prefers-reduced-motion: reduce) {
  .start-top-banner-wrap { grid-template-rows: 1fr; animation: none; }
  .start-top-banner-clip,
  .start-top-banner-wrap .start-top-banner__glow,
  .start-top-banner-wrap .start-top-banner__glass,
  .start-top-banner-wrap .start-top-banner__track,
  .start-top-banner-wrap .start-top-banner__arrow,
  html:has(.start-top-banner-wrap) #navbar { animation: none; }
  .start-top-banner__arrow { transition: none; }
  .start-top-banner:hover .start-top-banner__arrow { transform: none; }
}
@media screen and (max-width: 480px) and (prefers-reduced-motion: reduce) {
  .start-top-banner__marquee { animation: none; width: auto; min-width: 0; }
  .start-top-banner__item { flex: 0 1 auto; padding-right: 0; }
  .start-top-banner__item--dup { display: none; }
  .start-top-banner__content { overflow: hidden; text-overflow: ellipsis; }
}

/* ── 띠 높이(42px)만큼 내려야 하는 다른 고정 요소들 ──
   띠가 GNB 위에 붙으면서 GNB 바닥이 42px 내려갔다. GNB 바닥에 맞춰 붙던 요소들이
   그대로면 GNB 밑으로 들어간다(블로그 목차 실측: top 80px, GNB 바닥 99px).
   - .toc                    블로그·가이드 본문 목차(style.css, ≥992px 에서 sticky top 80px)
   - .articles-sticky-banner 아티클 허브의 GNB 아래 띠(articles/hero.html, top = inset + GNB 높이)
   - --v2-gnb-h              앵커 이동 여백(promo-institution-program.html 의 scroll-margin)
   ⚠️ html 에 scroll-padding-top 을 걸어 앵커 이동 여백까지 맞추려 했다가 걷어냈다 — 모바일 메뉴를
      닫을 때 포커스가 토글로 돌아가며 그 여백만큼 스크롤이 튀었다(check:gnb «닫은 뒤 스크롤 위치
      보존» 3000 → 2063). 블로그 목차 링크로 이동하면 제목이 GNB 밑에 걸리는 건 띠 이전부터 그랬다.
   - [data-insight-nav]      가이드 목록 탭 줄은 JS 가 GNB 의 top+높이로 잡는다(insight-nav.html) —
                             GNB 의 top 이 등장 모션으로 늦게 42px 이 되므로 그쪽이 animationend 에 다시 잰다. */
@media screen and (min-width: 992px) {
  html:has(.start-top-banner-wrap) .toc { top: calc(80px + 42px); }
}
html:has(.start-top-banner-wrap) .articles-sticky-banner { top: calc(42px + var(--gnb-inset, 0px) + var(--gnb-height, 57px)); }
html:has(.start-top-banner-wrap) {
  --v2-gnb-h: calc(64px + 42px);
}

/* 스크롤을 내린 채 새로고침·뒤로가기·앵커 진입 — 등장 없이 처음부터 펼쳐 둔다
   (html.tb-instant 는 baseof.html <head> 의 인라인 스크립트가 첫 페인트 전에 건다). */
html.tb-instant .start-top-banner-wrap { grid-template-rows: 1fr; animation: none; }
html.tb-instant .start-top-banner-clip,
html.tb-instant .start-top-banner-wrap .start-top-banner__glow,
html.tb-instant .start-top-banner-wrap .start-top-banner__glass,
html.tb-instant .start-top-banner-wrap .start-top-banner__track,
html.tb-instant .start-top-banner-wrap .start-top-banner__arrow,
html.tb-instant:has(.start-top-banner-wrap) #navbar { animation: none; }
