:root {
    /* Apple-Style Color Palette */
    --primary-color: #0071e3;
    /* Apple Blue */
    --primary-dark: #0077ed;
    --accent-color: #0071e3;

    --bg-main: #f5f5f7;
    /* Apple Light Gray Background */
    --bg-card: rgba(255, 255, 255, 0.65);

    --text-primary: #1d1d1f;
    --text-secondary: #86868b;

    --border-color: rgba(0, 0, 0, 0.1);

    --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 8px;
}

[data-theme="dark"] {
    --primary-color: #2997ff;
    /* Apple Blue Dark Mode */
    --primary-dark: #409cff;

    --bg-main: #000000;
    --bg-card: rgba(30, 30, 30, 0.75);

    --text-primary: #f5f5f7;
    --text-secondary: #86868b;

    --border-color: rgba(255, 255, 255, 0.15);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Entry Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero,
.section {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    scroll-margin-top: 80px; /* Offset for fixed navbar */
}

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.4s ease;
}

[data-theme="dark"] .navbar {
    background: rgba(20, 20, 20, 0.7);
}

.nav-container {
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-size: 12px;
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 1;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.theme-toggle:hover {
    opacity: 1;
}

#themeText {
    display: none;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    text-align: center;
}

.hero h1 {
    font-size: 64px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.025em;
    /* Tighter tracking for large text */
    margin-bottom: 24px;
    background: linear-gradient(180deg, var(--text-primary) 0%, rgba(29, 29, 31, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--text-primary);
}

[data-theme="dark"] .hero h1 {
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.005em;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 48px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Buttons - Apple Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 980px;
    /* Fully rounded pill */
    font-size: 17px;
    font-weight: 400;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    font-weight: 400;
}

.btn-secondary:hover {
    text-decoration: underline;
}

/* Sections */
.section {
    padding: 20px 0;
}

.section h2 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.section-description {
    font-size: 21px;
    line-height: 1.4;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Bento Grid */
.feature-grid,
.model-characteristics,
.stats-grid,
.bento-grid-placeholder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

/* Cards - Frosted & Rounded */
/* Cards - Premium Frosted Glass */
.result-card,
.feature-card,
.char-card,
.stat-card,
.metrics-container,
.download-content,
.bento-card {
    background: var(--bg-card);
    backdrop-filter: saturate(180%) blur(25px);
    -webkit-backdrop-filter: saturate(180%) blur(25px);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.4);
    /* Luminous top border for light mode */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-container {
    padding: 20px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    background: transparent;
    box-shadow: none;
    border: none;
}

[data-theme="dark"] .result-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .bento-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-card:hover,
.char-card:hover,
.bento-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.feature-card h3,
.char-card h4,
.bento-card h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p,
.char-card p,
.bento-card p {
    font-size: 17px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Search Box */
.search-container {
    text-align: center;
    margin-bottom: 40px;
}

.search-box {
    margin: 0 auto;
    display: flex;
    gap: 12px;
    background: rgba(120, 120, 128, 0.08);
    /* Unified container background */
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.2);
    border-color: var(--primary-color);
}

[data-theme="dark"] .search-box:focus-within {
    background: #1c1c1e;
}

#searchInput {
    flex: 2;
    padding: 12px 16px;
    font-size: 17px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
}

.model-selector {
    flex: 0.8;
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 10px;
    border: none;
    background: transparent;
    /* Seamless integration */
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    border-right: 1px solid var(--border-color);
    /* Separator */
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2386868b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
}

#searchInput:focus {
    background: rgba(120, 120, 128, 0.18);
    border-color: var(--primary-color);
}

.search-btn {
    padding: 10px 24px;
    border-radius: 10px;
    background-color: var(--primary-color);
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.search-btn:active {
    transform: scale(0.96);
}

.search-status {
    margin-top: 16px;
    font-size: 15px;
    color: var(--text-secondary);
}

/* Results */
.prediction-item {
    margin-bottom: 16px;
    padding: 20px;
    background: rgba(120, 120, 128, 0.05);
    border-radius: 12px;
}

.prediction-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.prediction-proba {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Colors for prediction text */
.oral .prediction-proba {
    color: var(--primary-color);
}

.spotlight .prediction-proba {
    color: var(--warning);
}

.poster .prediction-proba {
    color: var(--success);
}

.reject .prediction-proba {
    color: var(--danger);
}

.prob-bar-container {
    background: rgba(120, 120, 128, 0.1);
    height: 6px;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.prob-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.prob-bar-fill.oral {
    background-color: var(--primary-color);
}

.prob-bar-fill.spotlight {
    background-color: var(--warning);
}

.prob-bar-fill.poster {
    background-color: var(--success);
}

.prob-bar-fill.reject {
    background-color: var(--danger);
}

/* Model Tabs - Segmented Control Style */
.model-tabs {
    display: inline-flex;
    background: rgba(120, 120, 128, 0.08);
    /* Segmented control bg */
    padding: 3px;
    border-radius: 9px;
    margin-bottom: 30px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.model-tab {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.model-tab.active {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #000;
}

[data-theme="dark"] .model-tab.active {
    background: #636366;
    color: #fff;
}

/* Stats */
.stat-value {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Bento Cards Specifics */
.bento-value {
    font-size: 42px;
    font-weight: 700;
    margin: 10px 0;
    color: var(--text-primary);
}

.bento-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
}

.bento-card.wide {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .bento-card.wide {
        grid-column: span 1;
    }
}

/* Footer */
.footer {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-main);
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}