/* CODABLE Space — codable.co.kr 브랜드 컬러 */
:root {
    --codable-orange: #f5914e;
    --codable-orange-dark: #e07a35;
    --codable-teal: #4db6ac;
    --codable-teal-dark: #3a9a91;
    --codable-sky: #4a90e2;
    --codable-sky-dark: #357abd;
    --codable-navy: #2c3e50;
    --codable-text: #2d3436;
    --codable-text-muted: #636e72;
    --codable-bg: #f0f3f7;
    --codable-white: #ffffff;
    --codable-border: #e4e9ef;
    --shadow-card: 0 2px 8px rgba(44, 62, 80, 0.06), 0 8px 24px rgba(44, 62, 80, 0.04);
    --shadow-card-hover: 0 4px 12px rgba(44, 62, 80, 0.08), 0 16px 40px rgba(44, 62, 80, 0.1);
    --radius-card: 16px;
    --radius-pill: 999px;
    --font-sans: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont,
        'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

body {
    margin: 0;
    height: 100%;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    color: var(--codable-text);
    background: var(--codable-bg);
    line-height: 1.5;
    position: relative;
    overflow: hidden;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 70% 50% at 10% 0%, rgba(74, 144, 226, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 60% 45% at 95% 10%, rgba(245, 145, 78, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(77, 182, 172, 0.05) 0%, transparent 55%),
        linear-gradient(180deg, #f7f9fc 0%, var(--codable-bg) 100%);
    pointer-events: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header */
.hub-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--codable-text);
    border-bottom: 1px solid var(--codable-border);
}

.hub-header__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hub-header__grid-icon {
    display: grid;
    grid-template-columns: repeat(2, 7px);
    gap: 3px;
}

.hub-header__grid-icon span {
    width: 7px;
    height: 7px;
    background: var(--codable-orange);
    border-radius: 2px;
}

.hub-header__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hub-header__title em {
    font-style: normal;
    color: var(--codable-orange);
}

/* Main — 짧은 화면에서도 이 영역만 스크롤, 푸터는 항상 노출 */
.hub-main {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 48px 24px 56px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* Service card */
.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--codable-white);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--codable-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.service-card--sky:hover {
    border-color: rgba(74, 144, 226, 0.35);
}

.service-card--teal:hover {
    border-color: rgba(77, 182, 172, 0.35);
}

.service-card__header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
    color: white;
    overflow: hidden;
}

.service-card__header::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.service-card__header--sky {
    background: linear-gradient(135deg, var(--codable-sky) 0%, #5ba3eb 50%, var(--codable-sky-dark) 100%);
}

.service-card__header--teal {
    background: linear-gradient(135deg, var(--codable-teal) 0%, #5ec4bb 50%, var(--codable-teal-dark) 100%);
}

.service-card__header--muted {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.service-card__icon {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.service-card__icon svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.service-card__header-label {
    position: relative;
    z-index: 1;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.95;
}

.service-card__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--codable-teal-dark);
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius-pill);
}

.service-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px 24px 24px;
}

.service-card__title {
    margin: 0 0 10px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--codable-text);
    letter-spacing: -0.02em;
}

.service-card__desc {
    margin: 0;
    flex: 1;
    font-size: 0.875rem;
    color: var(--codable-text-muted);
    line-height: 1.65;
}

.service-card__footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--codable-border);
}

.service-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--codable-text);
    background: var(--codable-bg);
    border-radius: var(--radius-pill);
    transition: background 0.2s ease, color 0.2s ease, gap 0.2s ease;
}

.service-card--sky:hover .service-card__link {
    background: rgba(74, 144, 226, 0.12);
    color: var(--codable-sky-dark);
}

.service-card--teal:hover .service-card__link {
    background: rgba(77, 182, 172, 0.12);
    color: var(--codable-teal-dark);
}

.service-card__link-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.service-card:hover .service-card__link-arrow {
    transform: translateX(3px);
}

.service-card--disabled {
    opacity: 0.72;
    pointer-events: none;
}

.service-card--disabled:hover {
    transform: none;
    box-shadow: var(--shadow-card);
}

/* Footer */
.hub-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 16px 24px max(20px, calc(12px + env(safe-area-inset-bottom)));
    font-size: 0.8125rem;
    color: var(--codable-text-muted);
    background: rgba(247, 249, 252, 0.96);
    border-top: 1px solid var(--codable-border);
}

.hub-footer a {
    color: var(--codable-orange-dark);
    font-weight: 600;
}

.hub-footer a:hover {
    text-decoration: underline;
}

