/* ============================================================
   afumi.io — Minimalist Pure Static Web CV
   Design tokens & aesthetic inspired by ../cv-maker
   ============================================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---------- Design Tokens & Themes ---------- */
:root {
    color-scheme: light;
    --bg-main: #f0f2f5;
    --bg-card: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-subtle: #f1f5f9;
    --bg-subitems: #f8fafc;
    --bg-input: #ffffff;
    --border-color: #e2e8f0;
    --border-subtle: #cbd5e1;
    --border-subitems: #e2e8f0;
    --border-input: #d1d5db;
    --text-main: #1e293b;
    --text-title: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Warm Brownish Orange Accent */
    --accent: #b45309;
    --accent-hover: #92400e;
    --accent-subtle: #fef3c7;
    --accent-subtle-text: #92400e;
    --accent-border: #fcd34d;
    --accent-glow: rgba(180, 83, 9, 0.2);

    /* Button tokens matching cv-maker */
    --btn-sec-bg: #ffffff;
    --btn-sec-text: #374151;
    --btn-sec-border: #d1d5db;
    --btn-sec-hover: #f9fafb;

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg-main: #0b0f19;
    --bg-card: #151c2c;
    --bg-secondary: #1a2336;
    --bg-subtle: #1e293b;
    --bg-subitems: #0c1220;
    --bg-input: #0f172a;
    --border-color: #27354f;
    --border-subtle: #334155;
    --border-subitems: #26334d;
    --border-input: #3b4b66;
    --text-main: #f1f5f9;
    --text-title: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #8090a8;

    /* Warm Brownish Orange for Dark Mode */
    --accent: #f59e0b;
    --accent-hover: #fbbf24;
    --accent-subtle: rgba(245, 158, 11, 0.15);
    --accent-subtle-text: #fde68a;
    --accent-border: rgba(245, 158, 11, 0.35);
    --accent-glow: rgba(245, 158, 11, 0.25);

    --btn-sec-bg: #1e293b;
    --btn-sec-text: #e2e8f0;
    --btn-sec-border: #3b4b66;
    --btn-sec-hover: #263348;

    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.55);
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.65;
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* ---------- Header ---------- */
.app-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--accent);
    background: var(--accent-subtle);
    flex-shrink: 0;
    box-shadow: 0 1px 4px var(--accent-glow);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.header-brand:hover .brand-logo {
    transform: scale(1.05);
    border-color: var(--accent-hover);
}

.header-title h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-title);
    line-height: 1.2;
}

.header-title .subtitle {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover {
    color: var(--accent);
    text-decoration: none;
    background-color: var(--bg-subtle);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
}

.btn small {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
}

.btn-icon {
    font-size: 13px;
    display: inline-flex;
    align-items: center;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 2px 8px var(--accent-glow);
    text-decoration: none;
    color: #ffffff;
}

.btn-secondary {
    background: var(--btn-sec-bg);
    color: var(--btn-sec-text);
    border-color: var(--btn-sec-border);
}

.btn-secondary:hover {
    background: var(--btn-sec-hover);
    border-color: var(--border-input);
    text-decoration: none;
}

.btn-print {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
}

.btn-print:hover {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
    text-decoration: none;
    color: #ffffff;
}

/* ---------- Main Content Container ---------- */
.app-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---------- Profile Hero Card ---------- */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    display: flex;
    gap: 24px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.profile-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #eab308, var(--accent));
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
    background: var(--bg-secondary);
}

.status-badge-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2.5px solid var(--bg-card);
    border-radius: 50%;
}

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

.profile-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-names {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-title);
    letter-spacing: -0.02em;
}

.profile-handle {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--accent-border);
}

.profile-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.profile-tagline {
    font-size: 14px;
    color: var(--accent-hover);
    font-weight: 500;
    font-style: italic;
}

[data-theme="dark"] .profile-tagline {
    color: #fde68a;
}

.profile-bio {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.6;
}

.profile-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.profile-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* ---------- General Section Cards ---------- */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    flex-shrink: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-title);
    letter-spacing: -0.01em;
}

.section-badge {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-subtle);
    padding: 3px 9px;
    border-radius: 12px;
    border: 1px solid var(--accent-border);
}

