:root {
    --bg-primary:       #0f172a;
    --bg-secondary:     #1e293b;
    --bg-card:          #1e293b;
    --accent:           #38bdf8;
    --accent-hover:     #7dd3fc;
    --text-primary:     #f8fafc;
    --text-secondary:   #94a3b8;
    --text-muted:       #475569;
    --border:           #334155;
    --border-accent:    #38bdf8;
    --font-main:        'Inter', 'Segoe UI', sans-serif;
    --font-mono:        'Fira Code', 'Courier New', monospace;
    --radius-sm:        6px;
    --radius-md:        12px;
    --radius-lg:        20px;
    --transition:       all 0.3s ease;
    --shadow:           0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-accent:    0 4px 24px rgba(56, 189, 248, 0.15);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

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

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ── Section Layout ── */
section {
    padding: 100px 0;
}

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

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 10px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 56px;
    margin-top: 8px;
}

/* ── Buttons ── */
.btn-primary-custom {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    letter-spacing: 0.3px;
}

.btn-primary-custom:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: var(--shadow-accent);
}

.btn-outline-custom {
    background: transparent;
    color: var(--text-primary);
    padding: 12px 32px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
}

.btn-outline-custom:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ── Selection ── */
::selection {
    background: rgba(56, 189, 248, 0.25);
    color: var(--text-primary);
}

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in-up-delay-1 { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; animation-name: fadeInUp; animation-duration: 0.6s; }
.fade-in-up-delay-2 { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; animation-name: fadeInUp; animation-duration: 0.6s; }
.fade-in-up-delay-3 { animation-delay: 0.3s; opacity: 0; animation-fill-mode: forwards; animation-name: fadeInUp; animation-duration: 0.6s; }

/* ── Utilities ── */
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.bg-card       { background: var(--bg-card); }
.border-subtle { border: 1px solid var(--border); }

/* ── Responsive ── */
@media (max-width: 768px) {
    section { padding: 72px 0; }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

/* ── Layout stretch ── */
main {
    flex: 1;
}

footer {
    margin-top: auto;
}

/* ── Fix whitespace ── */
.navbar + div,
.navbar + main,
nav + div {
    margin-top: 0;
    padding-top: 0;
}

body > div {
    margin: 0;
    padding: 0;
}

/* ── Back to Top ── */
#backToTop {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
    opacity: 0;
    transform: translateY(16px);
    transition: var(--transition);
    pointer-events: none;
    z-index: 999;
}

#backToTop.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#backToTop:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
}

