/* Base */
html, body {
    margin: 0;
    padding: 0;
    background-color: #EAF6F6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 11.5pt;
    line-height: 1.45;
    color: #222;
}

a { color: #115e9a; text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { color: #1c8a8a; font-size: 22pt; margin: 0 0 4px 0; letter-spacing: 0.3px; }
h3 {
    color: #27acac;
    font-size: 13pt;
    margin: 0 0 6px 0;
    border-bottom: 1px solid #cfe7e7;
    padding-bottom: 3px;
    letter-spacing: 0.3px;
}
h4 { font-size: 11.5pt; margin: 6px 0 2px 0; }
p  { margin: 4px 0; }
ul { margin: 4px 0 4px 18px; padding: 0; }
li { margin: 2px 0; }
hr { display: none; }

/* A4 page boundary - flex column so content fills the entire page */
.page {
    width: 210mm;
    height: 297mm;
    box-sizing: border-box;
    padding: 12mm 14mm;
    margin: 12px auto;
    background: #ffffff;
    border: 2px solid #27acac;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #cfe7e7;
}
.header img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #cfe7e7;
}
.header .meta { font-size: 10.5pt; color: #444; line-height: 1.55; }
.header .meta a { color: #115e9a; }

/* Top nav (outside the A4 page) */
.nav {
    font-size: 9.5pt;
    width: 210mm;
    box-sizing: border-box;
    margin: 16px auto 0 auto;
    padding: 5px 6px;
    background: linear-gradient(135deg, #ffffff 0%, #eafafa 100%);
    border: 1px solid #cfe7e7;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(39, 172, 172, 0.08);
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
}
.nav a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    color: #1c8a8a;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1;
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.nav a:hover {
    background: #ffffff;
    color: #115e9a;
    border-color: #b9dede;
    box-shadow: 0 1px 4px rgba(39, 172, 172, 0.18);
    transform: translateY(-1px);
    text-decoration: none;
}
.nav a.download-link {
    gap: 6px;
    background: linear-gradient(135deg, #27acac 0%, #1c8a8a 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(28, 138, 138, 0.35);
}
.nav a.download-link:hover {
    background: linear-gradient(135deg, #1c8a8a 0%, #156b6b 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 3px 8px rgba(28, 138, 138, 0.45);
}
.nav a.download-link .dl-icon { vertical-align: middle; }

/* About section spacing */
section { margin-bottom: 6px; }
#about p { text-align: justify; }

/* Two-column body - grows to fill remaining vertical space */
.cols {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 18px;
    flex: 1 1 auto;
}
.cols .col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.cols .col > section { margin-bottom: 8px; }
.cols .col > section:last-child { margin-bottom: 0; }

/* Compact key-value lists */
.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 3px 6px; vertical-align: top; font-size: 10.5pt; }
.kv tr + tr td { border-top: 1px dotted #e0eded; }
.kv td:first-child { white-space: nowrap; color: #555; width: 1%; font-weight: 600; }

/* Experience entries */
.exp { margin: 6px 0; }
.exp + .exp { padding-top: 6px; border-top: 1px dotted #e0eded; }
.exp .row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11pt;
}
.exp .row .role { color: #444; font-style: italic; }
.exp .row .when { color: #666; font-style: italic; white-space: nowrap; }

/* Footer back-to-top */
.footer {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #cfe7e7;
    font-size: 9.5pt;
    color: #666;
    text-align: right;
}

/* Print: keep A4 boundary clean */
@page { size: A4; margin: 0; }
@media print {
    body { background: #fff; }
    .page { margin: 0; border: 1px solid #000; box-shadow: none; }
    a { color: #000; }
}