/*************************************
 * FONT IMPORT & GLOBAL RESET
 *************************************/
@import url('config.css');

/* CSS Variables for Light/Dark Mode */
:root {
    /* Light Mode (Default) */
    --bg-color: #ffffff;
    --text-color: #333333;
    --secondary-text-color: #555555;
    --tertiary-text-color: #666666;
    --divider-color: rgba(0, 0, 0, 0.125);
    --card-bg-color: #ffffff;
    --hover-bg-color: rgba(0, 0, 0, 0.03);
    --shadow-color: rgba(0, 0, 0, 0.05);
    --transition-duration: 0.3s;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --secondary-text-color: #bbbbbb;
    --tertiary-text-color: #999999;
    --divider-color: rgba(255, 255, 255, 0.1);
    --card-bg-color: #1e1e1e;
    --hover-bg-color: rgba(255, 255, 255, 0.05);
    --shadow-color: rgba(0, 0, 0, 0.2);
}

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

/* Theme transitions - only on elements that actually change */
body,
.container,
.theme-toggle,
.video-card,
.experience-entry,
.project-entry,
.blog-entry,
hr,
.divider,
.divider::after,
.refresh-button,
pre,
code,
blockquote,
table,
th,
td {
    transition: background-color var(--transition-duration) ease, 
                color var(--transition-duration) ease, 
                border-color var(--transition-duration) ease,
                box-shadow var(--transition-duration) ease;
}

/* Disable transitions during initial theme paint to avoid flashing */
.no-theme-transition,
.no-theme-transition *,
.no-theme-transition *::before,
.no-theme-transition *::after {
    transition: none !important;
}

/*************************************
 * BASE TYPOGRAPHY & BODY
 *************************************/
html {
    overflow-x: hidden;
    max-width: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-color);
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
    padding: 0 5px;
    font-family: var(--font-heading);
}

h2 {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--secondary-text-color);
    padding: 0 5px;
    font-family: var(--font-heading);
}

/*************************************
 * TABLE OF CONTENTS (RIGHT SIDE)
 *************************************/
.navbar {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.nav-links li {
    text-align: right;
}

.nav-links li a {
    color: var(--tertiary-text-color);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 2px 10px;
    border-right: 2px solid var(--divider-color);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: var(--text-color);
    border-right-color: var(--text-color);
}

/*************************************
 * LAYOUT & CONTAINER
 *************************************/
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 15px;
}

.row {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
}

hr {
    margin: 20px 0;
    border: none;
    height: 1px;
    background: var(--divider-color);
}

hr.gradient-divider {
    background: linear-gradient(90deg, transparent, var(--divider-color) 20%, var(--text-color) 50%, var(--divider-color) 80%, transparent);
    opacity: 0.4;
}

/*************************************
 * HEADER & PROFILE
 *************************************/
#dhead {
    margin-top: 20px;
}

.header-grid {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    min-height: 250px;
}

.header-left {
    position: absolute;
    left: -120px;
    top: 0;
    z-index: 2;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
    width: 100%;
}

#dpic img {
    width: 250px;
    height: 250px;
    border-radius: 30%;
    object-fit: cover;
    object-position: 60% center;
    animation: fadeSlideIn 0.8s ease-out both;
}

#ddesc {
    padding-top: 0;
    width: 100%;
}

/*************************************
 * SOCIAL ICONS
 *************************************/
#dico {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.iico {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    filter: grayscale(1) brightness(0);
}

[data-theme="dark"] .iico {
    filter: grayscale(1) brightness(0) invert(1);
}

.cv-icon {
    fill: var(--text-color);
    border-radius: 0;
}

/*************************************
 * CONFIG BUTTON & PANEL
 *************************************/
.top-controls {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-controls .lang-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tertiary-text-color);
    background: var(--bg-color);
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-main);
    transition: all 0.2s ease;
}

