@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800&family=Roboto:wght@400;500;700&display=swap');

:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 4px 14px rgba(17, 24, 39, 0.08);
    --text: #1f2937;
    --text-soft: #374151;
    --muted: #6b7280;
    --accent-blue: #2980b9;
    --accent-orange: #f97316;
    --accent-teal: #10b981;
    /* Design tokens */
    --radius: 14px;
    --radius-sm: 10px;
    --ring: 0 0 0 3px rgba(41, 128, 185, 0.25);
    --ring-strong: 0 0 0 4px rgba(41, 128, 185, 0.28);
    --bg-grad-1: #f6f9fc;
    --bg-grad-2: #eef3f8;
}

.exp-duration {
    color: var(--accent-orange);
    font-weight: bold;
    margin-left: 8px;
    font-size: 1.01rem;
}

/* Experience section styles - vertical timeline */
.experience-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin: 8px 0 24px 0;
}

/* Landing blocks grid (3 columns) */
.experience-grid,
.landing-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 16px;
    margin: 8px auto 24px auto;
    align-items: start;
}

.experience-grid>.experience {
    width: 100%;
}

/* Make the first block span full width on desktop */
.experience-grid>.experience-featured {
    grid-column: 1 / -1;
}

/* Landing featured block spans full width on desktop */
.landing-grid>.landing-featured {
    grid-column: 1 / -1;
}

@media (max-width: 1050px) {

    .experience-grid,
    .landing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .experience-grid>.experience-featured,
    .landing-grid>.experience-featured {
        grid-column: auto;
    }
}

@media (max-width: 640px) {

    .experience-grid,
    .landing-grid {
        grid-template-columns: 1fr;
    }

    .experience-grid>.experience-featured,
    .landing-grid>.experience-featured {
        grid-column: auto;
    }
}

/* Prevent overlap: ensure each card grows naturally and cannot overlap next row */
.landing-grid>article {
    min-height: 10px;
    display: block;
}

/* Article itself is the card */
.landing-grid>article.md-section {
    overflow: hidden;
}

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

    .experience-grid>.experience-featured {
        grid-column: auto;
    }
}

.experience-list::before {
    content: "";
    position: absolute;
    left: 22px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.experience {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 18px 24px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    text-align: left;
    transition: box-shadow .2s ease, transform .06s ease;
    padding-left: 56px;
}

.experience::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 24px;
    width: 14px;
    height: 14px;
    background: var(--surface);
    border: 3px solid var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.experience:hover {
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.12);
    transform: translateY(-2px);
}

.experience.current::before {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
}

.exp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.exp-title {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
}

.exp-role {
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 1.08rem;
}

.exp-company {
    color: #2c3e50;
    font-weight: 600;
    opacity: 0.9;
}

.exp-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.exp-years {
    color: var(--muted);
    font-size: 0.98rem;
    font-weight: 600;
}

.exp-desc {
    color: var(--text-soft);
    font-size: 1.03rem;
}

.exp-points {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.exp-points li {
    margin: 6px 0;
    line-height: 1.45;
}

.exp-badge {
    background: rgba(249, 115, 22, 0.12);
    color: var(--accent-orange);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Flag icon for language switch */
.flag-icon {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    margin-left: 8px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(44, 62, 80, 0.10);
}

/* Language switch button */
.lang-switch {
    position: absolute;
    top: 24px;
    right: 40px;
    z-index: 10;
}

.lang-switch a {
    background: var(--accent-blue);
    color: #fff;
    padding: 8px 18px;
    border-radius: 18px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.10);
    transition: background 0.2s;
}

.lang-switch a:hover {
    background: var(--accent-orange);
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background: radial-gradient(1200px 600px at 50% -200px, var(--bg-grad-1), transparent 60%),
        linear-gradient(180deg, var(--bg-grad-2) 0%, var(--bg) 60%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding-left: clamp(6px, 1.5vw, 14px);
    padding-right: clamp(6px, 1.5vw, 14px);
}

.hero {
    min-height: auto;
    display: flex;
    align-items: flex-start;
    background: transparent;
    padding: 24px 0 16px 0;
}

.hero-inner {
    display: block;
    width: 100%;
}

.hero-text {
    width: 100%;
    max-width: none;
    /* let it align like lower sections */
}

.hero-title {
    color: var(--text);
    font-size: 2.8rem;
    margin: 0 0 8px 0;
}

/* New hero heading styles */
.hero-heading {
    margin-bottom: 12px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.hero-title-group {
    display: flex;
    flex-direction: column;
}

.hero-name {
    color: var(--text);
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
    font-weight: 800;
    font-size: 2.4rem;
    letter-spacing: -0.02em;
    margin: 0;
}

.hero-role {
    color: var(--muted);
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: 2px;
}

.hero-subtitle {
    color: var(--text-soft);
    font-size: 1.2rem;
    margin: 0;
    max-width: 100%;
    letter-spacing: 0.005em;
}

.hero-lead {
    margin: 0 0 12px 0;
    color: var(--text-soft);
    line-height: 1.65;
}

/* Nicer intro list visuals */
.hero-intro-list {
    margin: 12px 0 0 0;
    padding-left: 22px;
    max-width: 100%;
}

.hero-intro-list li {
    margin: 8px 0;
    line-height: 1.6;
}

.hero-intro-list li::marker {
    color: var(--accent-orange);
}

.hero-avatar {
    width: 140px;
    height: 140px;
}

.hero-avatar-inline {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.10);
}

.hero-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
}

/* Disabled buttons */
.btn.disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    filter: grayscale(10%);
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent-orange);
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, .25);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(41, 128, 185, .25);
}

