/*
 * Ryan Kidd - Personal Site Styles
 * A clean, editorial design with dark/light mode
 */

/* ============================================
   CSS Variables & Theming
   ============================================ */

:root {
    /* Fonts */
    --font-serif: 'Newsreader', Georgia, serif;
    --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Light theme (default) */
    --bg-primary: #faf9f7;
    --bg-secondary: #f0efec;
    --bg-accent: #e8e6e1;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #7a7a7a;
    --accent: #b44d2d;
    --accent-hover: #933d23;
    --border: #d4d2cd;
    --shadow: rgba(0, 0, 0, 0.06);
    --code-bg: #f5f4f2;
}

[data-theme="dark"] {
    --bg-primary: #141413;
    --bg-secondary: #1e1e1c;
    --bg-accent: #282825;
    --text-primary: #e8e6e1;
    --text-secondary: #b5b3ae;
    --text-muted: #7a7875;
    --accent: #d4724e;
    --accent-hover: #e8865f;
    --border: #3a3936;
    --shadow: rgba(0, 0, 0, 0.3);
    --code-bg: #1e1e1c;
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 17px;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
}

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

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

strong {
    font-weight: 600;
}

/* ============================================
   Navigation
   ============================================ */

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-logo:hover {
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

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

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

/* ============================================
   Main Content
   ============================================ */

main {
    padding-top: 80px;
    min-height: calc(100vh - 160px);
}

section, .page, .post {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* ============================================
   Homepage Hero
   ============================================ */

.hero {
    padding-top: 6rem;
    padding-bottom: 5rem;
}

.hero-eyebrow {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-intro {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.2s forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Section Headers
   ============================================ */

.section-header {
    margin-bottom: 2.5rem;
}

.section-header h1,
.section-header h2 {
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 0;
}

/* ============================================
   Featured Items
   ============================================ */

.featured {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.featured:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px var(--shadow);
}

.featured-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.featured h3 {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.featured h3 a {
    color: var(--text-primary);
}

.featured h3 a:hover {
    color: var(--accent);
}

.featured p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.featured-meta {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   Content Cards
   ============================================ */

.card-grid {
    display: grid;
    gap: 0;
}

.card {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.card:first-child {
    padding-top: 0;
}

.card:last-child {
    border-bottom: none;
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card h3 a {
    color: var(--text-primary);
}

.card h3 a:hover {
    color: var(--accent);
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-accent);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

/* ============================================
   About Page
   ============================================ */

.about-content {
    display: grid;
    gap: 3rem;
}

.about-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-section p {
    color: var(--text-secondary);
}

.about-section ul {
    list-style: none;
    color: var(--text-secondary);
}

.about-section li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.about-section li:last-child {
    border-bottom: none;
}

.position-title {
    font-weight: 500;
    color: var(--text-primary);
}

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

/* ============================================
   Blog Post Styles
   ============================================ */

.post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-header h1 {
    margin-bottom: 0.5rem;
}

.post-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.post-content {
    font-size: 1.05rem;
}

.post-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-content ul, .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9em;
    background: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.post-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
}

.prev-post, .next-post {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.prev-post:hover, .next-post:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.next-post {
    text-align: right;
    grid-column: 2;
}

.nav-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.nav-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
}

/* ============================================
   Contact
   ============================================ */

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.contact-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.contact-link svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Dividers
   ============================================ */

.divider {
    height: 1px;
    background: var(--border);
    max-width: 800px;
    margin: 0 auto;
}

hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
}

/* ============================================
   Footer
   ============================================ */

footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    nav {
        padding: 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    .nav-links a:last-of-type {
        border-bottom: none;
    }

    .nav-links .theme-toggle {
        margin-top: 1rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    section, .page, .post {
        padding: 3rem 1.5rem;
    }

    .hero {
        padding-top: 4rem;
        padding-bottom: 3rem;
    }

    .post-navigation {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .next-post {
        grid-column: 1;
        text-align: left;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

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

.text-secondary {
    color: var(--text-secondary);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
