/* =========================
   Base
   ========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #ffffff;
    color: #222;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
}


/* =========================
   Navigation
   ========================= */

header {
    border-bottom: none;
}

nav {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.2rem 1rem; /* reduce left/right padding to bring title closer to edge */

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

/* Make links inside cards act like blocks so the whole card is clickable */
.card a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.card a:hover {
    text-decoration: underline;
}

nav a {
    color: #222;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}


/* =========================
   Main content
   ========================= */

main {
    max-width: 850px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

section {
    margin-bottom: 5rem;
}

.hero {
    min-height: 55vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.eyebrow {
    margin-bottom: 0;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.85rem;
}

h1 {
    margin-top: 0.3rem;
    margin-bottom: 1rem;
    font-size: 3.5rem;
    line-height: 1.1;
}

h2 {
    margin-bottom: 1rem;
    font-size: 1.7rem;
}

h3 {
    margin-bottom: 0.3rem;
}

p {
    max-width: 700px;
}

.intro {
    font-size: 1.3rem;
    color: #555;
}


/* =========================
   Links
   ========================= */

a {
    color: #333;
}

a:hover {
    color: #000;
}


/* =========================
   Cards
   ========================= */

.card {
    margin-top: 2rem;
    padding: 1.5rem;

    border: 1px solid #ddd;
    background: white;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.notes-card {
    margin-top: 0;
    min-height: 180px;
}


/* =========================
   Buttons
   ========================= */

.button {
    display: inline-block;

    padding: 0.6rem 1.2rem;

    border: 1px solid #222;
    color: #222;
    text-decoration: none;
}

.button:hover {
    background: #222;
    color: white;
}


/* =========================
   Misc.
   ========================= */

.muted {
    color: #777;
    font-size: 0.9rem;
}


/* =========================
   Footer
   ========================= */

footer {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;

    border-top: 1px solid #ddd;

    color: #777;
    font-size: 0.85rem;
}


/* =========================
   Mobile
   ========================= */

@media (max-width: 650px) {

    nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    main {
        padding: 3rem 1.5rem;
    }

    h1 {
        font-size: 2.7rem;
    }

    .hero {
        min-height: 60vh;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   CV PAGE
   ========================= */

.cv-page {
    max-width: 850px;
    position: relative;
    padding-right: 260px; /* reserve space on the right for a figure */
}

/* Right-side figure shown on larger viewports */
.cv-figure {
    position: absolute;
    top: 2.5rem;
    right: 0;
    width: 220px;
    background: white;
    padding: 0.5rem;
    border: 1px solid #ffffff;
    text-align: center;
    transform: translateX(100px);
}

.cv-figure img {
    width: 100%;
    height: auto;
    display: block;
}

.cv-figure figcaption {
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.4rem;
}

@media (max-width: 650px) {
    .cv-page {
        padding-right: 0;
        position: static;
    }

    .cv-figure {
        position: static;
        width: 100%;
        margin-top: 1rem;
    }
}


/* CV section headings */

.cv-section {
    margin-bottom: 3.5rem;
}

.cv-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.35rem;
    font-weight: normal;
}


/* Download link */

.cv-download {
    margin-top: -0.5rem;
    margin-bottom: 4rem;
}

.cv-download a {
    text-decoration: underline;
}


/* Individual CV entries */

.cv-entry {
    margin-bottom: 2rem;
}

.cv-entry-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 2rem;
}

.cv-entry-title strong {
    font-weight: bold;
}

.cv-entry-title span {
    white-space: nowrap;
    color: #555;
}

.cv-entry p {
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}


/* Mobile */

@media (max-width: 650px) {

    .cv-entry-title {
        display: block;
    }

    .cv-entry-title span {
        display: block;
        margin-top: 0.15rem;
    }

}

.video-card {
    margin-top: -20px;
    padding: 0;
    overflow: hidden; /* hide any visual overflow from negative offsets */
    display: inline-block;
    width: 100%;
}

/* Target the actual GIF element by id for snug fit */
#gifPlayer {
    display: block;
    width: 100%;
    height: auto;
    margin-top: -60px;
    margin-bottom: -60px; /* remove negative margins so layout doesn't leave a gap */
}