.btn-secondary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* Tertiary button (for CV) */
.btn-tertiary {
    background: var(--accent-teal);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, .25);
}

.btn-tertiary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* Project actions and disabled links */
.project-actions {
    margin-top: 8px;
}

.project-desc {
    white-space: pre-line;
    /* render \n as line breaks */
}

.project-link {
    font-weight: 700;
    color: var(--accent-blue);
    text-decoration: none;
}

.project-link:hover {
    text-decoration: underline;
}

.project-link.disabled,
.project-link[aria-disabled="true"] {
    opacity: 0.5;
    filter: grayscale(10%);
    cursor: not-allowed;
    pointer-events: none;
}

/* Code blocks inside project descriptions */
.project-body pre {
    background: #f5f7fa;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    overflow: auto;
    margin: 10px 0 0 0;
}

.project-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #0f172a;
    white-space: pre;
}

.content {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 16px 0 48px 0;
    margin-top: 0;
}

/* Markdown-driven sections (landing pages) */
.md-section {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    /* tighter, no left gutter */
    width: 100%;
    max-width: none;
    margin: 0;
    transition: box-shadow .2s ease, transform .06s ease;
    border-top: 3px solid rgba(41, 128, 185, 0.12);
}

/* vertical line like experience timeline */

/* When md-section is standalone, we can show its own timeline; inside .experience we defer to the card */
.md-section::before,
.md-section::after {
    display: none;
}

.md-section:hover {
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.12);
    transform: translateY(-2px);
}

/* Inside experience card, remove extra padding-left so content aligns nicely */
/* No special left padding anywhere for md-section now */

.md-section h1,
.md-section h2,
.md-section h3,
.md-section h4 {
    margin-top: 12px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.md-section h1 {
    font-size: 2.0rem;
}

.md-section h2 {
    font-size: 1.5rem;
    color: var(--accent-blue);
}

.md-section h3 {
    font-size: 1.25rem;
}

.md-section p {
    color: var(--text-soft);
    font-size: 1.08rem;
    line-height: 1.7;
    margin: 10px 0 12px 0;
}

.md-section a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 700;
}

.md-section a:hover {
    text-decoration: underline;
}

.md-section a:focus-visible,
.btn:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-color: var(--accent-blue);
}

.md-section ul,
.md-section ol {
    margin: 8px 0 14px 0;
    padding-left: 22px;
}

.md-section li {
    margin: 6px 0;
    line-height: 1.6;
}

.md-section li::marker {
    color: var(--accent-orange);
}

.md-section blockquote {
    margin: 14px 0;
    padding: 10px 14px;
    border-left: 4px solid var(--accent-blue);
    background: rgba(41, 128, 185, 0.06);
    border-radius: 8px;
}

.md-section code:not(pre code) {
    background: #f5f7fa;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95rem;
}

.md-section pre {
    background: #f5f7fa;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    /* keep inner padding reasonable */
}

.md-section pre code {
    color: #0f172a;
    white-space: pre;
}

.md-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.md-section th,
.md-section td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
}

.md-section thead th {
    background: #f5f7fa;
}

.md-section img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.08);
}

@media (max-width: 720px) {
    .md-section {
        padding: 16px 14px;
    }

    .md-section h1 {
        font-size: 1.7rem;
    }

    .md-section h2 {
        font-size: 1.35rem;
    }

    .md-section h3 {
        font-size: 1.15rem;
    }
}

/* Three-column layout */
.layout {
    display: grid;
    /* Slightly wider side columns; center adjusted to keep balance */
    grid-template-columns: minmax(280px, 0.65fr) minmax(0, 5.2fr) minmax(280px, 0.65fr);
    gap: 16px;
    align-items: start;
}

.column-left,
.column-right,
.column-center {
    min-width: 0;
    /* prevent overflow */
}

