/* Reset and base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Scroll progress indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #c4796a);
    z-index: 9999;
    transition: width 0.1s linear;
}

.scroll-progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
}

:root {
    --color-ink: #2c2825;
    --color-ink-light: #5a5652;
    --color-ink-faded: #8a8682;
    --color-paper: #ffffff;
    --color-paper-warm: #faf9f7;
    --color-paper-dark: #f0ede6;
    --color-accent: #8b4d3b;
    --color-accent-soft: rgba(139, 77, 59, 0.08);

    --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;

    --shadow-soft: 0 2px 20px rgba(44, 40, 37, 0.06);
    --shadow-lifted: 0 8px 40px rgba(44, 40, 37, 0.1);

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-ink);
    background-color: var(--color-paper);
    min-height: 100vh;
    position: relative;
}

/* Paper texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.12;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    z-index: 1000;
}


/* Typography */
h1 {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    background-image: linear-gradient(var(--color-accent), var(--color-accent));
    background-size: 0% 1px;
    background-position: 0% 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s var(--ease-out-expo);
}

a:hover {
    background-size: 100% 1px;
}

strong {
    font-weight: 600;
    color: var(--color-ink);
    background: linear-gradient(to top, var(--color-accent-soft) 40%, transparent 40%);
    padding: 0 0.1em;
}

ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Selection styling */
::selection {
    background-color: var(--color-accent);
    color: var(--color-paper);
}

/* Enhanced focus states for accessibility */
a:focus-visible,
iframe:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Subtle glow effect on interactive cards */
.skills-list,
.callout,
.video-embed {
    position: relative;
}

.skills-list::before,
.callout::before {
    transition: opacity 0.4s ease;
}

.callout:hover {
    box-shadow: 0 8px 40px rgba(139, 77, 59, 0.12);
}

/* Animated stat counter styling */
.stat-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* Scroll-triggered reveal animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reveal {
    opacity: 0;
}

.reveal.visible {
    animation: fadeInUp 0.8s var(--ease-out-expo) forwards;
}

.reveal-delay-1.visible { animation-delay: 0.1s; }
.reveal-delay-2.visible { animation-delay: 0.2s; }
.reveal-delay-3.visible { animation-delay: 0.3s; }

/* Staggered list item animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.skills-list li,
.topics-list li {
    opacity: 0;
}

.reveal.visible .skills-list li,
.reveal.visible .topics-list li {
    animation: slideInLeft 0.5s var(--ease-out-expo) forwards;
}

.reveal.visible .skills-list li:nth-child(1),
.reveal.visible .topics-list li:nth-child(1) { animation-delay: 0.1s; }
.reveal.visible .skills-list li:nth-child(2),
.reveal.visible .topics-list li:nth-child(2) { animation-delay: 0.15s; }
.reveal.visible .skills-list li:nth-child(3),
.reveal.visible .topics-list li:nth-child(3) { animation-delay: 0.2s; }
.reveal.visible .skills-list li:nth-child(4),
.reveal.visible .topics-list li:nth-child(4) { animation-delay: 0.25s; }
.reveal.visible .skills-list li:nth-child(5),
.reveal.visible .topics-list li:nth-child(5) { animation-delay: 0.3s; }

/* Hero section */
.hero {
    width: 100%;
    max-height: 32vh;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 88%);
    position: relative;
}

.hero-image {
    will-change: transform;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25%;
    background: linear-gradient(to top, rgba(255,255,255,0.7), transparent);
    pointer-events: none;
}

.hero-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center 30%;
    animation: fadeIn 1.2s var(--ease-out-expo);
}

/* Main content */
.content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Title section */
.title-section {
    margin-bottom: 0;
    animation: fadeInUp 0.8s var(--ease-out-expo) 0.2s both;
}


.tagline {
    color: var(--color-ink-faded);
    font-size: 1.05rem;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.03em;
    margin-bottom: 0;
}

/* About section with profile photo */
.about {
    margin-bottom: 0;
}

.about-content {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    margin-top: 0;
}


.about-image {
    flex-shrink: 0;
    width: 200px;
    padding-top: 3rem;
}

.profile-photo {
    width: 200px;
    height: auto;
    border-radius: 2px;
    transition: transform 0.5s var(--ease-out-expo);
}

.profile-photo:hover {
    transform: translateY(-4px) rotate(1deg);
}

.social-links {
    margin-top: 1rem;
    margin-bottom: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-paper-dark);
}

