/* Base styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Typography */
h1,
h2,
p,
a {
    transition: color 0.2s ease;
}

h1 {
    font-feature-settings: "ss01", "ss02", "ss03";
    letter-spacing: -0.02em;
}

/* Links */
a {
    text-decoration: none;
    position: relative;
}

/* Main content links */
main article a {
    position: relative;
    display: inline-block;
}

main article a:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.2s ease;
}

main article a:hover:after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Section headers with arrow */
section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Date alignment */
.date {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Image grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    aside {
        margin-bottom: 2rem;
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Sticky sidebar adjustments */
.sticky {
    position: sticky;
    top: 2rem;
}

/* Custom selection color */
::selection {
    background: rgba(0, 0, 0, 0.05);
}

/* Tabular numbers for dates */
.tabular-nums {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* Sidebar links */
.sidebar-link {
    opacity: 0.4;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    opacity: 1;
}

/* Project links */
#projects .group:hover .text-stone-400 {
    color: #525252;
}

.prose {
    font-size: 1.125rem;
    line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    font-family: inherit;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #171717;
}

.prose p {
    margin-bottom: 1.5em;
    color: inherit;
}

.prose h2 {
    margin-top: 2.5em;
    font-size: 1.5rem;
}

.prose pre {
    font-size: 0.875rem;
    line-height: 1.6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prose figure img {
    transition: transform 0.2s ease;
}

.prose figure:hover img {
    transform: scale(1.01);
}

.prose blockquote {
    font-family: inherit;
    font-size: 1.1em;
    line-height: 1.6;
    color: #525252;
    border-left: 2px solid #e5e5e5;
    padding-left: 1rem;
    margin-left: 0;
    font-style: normal;
}

/* Media blocks */
.media-block {
    transition: background-color 0.2s ease;
}

.media-block:hover {
    background-color: #fafafa;
}

/* Project card effects */
.project-card {
    transition: all 0.2s ease;
    position: relative;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right bottom, transparent 50%, rgba(0, 0, 0, 0.02) 50%);
    z-index: -1;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.project-card:hover::after {
    opacity: 1;
}

/* Photo grid hover effects */
.photo-item {
    position: relative;
    overflow: hidden;
}

.photo-item img {
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

/* Now section styling */
#now {
    position: relative;
}

#now::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #3b82f6, transparent);
}

/* Footer links */
footer a {
    transition: color 0.15s ease;
}

/* Thoughts version navigation */
#thoughtContent {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#thoughtContent.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

#timelineProgress {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

button:disabled {
    cursor: not-allowed;
}

/* Version timeline hover effect */
.version-timeline {
    position: relative;
    cursor: pointer;
}

.version-timeline:hover::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.05);
    z-index: -1;
}

/* Thoughts Timeline */
.thoughts-timeline {
    position: relative;
}

.thoughts-timeline::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom,
            #e5e5e5 0%,
            #e5e5e5 70%,
            transparent 100%);
}

.thoughts-timeline article {
    position: relative;
}

.thoughts-timeline article::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e5e5;
    transition: all 0.2s ease;
}

.thoughts-timeline article:first-child::before {
    background: #e5e5e5;
}

.thought-previous .prose {
    color: #737373;
}

.thought-previous .prose h2,
.thought-previous .prose h3 {
    color: #525252;
}

/* Version History */
.version-history {
    position: relative;
}

.version-history::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom,
            #e5e5e5 0%,
            #e5e5e5 70%,
            transparent 100%);
}

.version-entry {
    position: relative;
    padding-left: 24px;
}

.version-entry::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 12px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e5e5;
    transition: all 0.2s ease;
}

.version-entry:first-child::before {
    border-color: #22c55e;
    background: #22c55e;
}

.version-entry:hover::before {
    transform: scale(1.2);
}

/* Version history animation */
#versionHistory {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#versionHistory.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Version entry animations */
.version-entry {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.version-entry.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Load more button */
#loadMore {
    transition: color 0.2s ease;
    cursor: pointer;
}

#loadMore:hover {
    color: #525252;
}