.top-controls .lang-toggle:hover {
    color: var(--text-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.top-controls .theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tertiary-text-color);
    background: var(--bg-color);
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.top-controls .theme-toggle:hover {
    color: var(--text-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.config-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tertiary-text-color);
    background: var(--bg-color);
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.config-toggle:hover {
    color: var(--text-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.config-panel {
    position: fixed;
    top: 65px;
    right: 15px;
    z-index: 999;
    width: 240px;
    background: var(--bg-color);
    border: 1px solid var(--divider-color);
    border-radius: 10px;
    box-shadow: 0 4px 20px var(--shadow-color);
    padding: 16px;
    display: none;
    transition: background-color var(--transition-duration) ease,
                border-color var(--transition-duration) ease;
}

.config-panel.open {
    display: block;
}

.config-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.config-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.config-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--tertiary-text-color);
    line-height: 1;
    padding: 0 4px;
}

.config-close:hover {
    color: var(--text-color);
}

.config-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--tertiary-text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--font-main);
}

.config-label:hover {
    color: var(--text-color);
}

.collapse-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.config-label[aria-expanded="false"] .collapse-icon {
    transform: rotate(-90deg);
}

.config-section-body {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 1;
    margin-top: 8px;
}

.config-section-body.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.config-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--divider-color);
    border-radius: 20px;
    transition: background-color 0.2s ease;
}

.switch .slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-color);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.switch input:checked + .slider {
    background-color: var(--text-color);
}

.switch input:checked + .slider::before {
    transform: translateX(16px);
    background-color: var(--bg-color);
}

.font-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.font-option,
.heading-font-option,
.ascii-option,
.name-style-option,
.profile-pic-option {
    background: var(--hover-bg-color);
    border: 1px solid var(--divider-color);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 14px;
    text-align: left;
    transition: all 0.15s ease;
    font-family: var(--font-heading);
}

.font-option:hover,
.heading-font-option:hover,
.ascii-option:hover,
.name-style-option:hover,
.profile-pic-option:hover {
    background: var(--divider-color);
}

.font-option.active,
.heading-font-option.active,
.ascii-option.active,
.name-style-option.active,
.profile-pic-option.active {
    border-color: var(--text-color);
    font-weight: 600;
}

/*************************************
 * THEME TOGGLE
 *************************************/

#dico a:active {
    outline: none;
}

#dico a:hover {
    animation: flash 0.6s ease-in-out 1;
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    fill: var(--text-color);
}

/* Initial icon visibility based on detected theme - prevents flash */
.theme-icon-dark {
    display: none;
}

.theme-icon-light {
    display: block;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

/*************************************
 * NAME DISPLAY (ASCII ART & FONT STYLES)
 *************************************/
@keyframes revealRight {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

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

.font-name {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    padding: 10px 0;
    text-align: center;
    color: var(--text-color);
    white-space: nowrap;
    animation: fadeSlideIn 0.8s ease-out both;
}

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

@keyframes cursorFadeOut {
    to { opacity: 0; width: 0; margin: 0; }
}

.tagline-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5em;
}

.typing-cursor {
    font-size: clamp(0.85rem, 1.5vw, 1.05rem);
    color: var(--text-color);
    position: absolute;
    left: 2px;
    opacity: 0;
    animation: blink 0.5s step-end 0.8s 3, cursorFadeOut 0.2s ease 2.3s both;
}

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

.hero-tagline {
    font-size: clamp(0.85rem, 1.5vw, 1.05rem);
    color: var(--secondary-text-color);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
    padding: 2px 0 0 0;
    animation: revealRight 1.2s cubic-bezier(0.65, 0, 0.35, 1) 2.3s both;
}


.ascii-container,
.ascii-art {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.ascii-art pre {
    font-family: 'Courier New', monospace;
    white-space: pre;
    line-height: 1.2;
    font-size: clamp(6px, 1.2vw, 12px);
    text-align: left;
    margin: 0;
    width: auto;
    min-width: min-content;
    color: var(--text-color);
    animation: fadeSlideIn 0.8s ease-out both;
}

/*************************************
 * MAIN SECTIONS
 *************************************/
#left-section {
    grid-column: 1 / 6;
}

#left-section h2,
#right-section h2 {
    font-family: var(--font-main);
}

