/* =========================================
   Theme Variables
   ========================================= */
:root {
    /* Light theme colors */
    --bg: #ffffff;
    --text: #1a1a1a;
    --light-text: #757575;
    --border: #cccccc;
    --link: #1a1a1a;
    --link-hover: #8B0000;
    --code-bg: #e6e6e6;
    --code-text: #1a1a1a;
    --code-border: #cccccc;
}

html.dark {
    /* Dark theme colors */
    --bg: #1a1a1a;
    --text: #e6e6e6;
    --light-text: #757575;
    --border: #4d4d4d;
    --link: #e6e6e6;
    --link-hover: #8B0000;
    --code-bg: #333333;
    --code-text: #e6e6e6;
    --code-border: #4d4d4d;
}

/* =========================================
   Base Typography & Reset
   ========================================= */
html {
    margin: 0;
    padding: 0;
    line-height: 1.5;
    background-color: var(--bg);
    color: var(--text);
    font-family: "Noto Serif", Georgia, "Times New Roman", Times, serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    margin: 0;
    padding: 0;
    line-height: inherit;
    background-color: inherit;
    color: inherit;
}

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

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

/* =========================================
   Header
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
}

.site-title {
    font-size: 1.5rem;
    font-weight: bold;
}

#theme-toggle {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    color: var(--text);
}
@media (hover: hover) and (pointer: fine) {
  #theme-toggle:hover {
    color: var(--link-hover);
  }
}
#theme-toggle:active {
  color: var(--link-hover);
}
#theme-toggle:focus-visible {
  outline: 2px solid currentColor;
}


/* =========================================
   Footer
   ========================================= */
footer {
    padding: 2rem 1rem;
}

/* =========================================
   Main Layout
   ========================================= */
main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
}

/* =========================================
   Lists
   ========================================= */
.post-list {
    list-style: none;
    padding-left: 0;
}

.post-title {
    margin-right: 0.5rem;
}

.post-date {
    color: var(--light-text);
}

/* =========================================
   Links
   ========================================= */
.decorated-links {
    text-decoration: underline;
}

/* =========================================
   Projects galleries and sketches
   ========================================= */
.gallery-div {
    text-align: center;
}
.gallery-div p {
    text-align: inherit;
}
.gallery-div img {
    max-width: 80%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}
#random-quote-div {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}
#canvas_div {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}
#main-intro {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
#main-intro-portrait img {
    width: 150px;       
    height: 150px;
    object-fit: cover;  
    border-radius: 50%; 
    border: 2px solid var(--border); 
}
#main-intro-text {
    max-width: 600px;
}
@media (max-width: 600px) {
  #main-intro {
    flex-direction: column;
    align-items: center;
  }
}

/* ===============================
   Code Blocks
   =============================== */
pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--code-border);
}

code {
    font-family: monospace;
    font-size: 0.9rem;
    background: var(--code-bg);
}
