:root {
    color-scheme: light;
    --page-bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --surface-strong: #e2e8f0;
    --text: #0f172a;
    --muted: #475569;
    --border: #e2e8f0;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: rgba(79, 70, 229, 0.08);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --header-bg: #ffffff;
}

html.dark-theme {
    color-scheme: dark;
    --page-bg: #0f172a;
    --surface: #1e293b;
    --surface-soft: #334155;
    --surface-strong: #475569;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #334155;
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-soft: rgba(129, 140, 248, 0.15);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --header-bg: #1e293b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--page-bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

/* Floating Controls */
.floating-controls {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 100;
}

.theme-toggle,
.back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.theme-toggle {
    position: relative;
    background: var(--header-bg);
    color: var(--text);
    border: 1px solid var(--border);
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--surface-soft);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.theme-toggle__icon {
    position: absolute;
    width: 1.15rem;
    height: 1.15rem;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.theme-toggle__icon--sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

.theme-toggle__icon--moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

html.dark-theme .theme-toggle__icon--sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

html.dark-theme .theme-toggle__icon--moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.back-to-top {
    background: var(--accent);
    color: #ffffff;
    border: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.9);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.back-to-top svg {
    width: 1.2rem;
    height: 1.2rem;
}