@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- Light Mode (Default Crisp, Clean & Modern) --- */
:root,
[data-theme="light"] {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Outfit', 'Inter', -apple-system, sans-serif;

    --bg-page: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-elevated: #ffffff;
    --bg-blob-1: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0) 70%);
    --bg-blob-2: radial-gradient(circle, rgba(14, 165, 233, 0.14) 0%, rgba(14, 165, 233, 0) 70%);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --border-color: #e2e8f0;
    --border-hover: rgba(99, 102, 241, 0.4);

    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;

    --hero-title-gradient: linear-gradient(135deg, #0f172a 0%, #4338ca 100%);
    --badge-bg: #eef2ff;
    --badge-border: #c7d2fe;
    --badge-text: #4f46e5;

    --btn-secondary-bg: #ffffff;
    --btn-secondary-border: #e2e8f0;
    --btn-secondary-hover-bg: #f1f5f9;
    --btn-secondary-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

    --theme-btn-bg: #ffffff;
    --theme-btn-border: #e2e8f0;
    --theme-btn-color: #475569;
    --theme-btn-hover-bg: #f1f5f9;

    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --card-shadow-hover: 0 20px 30px -10px rgba(99, 102, 241, 0.15), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
    --card-spotlight: rgba(99, 102, 241, 0.05);

    --core-icon-bg: #eef2ff;
    --core-icon-border: #c7d2fe;
    --core-icon-color: #4f46e5;

    --supplier-icon-bg: #e0f2fe;
    --supplier-icon-border: #bae6fd;
    --supplier-icon-color: #0284c7;

    --logo-filter: brightness(0);

    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;
}

/* --- Dark Mode (Sleek, Glowing & Immersive) --- */
[data-theme="dark"] {
    --bg-page: #0f172a;
    --bg-surface: rgba(30, 41, 59, 0.5);
    --bg-surface-elevated: rgba(30, 41, 59, 0.85);
    --bg-blob-1: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, rgba(99, 102, 241, 0) 70%);
    --bg-blob-2: radial-gradient(circle, rgba(14, 165, 233, 0.4) 0%, rgba(14, 165, 233, 0) 70%);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(99, 102, 241, 0.5);

    --primary: #818cf8;
    --primary-light: #a5b4fc;
    --primary-dark: #6366f1;

    --hero-title-gradient: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    --badge-bg: rgba(99, 102, 241, 0.15);
    --badge-border: rgba(99, 102, 241, 0.3);
    --badge-text: #a5b4fc;

    --btn-secondary-bg: rgba(255, 255, 255, 0.05);
    --btn-secondary-border: rgba(255, 255, 255, 0.1);
    --btn-secondary-hover-bg: rgba(255, 255, 255, 0.1);
    --btn-secondary-shadow: none;

    --theme-btn-bg: rgba(255, 255, 255, 0.05);
    --theme-btn-border: rgba(255, 255, 255, 0.1);
    --theme-btn-color: #f8fafc;
    --theme-btn-hover-bg: rgba(255, 255, 255, 0.1);

    --card-shadow: 0 0 30px rgba(99, 102, 241, 0.12);
    --card-shadow-hover: 0 0 40px rgba(99, 102, 241, 0.3);
    --card-spotlight: rgba(255, 255, 255, 0.06);

    --core-icon-bg: linear-gradient(135deg, rgba(99,102,241,0.2) 0%, rgba(79,70,229,0.2) 100%);
    --core-icon-border: rgba(99, 102, 241, 0.3);
    --core-icon-color: #818cf8;

    --supplier-icon-bg: linear-gradient(135deg, rgba(14,165,233,0.2) 0%, rgba(2,132,199,0.2) 100%);
    --supplier-icon-border: rgba(14, 165, 233, 0.3);
    --supplier-icon-color: #38bdf8;

    --logo-filter: none;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Effects */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out alternate;
    transition: background 0.4s ease;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: var(--bg-blob-1);
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 800px;
    height: 800px;
    background: var(--bg-blob-2);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Header */
.site-header {
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.brand-logo {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.brand-logo-img svg,
.brand-logo-img img {
    height: 38px;
    width: auto;
    display: block;
    filter: var(--logo-filter);
    transition: filter 0.3s ease;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-btn-bg);
    border: 1px solid var(--theme-btn-border);
    color: var(--theme-btn-color);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: var(--btn-secondary-shadow);
}

.theme-toggle-btn:hover {
    background: var(--theme-btn-hover-bg);
    transform: translateY(-1px);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover svg {
    transform: rotate(15deg);
}

/* Toggle icon display based on data-theme */
[data-theme="dark"] .theme-toggle-btn .dark-icon {
    display: none;
}
[data-theme="dark"] .theme-toggle-btn .light-icon {
    display: block;
}

[data-theme="light"] .theme-toggle-btn .dark-icon,
:root:not([data-theme="dark"]) .theme-toggle-btn .dark-icon {
    display: block;
}
[data-theme="light"] .theme-toggle-btn .light-icon,
:root:not([data-theme="dark"]) .theme-toggle-btn .light-icon {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: var(--font-sans);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--btn-secondary-border);
    box-shadow: var(--btn-secondary-shadow);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover-bg);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.hero {
    text-align: center;
    max-width: 800px;
    margin-bottom: 4rem;
}

.badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--badge-text);
    background: var(--badge-bg);
    border: 1px solid var(--badge-border);
    border-radius: var(--radius-full);
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: var(--hero-title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Portal Cards */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1100px;
    width: 100%;
}

.portal-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: 3rem;
    text-decoration: none;
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--card-spotlight), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.portal-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--card-shadow-hover);
    background: var(--bg-surface-elevated);
}

.portal-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.card-icon.core {
    background: var(--core-icon-bg);
    color: var(--core-icon-color);
    border: 1px solid var(--core-icon-border);
}

.card-icon.supplier {
    background: var(--supplier-icon-bg);
    color: var(--supplier-icon-color);
    border: 1px solid var(--supplier-icon-border);
}

.card-icon svg {
    width: 32px;
    height: 32px;
}

.card-content {
    position: relative;
    z-index: 2;
    flex: 1;
}

.card-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.card-link-text {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s ease;
}

.portal-card:hover .card-link-text {
    gap: 0.75rem;
}

.card-link-text.core { color: var(--core-icon-color); }
.card-link-text.supplier { color: var(--supplier-icon-color); }

.card-link-text svg {
    transition: transform 0.2s ease;
}

.portal-card:hover .card-link-text svg {
    transform: translateX(4px);
}

/* Footer */
.site-footer {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    position: relative;
    z-index: 10;
}

/* Responsive */
@media (max-width: 900px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 3.5rem;
    }
}
@media (max-width: 600px) {
    .site-header {
        padding: 1.5rem;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .portal-card {
        padding: 2rem;
    }
}
