/* =========================================================
   ONPIA 레퍼런스 페이지 (pages/reference.html) 전용 스타일
   Figma node 129:2267 기준. common.css 의 :root 토큰 재활용.
   ========================================================= */

body {
    background: var(--color-white);
    color: var(--color-ink);
    overflow-x: hidden;
}

/* =========================================================
   Hero — 다크 배경 + 좌우 glow blob + 아래 정렬 텍스트
   ========================================================= */

.ref-hero {
    position: relative;
    width: 100%;
    height: 550px;
    background: var(--color-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 120px;
    overflow: hidden;
}

.ref-hero-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
}

.ref-hero-glow--right {
    top: -110px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(
        circle at center,
        rgba(37, 99, 235, 0.45) 0%,
        rgba(37, 99, 235, 0.18) 40%,
        rgba(37, 99, 235, 0) 70%
    );
}

.ref-hero-glow--left {
    top: 346px;
    left: -129px;
    width: 329px;
    height: 329px;
    background: radial-gradient(
        circle at center,
        rgba(6, 182, 212, 0.30) 0%,
        rgba(6, 182, 212, 0.10) 45%,
        rgba(6, 182, 212, 0) 75%
    );
}

.ref-hero-inner {
    position: relative;
    z-index: 2;
    width: var(--page-w);
    max-width: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--gap-2xl);
}

.ref-hero-title {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 48px;
    line-height: 1.2;
    color: var(--color-white);
}

.ref-hero-title p { margin: 0; }

.ref-hero-sub {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.5;
    color: var(--color-gray-500);
    max-width: 100%;
}

/* =========================================================
   Alternating(탭 + 로고 그리드) 섹션
   ========================================================= */

.ref-tabs {
    background: var(--color-white);
    padding: 100px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
}

/* -- 탭 바 -- */
.ref-tab-bar {
    display: inline-flex;
    padding: 4px;
    background: var(--color-surface-4);
    border-radius: var(--radius-full);
    align-items: center;
    overflow: hidden;
}

.ref-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-gray-650);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 16px;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.ref-tab.active {
    background: var(--color-blue);
    color: var(--color-white);
    font-weight: 600;
}

.ref-tab:hover:not(.active) {
    color: var(--color-ink);
}

/* -- 로고 그리드 (6 열, 카드 형태) -- */
.ref-logo-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--gap-lg);
    width: var(--page-w);
    max-width: 100%;
}

.ref-logo-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 125px;
    padding: 12px;
    background: var(--color-surface-3);
    border: 1px solid var(--color-border-1);
    border-radius: var(--radius-base);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.ref-logo-cell:hover {
    background: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ref-logo-cell img {
    /* min() : 넓은 뷰포트에서는 170px 로 캡, 좁은 뷰포트에서는 셀 폭에 맞춰 축소 → 오버플로 방지 */
    max-width: min(170px, 100%);
    max-height: 75px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* 탭 콘텐츠 스위칭 */
.ref-tab-panel { display: none; }
.ref-tab-panel.active { display: grid; }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1400px) {
    .ref-tabs { padding: 80px 40px; }
}

@media (max-width: 1200px) {
    .ref-logo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ref-hero-title { font-size: 36px; }
    .ref-hero-sub { font-size: 16px; }
}

@media (max-width: 800px) {
    .ref-hero { height: auto; padding: 160px 20px 80px; }
    .ref-tabs { padding: 60px 20px; gap: 30px; }
    .ref-tab { padding: 10px 18px; font-size: 14px; }
    .ref-logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ref-logo-cell { min-height: 90px; }
}

@media (max-width: 640px) {
    .ref-logo-cell { min-height: 80px; padding: 8px; }
    .ref-logo-cell img { max-height: 55px; }
}

@media (max-width: 480px) {
    .ref-logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ref-hero-title { font-size: 26px; }
}
