/* ═══════════════════════════════════════════════════════════════════════
 *  W-HOSTING Design System v3 — Toss-inspired Interactive Layer
 *  - 토스페이먼츠 스타일: 큰 타이포 / 부드러운 컬러 / 인터랙티브 모션
 *  - 모바일 / 태블릿 / 데스크탑 완벽 대응
 *  - 기존 페이지 구조 위에 시각적 개선만 자동 적용
 * ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Toss-inspired 컬러 시스템 (W-HOSTING 인디고 변형) */
  --t-blue:      #5B4CF5;            /* W-HOSTING primary (Toss #3182F6 와 호환) */
  --t-blue-100:  #EEF2FF;
  --t-blue-200:  #E0E7FF;
  --t-blue-500:  #5B4CF5;
  --t-blue-600:  #4F46E5;
  --t-blue-700:  #4338CA;

  /* Toss 그레이 스케일 (warm) */
  --t-grey-50:   #F9FAFB;
  --t-grey-100:  #F2F4F6;
  --t-grey-200:  #E5E8EB;
  --t-grey-300:  #D1D6DB;
  --t-grey-400:  #B0B8C1;
  --t-grey-500:  #8B95A1;
  --t-grey-600:  #6B7684;
  --t-grey-700:  #4E5968;
  --t-grey-800:  #333D4B;
  --t-grey-900:  #191F28;          /* Toss 브랜드 다크 */

  /* 시맨틱 */
  --t-success:   #10B981;
  --t-warning:   #F59E0B;
  --t-danger:    #EF4444;
  --t-info:      #0EA5E9;

  /* 모션 토큰 */
  --t-ease:      cubic-bezier(.4, 0, .2, 1);
  --t-ease-out:  cubic-bezier(0, 0, .2, 1);
  --t-ease-in:   cubic-bezier(.4, 0, 1, 1);
  --t-spring:    cubic-bezier(.34, 1.56, .64, 1);

  --t-dur-fast:  150ms;
  --t-dur-base:  250ms;
  --t-dur-slow:  500ms;
  --t-dur-slower: 800ms;

  /* 그림자 — Toss 스타일 부드러움 */
  --t-shadow-1:  0 1px 3px rgba(25, 31, 40, .04), 0 1px 2px rgba(25, 31, 40, .06);
  --t-shadow-2:  0 4px 12px rgba(25, 31, 40, .06), 0 2px 4px rgba(25, 31, 40, .04);
  --t-shadow-3:  0 12px 32px rgba(25, 31, 40, .08), 0 4px 12px rgba(25, 31, 40, .04);
  --t-shadow-4:  0 24px 64px rgba(25, 31, 40, .12), 0 8px 24px rgba(25, 31, 40, .06);
  --t-shadow-blue: 0 8px 24px rgba(91, 76, 245, .25);
  --t-shadow-blue-lg: 0 16px 48px rgba(91, 76, 245, .35);

  /* 라디우스 */
  --t-r-sm: 8px; --t-r: 12px; --t-r-md: 16px; --t-r-lg: 20px;
  --t-r-xl: 24px; --t-r-2xl: 32px; --t-r-full: 9999px;

  /* 컨테이너 */
  --t-container: 1180px;
}

/* ── 글로벌 폰트 / 렌더링 ───────────────────────────────────────────── */

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -.005em;
}

/* ── Toss 스타일 타이포 스케일 (Display) ────────────────────────────── */

.t-display-1 { font-size: clamp(40px, 7vw, 80px); font-weight: 800; line-height: 1.1;  letter-spacing: -.04em; }
.t-display-2 { font-size: clamp(34px, 5vw, 60px); font-weight: 800; line-height: 1.15; letter-spacing: -.035em; }
.t-display-3 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; line-height: 1.2;  letter-spacing: -.03em; }
.t-h1 { font-size: clamp(24px, 3vw, 36px); font-weight: 800; line-height: 1.3; letter-spacing: -.025em; }
.t-h2 { font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; line-height: 1.35; letter-spacing: -.02em; }
.t-body-1 { font-size: 17px; line-height: 1.6; letter-spacing: -.005em; }
.t-body-2 { font-size: 15px; line-height: 1.65; }
.t-caption { font-size: 13px; line-height: 1.55; color: var(--t-grey-600); }

/* ── 스크롤 리빌 — 진입 시 페이드 + 슬라이드업 ─────────────────────── */

