/* ===========================================
   OOIN Web Hub — MZ Vibe Design System
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

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

:root {
    --purple: #7c3aed;
    --purple-light: #a78bfa;
    --purple-dark: #5b21b6;
    --pink: #ec4899;
    --pink-light: #f9a8d4;
    --grad: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    --grad-subtle: linear-gradient(135deg, #f5f3ff 0%, #fdf2f8 100%);
    --surface: #ffffff;
    --bg: #fafafa;
    --text: #111827;
    --text-sub: #6b7280;
    --border: #e5e7eb;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 4px 24px rgba(124,58,237,0.10);
    --shadow-lg: 0 12px 48px rgba(124,58,237,0.18);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
.hub-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(124,58,237,0.10);
    padding: 0 20px;
}
.hub-nav-inner {
    max-width: 960px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 60px;
}
.hub-nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.hub-nav-logo img { height: 30px; }
.hub-nav-logo span { font-weight: 900; font-size: 18px; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hub-nav-links { display: flex; align-items: center; gap: 16px; }
.hub-nav-links a { font-size: 14px; color: var(--text-sub); text-decoration: none; transition: color .2s; }
.hub-nav-links a:hover { color: var(--purple); }
.btn-download {
    background: var(--grad);
    color: #fff !important;
    font-weight: 700;
    font-size: 13px !important;
    padding: 8px 18px;
    border-radius: 100px;
    text-decoration: none;
    transition: opacity .2s, transform .15s;
    white-space: nowrap;
}
.btn-download:hover { opacity: .88; transform: translateY(-1px); }

/* ── HERO BAND ── */
.hub-hero {
    background: var(--grad);
    padding: 64px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hub-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(255,255,255,0.18) 0%, transparent 60%);
}
.hub-hero-emoji {
    font-size: 56px; margin-bottom: 16px;
    display: block;
    animation: float 3s ease-in-out infinite;
}
.hub-hero h1 {
    font-size: clamp(26px, 5vw, 42px);
    font-weight: 900;
    color: #fff;
    margin-bottom: 14px;
    position: relative;
}
.hub-hero p {
    font-size: 16px;
    color: rgba(255,255,255,0.85);
    max-width: 480px; margin: 0 auto 32px;
    position: relative;
}
.hub-hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 13px; font-weight: 600; color: #fff;
    margin-bottom: 20px;
    position: relative;
}

/* ── CONTAINER ── */
.hub-container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ── CATEGORY CHIPS ── */
.chip-row {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 24px 0 4px;
}
.chip {
    padding: 7px 16px;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    font-size: 13px; font-weight: 500;
    cursor: pointer; text-decoration: none;
    color: var(--text-sub);
    background: var(--surface);
    transition: all .18s;
    white-space: nowrap;
}
.chip:hover, .chip.active {
    border-color: var(--purple);
    color: var(--purple);
    background: #f5f3ff;
}
.chip.active {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
}

