@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Noto+Serif+SC:wght@500;700&display=swap');

:root {
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --accent-color: #8b5cf6;
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --card-bg: #ffffff;
    --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Noto Serif SC', serif;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.01);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --gradient-text: linear-gradient(to right, #60a5fa, #c084fc);
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 600; }

/* Hero Section - Modern & Clean */
.hero-section {
    position: relative;
    padding: 4rem 0 4rem;
    background-color: #0f172a; /* Fallback */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    color: #fff;
    margin-bottom: 4rem;
    overflow: hidden;
    text-align: center;
}

/* Grid Pattern Overlay */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* Abstract Moving Glow */
.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-section p {
    color: #94a3b8;
    font-size: 1.25rem;
    font-weight: 400;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
}

.hero-section .bi {
    color: #8b5cf6;
    vertical-align: middle;
}

/* Cards - Modern Glass-ish feel */
.card {
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(59, 130, 246, 0.3);
}

.card-img-wrapper {
    overflow: hidden;
    height: 220px;
    position: relative;
    background: #f1f5f9;
}

.card-img-top {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-body {
    padding: 2rem;
}

.card-title {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Link wrapper */
.card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* Footer */
footer {
    margin-top: 8rem;
    padding: 4rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background-color: #fff;
    border-top: 1px solid #e2e8f0;
}

/* MBTI Info Section */
.dimension-card {
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    height: 100%;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e2e8f0;
}

.dimension-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.dim-pair {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.dim-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* 16 Types Section */
.type-group-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e2e8f0;
    border-top: 4px solid transparent; 
    transition: transform 0.3s;
}

.type-group-card:hover {
    transform: translateY(-5px);
}

.group-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.type-item:last-child {
    border-bottom: none;
}

.type-code {
    font-family: monospace; /* Monospace fits type codes well */
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.type-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Group Colors */
.group-analysts { border-color: #818cf8; }
.group-analysts .group-title { color: #4f46e5; }

.group-diplomats { border-color: #34d399; }
.group-diplomats .group-title { color: #059669; }

.group-sentinels { border-color: #60a5fa; }
.group-sentinels .group-title { color: #2563eb; }

.group-explorers { border-color: #fca5a5; }
.group-explorers .group-title { color: #e11d48; }

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-entrance {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    padding-left: 70px;
}

.timeline-marker {
    position: absolute;
    left: 11px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    z-index: 1;
}

.timeline-year {
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: inline-block;
    font-family: var(--font-heading);
}

.timeline-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.timeline-desc {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Article Typography */
.article-typography {
    font-family: var(--font-serif); /* Keep serif for long reading text */
    font-size: 1.15rem;
    line-height: 1.9;
    color: #334155;
}

.article-typography h3 {
    font-family: var(--font-heading);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.article-typography h4 {
    font-family: var(--font-heading);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: var(--accent-color);
}

.article-typography p {
    margin-bottom: 1.5rem;
}

.article-typography ul, .article-typography ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-typography li {
    margin-bottom: 0.5rem;
}

/* Markdown Specifics */
.article-typography blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-typography pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
}

.article-typography code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    padding: 0.2rem 0.4rem;
    background: #f1f5f9;
    border-radius: 4px;
    color: #e11d48;
}

.article-typography pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.article-typography table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.article-typography th, .article-typography td {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
}

.article-typography th {
    background: #f8fafc;
    font-weight: 600;
}

.article-typography img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    display: block;
}

/* Media Queries */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section {
        padding: 5rem 0 4rem;
    }
}
