/* =========================================================
   Two-Column CV — 2026 redesign (sidebar + main)
   - Design basis: cv-hr-friendly.html template (visual language only,
     no placeholder data — content comes from script.js)
   - Soft colors, large typography, comfortable spacing
   - Big touch targets and visible focus outlines
   - Dark theme and reduced-motion support
   - Sidebar stays dark in both themes
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ---------- Design Tokens ---------- */
:root {
    /* Light theme (main content area) */
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #2a2e34;
    /* soft dark text */
    --muted: #6f7785;
    /* secondary text */
    --border: #e8ecf2;
    /* thin separators */
    --accent: #4ea0df;
    /* calm accent color */
    --accent-soft: color-mix(in oklab, var(--accent) 16%, var(--card));
    --chip-bg: #f7f8fb;
    --chip-br: #e9edf3;
    --shadow: 0 10px 24px rgba(15, 23, 42, .06);

    /* Radii & spacing */
    --r-md: 14px;
    --r-lg: 18px;
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 20px;
    --space-5: 28px;
    --space-6: 40px;

    /* Typography */
    --font-size: 16px;
    --lh: 1.7;
    --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-display: 'Sora', var(--font-body);
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Monochrome icons (main area, theme-aware) */
    --icon-filter: grayscale(1) brightness(0);
    --icon-filter-inverted: grayscale(1) invert(1) brightness(1.05);

    /* Sidebar — constant across themes (stays dark in both) */
    --sidebar-bg: #12171f;
    --sidebar-text: #e8ecf1;
    --sidebar-muted: #9fb3c8;
    --sidebar-border: #2a3441;
    --sidebar-chip-bg: #1c232e;
    --sidebar-accent: #2c5f8a;
    --sidebar-accent-dark: #1b3a54;

    /* Status badge — constant, always sits on the dark sidebar */
    --status-bg: rgba(31, 157, 102, .15);
    --status-border: rgba(31, 157, 102, .35);
    --status-text: #4ade94;
    --status-dot: #4ade94;
}

[data-theme="dark"] {
    --bg: #0b1016;
    /* deep dark background */
    --card: #0f141b;
    --text: #e5e7eb;
    /* soft light text */
    --muted: #a6adbb;
    /* secondary text in dark theme */
    --border: #1b2330;
    --accent: #66b4ee;
    /* accent for dark theme */
    --chip-bg: #111721;
    --chip-br: #1b2330;
    --shadow: 0 10px 24px rgba(0, 0, 0, .50);

    --icon-filter: var(--icon-filter-inverted);
}

/* ---------- Global Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    color-scheme: light dark;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: var(--font-size)/var(--lh) var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.grid {
    display: grid;
    gap: var(--space-3);
}

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

@media (min-width:640px) {
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width:900px) {
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---------- Page (two-column layout) ---------- */
.page {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
    background: var(--card);
    box-shadow: 0 0 0 1px var(--border);
}

/* ---------- Sidebar (always dark) ---------- */
.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 40px 32px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .controls {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.sidebar .btn {
    background: var(--sidebar-chip-bg);
    border-color: var(--sidebar-border);
    color: var(--sidebar-text);
}

.sidebar .btn:hover {
    background: var(--sidebar-border);
    border-color: var(--sidebar-border);
    box-shadow: none;
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sidebar-accent), var(--sidebar-accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    color: #fff;
    margin-bottom: 16px;
}

.sidebar h1 {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

.sidebar .role {
    color: var(--sidebar-muted);
    font-size: 13.5px;
    margin-bottom: 18px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--status-bg);
    border: 1px solid var(--status-border);
    color: var(--status-text);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 20px;
    margin-bottom: 26px;
}

.status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-dot);
}

.sb-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 26px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sb-nav a {
    color: var(--sidebar-muted);
    opacity: 1;
    text-decoration: none;
    margin: 0;
    font-size: 13.5px;
    padding: 2px 0;
    transition: color .2s ease;
}

.sb-nav a:hover {
    color: #fff;
    text-decoration: none;
}

.sb-block {
    margin-bottom: 26px;
}

.sb-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    margin-bottom: 10px;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--sidebar-muted);
    margin-bottom: 8px;
    text-decoration: none;
}

.contact-row.link-row {
    color: var(--sidebar-muted);
}

.contact-row:hover {
    color: #fff;
}

.contact-row img.sb-ico {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    filter: var(--icon-filter-inverted);
    opacity: .85;
}

.skills-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skills-chips .badge {
    background: var(--sidebar-chip-bg);
    border-color: var(--sidebar-border);
    color: var(--sidebar-muted);
    font-size: 12.5px;
    padding: 5px 10px;
}

/* ---------- Main content ---------- */
.main {
    padding: 56px 56px 60px;
    min-width: 0;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 12px 16px;
    /* at least 44px tall */
    min-height: 44px;
    border: 1px solid var(--chip-br);
    background: color-mix(in oklab, var(--card) 90%, transparent);
    border-radius: var(--r-md);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
    box-shadow: none;
}