.t-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--t-dur-slow) var(--t-ease),
              transform var(--t-dur-slow) var(--t-ease);
  will-change: opacity, transform;
}
.t-reveal.is-visible {
  opacity: 1; transform: translateY(0);
}
.t-reveal[data-delay="100"] { transition-delay: 100ms; }
.t-reveal[data-delay="200"] { transition-delay: 200ms; }
.t-reveal[data-delay="300"] { transition-delay: 300ms; }
.t-reveal[data-delay="400"] { transition-delay: 400ms; }

.t-reveal-x {
  opacity: 0; transform: translateX(-40px);
  transition: opacity var(--t-dur-slow) var(--t-ease),
              transform var(--t-dur-slow) var(--t-ease);
}
.t-reveal-x.is-visible { opacity: 1; transform: translateX(0); }

.t-reveal-zoom {
  opacity: 0; transform: scale(.94);
  transition: opacity var(--t-dur-slow) var(--t-ease),
              transform var(--t-dur-slow) var(--t-spring);
}
.t-reveal-zoom.is-visible { opacity: 1; transform: scale(1); }

/* ── 카운터 (페이드인 시작) ─────────────────────────────────────────── */
.t-counter {
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transition: color .2s;
}

/* ── Toss 스타일 카드 ───────────────────────────────────────────────── */

.t-card {
  background: #fff;
  border-radius: var(--t-r-xl);
  padding: 28px;
  box-shadow: var(--t-shadow-1);
  transition: transform var(--t-dur-base) var(--t-ease),
              box-shadow var(--t-dur-base) var(--t-ease);
  position: relative;
  overflow: hidden;
}
.t-card-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--t-shadow-3);
}
.t-card-tilt {
  transition: transform var(--t-dur-base) var(--t-ease);
  transform-style: preserve-3d;
}

/* 카드 그라디언트 보더 (호버 시 드러남) */
.t-card-glow {
  position: relative;
}
.t-card-glow::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--t-blue-500), var(--t-blue-700), #8B5CF6);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--t-dur-base);
  pointer-events: none;
}
.t-card-glow:hover::before { opacity: 1; }

/* ── Toss 스타일 버튼 ───────────────────────────────────────────────── */

.t-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--t-r);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  border: none; cursor: pointer;
  transition: transform var(--t-dur-fast) var(--t-ease),
              box-shadow var(--t-dur-fast) var(--t-ease),
              background-color var(--t-dur-fast);
  position: relative; overflow: hidden;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.t-btn:active { transform: scale(.96); }

.t-btn-primary {
  background: var(--t-blue-500); color: #fff;
  box-shadow: var(--t-shadow-blue);
}
.t-btn-primary:hover {
  background: var(--t-blue-600);
  box-shadow: var(--t-shadow-blue-lg);
  transform: translateY(-2px);
}

.t-btn-dark {
  background: var(--t-grey-900); color: #fff;
}
.t-btn-dark:hover { background: var(--t-grey-800); transform: translateY(-2px); }

.t-btn-ghost {
  background: var(--t-grey-100); color: var(--t-grey-900);
}
.t-btn-ghost:hover { background: var(--t-grey-200); }

.t-btn-outline {
  background: transparent; color: var(--t-grey-900);
  border: 1.5px solid var(--t-grey-200);
}
.t-btn-outline:hover { border-color: var(--t-blue-500); color: var(--t-blue-500); }

.t-btn-lg { padding: 18px 32px; font-size: 17px; border-radius: var(--t-r-md); }
.t-btn-sm { padding: 10px 18px; font-size: 13px; border-radius: var(--t-r-sm); }

/* 버튼 ripple 효과 */
.t-btn-ripple { position: relative; overflow: hidden; }
.t-btn-ripple::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,.3) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0);
  transition: opacity .6s, transform .6s;
}
.t-btn-ripple:active::after { opacity: 1; transform: scale(2); transition: 0s; }

/* ── 헤더 글로벌 인터랙션 (스크롤 시 그림자 강화) ──────────────────── */

.t-header-scrolled.site-header,
.t-header-scrolled .header,
.t-header-scrolled .fx-header {
  box-shadow: 0 2px 16px rgba(25, 31, 40, .08) !important;
  background: rgba(255, 255, 255, .96) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
}

/* ── 섹션 패딩 일관화 (Toss 스타일 큰 여백) ───────────────────────── */

@media(min-width: 1024px) {
  .section, .fx-section { padding: 120px 0 !important; }
  .hero, .fx-hero { padding: 100px 0 80px !important; }
}
@media(min-width: 768px) and (max-width: 1023px) {
  .section, .fx-section { padding: 88px 0 !important; }
  .hero, .fx-hero { padding: 80px 0 60px !important; }
}

