/*
 * @file main.css
 * @brief Main stylesheet — subsurface/well-log design system (petrol teal + amber)
 * @author Carlos Esquivel
 * @date 2026-08-24
 */

/* ===== CSS VARIABLES FOR THEMING ===== */
:root {
    /* Light theme colors (default) — warm petroleum: cream paper, golden amber lead,
       petrol green secondary */
    --bg-primary: #faf6ec;
    --bg-secondary: #f2ecdd;
    --bg-tertiary: #e9e1cd;
    --text-primary: #241f14;
    --text-secondary: #4c4534;
    --text-tertiary: #665e4a;
    --text-muted: #857c66;
    --border-primary: #ddd4bd;
    --border-secondary: #eae3d0;
    --accent-primary: #b5731d;
    --accent-hover: #925b14;
    --accent-teal: #0e7a6c;
    --accent-amber: #b5731d;
    --accent-rust: #a8462d;
    --accent-blue: #3d6a96;
    --accent-contrast: #ffffff;
    --sidebar-bg: #f2ecdd;
    --card-bg: #fffdf6;
    --glow: rgba(181, 115, 29, 0.09);
    --glow-teal: rgba(14, 122, 108, 0.07);
    --shadow-card: 0 1px 2px rgba(76, 58, 22, 0.05), 0 10px 30px rgba(76, 58, 22, 0.07);

    --font-display: 'Archivo', 'Trebuchet MS', 'Segoe UI', sans-serif;
    --font-body: 'IBM Plex Sans', 'Segoe UI', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', 'Courier New', monospace;
}

/* Dark theme colors — crude oil: warm near-black with a golden sheen */
[data-theme="dark"] {
    --bg-primary: #14110a;
    --bg-secondary: #1a1610;
    --bg-tertiary: #241f15;
    --text-primary: #ede7da;
    --text-secondary: #c9c1ae;
    --text-tertiary: #aca389;
    --text-muted: #8c8370;
    --border-primary: #322b1d;
    --border-secondary: #262015;
    --accent-primary: #e0a24a;
    --accent-hover: #edb968;
    --accent-teal: #3cc2b0;
    --accent-amber: #e0a24a;
    --accent-rust: #d97b5e;
    --accent-blue: #7fa9d4;
    --accent-contrast: #241a09;
    --sidebar-bg: #171309;
    --card-bg: #1b1710;
    --glow: rgba(224, 162, 74, 0.10);
    --glow-teal: rgba(60, 194, 176, 0.06);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(1100px 520px at 82% -6%, var(--glow), transparent 62%),
        radial-gradient(900px 600px at -10% 108%, var(--glow-teal), transparent 60%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent-primary);
}

a:hover {
    color: var(--accent-hover);
}

::selection {
    background: var(--accent-primary);
    color: var(--accent-contrast);
}

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ===== TOP CONTROLS (THEME + LANGUAGE) ===== */
.top-controls {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    width: 40px;
    height: 34px;
    cursor: pointer;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
}

.language-toggle {
    display: flex;
    background-color: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    overflow: hidden;
}

.lang-btn {
    background: none;
    border: none;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-icon {
    width: 20px;
    height: auto;
    display: block;
    opacity: 0.45;
    transition: opacity 0.2s ease;
}

.lang-btn.active .flag-icon,
.lang-btn:hover .flag-icon {
    opacity: 1;
}

.lang-btn.active {
    background-color: var(--bg-tertiary);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-primary);
    padding: 2.5rem 1.75rem 2rem;
    overflow-y: auto;
    z-index: 1000;
    transition: width 0.3s ease, padding 0.3s ease, background-color 0.3s ease;
}

.sidebar.collapsed {
    width: 44px;
    padding: 4rem 0.35rem 2rem;
}

/* Hide text content when collapsed, keep icons visible and functional */
.sidebar.collapsed .profile-photo,
.sidebar.collapsed .sidebar-section h2,
.sidebar.collapsed .contact-item .contact-info {
    display: none;
}

.sidebar.collapsed .resume-btn span:not(.icon-svg),
.sidebar.collapsed .sidebar-navigation a span:not(.nav-icon) {
    display: none;
}

.sidebar.collapsed .contact-item {
    margin-bottom: 0.8rem;
    justify-content: center;
}

