:root {
    --bg-color: #f7f7f7;
    --text-color: #222;
    --card-bg: #fff;
    --card-border: #e0e0e0;
    --link-color: #0077cc;
    --accent: #0077cc;
    --button-bg: #0077cc;
    --button-text: #fff;
    /* semantic variables used in rest of stylesheet */
    --bg-0: #ffffff;
    --bg-1: #f6f8fb;
    --card: #ffffff;
    --card-border-color: rgba(11,61,145,0.06);
    --text: #071133;
    --muted: #556574;
    --accent-2: #2b6fb3;
    --page-border: rgba(11,61,145,0.14);
    --shadow: 0 8px 26px rgba(11,61,145,0.08);
    --radius-lg: 12px;
}

html.dark-mode {
    --bg-color: #181a20;
    --text-color: #e0e0e0;
    --card-bg: #23262f;
    --card-border: #33374a;
    --link-color: #6ec1e4;
    --accent: #6ec1e4;
    --button-bg: #23262f;
    --button-text: #e0e0e0;
    /* dark equivalents for semantic vars */
    --bg-0: #121216;
    --bg-1: #16171b;
    --card: #23262f;
    --card-border-color: rgba(255,255,255,0.04);
    --text: #e6e6e9;
    --muted: #a9b0bf;
    --accent-2: #84c9f1;
    --page-border: rgba(255,255,255,0.03);
    --shadow: 0 8px 26px rgba(0,0,0,0.5);
    --radius-lg: 12px;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    background: var(--card-bg, #fff);
    color: var(--text-color, #222);
    border: 1px solid var(--card-border, #e0e0e0);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: background 0.2s, color 0.2s;
}

html.dark-mode .dark-mode-toggle {
    background: var(--card-bg, #23262f);
    color: var(--text-color, #e0e0e0);
    border: 1px solid var(--card-border, #33374a);
}
/* (light theme semantic variables already defined above) */

/* Reset & base */
* { box-sizing: border-box; }
html,body { height: 100%; }
body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg-color, #f7f7f7);
    color: var(--text-color, #222);
    min-height: 100vh;
    padding: 0;
    transition: background 0.3s, color 0.3s;
    -moz-osx-font-smoothing:grayscale;
}

.container {
    /* centers the page and constrains width */
    max-width: 900px;
    margin: 36px auto;
    padding: 28px 36px;
    background: var(--card, #ffffff);
    border: 1px solid var(--card-border, rgba(0,0,0,0.06));
    color: var(--text, #071133);
    box-shadow: var(--shadow, 0 8px 26px rgba(11,61,145,0.08));
    border-radius: var(--radius-lg, 12px);
}

.brand {
    display: flex;
    gap: 16px;
    align-items: center;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 120px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 30px rgba(11,61,145,0.12);
}

.avatar[src] { /* image inside avatar */
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

header h1 {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text);
    font-weight: 700;
}

.subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 400;
}

/* Section headings */
h2 {
    font-size: 1.25rem;
    margin: 0 0 18px 0;
    color: var(--accent);
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(11,61,145,0.06);
    font-weight: 600;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
    background-image: linear-gradient(90deg, rgba(11,61,145,0.08), rgba(43,111,179,0.06));
    background-repeat: no-repeat;
    background-size: 100% 0.12em;
    background-position: 0 100%;
    transition: background-size 180ms ease, color 120ms ease;
}

a:hover,
a:focus {
    color: var(--accent-2);
    outline: none;
    background-size: 100% 0.4em;
}

/* Buttons */
.btn {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 8px 14px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #ffffff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(11,61,145,0.12);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(11,61,145,0.14); }

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 22px;
    border-top: 1px solid rgba(11,61,145,0.04);
    color: var(--muted);
    font-size: 0.9rem;
}

/* Lists and items */
#links-list, #skills-list { list-style: none; padding-left: 0; margin: 0; }

.item {
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(11,61,145,0.01), rgba(11,61,145,0.005));
    border: 1px solid rgba(11,61,145,0.03);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.item:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(11,61,145,0.06); }

.item h3 { margin: 0 0 6px 0; font-size: 1.05rem; color: var(--text); font-weight: 600; }
.item .meta { font-size: 0.92rem; color: var(--muted); }
.item p { margin: 8px 0 0 0; color: #23324b; }

/* Skill chips */
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0 0; }
.chip-list li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(11,61,145,0.04), rgba(43,111,179,0.02));
    color: var(--accent-2);
    font-size: 0.92rem;
    border: 1px solid rgba(11,61,145,0.06);
}

/* Responsive */
@media (max-width: 640px) {
    body { padding: 18px; }
    .container { padding: 20px; margin: 20px auto; }
    .avatar { width: 96px; height: 96px; flex: 0 0 96px; }
    header { gap: 10px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}