.divider {
    grid-column: 6 / 7;
    position: relative;
}

.divider::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background-color: var(--divider-color);
}

#right-section {
    grid-column: 7 / 12;
}

/*************************************
 * EXPERIENCE
 *************************************/
.experience-entry {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 15px;
    padding: 20px 10px;
    border-bottom: 1px solid var(--divider-color);
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    align-items: center;
}

.experience-entry:hover {
    background-color: var(--hover-bg-color);
    transform: translateX(4px);
    box-shadow: -2px 0 0 0 var(--text-color);
}

.experience-entry:last-child {
    border-bottom: none;
}

.experience-logo {
    width: 100px;
    height: 100px;
    border-radius: 6px;
    object-fit: contain;
    filter: brightness(0);
    transition: filter var(--transition-duration) ease;
}

[data-theme="dark"] .experience-logo {
    filter: brightness(0) invert(1);
}

.experience-logo.theme-swapped,
.experience-logo.color-logos {
    filter: none;
}

[data-theme="dark"] .experience-logo.theme-swapped,
[data-theme="dark"] .experience-logo.color-logos {
    filter: none;
}

.experience-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: relative;
    padding-right: 20px;
}

.experience-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    font-family: var(--font-heading);
    flex: 1;
}

.experience-date {
    font-size: 14px;
    color: var(--tertiary-text-color);
    white-space: nowrap;
    font-family: var(--font-heading);
    text-align: right;
    margin-left: auto;
    min-width: fit-content;
}

.experience-company {
    font-size: 16px;
    color: var(--secondary-text-color);
    margin: 0;
    font-family: var(--font-heading);
}

.experience-description {
    font-size: 14px;
    color: var(--tertiary-text-color);
    line-height: 1.4;
    margin: 5px 0 0 0;
}

.experience-entry.expandable {
    cursor: pointer;
}

.experience-entry.expandable .experience-header::after {
    content: '▸';
    font-size: 18px;
    color: var(--tertiary-text-color);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 10px;
}

.experience-entry.expandable:hover .experience-header::after {
    color: var(--text-color);
}

.experience-entry.expandable.expanded .experience-header::after {
    transform: rotate(90deg);
    color: var(--text-color);
}

.experience-details,
.experience-description {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.experience-entry.expanded {
    align-items: start;
}

.experience-entry.expanded .experience-header {
    align-items: flex-start;
}

.experience-entry.expanded .experience-logo-col {
    justify-content: flex-start;
}

.experience-entry.expanded .experience-details,
.experience-entry.expanded .experience-description {
    max-height: 800px;
    opacity: 1;
    margin-top: 8px;
}

.experience-details p {
    font-size: 14px;
    color: var(--tertiary-text-color);
    line-height: 1.5;
    margin: 6px 0;
}

.experience-details ul {
    margin: 6px 0;
    padding-left: 18px;
}

.experience-details li {
    font-size: 13px;
    color: var(--tertiary-text-color);
    line-height: 1.5;
    margin: 3px 0;
}

.experience-tools {
    font-size: 12px;
    color: var(--secondary-text-color);
    background: var(--hover-bg-color);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
    line-height: 1.4;
}

.badge-current {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #22c55e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 8px;
}

.dsl-projects-heading {
    padding: 0 5px;
}

.dsl-projects-heading h2,
#education h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
    padding: 0 5px;
    font-family: var(--font-heading);
}

.dsl-projects-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.dsl-projects-col {
    display: flex;
    flex-direction: column;
}

.dsl-projects-row .experience-entry:last-child {
    border-bottom: 1px solid var(--divider-color);
}

.experience-project {
    padding-left: 0;
}

.experience-logo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-width: 120px;
    flex-shrink: 0;
    justify-content: center;
}

.experience-details a {
    color: inherit;
    text-decoration: underline;
    transition: text-shadow 0.2s ease;
}