/* ── TOPIC GRID ── */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 28px 0 48px;
}
.topic-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    display: flex; flex-direction: column;
}
.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--purple-light);
}
.topic-card-img {
    aspect-ratio: 16/9;
    background: var(--grad-subtle);
    overflow: hidden;
    position: relative;
}
.topic-card-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s;
}
.topic-card:hover .topic-card-img img { transform: scale(1.06); }
.topic-card-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
}
.topic-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.topic-card-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.topic-card-sub {
    font-size: 13px; color: var(--text-sub); line-height: 1.5;
    flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.topic-card-tag {
    display: inline-block; margin-top: 10px;
    font-size: 11px; font-weight: 600; color: var(--purple);
    background: #f5f3ff; border-radius: 100px; padding: 3px 10px;
}

/* ── TOOL CARD (main CTA box) ── */
.tool-box {
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    padding: 40px 32px;
    text-align: center;
    max-width: 640px; margin: -40px auto 0;
    position: relative;
    box-shadow: var(--shadow-lg);
    transition: border-color .2s;
}

/* ── RESULT CARD ── */
.result-card {
    background: var(--grad-subtle);
    border-radius: var(--radius);
    border: 1.5px solid rgba(124,58,237,0.15);
    padding: 36px 28px;
    min-height: 180px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    margin-bottom: 24px;
    transition: all .3s;
}
.result-card.loading {
    opacity: .6;
}
.result-card-emoji { font-size: 48px; margin-bottom: 12px; }
.result-title {
    font-size: 22px; font-weight: 900;
    margin-bottom: 10px;
    background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.result-sub { font-size: 15px; color: var(--text-sub); line-height: 1.7; }
.result-placeholder { font-size: 15px; color: #9ca3af; }

/* ── BUTTONS ── */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--grad);
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    padding: 16px 40px;
    border-radius: 100px;
    border: none; cursor: pointer;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 20px rgba(124,58,237,0.35);
    width: 100%; max-width: 320px;
    text-decoration: none;
}
.btn-primary:hover { opacity: .9; transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124,58,237,0.40); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-sub);
    font-size: 14px; font-weight: 500;
    padding: 10px 20px;
    border-radius: 100px;
    cursor: pointer; text-decoration: none;
    transition: all .18s;
}
.btn-secondary:hover { border-color: var(--purple); color: var(--purple); background: #f5f3ff; }

.action-row {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
    margin-top: 16px;
}

/* ── TOPIC SHOW ── */
.topic-show-hero {
    background: var(--grad);
    padding: 48px 20px 96px;
    position: relative; overflow: hidden;
}
.topic-show-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.15) 0%, transparent 55%);
}
.topic-show-breadcrumb {
    font-size: 12px; color: rgba(255,255,255,0.7);
    margin-bottom: 16px; position: relative;
}
.topic-show-breadcrumb a { color: rgba(255,255,255,0.75); text-decoration: none; }
.topic-show-breadcrumb a:hover { color: #fff; }
.topic-show-title {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 900; color: #fff;
    position: relative; margin-bottom: 12px;
}
.topic-show-sub {
    font-size: 16px; color: rgba(255,255,255,0.85);
    position: relative; max-width: 560px;
}

.topic-show-content {
    max-width: 720px; margin: -56px auto 0;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.topic-show-img { width: 100%; aspect-ratio: 16/8; object-fit: cover; }
.topic-show-body { padding: 32px 36px 40px; }
.topic-show-desc {
    font-size: 16px; line-height: 1.9; color: #374151;
    margin-bottom: 32px;
    white-space: pre-wrap;
}
.topic-cta-box {
    background: var(--grad-subtle);
    border: 1.5px solid rgba(124,58,237,0.15);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
}
.topic-cta-box p { font-size: 14px; color: var(--text-sub); margin-bottom: 16px; }

/* ── RELATED ── */
.related-section { padding: 48px 0 64px; }
.section-label {
    font-size: 20px; font-weight: 800;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}

/* ── PAGINATION ── */
.hub-pagination { display: flex; justify-content: center; padding: 16px 0 48px; }
.hub-pagination nav { display: flex; gap: 6px; align-items: center; }
.hub-pagination .page-link,
.hub-pagination span {
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    border: 1.5px solid var(--border);
    color: var(--text-sub);
    text-decoration: none;
    background: var(--surface);
    transition: all .15s;
    cursor: pointer;
}
.hub-pagination .page-link:hover { border-color: var(--purple); color: var(--purple); }
.hub-pagination .active span, .hub-pagination [aria-current] span {
    background: var(--purple); color: #fff; border-color: var(--purple);
}

/* ── FOOTER ── */
.hub-footer {
    border-top: 1px solid var(--border);
    padding: 32px 20px;
    text-align: center;
    font-size: 13px; color: var(--text-sub);
}
.hub-footer a { color: var(--text-sub); text-decoration: none; }
.hub-footer a:hover { color: var(--purple); }

/* ── ANIMATIONS ── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
    0% { opacity: 0; transform: scale(.85); }
    70% { transform: scale(1.04); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fade-up { animation: fadeUp .45s ease both; }
.pop-in { animation: popIn .35s cubic-bezier(.34,1.56,.64,1) both; }

.tool-box { animation: fadeUp .4s ease .1s both; }

/* spinning emoji while loading */
.loading-spin { display: inline-block; animation: spin .7s linear infinite; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .hub-hero { padding: 48px 16px 64px; }
    .tool-box { margin: -32px 16px 0; padding: 28px 20px; }
    .topic-show-body { padding: 24px 20px 32px; }
    .topic-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .hub-nav-links a:not(.btn-download) { display: none; }
}
@media (max-width: 400px) {
    .topic-grid { grid-template-columns: 1fr; }
}


/* ── GUIDE HUB ── */
.guide-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s, border-color .2s;
    display: flex;
    flex-direction: column;
}
.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--purple-light);
}
.guide-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-sub);
}
.guide-meta-light { color: rgba(255,255,255,0.82); }
.guide-cta-link { color: var(--purple); font-weight: 700; }
.guide-show-hero {
    background: var(--grad);
    background-size: cover;
    background-position: center;
    padding: 48px 20px 88px;
    position: relative;
    overflow: hidden;
}
.guide-show-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.14) 0%, transparent 55%);
}
.guide-hero-card {
    position: relative;
    max-width: 720px;
}
.guide-show-content {
    max-width: 760px;
    margin: -56px auto 0;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.guide-show-cover { width: 100%; aspect-ratio: 16/8; object-fit: cover; }
.guide-show-body { padding: 32px 36px 40px; }
.guide-download-cta { margin-top: 32px; }
.guide-prose { font-size:16px; line-height:1.9; color:#374151; white-space: pre-wrap; }
.guide-prose h2 { font-size:22px; font-weight:800; margin: 32px 0 12px; }
.guide-prose h3 { font-size:18px; font-weight:700; margin: 24px 0 8px; }
.guide-prose p { margin-bottom:16px; }
.guide-prose ul, .guide-prose ol { padding-left:24px; margin-bottom:16px; }
.guide-prose li { margin-bottom:6px; }
.guide-prose strong { font-weight:700; }
.guide-prose a { color:var(--purple); }
.guide-prose hr { border:none; border-top:1px solid var(--border); margin:32px 0; }
@media (max-width: 640px) {
    .guide-show-body { padding: 24px 20px 32px; }
    .guide-meta { align-items: flex-start; flex-direction: column; }
}
