:root {
    --paper: #f4f2ee;
    --paper-soft: #ebe8e2;
    --surface: #ffffff;
    --ink: #17222c;
    --muted: #69737c;
    --line: #d9d9d5;
    --navy: #17344d;
    --navy-soft: #e7edf1;
    --accent: #9b7653;
    --accent-soft: #f1e8df;
    --success: #426d5a;
    --warning: #956d2c;
    --shadow: 0 24px 65px rgba(31, 40, 48, .09);
    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 30px;
    --nav-height: 82px;
}

html[data-theme="dark"] {
    --paper: #11171c;
    --paper-soft: #171e24;
    --surface: #1c242b;
    --ink: #edf1f3;
    --muted: #a5afb6;
    --line: #313b43;
    --navy: #b7cfdf;
    --navy-soft: #202f39;
    --accent: #cba47f;
    --accent-soft: #352b24;
    --success: #81b39d;
    --warning: #d3ad6f;
    --shadow: 0 24px 65px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 24px); }
body {
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--paper);
    font-family: "Manrope", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: color .25s ease, background-color .25s ease;
}

a { color: inherit; text-decoration: none; }
p { margin: 0; color: var(--muted); line-height: 1.75; }
button, input, textarea { font: inherit; }
::selection { color: #fff; background: var(--navy); }

.scroll-progress { position: fixed; inset: 0 0 auto; z-index: 1200; height: 2px; }
.scroll-progress span { display: block; width: 0; height: 100%; background: var(--accent); }

.site-navbar {
    min-height: var(--nav-height);
    padding: 14px 0;
    border-bottom: 1px solid transparent;
    transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.site-navbar.is-scrolled,
.site-navbar:has(.navbar-collapse.show) {
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    border-color: var(--line);
    box-shadow: 0 8px 30px rgba(20, 30, 38, .04);
    backdrop-filter: blur(18px);
}
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-lockup:hover { color: var(--ink); }
.brand-monogram {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--surface);
    background: var(--navy);
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: -.04em;
}
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: .93rem; font-weight: 800; letter-spacing: -.02em; }
.brand-copy small { margin-top: 6px; color: var(--muted); font-size: .56rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.site-navbar .nav-link { position: relative; margin: 0 4px; padding: 10px 11px !important; color: var(--muted); font-size: .82rem; font-weight: 650; }
.site-navbar .nav-link:hover, .site-navbar .nav-link.active { color: var(--ink); }
.site-navbar .nav-link.active::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 4px; height: 1px; background: var(--accent); }
.navbar-tools { display: flex; align-items: center; gap: 8px; }
.language-switcher, .theme-toggle { display: flex; align-items: center; justify-content: center; height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; }
.language-switcher { padding: 0 13px; gap: 7px; color: var(--muted); font-size: .68rem; font-weight: 800; }
.language-switcher a.active { color: var(--navy); }
.theme-toggle { width: 38px; color: var(--ink); cursor: pointer; }
.navbar-toggler { width: 43px; height: 42px; padding: 8px; border: 1px solid var(--line); border-radius: 50%; box-shadow: none !important; }
.navbar-toggler span { display: block; width: 100%; height: 1px; margin: 5px 0; background: var(--ink); }