.btn:hover {
    transform: translateY(-1px);
    background: color-mix(in oklab, var(--chip-bg) 80%, transparent);
    border-color: color-mix(in oklab, var(--chip-br) 88%, transparent);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.btn-ghost {
    padding: 10px 12px;
    min-height: 36px;
}

/* Visible focus outline for keyboard users */
:where(a, button).btn:focus-visible,
:where(a, button):focus-visible {
    outline: 2px solid color-mix(in oklab, var(--accent) 70%, transparent);
    outline-offset: 2px;
    border-radius: calc(var(--r-md) - 2px);
}

/* ---------- Sections ---------- */
.section {
    scroll-margin-top: 24px;
    padding: 34px 0;
}

.section:first-child {
    padding-top: 0;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 22px;
}

.section-head h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.section-head .rule {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* ---------- Hero ---------- */
.hero .eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.hero h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(28px, 4.6vw, 42px);
    line-height: 1.18;
    max-width: 680px;
    margin: 0 0 14px;
    letter-spacing: -0.01em;
    color: var(--text);
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.lead {
    color: var(--muted);
    max-width: 70ch;
    /* comfortable line length */
}

/* ---------- Badges (skills) ---------- */
.badge {
    display: inline-block;
    border: 1px solid var(--chip-br);
    background: var(--chip-bg);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    color: color-mix(in oklab, var(--text) 82%, transparent);
    white-space: nowrap;
}

/* ---------- Typography ---------- */
h2 {
    font-size: clamp(22px, 2.8vw, 30px);
    margin: 0 0 16px;
    font-weight: 650;
    color: var(--text);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 18px;
    margin: 0 0 8px;
    font-weight: 650;
    color: var(--text);
}

ul {
    margin: 0;
    padding: 0 0 0 18px;
}

/* ---------- Experience: timeline with dots ---------- */
.timeline {
    position: relative;
    padding-left: 26px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--border);
}

.tl-item {
    position: relative;
    padding-bottom: 28px;
}

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

.tl-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--accent);
}

.tl-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.tl-title {
    font-weight: 600;
    font-size: 15.5px;
    margin-bottom: 3px;
    color: var(--text);
}

.tl-org {
    color: var(--accent);
    font-size: 13.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.tl-desc {
    color: var(--muted);
    font-size: 14px;
    max-width: 640px;
}

.tl-desc ul {
    margin: 8px 0 0 18px;
}

.tl-desc li {
    margin-bottom: 5px;
}

/* ---------- Projects ---------- */
.proj-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.proj-card {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px 20px;
    background: var(--card);
}

.proj-card h4 {
    font-family: var(--font-display);
    font-size: 14.5px;
    margin: 0 0 6px;
    color: var(--text);
}

.proj-card p {
    font-size: 13.5px;
    color: var(--muted);
    margin: 0;
}

/* ---------- Certificates ---------- */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cert-card .cert-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
}

.cert-card .cert-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* ---------- CTA block (contacts) ---------- */
.cta-block {
    background: linear-gradient(135deg, var(--sidebar-bg), var(--sidebar-accent-dark));
    border-radius: var(--r-lg);
    padding: 32px 36px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.cta-block h3 {
    font-family: var(--font-display);
    font-size: 17px;
    margin: 0 0 5px;
    color: #fff;
}

.cta-block p {
    color: var(--sidebar-muted);
    font-size: 13.5px;
    margin: 0;
    max-width: 480px;
}

.cta-btn {
    background: #fff;
    color: var(--sidebar-bg);
    font-weight: 600;
    font-size: 13.5px;
    padding: 11px 22px;
    border-radius: 8px;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.cta-btn:hover {
    text-decoration: none;
    opacity: .9;
}

/* ---------- Footer ---------- */
.footer {
    color: var(--muted);
    text-align: center;
    padding: var(--space-5) 0 0;
}

/* ---------- Animations (subtle) ---------- */
.fade-in {
    opacity: 0;
    transform: translateY(6px);
    animation: fade .45s ease forwards;
}

@keyframes fade {
    to {
        opacity: 1;
        transform: none;
    }
}

.stagger>* {
    animation-delay: calc(var(--i) * 60ms);
}

.stagger>* {
    opacity: 0;
    transform: translateY(6px);
    animation: fade .45s ease forwards;
}

/* Respect the reduced-motion setting */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ---------- Links ---------- */
.link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed color-mix(in oklab, var(--muted) 55%, transparent);
}

.link:hover {
    opacity: .92;
}

/* ---------- Icons ---------- */
.ico {
    width: 18px;
    height: 18px;
    display: inline-block;
    filter: var(--icon-filter);
}

/* ---------- Small readability details ---------- */
::selection {
    background: color-mix(in oklab, var(--accent) 30%, transparent);
    color: var(--text);
}

/* ---------- Responsive collapse ---------- */
@media (max-width: 820px) {
    .page {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 32px 24px;
    }

    .main {
        padding: 40px 24px;
    }

    .proj-grid {
        grid-template-columns: 1fr;
    }

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

    .cta-block {
        flex-direction: column;
        align-items: flex-start;
    }
}