/* Align first section at the very top for all columns */
.column-left .section:first-child,
.column-center .section:first-child,
.column-right .section:first-child {
    margin-top: 0;
}

/* Ensure sidebars render cards in a single column to avoid overflow into center */
.column-left .skills {
    grid-template-columns: 1fr;
}

.column-right .certs {
    grid-template-columns: 1fr;
}

/* Allow cards in sidebars to shrink within narrow columns */
.column-left .skill,
.column-right .cert {
    min-width: 0;
}

/* Prevent long words from overflowing in left sidebar skill cards */
.column-left .skill,
.column-left .skill-cat,
.column-left .skill-tag {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.column-left .skill-tag {
    max-width: 100%;
    white-space: normal;
}

/* Guard against stacking issues: keep sidebars above center if elements overlap */
.column-left,
.column-right {
    position: relative;
    z-index: 2;
}

.column-center {
    position: relative;
    z-index: 1;
}

/* Stack on small screens */
@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .column-left,
    .column-right,
    .column-center {
        order: initial;
    }
}

h1 {
    color: var(--text);
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
    letter-spacing: -0.01em;
    font-size: 2.7rem;
    margin-bottom: 10px;
}

h2,
h3,
h4 {
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
    letter-spacing: -0.01em;
}

p {
    color: var(--text-soft);
    font-size: 1.15rem;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.10);
    object-fit: cover;
}

.section {
    margin: 56px 0;
    padding-left: clamp(6px, 1.5vw, 14px);
    padding-right: clamp(6px, 1.5vw, 14px);
}