.sidebar.collapsed .sidebar-navigation a,
.sidebar.collapsed .resume-btn {
    padding: 0.5rem 0.25rem;
    margin-bottom: 0.3rem;
    justify-content: center;
    border-left: none;
}

.sidebar.collapsed .resume-btn .icon-svg,
.sidebar.collapsed .sidebar-navigation .nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sidebar.collapsed .resume-btn .icon-svg svg,
.sidebar.collapsed .sidebar-navigation .nav-icon svg {
    width: 22px;
    height: 22px;
}

/* Sidebar toggle button */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 330px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
    z-index: 1001;
    transition: left 0.3s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.sidebar.collapsed~.sidebar-toggle {
    left: 50px !important;
}

/* Profile photo */
.profile-photo {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-photo img {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
    outline: 1px solid var(--border-primary);
    outline-offset: 6px;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h2 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 0.5rem;
}

/* Contact details */
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.contact-item .icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
}

.contact-item .icon-svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: inline-block;
}

.contact-item .icon-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.contact-item .contact-info {
    min-width: 0;
    line-height: 1.3;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.contact-item a,
.contact-item .value {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.contact-item a {
    text-decoration: none;
}

.contact-item a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* Resume download */
.resume-downloads {
    display: flex;
    flex-direction: column;
}

.resume-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-left: 2px solid transparent;
    border-radius: 0;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.resume-btn:hover,
.resume-btn:focus {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    background: transparent;
}

.resume-btn .icon-svg {
    width: 22px;
    height: 22px;
}

.resume-btn .icon-svg svg {
    width: 100%;
    height: 100%;
}

/* Navigation */
.sidebar-navigation {
    list-style: none;
}

.sidebar-navigation li {
    margin-bottom: 0.2rem;
}

.sidebar-navigation a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-left: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.sidebar-navigation a:hover,
.sidebar-navigation a.active {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

.sidebar-navigation .nav-icon {
    width: 22px;
    text-align: center;
}

.sidebar-navigation .nav-icon svg {
    width: 22px;
    height: 22px;
    vertical-align: middle;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 340px;
    padding: 2rem;
    background: transparent;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed~.main-content {
    margin-left: 44px;
}

.main-content.sidebar-collapsed {
    margin-left: 44px;
}

.content-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== HERO SECTION ===== */
.hero-section {
    margin-bottom: 3.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 3rem;
    align-items: center;
}

.hero-section h1 {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4.5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.hero-role {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--accent-teal);
    margin-bottom: 1.75rem;
}

.intro-content {
    margin-bottom: 2rem;
}

.intro-text p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.1rem;
}

.intro-text strong {
    color: var(--text-primary);
}

.intro-text a {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-primary);
    transition: color 0.2s ease;
}

.intro-text a:hover {
    color: var(--accent-hover);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-primary);
    color: var(--accent-contrast);
    padding: 0.7rem 1.4rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.cta-button:hover {
    background-color: var(--accent-hover);
    color: var(--accent-contrast);
}

.cta-secondary {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.cta-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Well-log motif */
.hero-log {
    margin: 0;
    padding: 1.25rem 0.75rem;
    background: radial-gradient(72% 58% at 50% 46%, var(--glow), transparent 74%);
}

.hero-log svg {
    width: 100%;
    height: auto;
    display: block;
}

.log-grid line {
    stroke: var(--border-primary);
    stroke-width: 1;
}

.log-panel-label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    fill: var(--text-muted);
}

.hero-log svg line,
.hero-log svg polyline,
.hero-log svg path,
.hero-log svg rect {
    fill: none;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.log-grid line,
.log-grid rect {
    stroke: var(--border-primary);
    stroke-width: 1;
}

.log-teal {
    stroke: var(--accent-teal);
}

.log-amber {
    stroke: var(--accent-amber);
}

.log-muted {
    stroke: var(--text-muted);
}

.log-rust {
    stroke: var(--accent-rust);
}

.log-blue {
    stroke: var(--accent-blue);
}

.log-ink {
    stroke: var(--text-primary);
}

.log-draw {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: log-draw 2s ease-out 0.2s forwards;
}

.log-fadein {
    opacity: 0;
    animation: log-fade 0.9s ease-out 1.4s forwards;
}

.ripple {
    animation: ripple-pulse 3s ease-in-out infinite;
}

.ripple2 {
    animation: ripple-pulse 3s ease-in-out 0.6s infinite;
}

.ripple3 {
    animation: ripple-pulse 3s ease-in-out 1.2s infinite;
}

@keyframes log-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes log-fade {
    to {
        opacity: 1;
    }
}

@keyframes ripple-pulse {

    0%,
    100% {
        opacity: 0.25;
    }

    50% {
        opacity: 0.9;
    }
}

@media (prefers-reduced-motion: reduce) {

    .log-draw {
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }

    .log-fadein {
        opacity: 1;
    }

    .ripple,
    .ripple2,
    .ripple3 {
        animation: none;
        opacity: 0.7;
    }
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
    margin-bottom: 3.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.content-section:last-child {
    border-bottom: none;
}

.content-section h2 {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Section rule: four log-curve colors, like a well-log track header */
.content-section h2::before {
    content: "";
    display: block;
    width: 52px;
    height: 3px;
    margin-bottom: 0.8rem;
    background: linear-gradient(90deg,
            var(--accent-amber) 0 25%,
            var(--accent-teal) 25% 50%,
            var(--accent-rust) 50% 75%,
            var(--accent-blue) 75% 100%);
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* ===== PROJECT CARDS ===== */
.project-article {
    background: var(--card-bg);
    border: 1px solid var(--border-secondary);
    border-radius: 10px;
    padding: 1.5rem 1.6rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, background-color 0.3s ease, transform 0.2s ease;
}

.project-article:hover {
    border-color: var(--card-accent, var(--accent-primary));
    transform: translateY(-2px);
}

/* Each project card takes one log-curve color for its details */
.project-article:nth-child(4n+1) {
    --card-accent: var(--accent-amber);
}

.project-article:nth-child(4n+2) {
    --card-accent: var(--accent-teal);
}

.project-article:nth-child(4n+3) {
    --card-accent: var(--accent-rust);
}

.project-article:nth-child(4n+4) {
    --card-accent: var(--accent-blue);
}

.project-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.project-article h3 {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

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

.project-article h3 a:hover {
    color: var(--accent-primary);
}

.project-date {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.project-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-amber);
    border: 1px solid var(--accent-amber);
    border-radius: 999px;
    padding: 0.1rem 0.65rem;
    margin-bottom: 0.6rem;
}

.project-article p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.project-achievements {
    margin-top: 0.9rem;
    padding-left: 1.2rem;
}

.project-achievements li {
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.project-achievements li::marker {
    color: var(--card-accent, var(--accent-primary));
}

.project-achievements li strong {
    color: var(--text-primary);
    font-weight: 600;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.tech-chip {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 0.12rem 0.5rem;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-secondary);
}

.project-links a {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--card-accent, var(--accent-primary));
    text-decoration: none;
}

.project-links a:hover {
    text-decoration: underline;
}

/* ===== EXPAND BUTTON ===== */
.expand-btn {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.5rem 1.5rem;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.expand-btn:hover {
    background: var(--accent-primary);
    color: var(--accent-contrast);
}

/* ===== EXPERIENCE ===== */
.experience-article {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-primary);
}

.experience-article::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 0.45em;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--exp-accent, var(--accent-primary));
    border: 2px solid var(--bg-primary);
}

.experience-article:nth-of-type(4n+1)::before {
    --exp-accent: var(--accent-amber);
}

.experience-article:nth-of-type(4n+2)::before {
    --exp-accent: var(--accent-teal);
}

.experience-article:nth-of-type(4n+3)::before {
    --exp-accent: var(--accent-rust);
}

.experience-article:nth-of-type(4n+4)::before {
    --exp-accent: var(--accent-blue);
}

.experience-article h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.company-name {
    font-size: 0.95rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.experience-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.experience-article p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.experience-hidden .experience-article {
    margin-top: 2rem;
}

/* ===== TECH GRID ===== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.tech-category {
    padding: 1.4rem 1.5rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-card);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.tech-category:nth-child(4n+1) {
    --cat-accent: var(--accent-amber);
}

.tech-category:nth-child(4n+2) {
    --cat-accent: var(--accent-teal);
}

.tech-category:nth-child(4n+3) {
    --cat-accent: var(--accent-rust);
}

.tech-category:nth-child(4n+4) {
    --cat-accent: var(--accent-blue);
}

.tech-category h4 {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.tech-category h4::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--cat-accent, var(--accent-primary));
    margin-right: 0.5rem;
}

.tech-items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tech-skill-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.tech-skill-item:hover {
    border-color: var(--accent-primary);
}

.tech-skill-item .tech-item-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.tech-skill-item .tech-item-fa {
    font-size: 1rem;
    color: var(--cat-accent, var(--accent-primary));
    width: 20px;
    text-align: center;
}

/* ===== CONTACT INFO ===== */
.contact-info {
    margin-top: 1.5rem;
    padding: 1.4rem 1.5rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-card);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contact-info p {
    margin-bottom: 0.5rem;
    font-size: 0.98rem;
    color: var(--text-secondary);
}

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

.contact-info a {
    color: var(--accent-primary);
    text-decoration: none;
}

.contact-info a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===== ABOUT HIGHLIGHTS ===== */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.highlight-item {
    border-top: 2px solid var(--hl-accent, var(--border-primary));
    padding-top: 1rem;
}

.highlight-item:nth-child(3n+1) {
    --hl-accent: var(--accent-amber);
}

.highlight-item:nth-child(3n+2) {
    --hl-accent: var(--accent-teal);
}

.highlight-item:nth-child(3n+3) {
    --hl-accent: var(--accent-rust);
}

.highlight-item .icon {
    font-size: 1.15rem;
    color: var(--hl-accent, var(--accent-primary));
    margin-bottom: 0.6rem;
    display: block;
}

.highlight-item h4 {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.highlight-item p {
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== EDUCATION ===== */
.education-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.education-item {
    padding: 1.3rem 1.5rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-card);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.education-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.education-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.education-icon-fa {
    font-size: 1.6rem;
    color: var(--accent-primary);
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.education-item h4 {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.education-item .institution {
    font-size: 0.92rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.education-item .details {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.languages-section {
    padding: 1.3rem 1.5rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-card);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.languages-section h4 {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.language-item {
    text-align: center;
    padding: 0.7rem;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-primary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.language-item .language {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.language-item .level {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* ===== FOOTER ===== */
.site-footer {
    margin-left: 340px;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-primary);
    background: transparent;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed~.site-footer {
    margin-left: 44px;
}

.footer-content {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 900px) {
    body {
        display: flex;
        flex-direction: column;
    }

    /* Content first on mobile; contact/navigation block moves to the end */
    .main-content {
        order: 1;
        padding-top: 4rem;
    }

    .sidebar {
        order: 2;
    }

    .site-footer {
        order: 3;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding: 2rem 1.25rem 1rem;
        border-right: none;
        border-top: 1px solid var(--border-primary);
    }

    .sidebar.collapsed {
        width: 100%;
        padding: 4rem 1.25rem 1rem;
    }

    .sidebar.collapsed .profile-photo,
    .sidebar.collapsed .sidebar-section h2,
    .sidebar.collapsed .contact-item .contact-info {
        display: revert;
    }

    .sidebar.collapsed .resume-btn span:not(.icon-svg),
    .sidebar.collapsed .sidebar-navigation a span:not(.nav-icon) {
        display: revert;
    }

    .sidebar-toggle {
        display: none;
    }

    .main-content,
    .main-content.sidebar-collapsed,
    .sidebar.collapsed~.main-content {
        margin-left: 0;
        padding: 4.5rem 1rem 1rem;
    }

    .site-footer,
    .sidebar.collapsed~.site-footer {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-log {
        display: none;
    }

    .profile-photo img {
        width: 125px;
        height: 125px;
    }

    .tech-grid,
    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .highlights-grid {
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 0.5rem;
    }

    .hero-section h1 {
        font-size: 1.9rem;
    }

    .intro-text p {
        font-size: 0.98rem;
    }

    .project-article {
        padding: 1.2rem 1.1rem;
    }

    .hero-actions .cta-button,
    .hero-actions .cta-secondary {
        width: 100%;
        text-align: center;
    }
}
