/* Light (GitHub) — default */
:root {
  --bg: #ffffff;
  --bg-surface: #f6f8fa;
  --bg-elevated: #e1e4e8;
  --text: #24292e;
  --text-muted: #6a737d;
  --keyword: #d73a49;
  --string: #032f62;
  --comment: #6a737d;
  --type: #005cc5;
  --function: #6f42c1;
  --punctuation: #6a737d;
  --border: #e1e4e8;
}

/* Dark (Monokai) — system preference */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #272822;
    --bg-surface: #2f3024;
    --bg-elevated: #3e3d32;
    --text: #f8f8f2;
    --text-muted: #75715e;
    --keyword: #f92672;
    --string: #e6db74;
    --comment: #75715e;
    --type: #ae81ff;
    --function: #a6e22e;
    --punctuation: #75715e;
    --border: #3e3d32;
  }
}

/* Manual overrides */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-surface: #f6f8fa;
  --bg-elevated: #e1e4e8;
  --text: #24292e;
  --text-muted: #6a737d;
  --keyword: #d73a49;
  --string: #032f62;
  --comment: #6a737d;
  --type: #005cc5;
  --function: #6f42c1;
  --punctuation: #6a737d;
  --border: #e1e4e8;
}

[data-theme="dark"] {
  --bg: #272822;
  --bg-surface: #2f3024;
  --bg-elevated: #3e3d32;
  --text: #f8f8f2;
  --text-muted: #75715e;
  --keyword: #f92672;
  --string: #e6db74;
  --comment: #75715e;
  --type: #ae81ff;
  --function: #a6e22e;
  --punctuation: #75715e;
  --border: #3e3d32;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    text-align: center;
    font-size: 1em;
}

.print-only {
    display: none;
}

.header-contact span {
    display: block;
}

.wrapper {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 32px;
    text-align: left;
}

header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

header .wrapper {
    padding-top: 20px;
    padding-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header nav {
    display: flex;
    gap: 24px;
}

header nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9em;
}

header nav a:hover {
    color: var(--function);
}

header a {
    text-decoration: none;
}

header .site-name {
    font-size: 1.3em;
    color: var(--function);
    font-weight: bold;
}

h1 {
    margin-bottom: 20px;
    font-size: 1.6em;
    color: var(--keyword);
}

h1::before {
    content: '# ';
    color: var(--punctuation);
}

h2 {
    margin-bottom: 16px;
    color: var(--keyword);
}

h2::before {
    content: '## ';
    color: var(--punctuation);
}

h3 {
    margin-bottom: 8px;
    color: var(--keyword);
}

h3::before {
    content: '### ';
    color: var(--punctuation);
}

p {
    margin-bottom: 10px;
    line-height: 1.6;
}

a {
    color: var(--function);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
    position: relative;
}

hr::before {
    content: '---';
    color: var(--punctuation);
    font-size: 0.85em;
    position: absolute;
    top: -0.6em;
    left: 0;
    background: var(--bg);
    padding-right: 8px;
}

.description {
    margin-bottom: 40px;
}

/* Resume section blocks */
.resume-section {
    border-left: 2px solid var(--border);
    padding-left: 16px;
    margin-bottom: 32px;
}

/* Item list (blog cards) */
.item-list > li {
    display: block;
    padding: 16px;
    border: 1px solid var(--border);
    background-color: var(--bg-surface);
    margin-bottom: 16px;
}

.item-list > li:last-child {
    margin-bottom: 0;
}

.item-list h1 {
    margin-bottom: 12px;
    font-size: 1.1em;
}

.item-list p {
    margin-bottom: 0;
}

/* Tag list */
.tag-list {
    margin-bottom: 15px;
}

.tag-list li,
.tag {
    display: inline-block;
    background-color: var(--bg-elevated);
    color: var(--text);
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    margin-right: 5px;
}

.tag-list a,
.tag a {
    text-decoration: none;
}

.item-page .tag-list {
    display: inline-block;
}

.content {
    margin-bottom: 40px;
}

.browse-all {
    display: block;
    margin-bottom: 30px;
}

.all-tags li {
    font-size: 1.2em;
    margin-right: 10px;
    padding: 4px 8px;
}

/* Skill tags — inline code style */
.resume-skills {
    list-style: none;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.resume-skills li {
    display: inline-block;
    font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 0.8em;
    color: var(--type);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 3px;
}

/* Social links */
.find-me {
    list-style: none;
    margin-bottom: 24px;
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
}

.find-me li {
    list-style: none;
    margin: 0;
}

.find-me a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.15s;
}

.find-me a:hover {
    color: var(--function);
    text-decoration: none;
}

.find-me li svg {
    height: 28px;
    width: 28px;
    fill: currentColor;
}

/* Portfolio */
.portfolio {
    list-style: none;
    max-width: 600px;
}

.portfolio li {
    margin-right: 16px;
    margin-bottom: 16px;
    display: inline-block;
}

.portfolio li img {
    border-radius: 12px;
    height: 72px;
    width: 72px;
    border: 1px solid var(--border);
}

.portfolio-item-description {
    display: none;
}

/* Company / date line */
.resume-company {
    margin-bottom: 8px;
    color: var(--comment);
    font-style: normal;
}

/* Markdown resume: inline code as skill pills */
.resume-section code {
    font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    font-size: 0.8em;
    color: var(--type);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 3px;
}

/* Markdown resume: em as company/date line */
.resume-section p em {
    color: var(--comment);
    font-style: normal;
    display: block;
    margin-bottom: 8px;
}

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

/* Theme toggle */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: inherit;
    font-size: 1em;
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

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

/* Print */
@media print {
    body {
        background: #fff;
        color: #000;
        font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    }

    header {
        background: #fff;
        border-bottom: 1px solid #ccc;
    }

    header .site-name {
        color: #000;
    }

    header nav {
        display: none;
    }

    h1, h2, h3 {
        color: #000;
    }

    a {
        color: #000;
    }

    .resume-section {
        border-left-color: #ccc;
    }

    .resume-skills li {
        color: #000;
        background: #f5f5f5;
        border-color: #ccc;
    }

    .find-me li svg {
        fill: #000;
        height: 20px;
        width: 20px;
    }

    .print-only {
        display: block;
    }

    .theme-toggle {
        display: none;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .wrapper {
        padding: 24px 16px;
    }

    body {
        font-size: 0.95em;
    }
}
