/* Theme variables */
:root {
    --page-bg: #ffffff;
    --page-text: #000000;
    --container-bg: #f9f9f9;
    --border-color: #cccccc;
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #f31528;
    --secondary-hover: #7a0811;
    --title-color: #2c3e50;
    --link-color: #0251a6;
    --link-hover: #014089;
    --link-visited: #61188f;
    --link-active: #a31c1c;
}
:root[data-theme="dark"] {
    --page-bg: #121212;
    --page-text: #e0e0e0;
    --container-bg: #1e1e1e;
    --border-color: #333333;
    --primary-color: #3f51b5;
    --primary-hover: #303f9f;
    --secondary-color: #f31528;
    --secondary-hover: #940c15;
    --title-color: #90caf9;
    --link-color: #89c7f9;
    --link-hover: #c0def7;
    --link-visited: #c99ad1;
    --link-active: #f17d73;
}

/* General styling */
* , *::before, *::after {
    box-sizing: border-box;
}
body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--page-bg);
    color: var(--page-text);
    transition: background-color 0.4s ease, color 0.4s ease;
    margin: 0 auto;
}
#title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--title-color);
    margin-bottom: 1.5rem;
}
a {
    color: var(--link-color);
    text-decoration: underline;
    transition: color 0.2s;
}
a:hover {
    color: var(--link-hover);
}
a:visited {
    color: var(--link-visited);
}
a:active {
    color: var(--link-active);
}
p, h2, h3, h4, h5, h6, li, main, section {
    padding: 0 1rem;
}
p {
    line-height: 1.2;
    margin-bottom: 0.2rem;
}

/* Buttons */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
button:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
button:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Form elements */
input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--page-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    font-size: inherit;
}
input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Project snippets */
.project-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18.75rem, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    max-width: 75rem;
    margin: 0 auto;
}
.project-snippet {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background-color: var(--container-bg);
    transition: all 0.3s ease;
    font-family: inherit;
    text-decoration: none;
    color: var(--page-text);
    height: 100%;
}
.project-snippet:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* SVG diagram styling */
svg.diagram {
    display: block;
    margin: 0.5rem auto 1.5rem;
    max-width: 100%;
}
svg.diagram text {
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 500;
    fill: currentColor;
}