/* Color scheme adjustments */
:root {
  --background-color: #fafafa;
  --link-color: inherit;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #3e3e3e;
  }
}

/* Body base adjustments */
body {
    letter-spacing: 0.03em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sticky Header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--background-color);
    padding-top: 20px;
    margin-top: -20px;
    padding-bottom: 8px;
    margin-bottom: 15px;
    border-bottom: 1px dashed rgba(150, 150, 150, 0.3);
}

/* Link general styles - no blue, no default underline unless hover */
a {
    color: var(--text-color) !important;
    text-decoration: none !important;
}
a:hover {
    text-decoration: underline !important;
}

/* Footer links text size and style */
footer {
    font-size: 11px;
}
footer a {
    color: inherit !important;
    text-decoration: none !important;
}
footer a:hover {
    text-decoration: underline !important;
}

/* Navigation tabs */
nav a {
    font-weight: bold;
    text-decoration: none !important;
}
nav a:hover {
    text-decoration: underline !important;
    text-decoration-thickness: 3.2px !important;
    text-underline-offset: 4px;
}
nav a.active, nav a[aria-current="page"] {
    text-decoration: underline !important;
    text-decoration-thickness: 3.2px !important;
    text-underline-offset: 4px;
}

/* Blog list titles */
.blog-posts a {
    font-size: 1.15em;
}

/* Post title link with arrow + animated underline */
.post-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.5em;
    flex-wrap: nowrap;
    position: relative;
    text-decoration: none !important;
}
.post-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.21s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.post-link:hover {
    text-decoration: none !important;
}
.post-link:hover::after {
    transform: scaleX(1);
    transform-origin: left center;
}
.post-link:not(:hover)::after {
    transform-origin: left center;
}
.post-arrow {
    display: inline-block !important;
    flex: none !important;
    width: 0.85em;
    height: 0.85em;
    opacity: 0.5;
    margin-bottom: -0.1em;
    transition: opacity 0.2s;
}
.post-link:hover .post-arrow {
    opacity: 0.8;
}

/* Article spacing */
content p {
    line-height: 1.8;
    margin-bottom: 1.5em;
}

/* Article links should have underline and italic */
content a {
    text-decoration: none !important;
    font-style: italic;
}
content a:hover {
    text-decoration: underline !important;
}

/* Tags styles */
.tags span {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #333;
    font-size: 0.85em;
}
@media (prefers-color-scheme: dark) {
    .tags span {
        background-color: #555;
        color: #eee;
    }
}

/* Bell swing animation */
@keyframes swing {
    0% { transform: rotate(0deg); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}
.swinging {
    animation: swing 0.8s ease-in-out;
}


/* Page Load Transition */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
main {
    animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Sidenote Styles */
.sidenote-marker {
    color: var(--link-color);
    cursor: pointer;
    font-size: 0.85em;
    padding-left: 2px;
}
.sidenote-content {
    float: right;
    clear: right;
    margin-right: -250px;
    width: 220px;
    font-size: 12px;
    color: #999;
}
@media (prefers-color-scheme: dark) {
    .sidenote-content {
        color: #777;
    }
}
@media (max-width: 1250px) {
    .sidenote-content {
        float: none;
        display: block;
        margin: 0.5em 0 0.5em 2em;
        width: auto;
        border-left: 2px solid var(--text-color);
        opacity: 0.7;
        padding-left: 10px;
    }
}