/* ==========================================================================
   Tune It! Interactive Challenge & Simulation Lab — Core Design Tokens & Base
   ========================================================================== */

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../../3d_games/assets/fonts/cairo-arabic-400-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../../../3d_games/assets/fonts/cairo-arabic-700-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../../../3d_games/assets/fonts/cairo-arabic-800-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../../3d_games/assets/fonts/cairo-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../../../3d_games/assets/fonts/cairo-latin-700-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../../../3d_games/assets/fonts/cairo-latin-800-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

:root {
    --ti-bg-canvas: #070e1b;
    --ti-bg-graphite: #0d1524;
    --ti-bg-surface: #131f33;
    --ti-bg-surface-2: #182740;
    --ti-bg-glass: rgba(13, 21, 36, 0.84);
    --ti-bg-card: rgba(19, 31, 51, 0.88);
    --ti-bg-input: #0b1322;

    --ti-amber: #f59e0b;
    --ti-gold: #fbbf24;
    --ti-amber-soft: rgba(245, 158, 11, 0.14);
    --ti-cyan: #22d3ee;
    --ti-cyan-soft: rgba(34, 211, 238, 0.14);
    --ti-emerald: #10b981;
    --ti-emerald-soft: rgba(16, 185, 129, 0.14);
    --ti-rose: #f43f5e;
    --ti-rose-soft: rgba(244, 63, 94, 0.14);
    --ti-violet: #a78bfa;
    --ti-violet-soft: rgba(167, 139, 250, 0.14);

    --ti-grad-amber: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --ti-grad-lab: linear-gradient(135deg, #f59e0b 0%, #22d3ee 100%);
    --ti-grad-hero: radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.14), transparent 48%),
                    radial-gradient(circle at 82% 28%, rgba(34, 211, 238, 0.12), transparent 50%),
                    linear-gradient(180deg, #070e1b 0%, #0b1526 100%);

    --ti-text-primary: #f8fafc;
    --ti-text-secondary: #cbd5e1;
    --ti-text-muted: #94a3b8;
    --ti-text-on-amber: #070e1b;

    --ti-border: rgba(148, 163, 184, 0.18);
    --ti-border-strong: rgba(245, 158, 11, 0.42);
    --ti-shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.28);
    --ti-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.42);
    --ti-shadow-glow: 0 0 28px rgba(245, 158, 11, 0.18);

    --ti-font-sans: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    --ti-radius-sm: 10px;
    --ti-radius-md: 16px;
    --ti-radius-lg: 22px;
    --ti-radius-pill: 999px;
    --ti-container-max: 1280px;
    --ti-header-h: 72px;
    --ti-transition: 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
    --ti-bg-canvas: #f1f5f9;
    --ti-bg-graphite: #e2e8f0;
    --ti-bg-surface: #ffffff;
    --ti-bg-surface-2: #f8fafc;
    --ti-bg-glass: rgba(255, 255, 255, 0.92);
    --ti-bg-card: #ffffff;
    --ti-bg-input: #f1f5f9;
    --ti-grad-hero: radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.12), transparent 48%),
                    radial-gradient(circle at 82% 28%, rgba(14, 165, 233, 0.1), transparent 50%),
                    linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);

    --ti-text-primary: #0f172a;
    --ti-text-secondary: #334155;
    --ti-text-muted: #64748b;
    --ti-text-on-amber: #070e1b;

    --ti-border: rgba(15, 23, 42, 0.12);
    --ti-border-strong: rgba(217, 119, 6, 0.45);
    --ti-shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
    --ti-shadow-md: 0 12px 28px rgba(15, 23, 42, 0.09);
    --ti-shadow-glow: 0 8px 24px rgba(245, 158, 11, 0.16);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--ti-font-sans);
    background: var(--ti-bg-canvas);
    color: var(--ti-text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img, svg {
    display: block;
    max-width: 100%;
}

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

button, input, select, textarea {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid var(--ti-amber);
    outline-offset: 2px;
}

.ti-skip-link {
    position: absolute;
    top: -60px;
    right: 16px;
    background: var(--ti-amber);
    color: var(--ti-text-on-amber);
    padding: 10px 16px;
    border-radius: var(--ti-radius-sm);
    font-weight: 800;
    z-index: 200;
}
.ti-skip-link:focus {
    top: 12px;
}

.ti-container {
    width: 100%;
    max-width: var(--ti-container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.ti-tabular {
    font-variant-numeric: tabular-nums;
}

/* Header */
.ti-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: var(--ti-header-h);
    height: auto;
    padding: 8px 0;
    background: var(--ti-bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ti-border);
    transition: box-shadow var(--ti-transition);
}

.ti-header.is-scrolled {
    box-shadow: var(--ti-shadow-sm);
}

.ti-header__inner {
    min-height: calc(var(--ti-header-h) - 16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ti-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    min-width: 0;
}

.ti-brand__logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.ti-brand__title {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.ti-brand__name {
    font-size: 1.15rem;
    color: var(--ti-text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.ti-brand__name span {
    color: var(--ti-amber);
}

.ti-brand__sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ti-text-muted);
}

.ti-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ti-nav__link {
    padding: 8px 14px;
    border-radius: var(--ti-radius-pill);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ti-text-secondary);
    transition: background var(--ti-transition), color var(--ti-transition);
}

.ti-nav__link:hover,
.ti-nav__link.is-active {
    background: var(--ti-amber-soft);
    color: var(--ti-gold);
}

[data-theme="light"] .ti-nav__link:hover,
[data-theme="light"] .ti-nav__link.is-active {
    color: #b45309;
}

.ti-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ti-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--ti-radius-sm);
    border: 1px solid var(--ti-border);
    background: var(--ti-bg-surface);
    color: var(--ti-text-primary);
    cursor: pointer;
}

/* Sections & Headings */
.ti-section {
    padding: 64px 0;
}

.ti-section--alt {
    background: var(--ti-bg-graphite);
    border-top: 1px solid var(--ti-border);
    border-bottom: 1px solid var(--ti-border);
}

.ti-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.ti-section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--ti-amber);
    margin-bottom: 6px;
}

