/* Gergely Papp, variant A "Full-bleed panorama": single stylesheet. Palette from the approved Canva CV. */
:root {
    --stone: #EFECEA;
    --paper: #FEFEFE;
    --navy: #202944;
    --ink: #393939;
    --muted: #666;
    --red: #E53935;
    --red-strong: #D32F2F; /* button fill: white text passes AA */
    --line: #DEDAD6;
    --label: #0B0B0B;
    --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
    --nav-h: 56px;
    --gutter: clamp(16px, 4vw, 56px);
    --hero-h: clamp(520px, 70vh, 760px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    margin: 0; background: var(--paper); color: var(--ink);
    font: 400 1.0625rem/1.55 var(--body); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--navy); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--red); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--red-strong); outline-offset: 3px; }
section[id], footer[id] { scroll-margin-top: calc(var(--nav-h) + 12px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip-link {
    position: absolute; left: 16px; top: -100px; z-index: 100;
    background: var(--label); color: #fff; padding: .6rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Top nav: always there; the name appears only after the hero ---------- */
.topnav {
    position: sticky; top: 0; z-index: 50; height: var(--nav-h);
    background: rgba(254, 254, 254, .95);
    -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
}
.topnav-inner {
    max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 var(--gutter);
    display: flex; align-items: center; gap: 1.75rem;
}
.topnav-brand {
    font: 800 .95rem var(--display); letter-spacing: .08em; text-transform: uppercase;
    color: var(--navy); text-decoration: none; white-space: nowrap;
    transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}
.js .topnav-brand { opacity: 0; visibility: hidden; transform: translateY(6px); }
.js .hero-gone .topnav-brand { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.topnav nav { margin-left: auto; }
.topnav-links { list-style: none; display: flex; gap: 1.6rem; }
.topnav-links a, .topnav-cv { font: 600 .9rem var(--display); color: var(--ink); text-decoration: none; }
.topnav-links a:hover { color: var(--navy); text-decoration: underline; text-decoration-color: var(--red); }
.topnav-cv { background: var(--label); color: #fff; padding: .45rem .8rem; white-space: nowrap; }
.topnav-cv:hover { background: var(--navy); }
.nav-cv-item { display: none; }
.nav-toggle { display: none; }

/* ---------- Hero: full-bleed panorama ---------- */
.hero {
    position: relative; height: var(--hero-h); overflow: hidden;
    background: #6b7f99; display: flex; align-items: center;
}
/* .pano is the visible window. .pano-frame keeps the image's exact 3584:1536 ratio and
   "covers" the window, positioned by --px/--py (like object-position, in pure CSS); the
   SVG box inside uses the image's own pixel coordinates, so it is locked to the person.
   Wide screens crop top/bottom (mostly top: the feet are near the bottom edge). */
.pano { position: absolute; inset: 0; overflow: hidden; container-type: size; --px: .5; --py: .95; }
.pano-frame {
    --w: max(100cqw, 233.334cqh);
    position: absolute; width: var(--w); aspect-ratio: 3584 / 1536;
    left: calc((100cqw - var(--w)) * var(--px));
    top: calc((100cqh - var(--w) * .428571) * var(--py));
}
.pano-frame img { width: 100%; height: 100%; }
.hero-box { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hero-box-rect {
    fill: none; stroke: var(--red); stroke-width: 8; stroke-linejoin: miter;
    stroke-dasharray: 1; stroke-dashoffset: 0;
}
.hero-box-tag rect { fill: var(--red); }
.hero-box-tag text { fill: #fff; font: 600 44px var(--body); }

.hero-content {
    position: relative; z-index: 2; width: 100%; max-width: 1200px; margin: 0 auto;
    padding: 0 var(--gutter);
}
.hero-content > * { max-width: min(46vw, 600px); }
.hero-name { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.label { display: inline-block; background: var(--label); color: #fff; line-height: 1.15; }
.label-xl {
    font: 800 clamp(2.5rem, 5.4vw, 4.9rem)/1 var(--display);
    text-transform: uppercase; letter-spacing: .02em; padding: .08em .22em .1em;
}
.hero-title { margin-top: 16px; }
.label-md { font: 600 clamp(1rem, 1.6vw, 1.3rem) var(--display); padding: .5em .75em; }
.hero-sub { margin-top: 6px; }
.label-sm { font: 400 1rem var(--body); padding: .36em .7em; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.2rem;
    font: 600 .98rem var(--display); text-decoration: none; letter-spacing: .01em;
    transition: background-color .2s ease, color .2s ease;
}
.btn-primary { background: var(--red-strong); color: #fff; }
.btn-primary:hover { background: #B71C1C; }
.btn-light { background: #fff; color: var(--label); }
.btn-light:hover, .btn-light[aria-expanded="true"] { background: var(--stone); }

/* Contact panel (native popover, anchored to its button where supported) */
.contact-pop {
    border: 0; padding: 18px 20px 16px; min-width: 280px; max-width: calc(100vw - 32px);
    background: var(--paper); color: var(--ink); border-top: 3px solid var(--red);
    box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .45);
}
.contact-pop::backdrop { background: transparent; }
.contact-pop-h { font: 700 .78rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--navy); margin-bottom: 10px; }
.contact-pop ul { list-style: none; display: grid; gap: 8px; }
.contact-pop .phone-reveal { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.contact-pop-close { margin-top: 14px; font: 600 .85rem var(--display); color: var(--muted); }
.contact-pop-close:hover { color: var(--navy); }
.contact-btn { anchor-name: --contact; }
@supports (position-area: bottom) {
    .contact-pop {
        position-anchor: --contact; inset: auto; margin: 8px 0 0;
        position-area: bottom span-right; position-try-fallbacks: flip-block, flip-inline;
    }
}

/* Load-in motion: labels clip in left-to-right, then the detection box draws. */
@keyframes clip-in {
    from { clip-path: inset(0 100% 0 0); transform: translateX(-12px); }
    to { clip-path: inset(0 0 0 0); transform: none; }
}
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes tag-in { from { opacity: 0; transform: translateY(8px); } }
.hero .label, .hero .btn { animation: clip-in .75s cubic-bezier(.7, 0, .2, 1) var(--d, 0s) both; }
.hero-box-rect { animation: draw 1.5s cubic-bezier(.6, 0, .3, 1) 1.1s both; }
.hero-box-tag { animation: tag-in .4s ease-out 2.5s both; }
.js .hero:not(.is-ready) :is(.label, .btn, .hero-box-rect, .hero-box-tag) { animation-play-state: paused; }

/* ---------- Facts strip ---------- */
.facts { background: var(--paper); border-bottom: 1px solid var(--line); }
.facts-inner {
    list-style: none; max-width: 1200px; margin: 0 auto; padding: 18px var(--gutter);
    display: grid; grid-template-columns: 1fr 1.25fr 1.9fr 1.15fr; gap: 0 28px;
}
.facts li { font-size: .9rem; line-height: 1.4; color: var(--muted); padding-left: 14px; border-left: 3px solid var(--red); }
.facts strong { display: block; font: 700 1rem/1.3 var(--display); color: var(--navy); margin-bottom: 2px; }

/* ---------- CV body: main column + stone sidebar ---------- */
.cv-wrap { background: linear-gradient(to right, var(--paper) 50%, var(--stone) 50%); }
.cv { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.cv-main { background: var(--paper); padding: 52px clamp(24px, 4vw, 60px) 52px var(--gutter); }
.cv-side { background: var(--stone); padding: 52px var(--gutter) 52px clamp(24px, 3vw, 40px); }

.eyebrow {
    display: flex; align-items: center; gap: 12px;
    font: 700 .8rem var(--display); letter-spacing: .16em; text-transform: uppercase;
    color: var(--navy); margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 28px; height: 3px; background: var(--red); flex: none; }

/* Timeline that fills as you scroll */
.timeline { position: relative; padding-left: 40px; }
.timeline-track { position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.timeline-fill {
    position: absolute; inset: 0; background: var(--red);
    transform: scaleY(var(--progress, 0)); transform-origin: top;
}
.jobs { list-style: none; }
.job { position: relative; padding-bottom: 34px; }
.job:last-child { padding-bottom: 0; }
.job::before {
    content: ""; position: absolute; left: -40px; top: 7px; width: 16px; height: 16px;
    border-radius: 50%; background: var(--paper); border: 2px solid var(--line);
    transition: border-color .4s, background-color .4s;
}
.job.passed::before { border-color: var(--red); background: var(--red); box-shadow: 0 0 0 4px var(--paper); }
.job-title { font: 700 1.3rem/1.3 var(--display); color: var(--navy); letter-spacing: -.005em; }
.job-title-secondary { font-size: 1.08rem; margin-top: 16px; }
.job-title-note { font: 400 .95rem var(--body); color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.job-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 2px; margin-top: 8px; }
.job-meta img { width: 32px; height: 32px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid var(--line); }
.job-company { font-weight: 600; color: var(--ink); }
.job-dates { color: var(--muted); }
.job-dates::before { content: ""; display: inline-block; width: 1px; height: .9em; background: var(--line); margin-right: 12px; vertical-align: -1px; }
.job-lead { margin-top: 12px; font-weight: 600; }
.job ul { margin-top: 10px; padding-left: 1.15rem; }
.job-lead + ul { margin-top: 4px; }
.job li { padding-left: .2rem; }
.job li + li { margin-top: 5px; }
.job li::marker { color: var(--muted); }
.job li strong { color: var(--navy); }
.job-tech { margin-top: 12px; font-style: italic; color: var(--muted); font-size: .96rem; }

.side-block + .side-block { margin-top: 38px; }
.skills dt { font: 700 .95rem var(--display); color: var(--navy); }
.skills dd { margin-bottom: 12px; }
.skills dd:last-child { margin-bottom: 0; }
.skills-lang { margin-top: 14px; font-size: .9rem; color: var(--muted); }
.plain-list { list-style: none; }
.plain-list li + li { margin-top: 14px; }
.plain-list span { display: block; }
.item-title { font: 700 .98rem var(--display); color: var(--navy); }
.item-note { color: #5E5E5E; font-style: italic; font-size: .95rem; }
.pubs .item-sub { font: 700 .76rem var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--navy); margin-bottom: 2px; }
.pubs a { line-height: 1.45; }

/* ---------- Projects ---------- */
.projects { background: var(--stone); border-top: 1px solid var(--line); }
.projects-inner { max-width: 1200px; margin: 0 auto; padding: 56px var(--gutter) 64px; }
.projects-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.projects-head .eyebrow { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters[hidden] { display: none; }
.filter {
    font: 600 .86rem var(--display); color: var(--label); padding: .5rem .85rem; min-height: 38px;
    border: 1px solid var(--label); background: transparent; transition: background-color .2s, color .2s;
}
.filter:hover { background: #fff; }
.filter[aria-pressed="true"] { background: var(--label); color: #fff; }
.project-grid {
    list-style: none; display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.project {
    display: flex; flex-direction: column; gap: 8px;
    background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--navy);
    padding: 20px 20px 18px; transition: box-shadow .2s ease, border-top-color .2s ease;
}
.project:hover { box-shadow: 0 12px 30px -18px rgba(32, 41, 68, .45); border-top-color: var(--red); }
.project[hidden] { display: none; }
.project-context { font: 600 .74rem/1.45 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.badge { color: var(--red-strong); }
.project-title { font: 700 1.15rem/1.3 var(--display); color: var(--navy); }
.project p:not([class]) { font-size: .98rem; }
.project-tech { margin-top: auto; padding-top: 4px; font-style: italic; color: var(--muted); font-size: .93rem; }
.project-link { align-self: flex-start; font: 600 .88rem var(--display); }
.project-link::after { content: " \2192"; }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: #E9EAF0; }
.footer-inner {
    max-width: 1200px; margin: 0 auto; padding: 44px var(--gutter) 24px;
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 48px;
}
.footer-h { font: 700 .8rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: #fff; }
.footer-title { margin-top: 6px; color: #C5C8D4; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; }
.footer a, .footer button { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.footer a:hover, .footer button:hover { text-decoration-color: var(--red); }
.footer-copy { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) 24px; color: #A9ADBE; font-size: .88rem; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .cv-wrap { background: none; }
    .cv { grid-template-columns: 1fr; }
    .cv-main { padding: 44px var(--gutter) 40px; }
    .cv-side { padding: 40px var(--gutter); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 32px 40px; }
    .side-block + .side-block { margin-top: 0; }
    .facts-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
}
@media (max-width: 860px) {
    /* Stack: panorama on top (person centre-right), name blocks below on stone. */
    .hero { height: auto; display: block; background: var(--stone); }
    .pano { position: relative; height: min(112vw, 480px); --px: .8; --py: 1; }
    .hero-content { padding: 20px var(--gutter) 28px; margin-top: 0; font-size: 1rem; }
    .hero-content > * { max-width: none; }
    .hero-name { gap: 4px; }
    .btn-light { box-shadow: inset 0 0 0 1px var(--label); }
}
@media (max-width: 760px) {
    .topnav-cv { display: none; }
    .nav-cv-item { display: block; }
    .js .nav-toggle {
        display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
        font: 600 .9rem var(--display); color: var(--ink); min-height: 44px;
    }
    .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
        display: block; width: 18px; height: 2px; background: currentColor; position: relative;
    }
    .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
    .nav-toggle-bars::before { top: -6px; }
    .nav-toggle-bars::after { top: 6px; }
    .js .topnav nav {
        display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
        background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px -16px rgba(0, 0, 0, .3);
    }
    .js .menu-open .topnav nav { display: block; }
    .js .topnav-links { flex-direction: column; gap: 0; padding: 6px var(--gutter) 12px; }
    .js .topnav-links a { display: block; padding: 12px 0; font-size: 1rem; border-bottom: 1px solid var(--line); }
    .js .topnav-links li:last-child a { border-bottom: 0; }
    .topnav-inner { gap: 1rem; }
    html:not(.js) .topnav-brand, html:not(.js) .topnav-cv { display: none; }
    html:not(.js) .topnav-links { gap: 1rem; }
    .label-sm { font-size: .95rem; }
    .job-title { font-size: 1.18rem; }
    .job-title-note { display: block; margin: 2px 0 0; }
    .job-dates { flex-basis: 100%; padding-left: 44px; }
    .job-dates::before { display: none; }
    .timeline { padding-left: 30px; }
    .timeline-track { left: 6px; }
    .job::before { left: -30px; width: 14px; height: 14px; }
    .footer-links { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
    .label-md { font-size: .88rem; }
    .facts-inner { grid-template-columns: 1fr; }
    .hero-actions .btn { flex: 1 1 130px; justify-content: center; }
}

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