/* =========================================================
   Ai PANTHIYA - GLOBAL DESIGN SYSTEM
   ========================================================= */

:root {
    /* Image-derived palette, organized by interface role. */
    color-scheme: dark;
    --color-background: #010314;
    --color-surface-dark: #040f2e;
    --color-surface-alt: #040f2e;
    --color-reading: #0f1737;
    --color-surface: #101c43;
    --color-surface-raised: #14264d;
    --color-selected: #0e3062;
    --color-purple-surface: #271742;
    --color-text: #eef4f6;
    --color-text-muted: #aebbd0;
    --color-primary: #3aadfb;
    --color-primary-hover: #75c7ff;
    --color-on-primary: #010314;
    --color-accent: #3aadfb;
    --color-blue: #105fa6;
    --color-magenta: #bc0ea5;
    --color-magenta-hover: #951085;
    --color-lavender: #c2b9f2;
    --color-gold: #e5bf68;
    --color-success: #67c1af;
    --color-success-surface: #102e34;
    --color-error: #d56c71;
    --color-error-surface: #301d35;
    --color-border: #2c4166;
    --color-control-border: #607da5;

    /* Compatibility aliases for older content and diagram markup. */
    --color-yellow: var(--color-primary);
    --color-red: var(--color-error);
    --color-maroon: var(--color-primary);
    --color-charcoal: var(--color-surface-dark);
    --color-black: var(--color-on-primary);
    --color-ash-dark: var(--color-surface-raised);
    --color-ash: var(--color-text-muted);
    --color-ash-light: var(--color-border);
    --color-ash-soft: var(--color-surface-alt);
    --color-ivory: var(--color-reading);
    --color-white: var(--color-text);
    --color-dark: var(--color-surface-dark);
    --color-yellow-dark: var(--color-primary);

    /* Typography */
    --font-heading: "Inter", "Segoe UI", Arial, sans-serif;
    --font-body: "Inter", "Segoe UI", Arial, sans-serif;

    /* Layout */
    --container-width: 1200px;
    --container-padding: 24px;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 5rem;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    /* Shadow */
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 12px 35px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition: 180ms ease;
}

/* Reset */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
}

main:focus {
    outline: none;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

a,
button {
    -webkit-tap-highlight-color: rgba(58, 173, 251, 0.24);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    font-family: var(--font-heading);
    line-height: 1.15;
}

p {
    margin-top: 0;
}

.container {
    width: min(calc(100% - (var(--container-padding) * 2)),
            var(--container-width));
    margin-inline: auto;
}

.section {
    padding-block: var(--space-3xl);
}

.section--dark {
    background: var(--color-surface-dark);
    color: var(--color-text);
}

.section--ash {
    background: var(--color-surface-alt);
}

.section-heading {
    max-width: 760px;
    margin-bottom: var(--space-2xl);
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-label::before {
    width: 24px;
    height: 3px;
    background: var(--color-primary);
    content: "";
}

.section-title {
    margin-bottom: var(--space-md);
    font-size: clamp(2rem, 4vw, 3.5rem);
}

.section-description {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.section--dark .section-description {
    color: var(--color-text-muted);
}

.section--dark .section-label {
    color: var(--color-primary);
}

/* Accessibility */

.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    z-index: 9999;
    padding: 12px 18px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 800;
}

.skip-link:focus {
    top: 20px;
}

:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