.skills,
.certs,
.blog,
.social {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.skills-categorized {
    flex-direction: column;
    gap: 12px;
}

.skill {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 220px;
    font-weight: 600;
    font-size: 1.02rem;
    text-align: left;
    transition: transform .08s ease, box-shadow .2s ease;
}

.skill:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

.skill-cat {
    margin-right: 8px;
    color: var(--accent-blue);
    font-weight: 800;
}

.skill-header {
    margin-bottom: 10px;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(41, 128, 185, 0.10);
    color: var(--text);
    font-weight: 600;
    border: 1px solid rgba(41, 128, 185, 0.18);
}


.cert {
    color: var(--accent-blue);
    background: var(--surface);
    border: 1px solid var(--border);
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .08s ease, box-shadow .2s ease;
}

.cert:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

.cert-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.cert-logo img {
    width: 64px !important;
    height: 64px !important;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
    object-fit: contain;
}

.cert-name {
    text-align: center;
    font-size: 1.08rem;
    font-weight: 600;
    margin-top: 2px;
}

.blog-post {
    color: #8e44ad;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 24px;
}

.social-link {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 24px;
    text-align: center;
}

.social-link a {
    color: var(--text);
    text-decoration: none;
    font-weight: bold;
}

.social-link a:hover {
    color: var(--accent-orange);
}

.project {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    margin: 20px 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

/* Unify radii (fallback if any missed) */
:is(.experience, .skill, .cert, .blog-post, .social-link, .project, .project-card, .contact-card, .calendar, .hours-panel, .summary, .md-section) {
    border-radius: var(--radius);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

.project:hover {
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

.project h2 {
    margin-top: 0;
    color: var(--accent-blue);
}

.project a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: bold;
}

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

/* New Projects grid and cards */
.projects-grid {
    display: grid;
    gap: 18px;
    /* Force full-width single column within the center column */
    grid-template-columns: 1fr;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    transition: transform .08s ease, box-shadow .2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

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

.project-title {
    margin: 0;
    font-size: 1.16rem;
    color: var(--accent-blue);
    letter-spacing: -0.005em;
}

/* Subheadings inside project descriptions (from Markdown #, ##, ###, ####) */
.project-subheading {
    margin: 10px 0 6px 0;
    font-size: 1.02rem;
    color: var(--text);
}

.project-desc {
    color: var(--text-soft);
    margin: 10px 0 6px 0;
    line-height: 1.55;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.project-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(41, 128, 185, 0.10);
    color: var(--text);
    font-weight: 600;
    border: 1px solid rgba(41, 128, 185, 0.18);
    font-size: 0.85rem;
}

.project-tag:hover {
    background: rgba(41, 128, 185, 0.16);
    border-color: rgba(41, 128, 185, 0.28);
}

.project-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Expand/Collapse projects */
.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.btn-link.project-toggle {
    background: transparent;
    color: var(--accent-blue);
    padding: 6px 8px;
    border: none;
    box-shadow: none;
    cursor: pointer;
}

.project-collapsible {
    transition: max-height .25s ease, opacity .2s ease;
    overflow: hidden;
}

.project-collapsible.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    margin-top: 0;
}

/* Contact page styles */
.contact-section {
    padding: 0 14px;
}

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-title {
    margin: 6px 0 16px 0;
}

.contact-form {
    display: block;
}

/* Guard: avoid duplicate native submit buttons if any input[type=submit] is present */
.contact-form input[type="submit"] {
    display: none !important;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
    border: 1px solid var(--border);
    background: #fbfcfe;
    border-radius: 10px;
    padding: 12px 12px;
    font-size: 1rem;
    color: var(--text);
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

/* Guard: if multiple primary submit buttons are rendered, keep only the first visually */
.contact-actions .btn.btn-primary:not(:first-of-type) {
    display: none !important;
}

/* Freelance scheduler */
.schedule-section {
    max-width: 980px;
    margin: 24px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.calendar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cal-title {
    font-weight: 700;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
    color: #6b7280;
    font-size: 13px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-cell {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 64px;
    padding: 6px;
    position: relative;
}

.cal-cell.cal-empty {
    background: transparent;
    border: none;
}

.cal-cell:hover {
    background: #f3f4f6;
    cursor: pointer;
}

.cal-cell.disabled,
.cal-cell.disabled:hover {
    background: #f9fafb;
    color: #9ca3af;
    border-color: #eee;
    cursor: not-allowed;
    opacity: 0.7;
}

.cal-date {
    font-weight: 600;
    font-size: 14px;
}

.cal-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}

.hours-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.hour-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.hour-slot {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    background: #f9fafb;
}

.hour-slot:hover {
    background: #f3f4f6;
}

.hour-slot.selected {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}

/* Reserved/disabled hour slots */
.hour-slot:disabled,
.hour-slot.reserved {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
    cursor: not-allowed;
    opacity: 0.85;
}

/* Dot indicator for days with any reserved hours */
.cal-dot-reserved {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f87171;
    /* red-400 */
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25);
}

.summary {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.summary .totals {
    display: flex;
    gap: 18px;
}

.summary .summary-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

@media (max-width: 900px) {
    .schedule-section {
        grid-template-columns: 1fr;
    }

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

.contact-note {
    color: var(--muted);
    font-size: 0.95rem;
}

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

/* Form validation helpers */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-error-message {
    color: #b91c1c;
    font-size: 0.92rem;
    margin-top: 6px;
}

.form-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 8px 0 16px 0;
    font-weight: 600;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: var(--muted);
    font-size: 1rem;
}

/* --- Carousel polish --- */
.carousel-slide>.md-section {
    min-height: 240px;
}

@media (max-width: 720px) {
    .carousel-slide>.md-section {
        min-height: 180px;
    }
}

.carousel-controls {
    gap: 12px;
}

.carousel-dots {
    background: rgba(41, 128, 185, 0.06);
    border: 1px solid rgba(41, 128, 185, 0.18);
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(41, 128, 185, 0.10);
}

.carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--border);
    transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
}

.carousel-dot:hover {
    transform: scale(1.15);
}

.carousel-dot.active {
    background: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.18);
}

.carousel-prev,
.carousel-next {
    background: linear-gradient(180deg, #ffffff, #f7fafc);
}

.carousel-prev:hover,
.carousel-next:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.12);
}

.carousel-slide.active .md-section {
    animation: slideIn .18s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 24px;
    }

    .hero-avatar {
        width: 110px;
        height: 110px;
        justify-self: start;
    }

    .container {
        padding: 0 8px;
    }

    .content {
        padding: 12px 0 24px 0;
    }
}

/* Responsive tweaks for experience */
@media (max-width: 600px) {
    .exp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .exp-meta {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Dark mode (automatic) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --surface: #0b1220;
        --border: #1f2937;
        --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
        --text: #e5e7eb;
        --text-soft: #d1d5db;
        --muted: #9ca3af;
        --accent-blue: #60a5fa;
        --accent-orange: #fb923c;
        --accent-teal: #34d399;
        --bg-grad-1: #0e1729;
        --bg-grad-2: #0b1321;
    }

    .experience-list::before {
        background: var(--border);
    }

    .experience::before {
        background: var(--surface);
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
    }

    /* Dark mode improvements for Markdown section */
    .md-section {
        background: var(--surface);
        border-color: var(--border);
        border-top-color: rgba(96, 165, 250, 0.22);
    }

    .md-section blockquote {
        background: rgba(96, 165, 250, 0.07);
        border-left-color: var(--accent-blue);
    }

    .md-section pre,
    .md-section code:not(pre code) {
        background: #0b172b;
        border-color: var(--border);
    }

    .md-section thead th {
        background: rgba(255, 255, 255, 0.03);
    }
}

/* Optional: orange variant for Spanish if container gets .lang-es on body */
body.lang-es .md-section::after {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.16);
}