/* ═══════════════════════════════════════════════════════
   FULLPAGE SCROLL ENGINE
   ═══════════════════════════════════════════════════════ */

html {
    scroll-behavior: auto !important;
    overflow: hidden !important;
    height: 100%;
}
body {
    overflow: hidden !important;
    height: 100%;
}

/* Full-page container — moves via translateY */
#fp-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
    transition: transform 700ms cubic-bezier(0.86, 0, 0.07, 1);
    z-index: 1;
}

/* Each page slot */
.fp-section {
    height: 100vh;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Overflow pages — content scrolls internally */
.fp-section.fp-overflow {
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.fp-section.fp-overflow::-webkit-scrollbar { display: none; }

/* Last section: 이제 밝은 계열로 통합 */
.fp-section--final {
    background: #ffffff;
}

/* Side navigation dots */
#fp-nav {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    pointer-events: none;
}
#fp-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
#fp-nav li {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    pointer-events: all;
}
.fp-dot-label {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    background: rgba(10,18,40,0.80);
    padding: 3px 9px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    text-shadow: none;
}
#fp-nav li:hover .fp-dot-label { opacity: 1; }
.fp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    border: 1.5px solid rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    flex-shrink: 0;
}
.fp-dot.fp-active {
    background: rgba(20,184,166,0.95);
    border-color: #14B8A6;
    transform: scale(1.45);
    box-shadow: 0 0 10px rgba(20,184,166,0.65);
}
.fp-dot:hover:not(.fp-active) {
    background: rgba(255,255,255,0.55);
    transform: scale(1.2);
}

/* 하얀 배경 섹션용 페이지 인디케이터 */
body.on-white-section #fp-nav .fp-dot-label {
    color: rgba(15,23,42,0.85);
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(15,23,42,0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body.on-white-section #fp-nav .fp-dot {
    background: rgba(15,23,42,0.25);
    border: 1.5px solid rgba(15,23,42,0.6);
}

body.on-white-section #fp-nav .fp-dot.fp-active {
    background: rgba(20,184,166,0.95);
    border-color: #14B8A6;
    transform: scale(1.45);
    box-shadow: 0 0 10px rgba(20,184,166,0.65);
}

body.on-white-section #fp-nav .fp-dot:hover:not(.fp-active) {
    background: rgba(15,23,42,0.45);
    transform: scale(1.2);
}

/* Down arrow indicator */
#fp-down-arrow {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    opacity: 0.55;
    color: rgba(255,255,255,0.85);  /* dark 배경 기본값 */
    animation: fpArrowBounce 1.8s ease-in-out infinite;
    cursor: pointer;
    transition: opacity 0.4s ease, color 0.3s ease;
}
#fp-down-arrow.fp-hidden {
    opacity: 0;
    pointer-events: none;
}
@keyframes fpArrowBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(7px); }
}
/* 밝은 배경 섹션에서 화살표 색상을 어둡게 */
body.on-white-section #fp-down-arrow {
    color: rgba(15,23,42,0.65);
}

/* === PRODUCTS (Page 3): fill viewport, no extra padding === */
.fp-section[data-fp="3"] > .section.dark {
    padding: 0 !important;
}
.fp-section[data-fp="3"] .plt-sticky-ui {
    position: relative !important;
    top: 0 !important;
    height: 100vh !important;
}