.social-links a {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Section headings with pencil underline images */
.section-heading-img {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.section-heading-img img {
    max-width: 100%;
    height: auto;
}

.section-heading-img.centered {
    text-align: center;
}

.about-text .section-heading-img {
    margin-top: 0;
}

/* Dividers */
.divider {
    border: none;
    border-top: 1px solid var(--color-paper-dark);
    margin: 2.5rem 0;
    opacity: 0.7;
}

.section-divider {
    width: 100%;
    margin: 3rem 0;
    position: relative;
}

.section-divider img {
    width: 100%;
    height: auto;
    opacity: 0.9;
    transition: opacity 0.4s ease, transform 0.6s var(--ease-out-expo);
}

.section-divider:hover img {
    opacity: 1;
    transform: scale(1.01);
}

/* Skills section */
.skills {
    margin-bottom: 2rem;
}

.skills-list {
    background-color: var(--color-paper-warm);
    padding: 1.75rem;
    padding-left: 2.75rem;
    border-radius: 4px;
    border-left: 3px solid var(--color-accent);
    box-shadow: var(--shadow-soft);
}

.skills-list li {
    margin-bottom: 0.85rem;
    transition: transform 0.3s var(--ease-out-expo);
}

.skills-list li:hover {
    transform: translateX(4px);
}

/* Topics section */
.topics {
    margin-bottom: 2rem;
}

.topics-list {
    list-style-type: disc;
}

/* Projects section */
.projects {
    margin-bottom: 2rem;
}

.project-category {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-ink-light);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-category::before {
    content: '';
    width: 24px;
    height: 2px;
    background: var(--color-accent);
    flex-shrink: 0;
}

.project-category::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--color-paper-dark), transparent);
}

/* Video projects list layout */
.video-projects-list {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 2rem;
}

.video-project-item {
    margin-bottom: 2.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--color-paper-dark);
    transition: border-color 0.3s ease;
}

.video-project-item:hover {
    border-left-color: var(--color-accent);
}

.video-project-item h4 {
    margin-bottom: 0.75rem;
    color: var(--color-ink);
}

.video-project-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* .reverse class: HTML order is media-first, text-second for video-on-left layout */

.video-project-content .project-text {
    flex: 1;
}

.video-project-content .project-text p {
    margin-bottom: 0;
}

.video-project-content .project-media {
    flex: 1;
}

/* Video embed responsive */
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.5s var(--ease-out-expo), box-shadow 0.5s var(--ease-out-expo);
    background: linear-gradient(135deg, var(--color-paper-dark) 0%, var(--color-paper-warm) 100%);
}

.video-embed::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.video-embed:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(44, 40, 37, 0.14);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.video-embed.small {
    max-width: 400px;
}

/* Press videos grid */
.press-videos {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Podcast project */
.podcast-project {
    margin-bottom: 2rem;
}

/* Spotify embed */
.spotify-embed {
    margin-top: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.5s var(--ease-out-expo);
}

.spotify-embed:hover {
    transform: scale(1.01);
}

.spotify-embed iframe {
    width: 100%;
    height: 152px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

/* Press project */
.press-project ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Digital media section */
.digital-media {
    margin-bottom: 2rem;
}

/* Collaboration section */
.collaboration {
    margin-bottom: 2rem;
}

.callout {
    background-color: var(--color-paper-warm);
    padding: 2rem;
    border-radius: 4px;
    border: 1px solid var(--color-paper-dark);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.callout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-accent), transparent);
}

.callout p:last-child {
    margin-bottom: 0;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 4rem;
    padding-bottom: 3rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-ink-faded), transparent);
}

.footer-image {
    max-width: 100%;
    height: auto;
    opacity: 0.95;
    transition: opacity 0.4s ease;
}

.footer-image:hover {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero {
        max-height: 20vh;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 94%);
    }

    .hero::after {
        height: 35%;
    }

    h1 {
        font-size: 1.75rem;
    }

    .about-content {
        flex-direction: column;
    }

    .about-image {
        order: -1;
        display: flex;
        justify-content: center;
        width: 100%;
        padding-top: 0;
    }

    .about-text {
        text-align: left;
    }

    .profile-photo {
        width: min(70vw, 320px);
        height: auto;
    }

    .about-image {
        padding-top: 0;
    }

    .video-project-content {
        flex-direction: column;
    }

    .video-project-content .project-text {
        order: 1;
    }

    .video-project-content .project-media {
        order: 2;
        width: 100%;
    }

    .video-embed.small {
        max-width: 100%;
    }

    .press-videos {
        flex-direction: column;
    }

    .content {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .profile-photo {
        width: min(75vw, 280px);
        height: auto;
    }
}
