*

{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    overflow-x: visible;
    overflow-y: visible;
}

:root {
    --black: #000000;
    --white: #ffffff;
    --gray: #666666;
    --light-gray: #f5f5f5;
    --border: 1px solid var(--black);
}


body {
    font-family: 'EB Garamond', serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--black);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 64px;
    margin-bottom: 16px;
}

h2 {
    font-size: 36px;
    margin-bottom: 32px;
    border-bottom: var(--border);
    padding-bottom: 16px;
}

h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

a {
    color: var(--black);
    text-decoration: none;
    border-bottom: 1px solid var(--black);
    transition: opacity 0.15s;
}

a:hover {
    opacity: 0.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.2s;
}

img:hover {
    filter: grayscale(0%);
}

.closing-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;  /* align top of left and right */
    margin-top: 24px;
}

.closing-left {
    line-height: 1.4; /* optional, makes the name a little closer to the line above */
}

.closing-date {
    font-style: italic;
    color: var(--gray);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    z-index: 1000;
}

.nav-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.nav-content a {
    font-size: 16px;
    border: none;
}

.nav-separator {
    color: var(--gray);
    user-select: none;
}

/* Main Content */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 120px 40px 80px;
}

.section {
    margin-bottom: 80px;
    padding-top: 20px;
}

.hero {
    margin-bottom: 120px;
    padding: 80px 0;
    border-top: var(--border);
    border-bottom: var(--border);
}

.subtitle {
    font-size: 24px;
    color: var(--gray);
    max-width: 700px;
}

/* Business Card Section */
.business-card {
    border: var(--border);
    background: var(--light-gray);
    padding: 48px;
    margin-bottom: 80px;
}

.card-main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: var(--border);
}

.card-portrait {
    width: 300px;
    height: 300px;
    border: var(--border);
    overflow: hidden;
    background: var(--white);
}

.card-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-name {
    font-size: 48px;
    margin-bottom: 8px;
}

.card-title {
    font-size: 20px;
    color: var(--gray);
    margin-bottom: 24px;
    font-style: italic;
}

.card-bio {
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
}
.card-bio a {
    color: var(--black);
    text-decoration: none;
    transition: opacity 0.15s;
}

.card-bio a:hover {
    opacity: 0.6;
}

.card-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.info-tile {
    border: var(--border);
    background: var(--white);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.15s;
}

.info-tile:hover {
    background: var(--black);
}

.info-tile:hover .info-label,
.info-tile:hover .info-value {
    color: var(--white);
}

.info-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    transition: color 0.15s;
}

.info-value {
    font-size: 16px;
    font-weight: 500;
    transition: color 0.15s;
}


/* Why Section */
.why-section {
    margin-bottom: 80px;
}

.why-container {
    border: 2px solid var(--black);
    background: var(--white);
    padding: 60px;
    max-width: 900px;
    margin: 0 auto;
}

.why-title {
    text-align: center;
    border: none;
    margin-bottom: 36px;
    padding-bottom: 0;
    font-size: 42px;
}

.why-intro {
    font-size: 16px;
    font-style: italic;
    margin-bottom: 32px;
    color: var(--gray);
    text-align: center;
}

.why-content {
    text-align: left;
}

.why-content p {
    font-size: 20px;
    line-height: 1.8;
    margin-bottom: 24px;
    font-weight: 400;
}

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

.cite {
    font-size: 15px;
    cursor: pointer;
    position: relative;
    color: var(--black);
    font-weight: 600;
    transition: color 0.2s;
}

.cite:hover {
    color: #666;
}