/* === VIZ DEMO (Page 4): 한 슬롯 높이(100vh)에 고정, 화살표 위까지 채움 === */
/* Fix 2: fp-section 자체에 dark 배경을 줘서 아래 흰 공백 방지 */
.fp-section[data-fp="4"] {
    background: linear-gradient(155deg, #05101F 0%, #0C1A36 48%, #071629 100%);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.fp-section[data-fp="4"] > .section.dark {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    /* 상단: 네비·타이틀 여유 / 하단: #fp-down-arrow 고정 영역(clamp) */
    padding: clamp(80px, 11vh, 108px) clamp(40px, 4vw, 56px) clamp(3.25rem, 7vh, 5.25rem) !important;
    overflow: hidden !important;
}
/* 섹션 타이틀 뒤 불필요 줄바꿈 제거 → 여백은 CSS로 통일 */
#viz-demo > br {
    display: none;
}
.fp-section[data-fp="4"] #vizDashboard {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.fp-section[data-fp="4"] #vizDashboard > .viz-prompt-bar,
.fp-section[data-fp="4"] #vizDashboard > .viz-scan-overlay,
.fp-section[data-fp="4"] #vizDashboard > .viz-topbar,
.fp-section[data-fp="4"] #vizDashboard > .kpi-row {
    flex-shrink: 0;
}
/* 남는 세로 공간은 중간 차트 행만 흡수 (히트맵·AI 인사이트 행은 행 높이만 콘텐츠에 맞춤, 두 패널은 서로 높이 맞춤) */
.fp-section[data-fp="4"] #vizDashboard > .chart-row {
    flex: 1 1 0;
    min-height: 0;
    align-items: stretch;
}
.fp-section[data-fp="4"] #vizDashboard > .chart-row-3 {
    flex: 0 0 auto;
    align-items: stretch !important;
    margin-bottom: clamp(12px, 1.8vh, 22px) !important;
}
.fp-section[data-fp="4"] #vizDashboard > .ai-bubble {
    flex-shrink: 0;
    margin-top: auto !important;
}
.fp-section[data-fp="4"] .chart-row .chart-panel {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
}
.fp-section[data-fp="4"] .chart-row .chart-panel h4 {
    flex-shrink: 0 !important;
}
.fp-section[data-fp="4"] > .section.dark > .section-title {
    flex-shrink: 0;
}
.fp-section[data-fp="4"] .section-title {
    font-size: 28px !important;
    margin-top: clamp(10px, 1.8vh, 24px) !important;
    margin-bottom: clamp(18px, 2.8vh, 36px) !important;
}
.fp-section[data-fp="4"] .viz-section-subtitle {
    font-size: 12px !important;
    margin-bottom: 10px !important;
}
/* 애니메이션 완료 후 프롬프트 바 숨김 (skeleton 제거되면 자동 적용) */
.fp-section[data-fp="4"] .viz-dashboard:not(.viz-skeleton) .viz-prompt-bar {
    display: none !important;
}
.fp-section[data-fp="4"] .viz-topbar {
    margin-bottom: 8px !important;
}
.fp-section[data-fp="4"] .kpi-row {
    margin-bottom: 8px !important;
    gap: 10px !important;
}
/* KPI 카드: change% 를 카드 우측 상단에 배지로 배치 */
.fp-section[data-fp="4"] .kpi-card {
    padding: 10px 14px !important;
    position: relative !important;
}
.fp-section[data-fp="4"] .kpi-card .kpi-value {
    font-size: 20px !important;
    margin-bottom: 0 !important;
}
.fp-section[data-fp="4"] .kpi-label {
    font-size: 10px !important;
}
.fp-section[data-fp="4"] .kpi-change {
    position: absolute !important;
    top: 9px !important;
    right: 11px !important;
    font-size: 10px !important;
    margin: 0 !important;
    background: rgba(20,184,166,0.12) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
}
.fp-section[data-fp="4"] .chart-row {
    margin-bottom: 8px !important;
    gap: 10px !important;
}
/* 차트 패널 공통 패딩 */
.fp-section[data-fp="4"] .chart-panel {
    padding: 12px 12px !important;
}
/* h4 제목 컴팩트화 */
.fp-section[data-fp="4"] .chart-panel h4 {
    font-size: 14px !important;
    margin-bottom: 5px !important;
}
/* 라인·바: 패널 안에서 비율로 높이 확장 (뷰포트에 맞춤) */
.fp-section[data-fp="4"] #vizLineChart,
.fp-section[data-fp="4"] #vizBarChart {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-height: clamp(96px, 18dvh, 220px) !important;
    height: 100% !important;
    max-height: none !important;
    display: block !important;
}
/* 도넛: 가용 높이 안에서 비율 유지 */
.fp-section[data-fp="4"] #vizDonutSvg {
    width: auto !important;
    height: auto !important;
    max-width: min(100%, 42vw) !important;
    max-height: min(100%, 38dvh) !important;
    aspect-ratio: 1 !important;
    flex-shrink: 0 !important;
}
.fp-section[data-fp="4"] .chart-row .chart-panel .viz-donut-wrap {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    align-items: center !important;
    justify-content: center !important;
}
.fp-section[data-fp="4"] .viz-donut-wrap {
    gap: 12px !important;
}
.fp-section[data-fp="4"] .viz-donut-legend {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 4px 10px !important;
    align-content: center !important;
}
.fp-section[data-fp="4"] .viz-legend-item {
    white-space: nowrap !important;
}
.fp-section[data-fp="4"] .chart-row-3 {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) !important;
    height: auto !important;
}
/* 두 패널을 그리드 행 높이(더 높은 쪽 기준)에 맞춤 */
.fp-section[data-fp="4"] .chart-row-3 .chart-panel {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
    align-self: stretch !important;
    max-height: none !important;
}
.fp-section[data-fp="4"] .chart-row-3 .chart-panel:first-child {
    overflow: hidden !important;
}
/* AI 인사이트: 내용 넘칠 때만 패널 내부 스크롤 */
.fp-section[data-fp="4"] .chart-row-3 .chart-panel:nth-child(2) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
/* 히트맵: 패널 안에서 남는 높이까지 영역 확장(박스 높이는 우측과 동일) */
.fp-section[data-fp="4"] .chart-row-3 .heatmap-grid {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    align-content: start !important;
    overflow: auto !important;
}
.fp-section[data-fp="4"] .heatmap-cell {
    aspect-ratio: 2.8 !important;
}
.fp-section[data-fp="4"] .chart-row-3 .chart-panel h4 {
    margin-bottom: 10px !important;
    font-size: 14px !important;
}
.fp-section[data-fp="4"] .ai-bubble {
    padding: 8px 12px !important;
}
.fp-section[data-fp="4"] .ai-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 13px !important;
}
.fp-section[data-fp="4"] .insight-item {
    padding: 8px 10px !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
    white-space: normal !important;
}

