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

:root {
    --bg-color: #f5f2e9;
    --text-color: #333;
    --highlight-color: #555;
    --active-color: #222;
}

.dark-mode {
    --bg-color: #2c2c2c;
    --text-color: #f0f0f0;
    --highlight-color: #ccc;
    --active-color: #f5f5f5;
}

.dark-mode svg { filter: invert(1); }

::selection {
  background: var(--highlight-color);
  color: var(--bg-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto Serif', ui-serif, Georgia, 'Times New Roman', serif;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

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

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

header {
    text-align: center;
    padding: 20px 0;
    position: relative;
}
header h1 {
    cursor: pointer;
}
.theme-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-color);
}

@media (max-width: 480px) {
    .theme-toggle {
        top: auto;
        bottom: 10px;
        transform: none;
    }
}

nav {
    text-align: center;
    margin-bottom: 20px;
}
nav a {
    margin: 0 15px;
    opacity: 0.5;
}
nav a:hover {
    font-weight: bold;
    opacity: 0.8;
}
nav a.active {
    font-weight: bold;
    color: var(--active-color);
    opacity: 1.0;
}
.content {
    max-width: 800px;
    margin-inline: auto;
    flex: 1;
}
.content a {
    border-bottom: 1px dotted var(--highlight-color);
}
.content a:hover {
    color: var(--active-color);
    border-bottom: 2px solid var(--highlight-color);
    text-decoration: none;
}

.content a[target="_blank"]::after {
    content: "↗";
    margin-left: 0.25em;
    font-size: 0.9em;
}

footer {
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    color: var(--highlight-color);
}
footer a {
    border-bottom: 1px dotted var(--highlight-color);
}
.footer-icons {
    margin-top: 10px;
}
.footer-icons a {
    margin: 0 15px;
    font-size: 1.5rem;
    border-bottom: none;
}