/* ── 헤로 그라디언트 메쉬 (Toss 스타일 매우 잔잔) ──────────────────── */

.t-hero-mesh {
  position: relative;
  background: #fff;
}
.t-hero-mesh::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 600px at 10% -10%, rgba(91, 76, 245, .08) 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 10%, rgba(139, 92, 246, .06) 0%, transparent 60%),
    radial-gradient(700px 400px at 50% 110%, rgba(14, 165, 233, .05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.t-hero-mesh > * { position: relative; z-index: 1; }

/* ── 큰 숫자 디스플레이 (Toss KPI) ─────────────────────────────────── */

.t-stat {
  display: inline-flex; flex-direction: column; gap: 4px;
}
.t-stat-num {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--t-grey-900);
  font-variant-numeric: tabular-nums;
}
.t-stat-num .unit { font-size: .55em; font-weight: 700; color: var(--t-grey-500); margin-left: 4px; }
.t-stat-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--t-grey-600);
  letter-spacing: -.005em;
}

/* ── 마퀴 / 슬라이딩 콘텐츠 ─────────────────────────────────────────── */

@keyframes t-marquee-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.t-marquee {
  overflow: hidden;
  position: relative;
  --t-marquee-speed: 30s;
}
.t-marquee::before, .t-marquee::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 80px;
  z-index: 2; pointer-events: none;
}
.t-marquee::before {
  left: 0; background: linear-gradient(to right, #fff, transparent);
}
.t-marquee::after {
  right: 0; background: linear-gradient(to left, #fff, transparent);
}
.t-marquee-track {
  display: flex; gap: 48px;
  animation: t-marquee-x var(--t-marquee-speed) linear infinite;
  width: max-content;
}

/* ── Floating CTA (Toss 모바일 하단 고정 버튼 스타일) ─────────────── */

.t-fab {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 90;
  background: var(--t-grey-900);
  color: #fff;
  border-radius: var(--t-r-full);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--t-shadow-4);
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform var(--t-dur-base), box-shadow var(--t-dur-base);
  -webkit-tap-highlight-color: transparent;
}
.t-fab:hover { transform: translateY(-2px); box-shadow: 0 28px 72px rgba(25, 31, 40, .2); }
.t-fab.is-hidden { transform: translateY(120px); opacity: 0; pointer-events: none; }

@media(max-width: 640px) {
  .t-fab { bottom: 16px; right: 16px; left: 16px; justify-content: center; }
}

/* ── 모바일 하단 고정 네비 (Toss 스타일 — 옵션) ───────────────────── */

.t-bottom-nav {
  display: none;
}
@media(max-width: 768px) {
  .t-bottom-nav-on .t-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 95;
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--t-grey-200);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .t-bottom-nav-on body { padding-bottom: 72px; }
  .t-bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 12px;
    color: var(--t-grey-500); text-decoration: none;
    font-size: 10px; font-weight: 600;
    transition: color .15s;
    flex: 1;
  }
  .t-bottom-nav-item.active { color: var(--t-blue-500); }
  .t-bottom-nav-item i { font-size: 18px; margin-bottom: 1px; }
}

/* ── Toss 스타일 hover 효과 (전역 .card 강화) ──────────────────────── */

@media (hover: hover) {
  .card { transition: transform var(--t-dur-base) var(--t-ease),
                       box-shadow var(--t-dur-base) var(--t-ease) !important; }
  .card:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--t-shadow-3) !important;
  }
}

/* ── Toss 스타일 버튼 강화 (전역 .btn-primary) ────────────────────── */

.btn-primary, .btn.btn-primary {
  transition: transform var(--t-dur-fast) var(--t-ease),
              box-shadow var(--t-dur-fast) var(--t-ease),
              background-color var(--t-dur-fast) !important;
}
.btn-primary:hover { transform: translateY(-2px) !important; }
.btn-primary:active { transform: scale(.97) !important; }

/* ── Toss 스타일 입력 ───────────────────────────────────────────── */

.t-input {
  width: 100%;
  padding: 16px 18px;
  background: var(--t-grey-50);
  border: 1.5px solid transparent;
  border-radius: var(--t-r);
  font-size: 16px;
  font-family: inherit;
  color: var(--t-grey-900);
  transition: all var(--t-dur-fast);
  outline: none;
}
.t-input:focus {
  background: #fff;
  border-color: var(--t-blue-500);
  box-shadow: 0 0 0 4px rgba(91, 76, 245, .12);
}

/* ── 이미지 / 미디어 호버 줌 ───────────────────────────────────────── */