/* Coming soon page */
.coming-soon {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.coming-soon__badge {
    display: inline-block;
    padding: 6px 16px;
    margin-bottom: 20px;
    background: var(--codable-teal);
    color: white;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
}

.coming-soon h1 {
    margin: 0 0 12px;
    font-size: 1.75rem;
    color: var(--codable-text);
}

.coming-soon p {
    margin: 0 0 28px;
    max-width: 420px;
    color: var(--codable-text-muted);
    line-height: 1.7;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--codable-orange);
    color: white;
    font-size: 0.9375rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-back:hover {
    background: var(--codable-orange-dark);
    transform: translateY(-1px);
}

/* 태블릿·짧은 화면: 패딩/카드 압축 */
@media (max-height: 820px) {
    .hub-main {
        padding: 28px 20px 36px;
    }

    .service-card__header {
        padding: 16px 20px;
    }

    .service-card__body {
        padding: 16px 20px 18px;
    }

    .service-card__desc {
        line-height: 1.5;
    }

    .service-card__footer {
        margin-top: 14px;
        padding-top: 14px;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .hub-main {
        padding: 36px 20px 40px;
    }

    .hub-grid {
        gap: 20px;
    }
}

/* 세로 640px 이하 (세로): 가로형 카드 + 푸터 고정 */
@media (max-height: 640px) and (orientation: portrait) {
    .hub-header {
        height: 48px;
        padding: 0 16px;
    }

    .hub-header__title {
        font-size: 0.9375rem;
    }

    .hub-main {
        padding: 12px 16px 16px;
    }

    .hub-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .service-card {
        flex-direction: row;
        align-items: stretch;
        min-height: 0;
    }

    .service-card__header {
        flex: 0 0 120px;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 14px;
    }

    .service-card__header::after {
        display: none;
    }

    .service-card__icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .service-card__icon svg {
        width: 20px;
        height: 20px;
    }

    .service-card__header-label {
        font-size: 0.75rem;
    }

    .service-card__body {
        padding: 12px 14px;
        min-width: 0;
    }

    .service-card__title {
        margin: 0 0 4px;
        font-size: 0.9375rem;
    }

    .service-card__desc {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .service-card__footer {
        margin-top: 8px;
        padding-top: 8px;
    }

    .service-card__link {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .hub-footer {
        padding: 8px 16px max(12px, calc(8px + env(safe-area-inset-bottom)));
        font-size: 0.75rem;
    }

    .service-card:hover {
        transform: none;
    }
}

@media (max-height: 700px) and (orientation: landscape) {
    .hub-header {
        height: 48px;
        padding: 0 20px;
    }

    .hub-main {
        padding: 12px 16px 16px;
    }

    .hub-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .service-card {
        flex-direction: column;
    }

    .service-card__header {
        flex: none;
        flex-direction: row;
        align-items: center;
        padding: 12px 14px;
    }

    .service-card__header::after {
        display: none;
    }

    .service-card__icon {
        width: 36px;
        height: 36px;
    }

    .service-card__body {
        padding: 12px 14px;
    }

    .service-card__title {
        margin-bottom: 4px;
        font-size: 1rem;
    }

    .service-card__desc {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .service-card__footer {
        margin-top: 8px;
        padding-top: 8px;
    }
}

/* 세로 640px 이하 (가로): 더 강하게 압축 */
@media (max-height: 640px) and (orientation: landscape) {
    .hub-header {
        height: 44px;
        padding: 0 16px;
    }

    .hub-header__title {
        font-size: 0.875rem;
    }

    .hub-main {
        padding: 10px 14px 12px;
    }

    .hub-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .service-card__header {
        padding: 10px 12px;
        gap: 10px;
    }

    .service-card__icon {
        width: 32px;
        height: 32px;
    }

    .service-card__icon svg {
        width: 18px;
        height: 18px;
    }

    .service-card__header-label {
        font-size: 0.6875rem;
    }

    .service-card__body {
        padding: 10px 12px 12px;
    }

    .service-card__title {
        margin: 0 0 4px;
        font-size: 0.875rem;
    }

    .service-card__desc {
        -webkit-line-clamp: 2;
        line-clamp: 2;
        font-size: 0.6875rem;
        line-height: 1.35;
    }

    .service-card__footer {
        margin-top: 8px;
        padding-top: 8px;
    }

    .service-card__link {
        padding: 5px 10px;
        font-size: 0.6875rem;
    }

    .hub-footer {
        padding: 6px 12px max(10px, calc(6px + env(safe-area-inset-bottom)));
        font-size: 0.6875rem;
    }

    .service-card:hover {
        transform: none;
    }
}

@media (max-width: 600px) {
    .hub-header {
        padding: 0 16px;
        height: 56px;
    }

    .hub-main {
        padding: 24px 16px 32px;
    }

    .hub-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* 좁고 짧은 세로: 세로 카드로 복원 */
@media (max-width: 600px) and (max-height: 640px) and (orientation: portrait) {
    .hub-header {
        height: 48px;
    }

    .hub-main {
        padding: 12px 12px 16px;
    }

    .service-card {
        flex-direction: column;
    }

    .service-card__header {
        flex: none;
        flex-direction: row;
        align-items: center;
        width: 100%;
        padding: 12px 14px;
    }
}

