/* ---------------------------------------------------------------------------
   Charlie Brodie Portfolio — Modern minimal design
--------------------------------------------------------------------------- */

:root {
    --bg: #0a0a0b;
    --bg-elevated: #141416;
    --bg-subtle: #1a1a1e;
    --ink: #fafafa;
    --muted: #71717a;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --success: #22c55e;
    --radius: 12px;
    --radius-sm: 8px;
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Subtle noise texture */
.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Header ------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo:hover {
    color: var(--accent);
}

nav {
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--ink);
}

/* --- Main Content ------------------------------------------------------- */

main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* --- Hero Section ------------------------------------------------------- */

.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: 4rem 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.greeting {
    display: block;
    font-size: 1rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 0.5rem;
    background: linear-gradient(135deg, var(--ink) 0%, var(--muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.5rem;
    color: var(--muted);
    margin: 0 0 1.5rem;
    font-weight: 500;
}

.intro {
    font-size: 1.1rem;
    color: var(--muted);
    margin: 0 0 2rem;
    max-width: 45ch;
}

.cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Visual orbs */
.hero-visual {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: -100px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    bottom: -50px;
    right: 20%;
    animation: float 25s ease-in-out infinite reverse;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: #06b6d4;
    top: 30%;
    right: 10%;
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -20px); }
    50% { transform: translate(-10px, 10px); }
    75% { transform: translate(15px, 15px); }
}

/* --- Buttons ------------------------------------------------------------ */

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.button.primary {
    background: var(--accent);
    color: white;
}

.button.primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.button.secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.button.secondary:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Sections ----------------------------------------------------------- */

.section {
    padding: 4rem 0;
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem;
    color: var(--ink);
}

.about-content {
    max-width: 65ch;
}

.about-content p {
    color: var(--muted);
    margin: 0 0 1rem;
}

.about-content a {
    color: var(--accent);
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}

/* --- Projects Grid ------------------------------------------------------ */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s;
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.project-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.project-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.project-card p {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.project-link:hover {
    text-decoration: underline;
}

/* --- Contact ------------------------------------------------------------ */

.contact-text {
    color: var(--muted);
    max-width: 50ch;
    margin: 0 0 1.5rem;
}

/* --- Library Page ------------------------------------------------------- */

.library-hero {
    padding: 3rem 0;
    text-align: center;
}

.library-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.75rem;
}

.subtitle {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 50ch;
    margin: 0 auto;
}

.book-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    font-size: 1.25rem;
}

/* --- Book Grid ---------------------------------------------------------- */

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.finished-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.book-card {
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

.book-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.book-card.reading {
    border-color: rgba(59, 130, 246, 0.3);
}

.book-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-subtle);
}

.book-cover.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.book-info {
    padding: 1rem;
}

.book-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.book-info .author {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
}

.book-info .rating {
    color: #fbbf24;
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
    letter-spacing: 2px;
}

.book-info .meta {
    color: var(--muted);
    font-size: 0.8rem;
    margin: 0 0 0.5rem;
}

.book-info .notes {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
    font-style: italic;
}

.book-link {
    color: var(--accent);
    font-size: 0.85rem;
    text-decoration: none;
}

.book-link:hover {
    text-decoration: underline;
}

/* --- Book List (Want to Read) ------------------------------------------- */

.book-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.book-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.book-info-inline h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.book-info-inline .author {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

/* --- Empty State -------------------------------------------------------- */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state p {
    color: var(--muted);
    font-size: 1.1rem;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
}

.site-footer p {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 768px) {
    .site-header {
        padding: 1rem;
    }

    nav {
        gap: 1rem;
    }

    main {
        padding: 1rem;
    }

    .hero {
        min-height: 60vh;
        padding: 2rem 0;
    }

    .section {
        padding: 2rem 0;
    }

    .cta-group {
        flex-direction: column;
    }

    .cta-group .button {
        width: 100%;
        justify-content: center;
    }
}

/* --- Reduced Motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .orb {
        animation: none;
    }
}
