/* ============================================
   BASE — Reset, biến CSS, typography chung
   Palette bám sát Capella Space
   ============================================ */

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

:root {
    /* Color palette — Capella-style dark */
    --color-bg: #05070B;
    --color-bg-elevated: #0B0E14;
    --color-bg-soft: #10141C;
    --color-surface: rgba(255, 255, 255, 0.04);
    --color-surface-strong: rgba(255, 255, 255, 0.08);
    --color-border: rgba(255, 255, 255, 0.10);
    --color-border-strong: rgba(255, 255, 255, 0.18);
    --color-text: #FFFFFF;
    --color-text-soft: rgba(255, 255, 255, 0.78);
    --color-text-muted: rgba(255, 255, 255, 0.55);
    --color-text-dim: rgba(255, 255, 255, 0.35);

    /* Accent cam Capella */
    --color-accent: #F04E23;
    --color-accent-hover: #FF6B3D;
    --color-accent-soft: rgba(240, 78, 35, 0.12);
    --color-accent-glow: rgba(240, 78, 35, 0.35);

    /* Typography */
    --font-display: "Inter", "Be Vietnam Pro", system-ui, sans-serif;
    --font-body: "Be Vietnam Pro", "Inter", system-ui, -apple-system, sans-serif;

    /* Spacing & layout */
    --container: 1320px;
    --container-narrow: 1080px;
    --gutter: clamp(20px, 4vw, 48px);
    --section-py: clamp(80px, 10vw, 160px);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 16px;
    --nav-height: 100px; /* floating nav + margin */

    /* Shadows */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(240, 78, 35, 0.25);

    /* Eases */
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
}

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

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: var(--nav-height);
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s var(--ease-out-quart);
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input,
textarea,
select {
    font: inherit;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

/* Utility */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.container-narrow {
    width: 100%;
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    color: var(--color-text-muted);
    font-size: 14px;
    letter-spacing: 0.04em;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Fade-in transition giữa các trang */
.page-fade {
    animation: pageFade 0.4s var(--ease-out-quart);
}

@keyframes pageFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
