:root {
    --primary: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #1e40af;
    --accent: #3b82f6;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-hover: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 12px;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto Light', 'Helvetica Neue Light', Arial, sans-serif;
    --font-weight-thin: 100;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-light: #93c5fd;
    --secondary: #60a5fa;
    --accent: #2563eb;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-hover: 0 2px 8px rgba(0,0,0,0.4);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    font-weight: var(--font-weight-light);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* === HEADER === */
header {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 72px;
    height: 72px;
}

h1 {
    font-size: 2.25rem;
    font-weight: var(--font-weight-thin);
    letter-spacing: -0.02em;
    color: var(--primary);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: var(--font-weight-light);
}

/* === THEME TOGGLE === */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: border-color 0.25s ease;
}

.theme-toggle:hover {
    border-color: var(--primary-light);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* === GRID === */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

/* === CARD === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card:hover {
    transform: translateY(2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.card:active {
    transform: translateY(1px);
}

.card-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    pointer-events: none;
}

.card-icon::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: none;
}

.card-icon svg {
    width: 36px;
    height: 36px;
    position: relative;
    z-index: 1;
}

.card h2 {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: var(--font-weight-normal);
    letter-spacing: -0.01em;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: var(--font-weight-light);
    flex-grow: 1;
}

.card-link {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: var(--font-weight-medium);
    margin-top: auto;
}

/* === PROTECTED CARDS === */
.card.protected {
    border-left: 2px solid var(--primary-light);
}

.card.protected .card-link {
    color: var(--text-muted);
}

/* === FOOTER === */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: var(--font-weight-light);
}

.footer-nav {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: var(--font-weight-light);
    transition: color 0.25s ease;
}

.footer-nav a:hover {
    color: var(--primary);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container { padding: 2rem 1rem; }
    h1 { font-size: 1.75rem; }
    .logo { width: 56px; height: 56px; }
    .grid { grid-template-columns: 1fr; }
    .theme-toggle { position: relative; margin-bottom: 1rem; }
}

/* === PRINT === */
@media print {
    .theme-toggle { display: none; }
    .card { break-inside: avoid; }
    body { background: white; color: black; }
}