*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --cream: #f0f4f8;
    --ink: #0f1c2e;
    --rust: #1a4d8f;
    --rust-light: #4a7fc1;
    --muted: #5a6e84;
    --border: #c2d0de;
    --card: #e2eaf3;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--cream);
    color: var(--ink);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13.5px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ── NOISE TEXTURE OVERLAY ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
}

/* ── LAYOUT ── */
.page {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 40px 100px;
}

/* ── HEADER ── */
header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
    border-bottom: 1.5px solid var(--ink);
    padding-bottom: 28px;
    margin-bottom: 56px;
    opacity: 0;
    animation: fadeUp 0.7s ease forwards;
}

.header-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 10px;
    text-align: center;
    padding: 8px;
}

.header-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(38px, 7vw, 64px);
    line-height: 1;
    letter-spacing: -1px;
}

.header-name em {
    font-style: italic;
    color: var(--rust);
}

.header-tagline {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 10px;
    max-width: 420px;
}

.header-contact {
    text-align: right;
    font-size: 12px;
    color: var(--muted);
    line-height: 2;
}

.header-contact a {
    color: var(--rust);
    text-decoration: none;
    transition: color 0.2s;
}

.header-contact a:hover {
    color: var(--ink);
}

.cv-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 5px 14px;
    background: var(--rust);
    color: var(--cream) !important;
    border-radius: 2px;
    font-size: 11px;
    letter-spacing: 0.06em;
    transition: opacity 0.2s !important;
}

.cv-download-btn:hover {
    opacity: 0.82;
    color: var(--cream) !important;
}

/* ── SECTION ── */
section {
    margin-bottom: 52px;
    opacity: 0;
    animation: fadeUp 0.7s ease forwards;
}

section:nth-child(2) {
    animation-delay: 0.08s;
}

section:nth-child(3) {
    animation-delay: 0.16s;
}

section:nth-child(4) {
    animation-delay: 0.24s;
}

section:nth-child(5) {
    animation-delay: 0.32s;
}

section:nth-child(6) {
    animation-delay: 0.40s;
}

section:nth-child(7) {
    animation-delay: 0.48s;
}

.section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--rust);
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── ENTRY (experience / edu) ── */
.entry {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.entry:last-child {
    border-bottom: none;
}

.entry-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    line-height: 1.2;
}

.entry-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.entry-date {
    font-size: 11px;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
    align-self: start;
    margin-top: 3px;
}

.entry-body {
    grid-column: 1 / -1;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12.5px;
}

.entry-body ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entry-body ul li::before {
    content: '→ ';
    color: var(--rust);
}

/* ── LINKS ROW ── */
.link-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.link-chip {
    display: inline-block;
    padding: 4px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 11.5px;
    color: var(--ink);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.link-chip:hover {
    background: var(--rust);
    border-color: var(--rust);
    color: var(--cream);
}

/* ── SKILLS ── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.skill-group {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 16px 18px;
    border-radius: 2px;
}

.skill-group-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--rust);
    margin-bottom: 10px;
    font-weight: 500;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-tag {
    font-size: 11.5px;
    color: var(--ink);
    background: var(--cream);
    border: 1px solid var(--border);
    padding: 2px 9px;
    border-radius: 1px;
}

/* ── PROJECTS ── */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.project-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.project-item:last-child {
    border-bottom: none;
}

.project-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
}

.project-desc {
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 4px;
}

/* ── LANGUAGES ── */
.lang-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.lang-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lang-name {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
}

.lang-level {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ── FOOTER ── */
footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1.5px solid var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--muted);
    opacity: 0;
    animation: fadeUp 0.7s 0.55s ease forwards;
}

footer a {
    color: var(--rust);
    text-decoration: none;
}

/* ── HONOR BADGE ── */
.honor-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--rust);
    color: var(--cream);
    font-size: 11px;
    border-radius: 2px;
    letter-spacing: 0.06em;
}

/* ── ANIMATION ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .page {
        padding: 36px 20px 72px;
    }

    header {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }

    .header-contact {
        grid-column: 1 / -1;
        text-align: left;
    }

    .entry {
        grid-template-columns: 1fr;
    }

    .entry-date {
        text-align: left;
    }
}