/* === CLIENTS (Page 5): vertical infinite ticker === */
.fp-section[data-fp="5"] {
    background-color: #ffffff;
}
.fp-section[data-fp="5"] > .section.white {
    padding: 74px 80px 20px !important;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background-color: #ffffff;
}
.fp-section[data-fp="5"] .section-title {
    margin-top: 40px !important;
    margin-bottom: 32px !important;
    flex-shrink: 0;
}
.clients-vscroll-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
    /* 카드들이 하단 summary-bar 쪽으로 자연스럽게 페이드 */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 6%, black 82%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, black 6%, black 82%, transparent 100%);
}
.clients-vscroll-track {
    --clients-loop-distance: 0px;
    --clients-loop-duration: 12s;
    animation: clientsUp var(--clients-loop-duration) linear infinite;
    will-change: transform;
}
@keyframes clientsUp {
    0%   { transform: translateY(0); }
    100% { transform: translateY(calc(-1 * var(--clients-loop-distance))); }
}
.clients-vscroll-track .clients-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding-bottom: 10px;
}
.clients-vscroll-track .client-card {
    padding: 14px 16px !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: border-color 0.2s ease !important;
}
.clients-vscroll-track .client-card-name {
    font-size: 13px !important;
}
.clients-vscroll-track .client-card-desc {
    font-size: 11px !important;
}
.fp-section[data-fp="5"] .summary-bar {
    flex-shrink: 0;
    margin-top: 10px;
    margin-bottom: 28px;
    /* 테두리·그림자 제거 */
    border: none !important;
    box-shadow: none !important;
    padding: 14px 20px !important;
    background: transparent !important;
}

/* === Why Us (Page 6): 래퍼·섹션 전체 흰색(빈 여백 시 색 불일치 방지) === */
.fp-section[data-fp="6"] {
    background-color: #ffffff;
}
.fp-section[data-fp="6"] > .section.white {
    min-height: 100vh;
    background-color: #ffffff;
}

