/* Self-hosted font (variable woff2, latin subset) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #2d2d2d;
    background: #f8f9fa;
    line-height: 1.6;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    background: #ffffff;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header-area {
    padding: 48px 40px 0;
    flex-shrink: 0;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px 40px 64px;
    scrollbar-width: thin;
    scrollbar-color: #c8d4e0 transparent;
}

.content-area::-webkit-scrollbar {
    width: 6px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: #c8d4e0;
    border-radius: 3px;
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: #0078d4;
}

/* Header */
.header {
    padding-bottom: 6px;
    margin-bottom: 24px;
    border-bottom: 2px solid #c8d4e0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.header .name {
    font-size: 30px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.header .doc-title {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
}

.header .subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin-top: 2px;
}

.header .title-line {
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 12px;
    margin-bottom: 6px;
}

.header .summary-line {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
    letter-spacing: 0.2px;
}

.header .industries-line {
    font-size: 12px;
    color: #888;
    margin-top: 12px;
    letter-spacing: 0.2px;
}

/* Category section */
.category-section {
    margin-bottom: 36px;
    scroll-margin-top: 16px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e4e4e4;
}

.category-bar {
    width: 3px;
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
}

.category-bar.ai { background: #764ba2; }
.category-bar.azure { background: #0078d4; }
.category-bar.dotnet { background: #512bd4; }

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.2px;
}

.category-count {
    font-size: 13px;
    font-weight: 400;
    color: #888;
    margin-left: 6px;
}

/* Organization group — card style */
.org-group {
    margin: 0 5px 20px;
    scroll-margin-top: 16px;
    background: #fafbfc;
    border: 1px solid #eef0f2;
    border-radius: 8px;
    padding: 14px 16px 10px;
}

.org-header {
    margin-bottom: 8px;
}

.org-header + table + .org-header {
    margin-top: 24px;
}

.org-name {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    border: 1px solid #d4d8dc;
    border-radius: 4px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.org-name svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.org-transcript {
    font-size: 11px;
    color: #0078d4;
    opacity: 0.75;
    margin-left: 6px;
    text-decoration: none;
    transition: color 0.2s;
    vertical-align: middle;
}

.org-transcript:hover {
    opacity: 1;
}

/* Cert table */
.cert-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.cert-table th {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #bbb;
    text-align: left;
    padding: 4px 12px 6px;
}

.cert-table td {
    font-size: 14px;
    padding: 7px 12px;
    border-bottom: 1px solid #f3f3f3;
    vertical-align: middle;
}

.cert-table tr:last-child td {
    border-bottom: none;
}

.cert-table tbody tr {
    transition: background-color 0.15s;
}

.cert-name.architect {
    font-weight: 700;
}

.cert-table tbody tr:hover {
    background-color: #f8f9fb;
}

.cert-name {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #2d2d2d;
}

.cert-name a {
    color: #2d2d2d;
    text-decoration: none;
    transition: color 0.2s;
}

.cert-name a:hover {
    color: #0078d4;
}

.verify {
    font-size: 10px;
    font-weight: 500;
    color: #0078d4;
    opacity: 0.75;
    margin-left: 4px;
    transition: opacity 0.2s;
}

.cert-name a:hover .verify {
    opacity: 1;
}

.cert-year {
    font-size: 11px;
    font-weight: 400;
    color: #aaa;
    margin-left: 6px;
    transition: color 0.2s;
}

.cert-name a:hover .cert-year {
    color: inherit;
}

/* Sub-group separator within a cert table (e.g. Microsoft Applied Skills
   under Microsoft Certifications). Centered chip-style label with thin
   horizontal lines on either side, like a section break. */
.subgroup-separator td {
    padding: 14px 12px 6px !important;
    border-bottom: none !important;
}
.subgroup-separator:hover {
    background-color: transparent !important;
}
.subgroup-divider {
    display: flex;
    align-items: center;
    gap: 12px;
}
.subgroup-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e4e4e4;
}
.subgroup-label {
    font-size: 9px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #d4d8dc;
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: -2px;
}

.cert-skills {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #666;
}

.cert-skills.pending {
    font-style: italic;
    font-size: 11px;
    color: #999;
}

.cert-pending-verify {
    font-size: 10px;
    font-weight: 500;
    color: #0078d4;
    opacity: 0.3;
    margin-left: 4px;
}

/* Footer */
.footer {
    padding-top: 16px;
    margin-top: 24px;
    border-top: 1px solid #e4e4e4;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #bbb;
}

.footer a {
    color: #0078d4;
    opacity: 0.5;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer a:hover {
    opacity: 1;
}

/* Print button */
.print-btn {
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: #666;
    background: none;
    border: 1px solid #d4d8dc;
    border-radius: 6px;
    padding: 5px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.print-btn:hover {
    color: #0078d4;
    border-color: #0078d4;
    background: #f0f7ff;
}

.print-btn svg {
    width: 13px;
    height: 13px;
}

/* Touch devices and narrow viewports get whole-page scroll instead of
   the desktop pinned-header + inner-scroll pattern. Two triggers, OR'd:
   - Capability check (catches phones/tablets in any orientation)
   - max-width 1024px (catches landscape phones on browsers like Edge
     for Android that report hover:hover, plus desktop windows resized
     small) */
@media (hover: none) and (pointer: coarse), (max-width: 1024px) {
    .container { height: auto; min-height: 100vh; }
    .content-area { overflow-y: visible; overflow-x: hidden; }
}

/* Responsive — mobile */
@media (max-width: 768px) {
    .container { height: auto; min-height: 100vh; }
    .header-area { padding: 32px 20px 0; }
    .content-area { padding: 24px 20px 48px; overflow-y: visible; overflow-x: hidden; }
    .header-top { align-items: center; }
    .header .name { font-size: 26px; }
    .header .subtitle { font-size: 15px; }
    .category-title { font-size: 17px; }
    .org-name { font-size: 15px; }
    .org-transcript { font-size: 12px; }
    .org-group { margin-left: 0; padding: 12px 12px 8px; }
    .cert-table, .cert-table thead, .cert-table tbody, .cert-table tr, .cert-table th, .cert-table td { display: block; width: 100%; max-width: 100%; }
    .cert-table th { display: none; }
    .cert-table td { padding: 0 8px; border-bottom: none; overflow-wrap: break-word; word-break: break-word; font-size: 15px; }
    .cert-table td:first-child { padding: 8px 8px 0; }
    .cert-table td:last-child:not(:first-child) { padding: 0 16px 6px; font-size: 13px; color: #999; }
    .cert-table tr { margin-bottom: 2px; border-bottom: 1px solid #f0f0f0; padding-bottom: 2px; }
    .cert-table tr:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
    .cert-name a { color: #0078d4; }
    .cert-skills { font-size: 13px; }
    .verify, .cert-pending-verify { display: none; }
    .footer { flex-direction: column; gap: 4px; }
}

@media (max-width: 480px) {
    .header-area { padding: 24px 16px 0; }
    .content-area { padding: 20px 16px 40px; }
    .header .name { font-size: 24px; }
    .org-group { margin-left: 0; padding: 10px 10px 6px; }
    .category-header { gap: 8px; }
    .cert-table td { padding: 3px 6px; }
}

/* Print styles */
@page {
    margin: 10mm 10mm 20mm;
    @bottom-center {
        content: counter(page) " / " counter(pages);
        font-size: 9px;
        color: #999;
    }
}
@media print {
    body { background: #fff; }
    .container { height: auto; max-width: 100%; display: block; margin: 0; }
    .header-area { padding: 16px 32px 0; }
    .header { margin-bottom: 16px !important; padding-bottom: 16px !important; }
    .content-area {
        overflow: visible;
        padding: 4px 32px 40px;
    }
    .header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
    }
    .print-btn { display: none; }
    .footer { display: flex !important; flex-direction: row !important; justify-content: space-between !important; }
    /* Override mobile stacking for print */
    .cert-table { display: table !important; width: 100% !important; }
    .cert-table thead { display: table-header-group !important; }
    .cert-table tbody { display: table-row-group !important; }
    .cert-table tr { display: table-row !important; width: auto !important; border-bottom: none !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }
    .cert-table th { display: table-cell !important; }
    .cert-table td { display: table-cell !important; width: auto !important; padding: 7px 12px !important; border-bottom: 1px solid #f3f3f3 !important; font-size: 13px !important; color: #2d2d2d !important; }
    .cert-table tr:last-child td { border-bottom: none !important; }
    .verify, .cert-pending-verify { display: inline !important; }
    .cert-name a { color: #2d2d2d !important; }
    .cert-skills { font-size: 12px !important; color: #888 !important; }
    .header .name { font-size: 30px !important; }
    .header .subtitle { font-size: 14px !important; }
    .org-name { font-size: 12px !important; }
    .org-group { margin: 0 5px 20px !important; padding: 14px 16px 10px !important; }
    .cert-table tbody tr:hover { background-color: transparent; }
}