.experience-details a:hover {
    animation: flash 0.6s ease-in-out 1;
}

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

.badge-project {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-heading);
    padding: 2px 8px;
    border-radius: 4px;
    background-color: var(--hover-bg-color);
    border: 1px solid var(--divider-color);
    color: var(--text-color);
    text-align: center;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
}

.education-divider {
    margin: 30px 0 10px;
    text-align: left;
}

.education-divider hr {
    border: none;
    border-top: 1px solid var(--divider-color);
    margin-bottom: 12px;
}

.education-divider h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.experience-project .experience-logo {
    width: 100px;
    height: 100px;
}

/*************************************
 * CHATBOT SECTION
 *************************************/
.chatbot-container {
    margin-top: 20px;
    max-width: 100%;
}

.chatbot-placeholder {
    border: 1px dashed var(--divider-color);
    border-radius: 10px;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: var(--hover-bg-color);
}

.chatbot-notice {
    color: var(--tertiary-text-color);
    font-size: 14px;
    font-style: italic;
}

/*************************************
 * HIGHLIGHT VIDEO
 *************************************/
.highlight-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 5px;
    margin-top: 20px;
    max-width: 100%;
}

.highlight-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.highlight-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.highlight-description {
    font-size: 14px;
    color: var(--tertiary-text-color);
    line-height: 1.4;
    margin: 0;
}

/*************************************
 * VIDEO CONTAINER
 *************************************/
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 6px;
}

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

/*************************************
 * VIDEO GRID
 *************************************/
.video-grid-section {
    grid-column: 1 / -1;
}

.content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.header-text {
    flex: 1;
}

.refresh-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--tertiary-text-color);
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-family: var(--font-main);
}

.refresh-button svg {
    width: 24px;
    height: 24px;
}

.refresh-button span {
    font-size: 12px;
    font-weight: 500;
}

.refresh-button.spinning svg {
    animation: spin 0.2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
    padding: 5px;
}

.video-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: transparent;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: none;
}

.card-content {
    padding: 10px 0;
}

.video-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 10px 0;
}

.video-description {
    font-size: 14px;
    color: var(--tertiary-text-color);
    line-height: 1.4;
    margin: 0;
}

/*************************************
 * PROJECTS
 *************************************/
.project-header-intro {
    grid-column: 1 / -1;
    text-align: left;
    margin-bottom: 20px;
}

.project-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.carousel-nav-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.carousel-nav {
    display: flex;
    gap: 1px;
}

.carousel-see-more {
    font-size: 0.75rem;
    color: var(--tertiary-text-color);
    letter-spacing: 0.5px;
    font-weight: 500;
}

.carousel-button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--tertiary-text-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.carousel-button svg {
    width: 24px;
    height: 24px;
}

.carousel-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.project-carousel {
    grid-column: 1 / -1;
    position: relative;
}

.project-list {
    display: flex;
    flex-direction: row;
}

/* Desktop carousel behavior */
@media (min-width: 769px) {
    .project-carousel {
        overflow: hidden;
    }

    .project-list {
        transition: transform 0.25s ease;
    }
}

.project-page {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
}

.project-entry {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 20px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--divider-color);
}

.project-entry:first-child {
    padding-top: 0;
}

.project-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.project-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.project-icon img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: contain;
}

.project-title {
    margin: 0;
}