.ti-section-title {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2.15rem);
    font-weight: 800;
    line-height: 1.25;
}

.ti-section-sub {
    margin: 6px 0 0;
    color: var(--ti-text-muted);
    max-width: 660px;
}

/* Hero Section */
.ti-hero {
    position: relative;
    background: var(--ti-grad-hero);
    padding: 64px 0 56px;
    border-bottom: 1px solid var(--ti-border);
    overflow: hidden;
}

.ti-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.ti-hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
    gap: 36px;
    align-items: center;
}

.ti-hero__slogan {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border-radius: var(--ti-radius-pill);
    background: var(--ti-amber-soft);
    border: 1px solid var(--ti-border-strong);
    color: var(--ti-gold);
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 18px;
}

[data-theme="light"] .ti-hero__slogan {
    color: #b45309;
}

.ti-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ti-amber);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
}

.ti-hero__title {
    margin: 0 0 16px;
    font-size: clamp(1.9rem, 3.8vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
}

.ti-text-gradient {
    background: var(--ti-grad-lab);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ti-hero__lead {
    margin: 0 0 12px;
    font-size: 1.08rem;
    color: var(--ti-text-secondary);
    max-width: 600px;
}

.ti-hero__tagline {
    margin: 0 0 26px;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ti-cyan);
}

[data-theme="light"] .ti-hero__tagline {
    color: #0284c7;
}

.ti-hero__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.ti-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ti-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--ti-radius-sm);
    background: var(--ti-bg-surface);
    border: 1px solid var(--ti-border);
    font-size: 0.85rem;
    color: var(--ti-text-muted);
}

.ti-stat-chip strong {
    color: var(--ti-text-primary);
    font-weight: 800;
}

/* Hero Interactive Mini-Lab */
.ti-minilab {
    background: var(--ti-bg-card);
    border: 1px solid var(--ti-border-strong);
    border-radius: var(--ti-radius-lg);
    padding: 24px;
    box-shadow: var(--ti-shadow-md), var(--ti-shadow-glow);
}

.ti-minilab__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ti-border);
}

.ti-minilab__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.ti-minilab__sliders {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.ti-minilab__result {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    background: var(--ti-bg-input);
    border: 1px solid var(--ti-border);
    border-radius: var(--ti-radius-md);
    padding: 14px;
}

.ti-minilab__metric {
    text-align: center;
}

.ti-minilab__metric span {
    display: block;
    font-size: 0.76rem;
    color: var(--ti-text-muted);
}

.ti-minilab__metric strong {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ti-gold);
}

[data-theme="light"] .ti-minilab__metric strong {
    color: #b45309;
}

/* How to Play 6 Steps */
.ti-steps-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.ti-step-card {
    background: var(--ti-bg-card);
    border: 1px solid var(--ti-border);
    border-radius: var(--ti-radius-md);
    padding: 18px 16px;
    position: relative;
}

.ti-step-card__num {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--ti-amber-soft);
    border: 1px solid var(--ti-border-strong);
    color: var(--ti-gold);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

[data-theme="light"] .ti-step-card__num {
    color: #b45309;
}

.ti-step-card h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 800;
}

.ti-step-card p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--ti-text-muted);
    line-height: 1.55;
}

/* Footer */
.ti-footer {
    border-top: 1px solid var(--ti-border);
    background: var(--ti-bg-graphite);
    padding: 36px 0;
}

.ti-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.ti-footer__links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--ti-text-muted);
}

.ti-footer__links a:hover {
    color: var(--ti-amber);
}