/* === PAGE 7: Careers + CTA + Footer (통합, 밝은 계열) === */
.fp-section[data-fp="7"] {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}
/* section.white가 flex 컬럼으로 늘어나 footer 위 공간 차지 */
.fp-section[data-fp="7"] > .section.white {
    flex: 1;
    padding: 92px 56px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    background-color: #ffffff;
}
.fp-section[data-fp="7"] .careers-layout {
    display: grid !important;
    grid-template-columns: minmax(260px, 3fr) minmax(0, 7fr) !important;
    gap: 36px !important;
    align-items: center !important;
}
.fp-section[data-fp="7"] .careers-content {
    display: block !important;
}
.fp-section[data-fp="7"] .careers-image {
    height: 460px !important;
    border-radius: 16px !important;
}
.fp-section[data-fp="7"] .careers-image img {
    object-fit: contain !important;
    background: #ffffff !important;
}
.fp-section[data-fp="7"] .careers-right {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
}
.fp-section[data-fp="7"] .careers-right h2 {
    font-size: 40px !important;
    margin-bottom: 16px !important;
    line-height: 1.22 !important;
}
.fp-section[data-fp="7"] .careers-right > p {
    font-size: 18px !important;
    margin-bottom: 24px !important;
    line-height: 1.75 !important;
}
.fp-section[data-fp="7"] .careers-chip {
    font-size: 16px !important;
    margin-bottom: 24px !important;
}
/* 2×2 혜택 그리드 */
.fp-section[data-fp="7"] .benefits-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
}
.fp-section[data-fp="7"] .benefit-card {
    background: #F8FAFC !important;
    border-radius: 14px !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    transition: all 0.25s ease !important;
}
.fp-section[data-fp="7"] .benefit-card:hover {
    background: rgba(20,184,166,0.08) !important;
    transform: translateY(-2px) !important;
}
.fp-section[data-fp="7"] .benefit-card .benefit-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 9px !important;
    flex-shrink: 0 !important;
    margin-bottom: 4px !important;
}
.fp-section[data-fp="7"] .benefit-card .benefit-icon svg {
    width: 16px !important;
    height: 16px !important;
}
.fp-section[data-fp="7"] .benefit-card strong {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    line-height: 1.3 !important;
    display: block !important;
}
.fp-section[data-fp="7"] .benefit-card p {
    font-size: 16px !important;
    color: #64748B !important;
    line-height: 1.55 !important;
    margin: 0 !important;
}
.fp-section[data-fp="7"] .careers-chip {
    font-size: 12px !important;
    margin-bottom: 14px !important;
}
.fp-section[data-fp="7"] .careers-image-badge {
    padding: 10px 14px !important;
    bottom: 16px !important;
    left: 16px !important;
}
.fp-section[data-fp="7"] .careers-image-badge .badge-text {
    font-size: 12px !important;
}
.fp-section[data-fp="7"] .careers-image-badge .badge-sub {
    font-size: 10px !important;
}
/* CTA 블록: 밝은 민트 배경 카드 */
.fp-section[data-fp="7"] .cta-section {
    margin: 0 !important;
}
.fp-section[data-fp="7"] .cta-section h2 {
    font-size: 24px !important;
    color: #0F172A !important;
    margin-bottom: 14px !important;
}
.fp-section[data-fp="7"] .cta-btn.primary {
    background: linear-gradient(135deg, #14B8A6 0%, #06B6D4 100%) !important;
    color: #ffffff !important;
}
/* 푸터 컴팩트화 */
.fp-section[data-fp="7"] footer {
    flex-shrink: 0;
    padding: 18px 72px !important;
    background: #ffffff !important;
    color: #475569 !important;
}
.fp-section[data-fp="7"] .footer-content {
    margin-bottom: 10px !important;
    gap: 24px !important;
}
.fp-section[data-fp="7"] .footer-section h4 {
    margin-bottom: 8px !important;
    font-size: 12px !important;
    color: #0F172A !important;
}
.fp-section[data-fp="7"] .footer-section li {
    margin-bottom: 5px !important;
    font-size: 12px !important;
    color: #64748B !important;
}
.fp-section[data-fp="7"] .footer-section a {
    color: #64748B !important;
}
.fp-section[data-fp="7"] .footer-section a:hover {
    color: #14B8A6 !important;
}
.fp-section[data-fp="7"] .footer-bottom {
    padding: 16px 0 !important;
    font-size: 12px !important;
    color: #64748B !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-contact {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748B;
}
.footer-contact a {
    color: #64748B;
    text-decoration: none;
}
.footer-contact a:hover {
    color: #14B8A6;
}
.footer-contact .footer-separator {
    color: #CBD5E1;
}
.footer-contact svg {
    display: inline-block !important;
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    flex-shrink: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    stroke: #14B8A6 !important;
    fill: none !important;
}