.project-title a {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    font-family: var(--font-heading);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.project-description {
    font-size: 14px;
    color: var(--tertiary-text-color);
    line-height: 1.4;
    margin: 0;
}

/*************************************
 * BLOG
 *************************************/
.blog-header-intro {
    grid-column: 1 / -1;
    text-align: left;
    margin-bottom: 20px;
}

.blog-list {
    grid-column: 1 / -1;
    padding: 0 15px;
}

.blog-entry {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 0;
    border-bottom: 1px solid var(--divider-color);
}

.blog-entry:first-child {
    padding-top: 0;
}

.blog-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Content Page Styles */
.content-header {
    text-align: center;
    margin-bottom: 40px;
}

.content-header h2 {
    white-space: nowrap;
}

.content-section {
    margin-bottom: 60px;
}

.section-header {
    text-align: left;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.subsection-header {
    text-align: left;
    margin: 40px 0 20px 0;
}

.subsection-header h3 {
    font-size: 1.5rem;
    color: var(--secondary-text-color);
    margin-bottom: 10px;
    font-family: var(--font-heading);
    font-weight: normal;
    display: inline-block;
    border-bottom: 1px solid var(--divider-color);
    padding-bottom: 5px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.content-card {
    padding: 15px 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content-card:hover {
    transform: translateY(-2px);
}

.content-card h3 {
    font-size: 1.3rem;
    color: var(--secondary-text-color);
    margin-bottom: 15px;
    font-family: var(--font-heading);
    font-weight: normal;
}

.content-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.content-card h3 a:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.content-card p {
    color: var(--secondary-text-color);
    line-height: 1.6;
    margin-bottom: 20px;
}

.content-card .button-link {
    display: inline-block;
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.content-card .button-link:hover {
    background-color: var(--secondary-text-color);
}

.embed-container {
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.embed-container iframe {
    width: 100%;
    height: auto;
    min-height: 351px;
}

.favorites-section {
    margin: 20px 0;
}

.favorites-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--tertiary-text-color);
    white-space: nowrap;
    font-family: var(--font-heading);
    font-weight: normal;
    transition: color 0.2s ease;
}

.favorites-toggle:hover {
    color: var(--text-color);
}

.favorites-icon {
    transition: transform 0.2s ease;
    display: inline-block;
}

.favorites-toggle.expanded .favorites-icon {
    transform: rotate(90deg);
}

.favorites-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    margin-top: 0;
}

.favorites-content.show {
    max-height: 500px;
    opacity: 1;
    margin-top: 15px;
}

.blog-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.blog-title {
    margin: 0;
    flex: 1;
}

.blog-title a {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.blog-date {
    font-size: 14px;
    color: var(--tertiary-text-color);
    white-space: nowrap;
    font-weight: 500;
}

.blog-description {
    font-size: 14px;
    color: var(--tertiary-text-color);
    line-height: 1.4;
    margin: 0;
}

/*************************************
 * CONTACT
 *************************************/
.contact-row {
    grid-column: 1 / -1;
    text-align: center;
    margin: 20px 0;
}

.contact-col {
    grid-column: 1 / -1;
}

.contact-link {
    color: var(--text-color);
    text-decoration: underline;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.contact-email {
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    margin-top: 10px;
    font-size: 16px;
    color: var(--secondary-text-color);
}

.contact-email a {
    color: var(--secondary-text-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

/*************************************
 * BOTTOM CTA
 *************************************/
.channel-cta {
    padding: 5px;
    text-align: center;
}

.channel-cta p {
    margin: 0;
    font-size: 16px;
}

.channel-cta a {
    color: var(--text-color);
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.2s ease;
}

/*************************************
 * Theme-transitioning images
 *************************************/
.theme-image-container {
    position: relative;
    display: inline-block;
}

.theme-image-light,
.theme-image-dark {
    transition: opacity var(--transition-duration) ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Light theme settings */
:root:not([data-theme="dark"]) .theme-image-light {
    opacity: 1;
}

:root:not([data-theme="dark"]) .theme-image-dark {
    opacity: 0;
}

/* Dark theme settings */
[data-theme="dark"] .theme-image-light {
    opacity: 0;
}

[data-theme="dark"] .theme-image-dark {
    opacity: 1;
}

/*************************************
 * REFERRALS
 *************************************/
.referrals-header {
    grid-column: 1 / -1;
    padding: 10px 5px;
}

.referrals-list {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 15px 5px;
}

.referral-card {
    border-left: 3px solid var(--divider-color);
    padding: 15px 20px;
    transition: border-color 0.2s ease;
}

.referral-card:hover {
    border-left-color: var(--text-color);
}

.referral-quote {
    font-style: italic;
    color: var(--secondary-text-color);
    line-height: 1.6;
    margin-bottom: 10px;
}

.referral-author {
    font-size: 13px;
    color: var(--tertiary-text-color);
    font-weight: 500;
}

/*************************************
 * FOOTER
 *************************************/
.site-footer {
    text-align: center;
    padding: 30px 15px;
    color: var(--tertiary-text-color);
    font-size: 13px;
}

/*************************************
 * RESPONSIVE MEDIA QUERIES
 *************************************/

/* Hide TOC on smaller screens */
@media (max-width: 1200px) {
    .navbar {
        display: none;
    }
}

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Show only first 6 videos in 2-column layout */
    .video-card:nth-child(n+7) {
        display: none;
    }
}

/* Tablets */
@media (max-width: 991px) {
    .dsl-projects-row {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 50px;
    }
}

/* Mobile and small tablets */
@media (max-width: 768px) {
    .header-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: center;
        text-align: center;
    }

    .header-left,
    .header-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #dpic {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    #dpic img {
        width: 150px;
        height: 150px;
    }

    .ascii-container {
        width: 100%;
        padding: 0 10px;
    }

    .ascii-art {
        width: auto;
        min-width: min-content;
    }

    .ascii-art pre {
        font-size: clamp(7px, 2.5vw, 12px);
        width: auto;
    }

    #dico {
        width: 100%;
        margin-top: 10px;
        justify-content: center;
    }

    #left-section,
    #right-section {
        grid-column: 1 / -1;
    }

    .divider {
        grid-column: 1 / -1;
        height: 1px;
        margin: 20px 0;
        background-color: var(--divider-color);
    }

    .divider::after {
        display: none;
    }

    .experience-header {
        flex-direction: column;
        gap: 5px;
    }

    .experience-date {
        white-space: normal;
    }

    .project-page {
        min-height: 500px;
        justify-content: space-between;
    }

    .project-entry {
        grid-template-columns: 1fr;
        flex: 1;
        gap: 12px;
        padding: 15px 0;
    }

    .project-header {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        text-align: left;
    }

    .project-icon img {
        width: 80px;
        height: 80px;
    }

    .project-title a {
        font-size: 20px;
    }

    /* Mobile carousel with Embla */
    .project-carousel {
        overflow: hidden;
        position: relative;
    }

    .project-list {
        display: flex;
        flex-direction: row;
        gap: 20px;
        padding: 0 5px;
    }

    .project-page {
        display: none;
    }

    .project-entry {
        flex: 0 0 75%;
        min-width: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px 15px;
        border: none;
        border-right: 1px solid var(--divider-color);
        background: var(--bg-color);
        align-items: start;
    }

    .blog-header {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .blog-date {
        white-space: normal;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    /* Show only first 3 videos in 1-column layout */
    .video-card:nth-child(n+4) {
        display: none;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .ascii-art pre {
        font-size: clamp(5px, 2vw, 8px);
    }

    #dpic img {
        width: 130px;
        height: 130px;
    }

    /* Make carousel cards wider on small screens */
    .project-entry {
        flex: 0 0 90%;
    }

    .project-icon img {
        width: 60px;
        height: 60px;
    }

    .project-title a {
        font-size: 16px;
    }

    .project-description {
        font-size: 13px;
    }
}

/* Hover-capable devices only */
@media (hover: hover) {
    .refresh-button:hover {
        color: var(--text-color);
        background-color: var(--hover-bg-color);
        transform: scale(1.02);
        box-shadow: 0 2px 8px var(--shadow-color);
    }

    .carousel-button:hover:not(:disabled) {
        color: var(--text-color);
        background-color: var(--hover-bg-color);
        transform: scale(1.05);
    }
}

/* Touch device active state */
.refresh-button:active,
.carousel-button:active:not(:disabled) {
    color: var(--text-color);
    background-color: var(--hover-bg-color);
    transform: scale(1.02);
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.1s ease;
}