.section-kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); font-size: .67rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.section-kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.display-heading { max-width: 760px; margin: 18px 0 0; font-family: "DM Serif Display", Georgia, serif; font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 400; line-height: 1.02; letter-spacing: -.035em; }
.content-section { padding: 115px 0; }
.section-head { display: grid; grid-template-columns: 1.2fr .8fr; gap: 60px; align-items: end; margin-bottom: 52px; }
.section-head > p { max-width: 520px; justify-self: end; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 11px 19px; border-radius: 999px; font-size: .79rem; font-weight: 750; transition: transform .2s ease, color .2s ease, background-color .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary-elegant { color: #fff; border: 1px solid var(--navy); background: var(--navy); }
.btn-primary-elegant:hover { color: #fff; background: color-mix(in srgb, var(--navy) 88%, #000); border-color: color-mix(in srgb, var(--navy) 88%, #000); }
.btn-outline-elegant { color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.btn-outline-elegant:hover { color: var(--ink); border-color: var(--ink); }
.text-action { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: .82rem; font-weight: 750; }
.text-action i { color: var(--accent); transition: transform .2s ease; }
.text-action:hover i { transform: translateX(4px); }

.home-hero { padding: calc(var(--nav-height) + 92px) 0 78px; }
.hero-content { max-width: 780px; }
.hero-content h1 { margin: 21px 0 0; font-family: "DM Serif Display", Georgia, serif; font-size: clamp(4rem, 8vw, 8rem); font-weight: 400; line-height: .88; letter-spacing: -.055em; }
.hero-role { margin-top: 27px; color: var(--navy); font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 750; letter-spacing: -.025em; }
.hero-summary { max-width: 700px; margin-top: 18px; font-size: clamp(.98rem, 1.2vw, 1.08rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 31px; }
.hero-location { display: flex; align-items: center; gap: 8px; margin-top: 25px; color: var(--muted); font-size: .76rem; }
.portrait-frame { position: relative; max-width: 430px; margin: auto; padding: 13px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.portrait-frame::before { content: ""; position: absolute; top: 25px; right: -17px; width: 35px; height: 1px; background: var(--accent); }
.portrait-image, .portrait-placeholder { display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 20px; }
.portrait-image { object-fit: cover; object-position: center top; }
.portrait-placeholder { place-content: center; text-align: center; background: var(--paper-soft); }
.portrait-placeholder:not([hidden]) { display: grid; }
.portrait-placeholder[hidden] { display: none; }
.portrait-placeholder span { font-family: "DM Serif Display", serif; color: var(--navy); font-size: 4rem; }
.portrait-placeholder small { color: var(--muted); }
.portrait-number { position: absolute; top: 25px; left: -20px; z-index: 2; padding: 7px 10px; color: var(--surface); background: var(--navy); border-radius: 999px; font-size: .62rem; font-weight: 800; }
.portrait-label { display: grid; padding: 17px 8px 5px; }
.portrait-label strong { font-size: .87rem; }
.portrait-label span { margin-top: 4px; color: var(--muted); font-size: .69rem; }

.facts-section { padding-bottom: 22px; }
.facts-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: 0 15px 45px rgba(20, 30, 38, .04); }
.fact-item { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; min-height: 105px; padding: 22px 27px; border-right: 1px solid var(--line); }
.fact-item:last-child { border-right: 0; }
.fact-item > i:first-child { display: grid; place-items: center; width: 42px; height: 42px; color: var(--navy); background: var(--navy-soft); border-radius: 50%; }
.fact-item div { display: grid; }
.fact-item span { color: var(--muted); font-size: .64rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.fact-item strong { margin-top: 5px; font-size: .81rem; }
.fact-link { transition: background-color .2s ease; }
.fact-link:hover { color: var(--ink); background: var(--paper-soft); }
.fact-arrow { color: var(--accent); font-size: .82rem; }

.profile-section { padding-top: 130px; }
.profile-copy { max-width: 740px; margin-top: 31px; }
.profile-copy p { font-size: 1.03rem; }
.profile-copy p + p { margin-top: 17px; }
.interest-line { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 33px; padding-top: 24px; border-top: 1px solid var(--line); }
.interest-line span { color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.interest-line strong { font-size: .8rem; }

.achievement-widget { display: block; padding: 30px; color: var(--ink); border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: transform .25s ease, border-color .25s ease; }
.achievement-widget:hover { color: var(--ink); border-color: var(--accent); transform: translateY(-4px); }
.achievement-topline { display: flex; justify-content: space-between; color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.achievement-topline i { color: var(--accent); }
.achievement-body { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; margin-top: 30px; }
.percentile-ring { display: grid; place-items: center; width: 112px; height: 112px; padding: 8px; border-radius: 50%; background: conic-gradient(var(--navy) 0 97%, var(--paper-soft) 97% 100%); }
.percentile-ring > div { display: grid; place-content: center; width: 100%; height: 100%; text-align: center; background: var(--surface); border-radius: 50%; }
.percentile-ring strong { font-family: "DM Serif Display", serif; font-size: 2rem; font-weight: 400; line-height: 1; }
.percentile-ring span { margin-top: 3px; color: var(--muted); font-size: .55rem; font-weight: 800; letter-spacing: .12em; }
.achievement-body h3 { margin: 0; font-family: "DM Serif Display", serif; font-size: 2rem; font-weight: 400; }
.rank-text { display: block; color: var(--navy); font-size: 1.12rem; }
.achievement-body small { color: var(--muted); font-size: .68rem; }
.achievement-widget > p { margin-top: 25px; font-size: .86rem; }
.widget-action { display: inline-block; margin-top: 20px; color: var(--accent); font-size: .72rem; font-weight: 800; }

.skills-section { background: var(--paper-soft); }
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.skill-panel { position: relative; min-height: 315px; padding: 35px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 72%, transparent); }
.skill-panel > i { color: var(--accent); font-size: 1.6rem; }
.skill-number { position: absolute; top: 35px; right: 35px; color: var(--muted); font: 700 .63rem/1 monospace; }
.skill-panel h3 { margin: 55px 0 12px; font-size: 1.25rem; font-weight: 760; letter-spacing: -.025em; }
.skill-panel p { max-width: 550px; font-size: .87rem; }
.skill-tags, .project-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.skill-tags span, .project-tags span { padding: 6px 9px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font-size: .62rem; font-weight: 700; }

.projects-showcase { background: var(--surface); }
.home-project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.showcase-card { position: relative; display: flex; flex-direction: column; min-height: 440px; padding: 27px; overflow: hidden; color: var(--ink); border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.showcase-card:hover { color: var(--ink); border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-4px); }
.showcase-header { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font: 700 .61rem/1.4 monospace; letter-spacing: .07em; }
.project-status { padding: 6px 8px; color: var(--navy); border: 1px solid var(--line); background: var(--navy-soft); border-radius: 999px; font: 750 .58rem/1 sans-serif; letter-spacing: 0; }
.project-status.active { color: var(--success); }
.project-status.planned { color: var(--warning); background: var(--accent-soft); }
.showcase-icon { display: grid; place-items: center; width: 90px; height: 90px; margin: 55px 0 45px; color: var(--navy); border: 1px solid var(--line); background: var(--surface); border-radius: 50%; font-size: 2.4rem; }
.showcase-copy { margin-top: auto; }
.showcase-copy h3 { margin: 0 0 11px; font-family: "DM Serif Display", serif; font-size: clamp(1.8rem, 3vw, 2.7rem); font-weight: 400; letter-spacing: -.025em; }
.showcase-copy p { max-width: 620px; font-size: .86rem; }
.showcase-large { grid-column: 1 / -1; min-height: 390px; }
.showcase-large .showcase-icon { position: absolute; top: 95px; right: 8%; margin: 0; width: 130px; height: 130px; font-size: 3.4rem; }
.showcase-large .showcase-copy { max-width: 70%; }
.showcase-large .showcase-copy h3 { font-size: clamp(2.2rem, 4vw, 3.8rem); }
.mini-topology { display: flex; align-items: center; margin: 68px 0 48px; }
.mini-topology span { padding: 10px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; font: 700 .64rem/1 monospace; }
.mini-topology i { flex: 1; height: 1px; background: var(--line); }
.railway-mark { position: relative; display: flex; align-items: center; height: 120px; margin: 50px 0 40px; }
.railway-mark i { position: relative; z-index: 1; display: grid; place-items: center; width: 82px; height: 82px; color: var(--navy); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; font-size: 2rem; }
.railway-mark span { flex: 1; height: 18px; margin-left: -4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: repeating-linear-gradient(90deg, transparent 0 18px, var(--line) 18px 19px); }
.section-action { display: flex; justify-content: flex-end; margin-top: 35px; }

.experience-section { background: var(--paper); }
.experience-section .display-heading { margin-bottom: 28px; }
.clean-timeline { border-top: 1px solid var(--line); }
.timeline-row { display: grid; grid-template-columns: 160px 1fr; gap: 30px; padding: 32px 0; border-bottom: 1px solid var(--line); }
.timeline-row time { color: var(--muted); font: 700 .66rem/1.5 monospace; text-transform: uppercase; }
.timeline-row h3 { margin: 0; font-size: 1.13rem; font-weight: 760; }
.timeline-row strong { display: block; margin-top: 4px; color: var(--navy); font-size: .78rem; }
.timeline-row p { max-width: 620px; margin-top: 12px; font-size: .84rem; }

.closing-section { padding: 30px 0 105px; }
.closing-card { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: clamp(35px, 6vw, 65px); color: #fff; background: var(--navy); border-radius: var(--radius-lg); }
.closing-card h2 { margin: 0; font-family: "DM Serif Display", serif; font-size: clamp(2.2rem, 4vw, 4rem); font-weight: 400; }
.closing-card p { margin-top: 10px; color: color-mix(in srgb, #fff 70%, transparent); }
.closing-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.closing-card .btn-primary-elegant { color: var(--navy); background: #fff; border-color: #fff; }
.closing-card .btn-outline-elegant { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }

.site-footer { padding: 70px 0 28px; border-top: 1px solid var(--line); background: var(--paper-soft); }
.footer-main { display: grid; grid-template-columns: 1.4fr .55fr .8fr; gap: 70px; }
.footer-intro p { max-width: 460px; margin-top: 23px; font-size: .8rem; }
.footer-nav, .footer-contact { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; font-size: .77rem; }
.footer-nav > span, .footer-contact > span { margin-bottom: 5px; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.footer-nav a, .footer-contact a { color: var(--ink); }
.footer-nav a:hover, .footer-contact a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 60px; padding-top: 23px; color: var(--muted); border-top: 1px solid var(--line); font-size: .65rem; }
.toast { color: var(--ink); background: var(--surface); border-color: var(--line); }

.page-hero { padding: calc(var(--nav-height) + 110px) 0 85px; }
.compact-hero, .contact-hero { border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 900px; margin: 20px 0 0; font-family: "DM Serif Display", serif; font-size: clamp(4rem, 8vw, 8rem); font-weight: 400; line-height: .9; letter-spacing: -.055em; }
.page-hero p { max-width: 520px; }

.projects-page-section { padding: 55px 0 115px; }
.project-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 34px; }
.project-toolbar button { padding: 9px 14px; color: var(--muted); border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font-size: .7rem; font-weight: 750; cursor: pointer; }
.project-toolbar button.active { color: #fff; background: var(--navy); border-color: var(--navy); }
.projects-catalog { display: grid; gap: 18px; }
.catalog-card { position: relative; display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); min-height: 420px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.catalog-card.is-hidden { display: none; }
.catalog-number { position: absolute; top: 20px; left: 22px; z-index: 2; color: rgba(255,255,255,.72); font: 700 .63rem/1 monospace; }
.catalog-visual { position: relative; display: grid; place-content: center; min-height: 330px; color: #fff; background: var(--navy); }
.catalog-visual > i { font-size: 4.8rem; }
.catalog-visual > span, .catalog-visual > small { position: absolute; left: 23px; bottom: 20px; font: 700 .6rem/1 monospace; letter-spacing: .12em; }
.visual-3d { background: #29465e; }
.visual-management { background: #53664e; }
.visual-homelab { background: #27343f; }
.visual-railway { background: #75644f; }
.server-stack { display: flex; align-items: center; }
.server-stack i { font-size: 2.4rem; }
.server-stack span { width: 55px; height: 1px; margin: 0 10px; background: rgba(255,255,255,.45); }
.catalog-content { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 6vw, 68px); }
.catalog-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: .63rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.catalog-content h2 { margin: 24px 0 12px; font-family: "DM Serif Display", serif; font-size: clamp(2.2rem, 4vw, 4rem); font-weight: 400; letter-spacing: -.03em; }
.catalog-content > p { max-width: 680px; }
.details-toggle { display: inline-flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 28px; padding: 13px 0 0; color: var(--ink); border: 0; border-top: 1px solid var(--line); background: transparent; font-size: .72rem; font-weight: 800; cursor: pointer; }
.details-toggle i { transition: transform .2s ease; }
.details-toggle[aria-expanded="true"] i { transform: rotate(45deg); }
.catalog-details p { padding-top: 15px; font-size: .82rem; }

.resume-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.resume-heading > div { max-width: 800px; }
.resume-heading p { max-width: 680px; margin-top: 20px; }
.resume-section { padding: 0 0 115px; }
.resume-layout { display: grid; grid-template-columns: 310px 1fr; gap: 70px; }
.resume-sidebar { align-self: start; padding: 23px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.resume-photo { position: relative; overflow: hidden; aspect-ratio: 1 / 1.1; border-radius: 14px; background: var(--paper-soft); }
.resume-photo img, .resume-photo .portrait-placeholder { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.sidebar-block { display: grid; gap: 6px; padding: 20px 3px; border-bottom: 1px solid var(--line); }
.sidebar-block > span { color: var(--muted); font-size: .61rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-block a, .sidebar-block strong { font-size: .76rem; font-weight: 700; }
.plain-list { display: grid; gap: 8px; margin: 5px 0 0; padding: 0; list-style: none; color: var(--ink); font-size: .75rem; }
.sidebar-profile-link { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; margin-top: 21px; padding: 15px; color: var(--ink); background: var(--navy-soft); border-radius: 12px; }
.sidebar-profile-link > i:first-child { color: var(--navy); }
.sidebar-profile-link span { display: grid; color: var(--muted); font-size: .6rem; }
.sidebar-profile-link strong { color: var(--ink); font-size: .75rem; }
.resume-block { padding: 0 0 50px; margin-bottom: 45px; border-bottom: 1px solid var(--line); }
.resume-block:last-child { margin-bottom: 0; }
.resume-block > h2 { margin: 0 0 28px; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.resume-entry { display: grid; grid-template-columns: 165px 1fr; gap: 25px; padding: 23px 0; border-top: 1px solid var(--line); }
.resume-entry time { color: var(--muted); font: 700 .64rem/1.5 monospace; }
.resume-entry h3 { margin: 0; font-size: 1.08rem; font-weight: 760; }
.resume-entry strong { display: block; margin-top: 5px; color: var(--navy); font-size: .75rem; }
.resume-entry p { margin-top: 12px; font-size: .83rem; }
.resume-note { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; padding: 22px; background: var(--paper-soft); border-radius: 14px; }
.resume-note i { color: var(--accent); font-size: 1.25rem; }

.contact-section { padding: 75px 0 115px; }
.contact-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 60px; }
.contact-details { display: grid; align-content: start; gap: 13px; }
.contact-card { position: relative; display: grid; padding: 24px; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; }
.contact-card > span { color: var(--muted); font-size: .61rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.contact-card > a, .contact-card > strong { margin-top: 9px; font-size: .88rem; }
.contact-card button { display: inline-flex; align-items: center; gap: 7px; width: fit-content; margin-top: 17px; padding: 0; color: var(--accent); border: 0; background: transparent; font-size: .68rem; font-weight: 800; cursor: pointer; }
.contact-link-card { color: var(--ink); transition: border-color .2s ease; }
.contact-link-card:hover { color: var(--ink); border-color: var(--accent); }
.contact-link-card > i { position: absolute; top: 24px; right: 24px; color: var(--accent); }
.contact-form-card { padding: clamp(30px, 5vw, 55px); border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-form-card h2 { margin: 0 0 30px; font-family: "DM Serif Display", serif; font-size: 2.4rem; font-weight: 400; }
.form-alert { margin-bottom: 20px; padding: 13px 15px; border-radius: 10px; font-size: .75rem; }
.form-alert.success { color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); }
.form-alert.error { color: #a94d4d; background: color-mix(in srgb, #a94d4d 10%, transparent); }
.contact-form { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; }
.contact-form label { display: grid; gap: 8px; }
.contact-form label > span { color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.contact-form input, .contact-form textarea { width: 100%; padding: 13px 14px; color: var(--ink); border: 1px solid var(--line); outline: 0; background: var(--paper); border-radius: 10px; font-size: .84rem; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.contact-form textarea { resize: vertical; }
.form-footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.form-footer small { max-width: 420px; color: var(--muted); font-size: .65rem; line-height: 1.6; }

.reveal { opacity: 1; transform: none; }
.js-enabled .reveal { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
.js-enabled .reveal.is-visible { opacity: 1; transform: none; }
.js-enabled .reveal-delay-1 { transition-delay: .1s; }

@media (max-width: 991.98px) {
    :root { --nav-height: 74px; }
    .site-navbar .navbar-collapse { margin-top: 13px; padding: 15px; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }
    .navbar-tools { margin-top: 12px; }
    .section-head { grid-template-columns: 1fr; gap: 20px; }
    .section-head > p { justify-self: start; }
    .home-hero { padding-top: calc(var(--nav-height) + 70px); }
    .hero-content h1 { font-size: clamp(4rem, 14vw, 7rem); }
    .portrait-frame { max-width: 390px; }
    .facts-grid { grid-template-columns: 1fr; }
    .fact-item { border-right: 0; border-bottom: 1px solid var(--line); }
    .fact-item:last-child { border-bottom: 0; }
    .skills-grid { grid-template-columns: 1fr; }
    .home-project-grid { grid-template-columns: 1fr; }
    .showcase-large { grid-column: auto; }
    .showcase-large .showcase-icon { position: static; width: 90px; height: 90px; margin: 55px 0 45px; font-size: 2.4rem; }
    .showcase-large .showcase-copy { max-width: none; }
    .closing-card { align-items: flex-start; flex-direction: column; }
    .footer-main { grid-template-columns: 1fr 1fr; }
    .footer-intro { grid-column: 1 / -1; }
    .catalog-card { grid-template-columns: 1fr; }
    .resume-layout { grid-template-columns: 1fr; gap: 45px; }
    .resume-sidebar { display: grid; grid-template-columns: 210px 1fr; gap: 0 25px; }
    .resume-photo { grid-row: 1 / span 5; }
    .contact-layout { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
    .container { padding-left: 19px; padding-right: 19px; }
    .brand-copy small { display: none; }
    .content-section { padding: 82px 0; }
    .display-heading { font-size: clamp(2.5rem, 12vw, 4rem); }
    .home-hero { padding-bottom: 55px; }
    .hero-content h1 { font-size: clamp(3.8rem, 18vw, 5.7rem); }
    .hero-actions .btn { width: 100%; }
    .portrait-frame { width: calc(100% - 12px); }
    .profile-section { padding-top: 90px; }
    .achievement-body { grid-template-columns: 1fr; }
    .skill-panel { min-height: 290px; padding: 28px; }
    .showcase-card { min-height: 420px; padding: 23px; }
    .mini-topology span { padding: 8px; font-size: .55rem; }
    .timeline-row, .resume-entry { grid-template-columns: 1fr; gap: 10px; }
    .closing-section { padding-bottom: 80px; }
    .closing-actions, .closing-actions .btn { width: 100%; }
    .footer-main { grid-template-columns: 1fr; gap: 35px; }
    .footer-intro { grid-column: auto; }
    .footer-bottom { flex-direction: column; }
    .page-hero { padding-top: calc(var(--nav-height) + 75px); }
    .page-hero h1 { font-size: clamp(3.7rem, 18vw, 6rem); }
    .catalog-visual { min-height: 260px; }
    .catalog-content { padding: 27px 22px 34px; }
    .resume-heading { align-items: flex-start; flex-direction: column; }
    .resume-sidebar { display: block; }
    .resume-photo { margin-bottom: 15px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-footer { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .js-enabled .reveal { opacity: 1; transform: none; }
}

@media print {
    :root { --paper: #fff; --surface: #fff; --ink: #111; --muted: #555; --line: #ccc; }
    .site-navbar, .site-footer, .print-button, .scroll-progress, .toast-container { display: none !important; }
    .page-hero { padding: 20px 0 35px; }
    .resume-section { padding-bottom: 0; }
    .resume-layout { grid-template-columns: 230px 1fr; gap: 35px; }
    .resume-sidebar { padding: 0 20px 0 0; border: 0; }
    .resume-photo { max-height: 230px; }
    .resume-block { break-inside: avoid; }
    body { background: #fff; }
}
