/* =====================================================
   gateway.css — index.html 관문(Gateway) 전용 스타일
   여백이 주인공. 로고 + 한 줄 브랜드 + 선택 카드 3개.
   기존 CSS는 수정하지 않고 이 파일에서만 관문 UI를 정의한다.
   design-system.css / new-structure.css 의 --lt-*, --changho-accent
   변수를 재사용한다.
   ===================================================== */

body.gw-body {
  background: var(--lt-paper, #f8fafc);
  color: var(--lt-ink, #0f172a);
  /* 관문은 자체 헤더(정적)를 쓰므로 header.css의 고정 헤더용
     상단 패딩을 상쇄한다. */
  padding-top: 0;
}

/* ---------------------------------------------------
   관문 헤더 — 미니멀, 정적(sticky). 드롭다운 없음.
   .header 클래스를 쓰지 않으므로 header.js/header.css의
   고정·모바일 햄버거 규칙과 충돌하지 않는다.
   --------------------------------------------------- */
.gw-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--lt-line, #dbe3ef);
}

.gw-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
}

.gw-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.gw-logo img {
  display: block;
  height: 34px;
  width: auto;
}

.gw-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gw-nav-link {
  color: var(--lt-muted, #475569);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 6px;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.gw-nav-link:hover {
  color: var(--lt-primary, #1a365d);
}

.gw-cta {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--lt-primary, #1a365d);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.16s ease, transform 0.16s ease;
}

.gw-cta:hover {
  background: var(--lt-primary-strong, #10233f);
  transform: translateY(-1px);
}

.gw-lang {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--lt-line, #dbe3ef);
  background: #ffffff;
  color: var(--lt-soft, #64748b);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.gw-lang:hover {
  border-color: var(--lt-line-strong, #c8d4e4);
  color: var(--lt-primary, #1a365d);
}

/* ---------------------------------------------------
   히어로 — 여백이 주인공
   --------------------------------------------------- */
.gw-hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(72px, 12vw, 140px) 24px clamp(28px, 5vw, 56px);
  text-align: center;
}

/* 재방문 인라인 배너 (자동 리다이렉트 없음) */
.gw-return {
  display: none;
  margin: 0 auto clamp(28px, 5vw, 48px);
  max-width: max-content;
}

.gw-return.is-visible {
  display: block;
}

.gw-return a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--lt-line-strong, #c8d4e4);
  background: var(--lt-paper-strong, #eef4fb);
  color: var(--lt-primary, #1a365d);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.gw-return a:hover {
  border-color: var(--lt-primary, #1a365d);
  background: #ffffff;
}

.gw-eyebrow {
  margin: 0 0 18px;
  color: var(--lt-primary, #1a365d);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gw-hero h1 {
  margin: 0 auto;
  max-width: 16em;
  color: var(--lt-ink, #0f172a);
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  font-weight: 800;
  word-break: keep-all;
}

.gw-hero-sub {
  margin: 20px auto 0;
  max-width: 34em;
  color: var(--lt-muted, #475569);
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  line-height: 1.75;
  word-break: keep-all;
}

/* ---------------------------------------------------
   선택 카드 3개 — 데스크톱 3열, 모바일 1열
   --------------------------------------------------- */
.gw-choices {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.gw-choice {
  --gw-accent: var(--lt-primary, #1a365d);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: clamp(24px, 3vw, 36px) clamp(22px, 2.6vw, 30px);
  border: 1px solid var(--lt-line, #dbe3ef);
  border-radius: 18px;
  background: var(--lt-panel, #ffffff);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.gw-choice::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--gw-accent);
  opacity: 0.85;
  z-index: 2;
}

/* 시그니처 모먼트 — 한지 warm glow + 얇은 문살(창살) 격자.
   기본은 조용히(투명), hover/focus 시에만 은은하게 드러난다. */
.gw-choice::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 420px 240px at 50% 0%,
      rgba(255, 248, 230, 0.55) 0%,
      rgba(255, 248, 230, 0.14) 46%,
      transparent 72%),
    repeating-linear-gradient(0deg, transparent 0 21px,
      color-mix(in srgb, var(--gw-accent) 7%, transparent) 21px 22px),
    repeating-linear-gradient(90deg, transparent 0 21px,
      color-mix(in srgb, var(--gw-accent) 7%, transparent) 21px 22px);
  transition: opacity 0.18s ease-out;
}

.gw-choice:hover,
.gw-choice:focus-visible {
  border-color: var(--gw-accent);
  /* 리프트는 이동이 아니라 그림자·문살 보더(inset 1px)로 표현 — 이동 ≤2px */
  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.11),
    inset 0 0 0 1px color-mix(in srgb, var(--gw-accent) 34%, transparent);
  transform: translateY(-2px);
}

.gw-choice:hover::after,
.gw-choice:focus-visible::after {
  opacity: 1;
}

.gw-choice:focus-visible {
  outline: 2px solid var(--gw-accent);
  outline-offset: 3px;
}

.gw-choice-eyebrow {
  color: var(--gw-accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.gw-choice h2 {
  margin: 0;
  color: var(--lt-ink, #0f172a);
  font-size: clamp(1.3rem, 2vw, 1.55rem);
  line-height: 1.35;
  font-weight: 800;
  word-break: keep-all;
}

.gw-choice p {
  margin: 0;
  color: var(--lt-muted, #475569);
  font-size: 0.95rem;
  line-height: 1.7;
  word-break: keep-all;
}

.gw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.gw-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--lt-line, #dbe3ef);
  background: var(--lt-paper, #f8fafc);
  color: var(--lt-soft, #64748b);
  font-size: 0.78rem;
  font-weight: 700;
}

.gw-choice-go {
  margin-top: auto;
  padding-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gw-accent);
  font-size: 0.92rem;
  font-weight: 800;
}

.gw-choice-go::after {
  content: "→";
  transition: transform 0.18s ease;
}

.gw-choice:hover .gw-choice-go::after,
.gw-choice:focus-visible .gw-choice-go::after {
  transform: translateX(4px);
}

/* 테넌트별 액센트 */
.gw-choice--k12 { --gw-accent: #0f7a5a; }
.gw-choice--university { --gw-accent: #4c53c6; }
.gw-choice--business { --gw-accent: #7c3aa0; }

/* ---------------------------------------------------
   한 줄 요약 + 보조 링크 행
   --------------------------------------------------- */
.gw-summary {
  max-width: 40em;
  margin: clamp(40px, 6vw, 72px) auto 0;
  padding: 0 24px;
  text-align: center;
  color: var(--lt-soft, #64748b);
  font-size: 1rem;
  line-height: 1.7;
  word-break: keep-all;
}

.gw-summary--about {
  margin-top: 14px;
  font-size: 0.9rem;
  opacity: 0.85;
}

.gw-sublinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 22px;
  max-width: 1120px;
  margin: 20px auto clamp(72px, 12vw, 128px);
  padding: 0 24px;
}

.gw-sublinks a {
  color: var(--lt-muted, #475569);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.16s ease;
}

.gw-sublinks a:hover {
  color: var(--lt-primary, #1a365d);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gw-sublinks .gw-sep {
  color: var(--lt-line-strong, #c8d4e4);
  font-weight: 400;
}

/* 카드 콘텐츠는 한지 glow·문살 격자 위에 또렷하게 */
.gw-choice > * {
  position: relative;
  z-index: 2;
}

/* ---------------------------------------------------
   진입 모션 — eyebrow → H1 → 서브 → 카드 3개 순 페이드업
   (y 12px, 350ms, stagger ~70ms). CSS 전용, JS 불필요.
   fill-mode backwards: 지연 동안만 시작 상태를 유지하고
   끝나면 기본값으로 복귀 → hover transform과 충돌 없음.
   --------------------------------------------------- */
@keyframes gwFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gw-eyebrow  { animation: gwFadeUp 0.35s ease-out backwards; }
.gw-hero h1  { animation: gwFadeUp 0.35s ease-out 0.07s backwards; }
.gw-hero-sub { animation: gwFadeUp 0.35s ease-out 0.14s backwards; }

.gw-choice              { animation: gwFadeUp 0.35s ease-out backwards; }
.gw-choice--k12         { animation-delay: 0.21s; }
.gw-choice--university  { animation-delay: 0.28s; }
.gw-choice--business    { animation-delay: 0.35s; }

/* ---------------------------------------------------
   헤더 버튼 focus-visible (브랜드 accent 링, outline 유지)
   --------------------------------------------------- */
.gw-nav-link,
.gw-cta,
.gw-lang {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.gw-nav-link:focus-visible,
.gw-cta:focus-visible,
.gw-lang:focus-visible,
.gw-logo:focus-visible {
  outline: 2px solid var(--lt-primary, #1a365d);
  outline-offset: 3px;
  border-radius: 6px;
}

.gw-cta:focus-visible {
  outline-offset: 2px;
}

/* 보조 링크 — 히트 타깃 ≥24px */
.gw-sublinks a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 4px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.gw-sublinks a:focus-visible {
  outline: 2px solid var(--lt-primary, #1a365d);
  outline-offset: 2px;
  border-radius: 6px;
  text-decoration: none;
}

.gw-return a:focus-visible,
.gw-return__close:focus-visible {
  outline: 2px solid var(--lt-primary, #1a365d);
  outline-offset: 2px;
}

/* ---------------------------------------------------
   재방문 배너 — 눈에 띄되 방해 않게. 링크 + 닫기 버튼.
   --------------------------------------------------- */
.gw-return.is-visible {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gw-return a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.gw-return__close {
  appearance: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--lt-soft, #64748b);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.16s ease, background 0.16s ease;
}

.gw-return__close:hover {
  color: var(--lt-primary, #1a365d);
  background: var(--lt-paper-strong, #eef4fb);
}

/* ---------------------------------------------------
   모션 최소화 — 진입 애니메이션·마이크로인터랙션 이동 제거
   --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .gw-eyebrow,
  .gw-hero h1,
  .gw-hero-sub,
  .gw-choice {
    animation: none;
  }

  .gw-choice,
  .gw-choice::after,
  .gw-choice-go::after,
  .gw-cta {
    transition: none;
  }

  .gw-choice:hover,
  .gw-choice:focus-visible {
    transform: none;
  }

  .gw-cta:hover {
    transform: none;
  }

  .gw-choice:hover .gw-choice-go::after,
  .gw-choice:focus-visible .gw-choice-go::after {
    transform: none;
  }
}

/* ---------------------------------------------------
   반응형 — 768px
   --------------------------------------------------- */
@media (max-width: 768px) {
  .gw-header-inner {
    padding: 12px 16px;
    gap: 10px;
  }

  .gw-logo img { height: 30px; }

  .gw-nav-link { display: none; }

  .gw-cta {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .gw-hero {
    padding: clamp(48px, 16vw, 72px) 18px 24px;
  }

  .gw-choices {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 18px;
  }

  .gw-summary { padding: 0 18px; }

  .gw-sublinks {
    gap: 8px 16px;
    padding: 0 18px;
  }

  .gw-sublinks .gw-sep { display: none; }
}
