/* Karl's Personal Site — Mobile-first, dark-on-light */

:root {
    --color-bg: #faf9f7;
    --color-bg-alt: #f0eeeb;
    --color-text: #2d2a26;
    --color-text-muted: #5c5852;
    --color-accent: #4a6fa5;
    --color-accent-hover: #3d5c8a;
    --color-border: #d4d1cc;
    --color-code-bg: #e8e6e3;
    --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
    --max-width: 42rem;
    --spacing: 1.5rem;
}

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

/* Base */
html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-stack);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Typography */
h1, h2, h3 {
    line-height: 1.25;
    font-weight: 600;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

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

strong {
    font-weight: 600;
}

em {
    font-style: italic;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-code-bg);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

/* Hero */
.hero {
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.logo svg {
    display: block;
}

.tagline {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 28rem;
    margin: 0 auto;
}

/* Sections */
.section {
    padding: 3rem 0;
}

.section.alt {
    background: var(--color-bg-alt);
}

/* Lists */
.capabilities, .contact-list {
    list-style: none;
    margin: 1.5rem 0;
}

.capabilities li, .contact-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.capabilities li::before, .contact-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--color-text-muted);
}

/* Tech note box */
.tech-note {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--color-bg);
    border-left: 3px solid var(--color-accent);
    border-radius: 0 4px 4px 0;
}

.tech-note p {
    margin-bottom: 0;
    font-size: 0.9375rem;
}

/* Footer */
footer {
    padding: 2.5rem 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    border-top: 1px solid var(--color-border);
}

footer p {
    margin-bottom: 0.5rem;
}

footer .small {
    font-size: 0.8125rem;
    margin-bottom: 0;
}

/* Responsive — larger screens */
@media (min-width: 640px) {
    :root {
        --spacing: 2rem;
    }

    h1 {
        font-size: 2.75rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .hero {
        padding: 5rem 0 4rem;
    }

    .section {
        padding: 4rem 0;
    }

    .tagline {
        font-size: 1.25rem;
    }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Reduce motion for those who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* Print styles */
@media print {
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .hero {
        padding: 1rem 0;
    }

    .section {
        padding: 1.5rem 0;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* Hero portrait */
.hero-portrait {
    margin-top: 2rem;
    width: 100%;
    max-width: 320px;
}

.hero-portrait img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

@media (min-width: 640px) {
    .hero-portrait {
        max-width: 400px;
        margin-top: 2.5rem;
    }

    .hero-portrait img {
        border-radius: 10px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    }
}