/* ---------- Projects Grid ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

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

.project-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-title);
}

.project-role-badge {
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
}

.project-role-badge.status-highlight {
    background: var(--accent-subtle);
    color: var(--accent-subtle-text);
    border-color: var(--accent-border);
}

.project-meta-line {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
}

.project-desc {
    font-size: 13.5px;
    color: var(--text-main);
    line-height: 1.55;
}

.project-highlights {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0;
}

.project-highlights li {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    position: relative;
    padding-left: 16px;
}

.project-highlights li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

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

.tag-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    font-size: 12px;
}

.project-footer a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

/* ---------- Skills Section ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.skill-category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-category-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-title);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.skill-pill {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.skill-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Uses / Gear Section ---------- */
.uses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.uses-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uses-group-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-title);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.uses-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.uses-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.uses-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-title);
}

.uses-item-type {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 1px 6px;
    border-radius: 4px;
}

.uses-item-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ---------- Experience Timeline ---------- */
.timeline {
    position: relative;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--accent-border);
}

.timeline-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-role {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-title);
}

.timeline-org {
    color: var(--accent);
    font-weight: 600;
}

.timeline-period {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.timeline-summary {
    font-size: 13.5px;
    color: var(--text-main);
}

.timeline-bullets {
    list-style: none;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-bullets li {
    font-size: 12.5px;
    color: var(--text-secondary);
    padding-left: 14px;
    position: relative;
}

.timeline-bullets li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.timeline-meta-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-location {
    font-size: 11.5px;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* ---------- Dispatch / Haken Sub-items ---------- */
.dispatch-subitems {
    margin: 8px 0 4px 0;
    padding: 12px 14px;
    background: var(--bg-subitems);
    border: 1px solid var(--border-subitems);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dispatch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-subitems);
}

.dispatch-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dispatch-agency-note {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.dispatch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dispatch-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dispatch-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.dispatch-title-group {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-title);
}

.dispatch-org {
    color: var(--accent);
    font-weight: 600;
}

.dispatch-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dispatch-loc {
    background: var(--bg-subtle);
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.dispatch-summary {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ---------- Footer ---------- */
.app-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 20px 24px;
    margin-top: 24px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 14px;
}

/* ---------- Toast Notification (inspired by cv-maker) ---------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-title);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: 500;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.2s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   Print Media Query (@media print)
   Optimized for physical printing and PDF export
   ============================================================ */
@page {
    size: A4 portrait;
    margin: 12mm 14mm;
}

@media print {
    body {
        background: #ffffff !important;
        color: #111827 !important;
        font-size: 12px !important;
        line-height: 1.45 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .app-header,
    .header-actions,
    .profile-actions,
    .toast-container,
    .app-footer,
    .project-footer {
        display: none !important;
    }

    .app-main {
        max-width: 100% !important;
        padding: 0 !important;
        gap: 14px !important;
    }

    .profile-card,
    .section-card {
        box-shadow: none !important;
        border: 1px solid #d1d5db !important;
        padding: 14px 16px !important;
        border-radius: 6px !important;
        page-break-inside: avoid;
    }

    .profile-card::before {
        display: none !important;
    }

    .profile-avatar {
        width: 72px !important;
        height: 72px !important;
        border: 2px solid #b45309 !important;
    }

    .projects-grid,
    .uses-grid,
    .skills-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .project-card,
    .skill-category-card,
    .uses-group {
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
        padding: 12px !important;
        page-break-inside: avoid;
    }

    .timeline::before {
        background: #9ca3af !important;
    }

    .dispatch-subitems {
        background: #f9fafb !important;
        border: 1px solid #e5e7eb !important;
        border-left: 3px solid #b45309 !important;
        padding: 8px 10px !important;
        page-break-inside: avoid;
    }

    .dispatch-card {
        border: 1px solid #e5e7eb !important;
        background: #ffffff !important;
        box-shadow: none !important;
        padding: 6px 8px !important;
    }

    a {
        text-decoration: none !important;
        color: #111827 !important;
    }
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .profile-header-row {
        justify-content: center;
    }

    .profile-meta-row {
        justify-content: center;
    }

    .profile-actions {
        justify-content: center;
    }

    .header-inner {
        padding: 10px 16px;
    }

    .app-main {
        padding: 16px 12px 36px;
    }
}