.t-img-zoom {
  overflow: hidden;
  border-radius: var(--t-r-md);
}
.t-img-zoom img {
  transition: transform var(--t-dur-slow) var(--t-ease);
  display: block; width: 100%;
}
.t-img-zoom:hover img { transform: scale(1.05); }

/* ── 스크롤바 (Toss 스타일 얇고 클린) ──────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--t-grey-300);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--t-grey-400); background-clip: content-box; }

/* ── 셀렉션 (Toss 블루) ───────────────────────────────────────────── */

::selection { background: var(--t-blue-200); color: var(--t-grey-900); }

/* ── 포커스 링 (접근성 + Toss 클린) ───────────────────────────────── */

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--t-blue-500);
  outline-offset: 2px;
  border-radius: var(--t-r-sm);
}

/* ── 모바일 바텀시트 (Toss 모달 스타일) ───────────────────────────── */

.t-bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px max(24px, env(safe-area-inset-bottom));
  box-shadow: 0 -16px 64px rgba(25, 31, 40, .15);
  z-index: 100;
  transform: translateY(100%);
  transition: transform var(--t-dur-base) var(--t-ease);
}
.t-bottom-sheet.is-open { transform: translateY(0); }
.t-bottom-sheet::before {
  content: '';
  display: block;
  width: 40px; height: 4px;
  background: var(--t-grey-300);
  border-radius: 2px;
  margin: 0 auto 16px;
}

/* ── Toss 스타일 토글 / 칩 ────────────────────────────────────────── */

.t-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--t-grey-100);
  border-radius: var(--t-r-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--t-grey-700);
  transition: all var(--t-dur-fast);
  cursor: pointer;
  border: none;
}
.t-chip:hover { background: var(--t-grey-200); }
.t-chip.is-active {
  background: var(--t-grey-900); color: #fff;
}
.t-chip-blue.is-active { background: var(--t-blue-500); }

/* ── Skeleton (Toss 스타일 부드러운 펄스) ─────────────────────────── */

.t-skeleton {
  background: linear-gradient(90deg, var(--t-grey-100) 0%, var(--t-grey-200) 50%, var(--t-grey-100) 100%);
  background-size: 200% 100%;
  animation: t-skeleton-pulse 1.4s linear infinite;
  border-radius: var(--t-r-sm);
}
@keyframes t-skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 모션 감소 — 접근성 ───────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .t-reveal, .t-reveal-x, .t-reveal-zoom { opacity: 1 !important; transform: none !important; }
}

/* ── 디바이스별 미세 조정 ─────────────────────────────────────────── */

/* 태블릿 */
@media(min-width: 768px) and (max-width: 1023px) {
  .t-card { padding: 24px; }
  .t-btn { padding: 12px 20px; font-size: 14px; }
  .t-btn-lg { padding: 16px 28px; font-size: 16px; }
}

/* 모바일 */
@media(max-width: 767px) {
  .t-card { padding: 20px; border-radius: var(--t-r-md); }
  .t-btn { padding: 13px 20px; font-size: 14px; }
  .t-btn-lg { padding: 16px 24px; font-size: 15px; width: 100%; }
  .t-display-1, .t-display-2 { letter-spacing: -.03em; }
}

/* ── 이지 다크모드 대비 (선택적) ──────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  /* 시스템 다크모드 시 부드러운 표시 조정만 */
  ::selection { background: rgba(91, 76, 245, .35); color: #fff; }
}

/* ── 토스 시그니처: 큰 둥근 카드 + 컬러 일러스트 영역 ─────────────── */

.t-illust-card {
  background: linear-gradient(135deg, var(--t-blue-100), #F5F3FF);
  border-radius: var(--t-r-2xl);
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
}
.t-illust-card::before {
  content: '';
  position: absolute; right: -40px; bottom: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--t-blue-200), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* ── 인뷰 카운터 시작 시 살짝 강조 ─────────────────────────────────── */

.t-counter.is-visible {
  animation: t-counter-pop .4s var(--t-spring);
}
@keyframes t-counter-pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ── Sticky CTA 바 (페이지 하단) ──────────────────────────────────── */

.t-sticky-cta {
  position: sticky;
  bottom: 16px;
  background: var(--t-grey-900);
  color: #fff;
  border-radius: var(--t-r-md);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--t-shadow-3);
  margin: 24px 0;
  z-index: 50;
}

/* ── Header 스크롤 progress bar (Toss 페이먼츠 스타일) ───────────── */

.t-scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--t-blue-500), #8B5CF6);
  z-index: 1000;
  transition: width 50ms linear;
  pointer-events: none;
  width: 0;
}
