/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a1a;
    background: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero h1 {
    position: relative;
    display: inline-block;
}

.hero h1::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    height: 2px;
    width: 0;
    background-color: #1a1a1a;
    animation: underlineAnimation 2s ease-in-out 0.5s forwards;
}

h2 {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 16px;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

p {
    margin-bottom: 8px;
    color: #333;
}

a {
    color: #1a1a1a;
    text-decoration: none;
    border-bottom: 1px solid #d0d0d0;
    transition: border-color 0.2s ease;
}

a:hover {
    border-bottom-color: #1a1a1a;
}

ul {
    list-style: none;
}

/* Header */
header {
    padding: 48px 0;
    border-bottom: 1px solid #f0f0f0;
}

nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border: none;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #1a1a1a;
}

/* Hero */
.hero {
    padding: 40px 0 25px;
}

.lead {
    font-size: 20px;
    line-height: 1.6;
    color: #666;
    max-width: 600px;
    margin-bottom: 0;
}

/* Sections */
section {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

section:last-of-type {
    border-bottom: none;
}

/* About */
.about-content {
    max-width: 600px;
}

.about-content p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 12px;
}

/* Work/Projects */
.project {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.project:last-child {
    border-bottom: none;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 24px;
}

.project-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 0;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border: none;
    white-space: nowrap;
    transition: color 0.2s ease, transform 0.2s ease;
}

.project-link:hover {
    color: #1a1a1a;
}

.project-link:hover svg {
    transform: translateX(2px);
}

.project-link svg {
    transition: transform 0.2s ease;
}

.project p {
    font-size: 15px;
    line-height: 1.7;
    color: #666;
    max-width: 560px;
}

.project-placeholder {
    padding: 64px 0;
    text-align: center;
}

.project-placeholder p {
    font-size: 15px;
    color: #999;
    margin: 0;
}

/* Reading */
.reading-shelf {
    margin-bottom: 28px;
}

.reading-shelf:last-child {
    margin-bottom: 0;
}

.shelf-label {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    margin-bottom: 12px;
}

.gr_grid_container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
}

.gr_grid_book_container {
    float: none !important;
    width: 72px !important;
    height: 110px !important;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 3px;
    flex-shrink: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gr_grid_book_container:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.gr_grid_book_container a {
    display: block;
    border: none;
    width: 100%;
    height: 100%;
}

.gr_grid_book_container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hide Goodreads branding and titles within reading widgets */
#gr_grid_widget_1780661645 h2,
#gr_grid_widget_1780661752 h2,
.gr_grid_branding,
#gr_grid_widget_1780661645 br,
#gr_grid_widget_1780661752 br {
    display: none !important;
}

/* Music / Scrobbles */
.scrobble-loading {
    font-size: 14px;
    color: #999;
}

a.scrobble-np-section {
    border-bottom: none;
}

.scrobble-np-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: opacity 0.2s ease;
}

.scrobble-np-section:hover {
    opacity: 0.7;
}

.scrobble-np-thumb {
    width: 48px;
    height: 48px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    background: #f0f0f0;
}

.scrobble-np-info {
    min-width: 0;
}

.scrobble-np-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 3px;
}

.scrobble-np-track {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scrobble-np-artist {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scrobble-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

a.scrobble-item {
    border-bottom: none;
}

.scrobble-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.scrobble-item:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.scrobble-art {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    object-fit: cover;
    display: block;
    background: #f5f5f5;
    margin-bottom: 8px;
}

.scrobble-art-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    background: #f0f0f0;
    margin-bottom: 8px;
}


.scrobble-info {
    width: 100%;
}

.scrobble-title {
    font-size: 12px;
    font-weight: 500;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scrobble-artist {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scrobble-plays {
    font-size: 10px;
    color: #bbb;
    margin-top: 2px;
}

.scrobble-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #1a1a1a;
    flex-shrink: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Contact */
.contact p {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 16px;
    max-width: 560px;
}

.social-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.social-links a {
    font-size: 15px;
    font-weight: 500;
    color: #666;
    border-bottom: 1px solid #d0d0d0;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.social-links a:hover {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a;
}

/* Footer */
footer {
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
}

footer p {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 0 20px;
    }

    h1 {
        font-size: 36px;
    }

    .lead {
        font-size: 18px;
    }

    header {
        padding: 32px 0;
    }

    nav {
        gap: 24px;
    }

    .hero {
        padding: 30px 0 20px;
    }

    section {
        padding: 15px 0;
    }

    .project-header {
        flex-direction: column;
        gap: 12px;
    }

    .project-link {
        align-self: flex-start;
    }

    .scrobble-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes underlineAnimation {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

/* Typing cursor */
.typing::after {
    content: '|';
    animation: blink 0.7s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Hoverable words */
.hoverable-word {
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
    color: inherit;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Selection */
::selection {
    background: #1a1a1a;
    color: #fff;
}