.citation-tooltip {
    position: fixed;
    background: var(--white);
    color: var(--black);
    border: var(--border);
    padding: 14px 18px;
    font-size: 14px;
    max-width: 450px;
    z-index: 999999;
    pointer-events: auto;
    cursor: pointer;
    line-height: 1.6;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.citation-tooltip:hover {
    background: var(--light-gray);
}


@media (max-width: 900px) {
    .why-container {
        padding: 40px 30px;
    }
    
    .why-title {
        font-size: 36px;
    }
    
    .why-content p {
        font-size: 18px;
    }
    
    .citation-tooltip {
        max-width: 90vw;
        font-size: 13px;
    }
}

/* Research Section */
.research-item {
    margin-bottom: 40px;
}

.research-item:last-child {
    margin-bottom: 0;
}

.research-desc {
    font-size: 16px;
    margin-top: 8px;
}

/* Experience Section */
.exp-item {
    margin-bottom: 40px;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.exp-date {
    font-size: 16px;
    color: var(--gray);
}

.exp-org {
    font-size: 16px;
    margin-bottom: 8px;
}

.exp-desc {
    font-size: 16px;
    color: var(--gray);
}

/* Formative Experiences Section */
.formative-section {
    padding-top: 20px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 24px;
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-image {
    border: var(--border);
    padding: 12px;
    background: var(--white);
    height: 100%;
    display: flex;
    align-items: center;
}

.timeline-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.timeline-image img {
    width: 100%;
    height: auto;
    display: block;
}

.timeline-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
}

.timeline-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-thumb {
    width: 100%;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.3s;
    cursor: pointer;
}

.video-thumb:hover {
    filter: grayscale(0%);
}

.video-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9; /* keeps 16:9 ratio */
}
.video-wrapper iframe {
    width: 100%;
    height: 100%;
}

.timeline-text {
    border: var(--border);
    padding: 24px;
    background: var(--light-gray);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.timeline-text h3 {
    margin-bottom: 4px;
}

.timeline-date {
    font-size: 14px;
    color: var(--gray);
    font-style: italic;
    margin-bottom: 12px;
}

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


/* Footer */
footer {
    border-top: var(--border);
    padding: 40px 0;
    margin-top: 20px;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-links {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.separator {
    color: var(--gray);
}

.footer-note {
    font-size: 14px;
    color: var(--gray);
}


/* Library Section */
.library-section {
    padding-top: 20px;
}

.library-subsection {
    margin-bottom: 60px;
}

.library-subsection:last-child {
    margin-bottom: 0;
}

.library-subtitle {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 24px;
    color: var(--gray);
    border: none;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 32px;
}

.book-item {
    border: var(--border);
    padding: 12px;
    background: var(--white);
    transition: transform 0.2s;
}
.book-item:hover {
    transform: translateY(-4px);
}

.book-item img {
    width: 100%;
    height: auto;
    display: block;
}
.book-item {
    border: var(--border);
    padding: 12px;
    background: var(--white);
    transition: transform 0.2s;
    position: relative;
}

.library-tooltip {
    position: fixed;
    background: var(--white);
    border: var(--border);
    padding: 10px 14px;
    font-size: 14px;
    font-style: italic;
    white-space: nowrap;
    z-index: 999999;
    pointer-events: none;
}

/* Click Ripple Effect */
.ripple {
  position: fixed;
    border: 1px solid white;
    pointer-events: none;
    animation: ripple-expand 0.8s ease-out forwards;
    z-index: 9999;
    mix-blend-mode: difference;
}

@keyframes ripple-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
    }
}

/* Explosion mode for rapid clicks */
.ripple.explosion {
    animation: ripple-explosion 1.2s ease-out forwards;
}

@keyframes ripple-explosion {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: var(--explosion-size, 400px);
        height: var(--explosion-size, 400px);
        opacity: 0;
    }
}


/* Click message */
.click-message {
   position: fixed;
    font-size: 14px;
    color: white;
    pointer-events: none;
    z-index: 10000;
    font-style: italic;
    mix-blend-mode: difference;
    animation: message-fade 2s ease-out forwards;
}

@keyframes message-fade {
    0% {
        opacity: 0;
        transform: translateY(0);
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}


/* Quote Section */
.quote-section {
    background: var(--black);
    color: var(--white);
    padding: 120px 80px;
    margin: 120px -40px 20px -40px;
    border-top: 1px solid var(--white);
    border-bottom: 1px solid var(--white);
}

body.dark-mode .quote-section {
    background: var(--white);
    color: var(--black);
    border-top: 1px solid var(--black);
    border-bottom: 1px solid var(--black);
}

.closing-quote {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.quote-text {
    font-size: 28px;
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 32px;
    font-style: italic;
}

.quote-author {
    font-size: 16px;
    font-weight: 500;
    font-style: normal;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 900px) {
    h1 {
        font-size: 48px;
    }
    
    h2 {
        font-size: 32px;
    }
    
  .nav-content {
        padding: 20px 24px;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .nav-content a {
        font-size: 14px;
    }
    
    .nav-separator {
        font-size: 14px;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    main {
        padding: 100px 24px 60px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .subtitle {
        font-size: 20px;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .portrait-container {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    .exp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .service-images,
    .cfar-images {
        grid-template-columns: 1fr;
    }
    
    .awards-grid {
        grid-template-columns: 1fr;
    }
        .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 20px;
    }
    .business-card {
        padding: 32px 24px;
    }
    
    .card-main {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .card-portrait {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    .card-name {
        font-size: 36px;
        text-align: center;
    }
    
    .card-title {
        text-align: center;
    }
    
    .card-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .quote-section {
        padding: 80px 40px;
        margin: 80px -24px 60px -24px;
    }
    
    .quote-text {
        font-size: 22px;
    }
        .timeline-item {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .timeline-image {
        max-width: 100%;
        margin: 0;
    }
    .timeline-image img {
        width: 100%; /* fill parent container */
        height: auto;
    }
    .timeline-video {
        width: 100%;
        padding-bottom: 56.25%; /* maintain 16:9 aspect ratio */
        position: relative;
    }

    .timeline-video iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
     .library-tooltip {
        max-width: 90vw; /* 90% of the viewport width */
        white-space: normal; /* allow text to wrap */
        left: 5vw !important; /* center-ish on screen */
        transform: none !important; /* remove any offset transforms from desktop */
    }
     .closing-line {
        align-items: baseline; /* align the text baselines */
    }
}