/* Base Styles */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&family=Roboto+Mono:wght@400;700&display=swap');

:root {
    --background-color: #191919;
    --text-color: #ffffff;
    --border-color: rgba(255, 255, 255, 0.3);
    --input-bg-color: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Mono', monospace, 'Roboto Mono', monospace;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.4;
    overflow-x: hidden;
}

/* Base typography */
p {
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Base style for all links */
a {
    color: inherit; /* Inherit text color from parent */
    text-decoration: none; /* Remove default underline by default */
}

/* Make all links inside paragraphs underlined */
p a {
    text-decoration: underline !important; /* Force underline for all paragraph links */
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

p a:hover {
    text-decoration-thickness: 2px;
}

/* Ensure links in company descriptions are underlined */
.company-details p a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

/* Style for PDF links */
.pdf-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none !important; /* Override the default paragraph link styling */
}

/* Light Theme */
body.light-theme {
    --background-color: #f5f5f5;
    --text-color: #191919;
    --border-color: rgba(0, 0, 0, 0.3);
    --input-bg-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .form-status.success {
    color: #2e7d32;
}

body.light-theme .form-status.error {
    color: #c62828;
}

body.light-theme .slider:before {
    background-color: var(--text-color);
}

body.light-theme input:checked + .slider:before {
    background-color: #f5f5f5;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0 0 1.5rem;
    position: relative;
}

/* Single vertical line on the left */
.container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 100%; 
    background-color: var(--text-color);
    z-index: 2; /* Ensure vertical line is visible */
}

/* Remove the additional vertical line */

/* Header */
header {
    padding: 1.5rem;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    left: -1.5rem;
    right: 0;
    bottom: 0;
    height: 1px;
    background-color: var(--text-color);
}

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

.name {
    font-weight: bold;
    letter-spacing: 1px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-dots {
    display: flex;
    gap: 4px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.menu-dots:hover {
    opacity: 0.7;
}

.menu-dots span {
    width: 6px;
    height: 6px;
    background-color: var(--text-color);
    border-radius: 50%;
}

/* Menu overlay */
.menu-overlay {
    position: absolute;
    top: 60px;
    right: -20px;
    width: 20%;
    background-color: var(--background-color);
    border-width: 1px;
    border-style: solid;
    border-color: var(--text-color);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    padding: 2rem 0 1rem;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.menu-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-close::before, 
.menu-close::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1px;
    background-color: var(--text-color);
    transform-origin: center;
}

.menu-close::before {
    transform: rotate(45deg);
}

.menu-close::after {
    transform: rotate(-45deg);
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    width: 100%;
}

.menu-link {
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s ease, opacity 0.3s ease;
    padding: 0.25rem 0;
}

.menu-link:hover {
    opacity: 0.7;
    transform: translateY(-2px);
}

/* Theme Toggle Switch */
.theme-toggle {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 2px;
    background-color: var(--text-color);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #ccc;
}

input:checked + .slider:before {
    transform: translateX(18px);
    background-color: #191919;
}

/* Hero Section */
.hero {
    padding: 3rem 1.5rem;
    position: relative;
}

/* Hero divider line removed */

h1 {
    font-size: 2rem;
    font-weight: normal;
    margin-bottom: 3rem;
    line-height: 1.3;
    max-width: none;
}

h1 em {
    font-style: italic;
}

.hero-image {
    width: 100%;
    height: 700px; /* Increased from 650px to 700px */
    overflow: hidden;
    position: relative;
    margin-bottom: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures all images cover the area regardless of aspect ratio */
    object-position: center; /* Centers the image */
    /* Transition is now set dynamically in JavaScript for better control */
    display: block;
}

/* Additional hero image styling */
.hero-image {
    cursor: pointer;
}

/* Custom tooltip that follows cursor - hidden for now */
.custom-tooltip {
    position: fixed;
    display: none; /* Hidden by default */
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'IBM Plex Mono', monospace;
    pointer-events: none; /* Allow mouse events to pass through */
    z-index: 1000;
    max-width: 250px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.2s ease;
    visibility: hidden; /* Add this to ensure it's completely hidden */
}

/* Hero image controls removed */

/* Main Content */
.main-content {
    position: relative;
}

/* Navigation and Toggle Sections */
.toggle-section {
    border-bottom: none;
    position: relative;
    /* No horizontal lines for section separators */
}

.nav-item {
    font-size: 2rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.arrow {
    margin-right: 0.5rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.nav-item.active .arrow {
    transform: rotate(90deg);
}

/* Content Sections - Loading inline below toggle */
.content-section {
    padding: 0 1.5rem 1.5rem 1.5rem;
    transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
    overflow: hidden;
    position: relative;
    opacity: 1;
    max-height: 9999px; /* Large enough to contain any content */
}

.content-section p {
    margin-bottom: 1.5rem;
}

.hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
}

.content-wrapper {
    margin-top: 1rem;
}

/* Companies Grid */
.companies-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
}

.company-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-left: 0;
}

.company-image {
    width: 100%;
    height: auto;
    overflow: hidden;
}

.company-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.company-image img:hover {
    transform: scale(1.02);
}

.company-details h3 {
    margin-bottom: 1rem;
    font-weight: bold;
}

.company-details p {
    line-height: 1.6;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .company-item {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

/* Interests Section */
.interests-header {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 3rem;
    margin-bottom: 2.5rem;
    align-items: flex-start;
}

.interests-heading {
    font-size: 2.7rem;
    letter-spacing: 0.05em;
    font-weight: normal;
    line-height: 1.3;
    margin: 0;
    width: 100%;
}

.interests-subheading {
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
    width: 100%;
    color: var(--text-color);
    opacity: 0.85;
    margin: 0;
    font-weight: normal !important;
    letter-spacing: 0.01em;
}

.interest-gallery {
    margin: 2rem 0 3rem;
    width: 100%;
}

.full-width-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.interest-item {
    margin: 3rem 0;
}

.interest-item h3 {
    position: relative;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    padding-left: 0;
}

.interest-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-left: 0;
    border-left: none;
    margin-left: 0;
}

.interest-text p {
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.interest-image {
    width: 100%;
}

.interest-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.interest-divider {
    margin: 3rem 0;
    padding: 1.5rem 0;
    position: relative;
    display: block;
    width: 100%;
}

.interest-divider::before,
.interest-divider::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--text-color);
}

.interest-divider::before {
    top: 0;
}

.interest-divider::after {
    bottom: 0;
}

.interest-divider p {
    font-size: 1.25rem;
    line-height: 1.4;
    letter-spacing: 0.05em;
    margin: 0;
}

.text-link {
    /* Keep text color inherited from current theme */
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: text-decoration-thickness 0.2s ease;
}

.text-link:hover {
    text-decoration-thickness: 2px;
}

@media (min-width: 768px) {
    .interests-heading {
        font-size: 3rem;
    }
    
    .interests-subheading {
        font-size: 0.95rem;
    }
    
    .interest-content {
        grid-template-columns: 2fr 1fr;
    }
    
    .interest-divider p {
        font-size: 1.5rem;
    }
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

input, textarea {
    background-color: var(--input-bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem;
    font-family: 'IBM Plex Mono', monospace, 'Roboto Mono', monospace;
    width: 100%;
}

textarea {
    min-height: 6rem;
    resize: vertical;
}

.submit-button {
    background-color: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0.75rem 2rem;
    font-family: 'IBM Plex Mono', monospace, 'Roboto Mono', monospace;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.submit-button:hover {
    background-color: var(--text-color);
    color: var(--background-color);
}

.form-status {
    margin-top: 1rem;
    padding: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.form-status.success {
    color: #4caf50;
    background-color: rgba(76, 175, 80, 0.1);
    border-left-color: #4caf50;
}

.form-status.error {
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
    border-left-color: #f44336;
}

.form-status.sending {
    color: #2196f3;
    background-color: rgba(33, 150, 243, 0.1);
    border-left-color: #2196f3;
}

/* Footer */
footer {
    padding: 1.5rem;
    margin-top: auto;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    right: 0;
    top: 0;
    height: 1px;
    background-color: var(--text-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

/* Talks section */
.talks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.talk-item {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.talk-media {
    width: 100%;
    position: relative;
}

.video-thumbnail,
.podcast-thumbnail,
.pdf-thumbnail {
    width: 100%;
    height: auto;
    display: block;
}

.video-embed {
    position: relative;
    width: 100%;
}

/* Additional Talks List Styling */
.talks-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.talk-list-item {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative;
}

.talk-list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.talk-list-item h4 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-weight: bold;
}

.talk-list-item p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Alternative Talks List Styling */
.talks-list-alt {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
    row-gap: 0;
}

.talk-list-alt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    grid-column: span 1;
}

.talk-list-alt-item:nth-last-of-type(1),
.talk-list-alt-item:nth-last-of-type(2) {
    border-bottom: none;
}

.talk-list-alt-item h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
    width: 50%;
    padding-right: 0.5rem;
}

.talk-list-alt-item p {
    display: none; /* Hide the description - it doesn't fit properly */
}

.talk-list-alt-item a {
    white-space: nowrap;
    margin-left: auto;
    text-align: right;
}

@media (max-width: 1023px) {
    .talks-list {
        grid-template-columns: 1fr;
    }
    
    .talks-list-alt {
        grid-template-columns: 1fr;
    }
    
    .talk-list-alt-item:nth-last-of-type(2) {
        border-bottom: 1px solid var(--border-color);
    }
    
    .talk-list-alt-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .talk-list-alt-item h4 {
        width: 65%;
    }
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podcast-embed {
    position: relative;
    width: 100%;
}

.audio-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-button {
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-progress {
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    flex-grow: 1;
    position: relative;
}

.audio-progress::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30%;
    background-color: white;
}

.pdf-link {
    position: relative;
    display: block;
    width: 100%;
}

.pdf-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdf-link:hover .pdf-overlay {
    opacity: 1;
}

.pdf-icon {
    background-color: var(--text-color);
    color: var(--background-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}

.talk-details h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.talk-details p {
    line-height: 1.6;
    font-size: 0.95rem;
}

@media (max-width: 767px) {
    .talks-grid {
        grid-template-columns: 1fr;
    }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background-color: var(--background-color);
    border: 1px solid var(--text-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top::before {
    content: '↑';
    color: var(--text-color);
    font-size: 1.2rem;
}

/* Animation Classes */
.loading {
    opacity: 0;
}

.loaded {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

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

/* Markdown-like cursor effect - removed */
.content-wrapper {
    position: relative;
}

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

/* Responsive */
/* Hide theme toggle in desktop menu */
@media (min-width: 1024px) {
    .menu-theme-toggle {
        display: none;
    }
}

/* Tablet and Mobile Styles */
@media (max-width: 1023px) {
    .container {
        padding: 0 0 0 1rem;
    }
    
    /* Improved paragraph typography for mobile/tablet */
    p {
        font-size: 1rem;
        line-height: 1.6;
        letter-spacing: 0.01em;
    }
    
    .content-section p {
        margin-bottom: 1.2rem;
    }
    
    /* Hide theme toggle in header for mobile/tablet */
    .header-controls .theme-toggle {
        display: none;
    }
    
    /* Fullscreen menu for mobile/tablet */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background-color: var(--background-color);
    }
    
    .menu-close {
        position: absolute;
        top: 2rem;
        right: 2rem;
        width: 2rem;
        height: 2rem;
    }
    
    /* Show theme toggle inside mobile menu */
    .menu-theme-toggle {
        display: flex;
        margin-top: 2rem;
    }
    
    .menu-theme-toggle .theme-toggle {
        display: flex;
        align-items: center;
        gap: 1rem;
        color: var(--text-color);
    }
    
    .menu-links {
        gap: 2rem;
    }
    
    .menu-link {
        font-size: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .nav-item {
        font-size: 1.5rem;
        padding: 0.75rem 1rem;
    }
    
    .hero-image {
        height: 400px;
    }
}

/* Mobile Only Styles */
@media (max-width: 768px) {
    /* Further optimize typography for small screens */
    h1 {
        font-size: 1.75rem;
        max-width: 100%;
    }
    
    .hero-image {
        height: 300px;
    }
    
    /* Stack interests header on mobile */
    .interests-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .interests-heading {
        font-size: 2rem;
        margin-bottom: 0;
    }
    
    .interests-subheading {
        margin-bottom: 1.5rem;
    }
    
    p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .company-details p,
    .interest-text p,
    .talk-details p {
        font-size: 0.95rem;
        line-height: 1.7;
        margin-bottom: 1.2rem;
    }
    
    .interest-divider {
        margin-left: -1rem;
        padding-left: 1rem;
        width: calc(100% + 1rem);
    }
    
    .interest-divider p {
        font-size: 1.1rem;
        line-height: 1.5;
    }
    
    header::after,
    footer::before {
        left: -1rem;
    }
    
    .company-item {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-left: 0;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 90%;
        margin: 0 auto;
        padding-left: 2rem; /* More padding to avoid overlap */
    }
    
    .interests-header {
        grid-template-columns: 1.8fr 1fr;
        gap: 3rem;
    }
    
    /* Vertical line */
    .container::before {
        left: 14px; /* Move it to the right */
    }
    
    /* Horizontal lines don't extend all the way to the vertical line */
    header::after,
    footer::before {
        left: -1.8rem;
        width: calc(100% - 10px); /* Slightly shorter than container */
    }
    
    /* Adjust interest divider for tablet view */
    .interest-divider {
        margin-left: -2rem;
        padding-left: 2rem;
        width: calc(100% + 2rem);
    }

    h1 {
        font-size: 2.5rem;
        max-width: 80%;
    }

    .form-row {
        flex-direction: row;
    }
    
    .company-item {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 80%;
        margin: 0 auto;
    }
    
    .interests-header {
        grid-template-columns: 1.8fr 1fr;
        gap: 4rem;
    }

    h1 {
        font-size: 3rem;
        max-width: none;
    }

    .company-item {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
    
    .interest-content {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Fine-tune interest divider alignment for desktop */
    .interest-divider {
        margin-left: -1.5rem;
        padding-left: 1.5rem;
        width: calc(100% + 1.5rem);
    }
}

@media (min-width: 1440px) {
    h1 {
        font-size: 3.5rem;
        max-width: none;
    }
}
