/* Fonts */
@font-face {
    font-family: 'Fraunces';
    src: url('../fonts/fraunces/Fraunces-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/merriweather/Merriweather-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito Sans';
    src: url('../fonts/nunito-sans/NunitoSans-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

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

/* Theme variables */
:root {
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #555555;
    --color-accent: #2a5a8a;
    --color-border: #e0e0e0;
    --color-link: #2a5a8a;
    --color-link-hover: #1a3a5a;

    --font-display: 'Fraunces', Georgia, serif;
    --font-heading: 'Merriweather', Georgia, serif;
    --font-body: 'Nunito Sans', system-ui, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

/* System dark preference (no explicit toggle) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #121212;
        --color-surface: #1e1e1e;
        --color-text: #e0e0e0;
        --color-text-muted: #999999;
        --color-accent: #6aadeb;
        --color-border: #333333;
        --color-link: #6aadeb;
        --color-link-hover: #8ec4f0;
    }
}

/* Explicit dark override */
[data-theme="dark"] {
    --color-bg: #121212;
    --color-surface: #1e1e1e;
    --color-text: #e0e0e0;
    --color-text-muted: #999999;
    --color-accent: #6aadeb;
    --color-border: #333333;
    --color-link: #6aadeb;
    --color-link-hover: #8ec4f0;
}

html {
    font-size: 18px;
    line-height: 1.6;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

main {
    max-width: 960px;
    width: 100%;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease;
}

.theme-toggle:hover {
    border-color: var(--color-text-muted);
}

/* Sun icon (shown in dark mode) */
.theme-toggle-icon {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: 2px solid var(--color-text-muted);
    position: relative;
    transition: all 0.3s ease;
}

/* Moon: fill half (light mode - clicking will go dark) */
:root:not([data-theme]) .theme-toggle-icon,
[data-theme="light"] .theme-toggle-icon {
    background: linear-gradient(90deg, var(--color-text-muted) 50%, transparent 50%);
}

/* Sun: empty circle (dark mode - clicking will go light) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .theme-toggle-icon {
        background: none;
        box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 3px var(--color-text-muted);
    }
}

[data-theme="dark"] .theme-toggle-icon {
    background: none;
    box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 3px var(--color-text-muted);
}

/* Header - Row 1 */
header {
    margin-bottom: 2rem;
}

h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.subtitle {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.location {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Content - Row 2, two columns */
.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

/* Left column */
.col-left {
    display: flex;
    flex-direction: column;
}

.intro {
    margin-bottom: 2rem;
}

.intro p {
    color: var(--color-text);
    line-height: 1.7;
}

/* Contact */
.contact {
    margin-bottom: 2rem;
}

.contact a {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* Links */
.links {
    margin-bottom: 2rem;
}

.links ul {
    list-style: none;
}

.links li {
    margin-bottom: 0.5rem;
}

.link-desc {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

/* Right column - Skills */
h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

dl {
    display: grid;
    gap: 0.75rem;
}

dt {
    font-weight: 600;
    color: var(--color-text);
}

dd {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* Responsive - stack columns on narrow screens */
@media (max-width: 700px) {
    html {
        font-size: 16px;
    }

    body {
        padding: 1.5rem;
        align-items: flex-start;
    }

    h1 {
        font-size: 1.75rem;
    }

    .content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }
}
