:root{--bg:#f2f4f7;--panel:#ffffff;--text:#101828;--muted:#667085;--blue:#2F6EBA;--blue-dark:#1E4E85;--gold:#D4AF37;--gold-soft:#C9A961;--line:#EAECF0;--dark:#141922;--darkText:#f5f7fb;--headerH:72px;--font:'Manrope','Inter',-apple-system,system-ui,Segoe UI,Roboto,Arial,sans-serif}
*{box-sizing:border-box}html,body{margin:0;padding:0}
body{font:16px/1.55 var(--font);background:#fff;color:var(--text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
img{max-width:100%;height:auto;display:block}
.wrap{max-width:1200px;margin:0 auto;padding:0 20px}
.section{padding:56px 0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body.home{overflow:hidden}

/* Header */
.site-header{position:sticky;top:0;z-index:20;background:#fff;border-bottom:1px solid var(--line)}
.site-header .wrap{display:flex;align-items:center;gap:0}
.brand{color:var(--blue);text-decoration:none;font-weight:800}
.nav .lang{color:var(--blue);text-decoration:none;margin-left:16px;font-weight:700;display:inline-flex;align-items:center;gap:8px;background:transparent;border:none;padding:2px 8px;border-radius:8px}
.nav .lang:hover{background:rgba(47,110,186,.12);text-decoration:none}
.flag{font-size:18px;line-height:1}

/* Hero split 35/65 full viewport */
.hero--vh{min-height:calc(100vh - var(--headerH));}
.hero--split{display:grid;grid-template-columns:35% 65%;min-height:calc(100vh - var(--headerH));}
.hero__left{background:var(--dark);color:var(--darkText);display:flex;align-items:center}
.hero__inner{max-width:560px;margin-left:clamp(40px,6vw,64px);margin-right:clamp(16px,3vw,24px)}
.hero__title{margin:0 0 22px;font-weight:800;text-transform:uppercase;letter-spacing:.3px;color:var(--blue);font-size:clamp(26px,3.4vw,42px);line-height:1.15;overflow-wrap:break-word;word-break:normal;hyphens:auto}
.hero__lead{margin:0 0 26px;font-size:clamp(17px,2.1vw,22px);line-height:1.6;color:#e9edf5}
.hero__cta{display:flex;gap:18px}
.btn{display:inline-block;border-radius:999px;border:1px solid #D0D5DD;text-decoration:none;font-weight:600;transition:all .2s ease}
.btn--xl{padding:14px 28px;text-transform:uppercase;letter-spacing:.2px}
.btn--primary{background:var(--blue);border-color:var(--blue);color:#fff}
.btn--ghost{background:transparent;border:1.5px solid rgba(255,255,255,.35);color:#fff}
.btn--primary:hover{background:#265E9F;border-color:#265E9F;box-shadow:0 8px 20px rgba(38,94,159,.35)}
.btn--ghost:hover{background:rgba(47,110,186,.22);border-color:rgba(47,110,186,.75);color:#fff;box-shadow:0 8px 20px rgba(47,110,186,.25)}
.hero__right{background:#fff;position:relative;overflow:hidden}
.hero__photo{width:100%;height:100%;object-fit:cover;object-position:60% center;display:block}

/* Contacts widget */
.cw{position:fixed;right:24px;bottom:24px;z-index:30}
.cw__toggler{width:56px;height:56px;border-radius:50%;border:none;background:var(--blue);color:#fff;box-shadow:0 8px 24px rgba(47,110,186,.35);cursor:pointer;display:grid;place-items:center}
.cw__panel{position:absolute;right:0;bottom:70px;display:none;flex-direction:column;gap:10px;align-items:flex-end}
.cw__btn{width:50px;height:50px;border-radius:50%;display:grid;place-items:center;background:#0f1722;color:#fff;text-decoration:none;border:1px solid #243046}
.cw__btn svg{width:24px;height:24px}
.cw__close{width:36px;height:36px;border-radius:50%;border:1px solid #243046;background:#0f1722;color:#fff;cursor:pointer}
.cw.open .cw__panel{display:flex}

/* Footer */
.site-footer{border-top:1px solid var(--line);background:#fff;color:#475467}
.site-footer .wrap{display:flex;align-items:center;justify-content:space-between;padding:18px 0}

.exp h1{color:#2F6EBA;font-size:22px;margin-bottom:8px}
.exp .check{margin-top:8px}
.muted{color:#2F6EBA;text-decoration:none}
.muted:hover{text-decoration:underline}
.exp .job h3{margin:.5rem 0;font-size:18px;color:#2F6EBA;font-weight:800}

/* Experience page */
.exp-head{display:grid;grid-template-columns:220px 1fr;gap:18px;align-items:center;margin:8px 0 16px}
.exp-head__photo{display:block;width:100%;height:auto;object-fit:cover;border-radius:6px;border:1px solid #e5e7eb}
.exp-name{margin:24px 0 6px 0;color:#2F6EBA;font-weight:800;letter-spacing:.2px;font-size:24px}
.exp-meta,.exp-contact,.exp-roles{margin:.15rem 0;color:#475467}
.exp-contact a{color:#2F6EBA;text-decoration:none}.exp-contact a:hover{text-decoration:underline}
.exp-roles{margin-top:.4rem}
.exp-title{background:#2F6EBA;color:#fff;padding:8px 12px;border-radius:6px;margin:24px 0 8px;display:inline-block;font-size:16px;font-weight:800;letter-spacing:.2px}

/* Lists */
.check.big{font-size:16px}
.check.big li{margin:.5rem 0}
.dash{padding-left:18px}.dash li{margin:.35rem 0}

/* Flat accordions, collapsed by default (except first) */
.acc--flat{border-top:1px solid #EAECF0;margin-top:16px}
.acc--flat>summary{list-style:none;cursor:pointer;padding:18px 0;display:flex;align-items:center;gap:12px;font-weight:800;color:#2F6EBA;border-bottom:1px solid #EAECF0;user-select:none}
.acc--flat>summary::-webkit-details-marker{display:none}
.acc--flat .plus{margin-left:auto;color:#98A2B3;font-weight:800}
.acc--flat[open] .plus{content:"–";color:#2F6EBA}
.acc--flat .acc__body{padding:12px 0 4px}
.job h3{margin:.5rem 0;font-size:18px}
.time{color:#2F6EBA;font-weight:800}

.check.big{list-style:disc;margin:8px 0 16px 22px}
.check.big li{margin:10px 0}
.check.big strong{color:#2F6EBA}

.acc--flat>summary .plus{margin-left:auto;display:inline-block;width:18px;height:18px;border-radius:2px;color:#2F6EBA;text-align:center;font-weight:800}
.acc--flat:not([open])>summary .plus::after{content:"+"}
.acc--flat[open]>summary .plus::after{content:"–"}

.exp-head__info p{margin:.2rem 0}
.exp-meta{margin:.2rem 0 .6rem 0;color:#374151;font-size:18px}
.exp-roles{color:#1F2937}
.exp-head .exp-contact a{color:#2F6EBA}
.exp-head .exp-contact a:hover{text-decoration:underline}

.exp-flat{margin:18px 0 8px 0;padding:14px 0;border-bottom:1px solid #EAECF0;color:#2F6EBA;font-weight:800;letter-spacing:.2px;font-size:24px}
.exp-line{display:none} /* legacy placeholder */

/* Stretch header photo to full block height */
.exp-head{align-items:stretch}
.exp-head__photo{border-radius:4px;border:1px solid #e5e7eb;object-fit:cover;width:100%;height:100%;display:block}

.job p strong{color:var(--blue)}
.acc__body a{color:var(--blue);text-decoration:none}
.acc__body a:hover{text-decoration:underline}
/* Keep education subheads blue (already via h4); ensure consistency */
.exp h4{color:var(--blue);margin:14px 0 8px 0;font-weight:400}
.time{color:var(--blue);font-weight:800}

.exp-contact strong{font-weight:600;color:#111827}

.acc__body .job p strong{color:var(--blue);font-weight:400}

.acc__body p strong{color:var(--blue);font-weight:400}

@media (max-width: 640px){
  .exp-head{grid-template-columns:1fr;align-items:start}
  .exp-head__photo{width:220px;max-width:60%;height:auto;margin-bottom:.75rem}
}

.nav a{margin:0;color:#2F6EBA;text-decoration:none;font-weight:700;opacity:1;transition:opacity .15s}

.nav a:hover{opacity:.75}

.contact-row{display:inline-flex;align-items:center;gap:4px;color:#2F6EBA;text-decoration:none}
.contact-row:hover{opacity:.8}
.icon{display:inline-block;width:18px;height:18px}
.icon svg{display:block;width:18px;height:18px;fill:#2F6EBA}
.exp-contact small{color:#6b7280;font-weight:400}

.contact-row .sep{margin-left:0;margin-right:2px;color:#2F6EBA}


/* Header separator and unified layout */
.site-header .wrap{display:flex; align-items:center; gap:10px}
.brand{font-weight:800; color:#2F6EBA; text-decoration:none}
.brand-sep{color:#2F6EBA;opacity:.8;margin:0 6px;user-select:none}
.nav.pages{margin-left:0;display:flex;gap:0}
.nav.langs{margin-left:auto;display:flex;gap:10px}
.nav a{color:#2F6EBA; text-decoration:none; font-weight:700; opacity:1; transition:opacity .15s}
.nav a:hover{opacity:.75}
.lang .flag{margin-right:6px}


/* Subtle hairline separators between page links */
.nav.pages a + a::before{content:'│';margin:0 6px;color:#64748B;opacity:.35}


/* === EN/RU pixel-tuning === */
.site-header .brand-sep{margin:0 14px;color:#cfd6df}
.site-header .nav.pages a{margin:0 14px}
.site-header .nav.langs .lang{display:inline-flex;align-items:center;gap:6px;margin-left:14px;line-height:1}

.exp-head{display:grid;grid-template-columns:240px 1fr;align-items:stretch}
.exp-head__photo{height:100%;object-fit:cover;border-radius:8px}

.exp-contact .icon{width:18px;min-width:18px;display:inline-block;margin-right:6px}
.exp-contact .sep{display:inline-block;margin:0 6px}

.exp-flat{margin:28px 0 12px}
.check.big{margin-bottom:24px}

details.acc summary{position:relative;padding-right:40px}
details.acc summary .plus{position:absolute;right:12px;top:50%;transform:translateY(-50%)}

.acc__body .subhead{font-weight:400;color:#2F6EBA;margin:8px 0 6px}

.check .hl,.check.big .hl{color:#2F6EBA;font-weight:600}

/* h4 subhead color */
.exp .acc__body h4{color:#2F6EBA;font-weight:400;margin:8px 0 6px}
/* === vPortFix 2025-09-04 ===
   - Make first slide on portfolio full-bleed (no side bars)
   - Ensure transparent backgrounds for slider layers
*/
#pf .slides, #pf .slide { background: transparent !important; }
#pf .slide:first-child img { width: 100%; height: 84vh; max-height: 84vh; object-fit: cover; display: block; }

@media (max-width: 640px){
  #pf .slide:first-child img { height: 60vh; max-height: 60vh; }
}

/* === EN portfolio PDF slides === */
#pf .slide embed /*removed*/{ width:100%; height:84vh; max-height:84vh; display:block; border:0; }
@media (max-width:640px){
  #pf .slide embed /*removed*/{ height:60vh; max-height:60vh; }
}

/* === EN portfolio images (converted from PDF) === */
#pf .slide img{ width:100%; height:84vh; max-height:84vh; object-fit:contain; display:block; }
@media (max-width:640px){
  #pf .slide img{ height:60vh; max-height:60vh; }
}

/* === EN portfolio: full-bleed for all slides === */
html[lang="en"] #pf .slide img{ object-fit: cover !important; }

/* === ZH portfolio: full-bleed for all slides === */
html[lang^="zh"] #pf .slide img{ object-fit: cover !important; }

/* =================================================================== */
/* === v2 — Responsive overhaul + visual polish (2026)             === */
/* =================================================================== */

/* Smooth scroll & better focus states */
html{scroll-behavior:smooth}
a:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}

/* Slightly nicer buttons */
.btn{transition:transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:translateY(0)}

/* Photo hover on hero (desktop only) */
@media (hover:hover) and (min-width:1025px){
  .hero__photo{transition:transform .6s ease}
  .hero__right:hover .hero__photo{transform:scale(1.02)}
}

/* Floating contact widget polish */
.cw__toggler{transition:transform .18s ease, box-shadow .18s ease}
.cw__toggler:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(47,110,186,.45)}
.cw__btn{transition:transform .18s ease, background .18s ease}
.cw__btn:hover{transform:translateY(-2px);background:#1a2534}

/* Accordion polish */
.acc--flat>summary{transition:background .15s ease}
.acc--flat>summary:hover{background:rgba(47,110,186,.04)}

/* ==== TABLET (≤1024px) ==== */
@media (max-width:1024px){
  .wrap{padding:0 24px}
  /* Hero: shift to 45/55 so title has room */
  .hero--split{grid-template-columns:45% 55%}
  .hero__inner{margin-left:clamp(24px,4vw,40px);margin-right:clamp(16px,3vw,24px)}
  .hero__title{font-size:clamp(24px,3.8vw,36px)}
  .hero__lead{font-size:clamp(16px,2vw,19px)}
  .hero__cta{gap:14px;flex-wrap:wrap}
  .btn--xl{padding:12px 22px;font-size:14px}
  /* Experience page: tighter photo column */
  .exp-head{grid-template-columns:200px 1fr;gap:20px}
  .site-header .nav.pages a{margin:0 10px}
  .site-header .nav.langs .lang{margin-left:10px}
  .site-header .brand-sep{margin:0 10px}
}

/* ==== MOBILE (≤768px) ==== */
@media (max-width:768px){
  :root{--headerH:60px}
  .wrap{padding:0 16px}

  /* Allow home page to scroll on mobile (hero stacks and becomes tall) */
  body.home{overflow:auto}

  /* Header: stack neatly, center brand+pages, langs on right */
  .site-header .wrap{flex-wrap:wrap;gap:8px;padding:10px 16px;row-gap:6px}
  .brand{font-size:17px}
  .site-header .brand-sep{margin:0 8px}
  .site-header .nav.pages{gap:0;flex-wrap:wrap}
  .site-header .nav.pages a{margin:0 8px;font-size:14px}
  .site-header .nav.langs{margin-left:auto;gap:4px}
  .site-header .nav.langs .lang{margin-left:6px;padding:4px 6px;font-size:13px}
  .flag{font-size:16px}

  /* Hero: single column, photo on top, text below — cleaner on phone */
  .hero--vh,.hero--split{min-height:auto}
  .hero--split{grid-template-columns:1fr;grid-template-rows:auto auto}
  .hero__right{order:-1;height:52vh;min-height:320px;max-height:520px}
  .hero__photo{width:100%;height:100%;object-fit:cover;object-position:60% 20%}
  .hero__left{padding:32px 0}
  .hero__inner{max-width:100%;margin:0 auto;padding:0 20px}
  .hero__title{font-size:clamp(26px,7vw,34px);margin-bottom:16px;line-height:1.2}
  .hero__lead{font-size:16px;margin-bottom:22px;line-height:1.55}
  .hero__cta{gap:10px;flex-wrap:wrap}
  .hero__cta .btn{flex:1 1 140px;text-align:center;padding:13px 16px;font-size:13px;letter-spacing:.3px}

  /* Section padding reduced */
  .section{padding:28px 0}

  /* Experience page — stack header block */
  .exp-head{grid-template-columns:1fr;gap:16px;margin-bottom:12px}
  .exp-head__photo{width:160px;max-width:45%;height:auto !important;border-radius:10px;margin:0 auto}
  .exp-head__info{text-align:center}
  .exp-name{font-size:22px !important;margin-top:12px !important;text-align:center}
  .exp-contact{text-align:left}
  .exp-contact .contact-row{font-size:14px;flex-wrap:wrap}
  .exp-flat{font-size:18px !important;margin:20px 0 10px;padding:12px 0}
  .check.big{font-size:15px;margin-left:18px}
  .check.big li{margin:8px 0;line-height:1.5}
  .acc--flat>summary{padding:16px 0;font-size:15px}
  .job h3{font-size:16px;line-height:1.35}
  .job p,.job li{font-size:14.5px;line-height:1.55}
  .dash li{margin:.3rem 0}

  /* Portfolio page — slider fits nicely */
  .slider{min-height:50vh !important}
  #pf .slide img{height:50vh !important;max-height:50vh !important}
  .ctrl{width:40px !important;height:40px !important}
  .ctrl.prev{left:8px !important}
  .ctrl.next{right:8px !important}
  .dots{margin-top:14px}

  /* Floating contact widget — closer to edge on phone */
  .cw{right:14px;bottom:14px}
  .cw__toggler{width:52px;height:52px}
  .cw__btn{width:46px;height:46px}

  /* Site footer */
  .site-footer .wrap{padding:14px 0;font-size:13px;justify-content:center;text-align:center}
}

/* ==== SMALL PHONE (≤380px) fine-tune ==== */
@media (max-width:380px){
  .hero__cta{flex-direction:column}
  .hero__cta .btn{flex:1 1 auto;width:100%}
  .site-header .nav.pages a{margin:0 6px;font-size:13px}
  .brand{font-size:15px}
}

/* ==== PRINT helper — hide floating widget when printing ==== */
@media print{.cw,.site-header,.site-footer{display:none}}

/* =================================================================== */
/* === v3 — premium design upgrade (gold accent, timeline, etc.)   === */
/* =================================================================== */

/* Hero decor: just a subtle gold accent top line + soft glow (no grid) */
.hero__left{position:relative;overflow:hidden}
.hero__left::before{
  content:'';position:absolute;inset:0;pointer-events:none;
  background-image:
    linear-gradient(90deg,var(--gold) 0,transparent 40%),
    radial-gradient(circle at 20% 15%, rgba(212,175,55,.10) 0%, transparent 50%);
  background-size: 100% 3px, 100% 100%;
  background-position: top left, top left;
  background-repeat: no-repeat, no-repeat;
}
.hero__inner{position:relative;z-index:1}

/* Lock home hero to single-screen, no scroll */
body.home .hero--vh{height:calc(100vh - var(--headerH));min-height:calc(100vh - var(--headerH));max-height:calc(100vh - var(--headerH));overflow:hidden}
body.home main#top{height:calc(100vh - var(--headerH));overflow:hidden}

/* Hero stats row */
.hero__stats{display:flex;gap:clamp(18px,3vw,40px);margin:0 0 26px;padding:18px 0;border-top:1px solid rgba(255,255,255,.1);border-bottom:1px solid rgba(255,255,255,.1);flex-wrap:wrap}
.hero__stat{display:flex;flex-direction:column;gap:4px;min-width:0}
.hero__stat-num{font-weight:800;font-size:clamp(20px,2.2vw,28px);color:var(--gold);letter-spacing:.3px;line-height:1;white-space:nowrap}
.hero__stat-label{font-size:12px;color:#c8d0dc;text-transform:uppercase;letter-spacing:.8px;font-weight:500}

/* Gold highlight on hero lead key segment (optional utility) */
.hero__lead .gold{color:var(--gold);font-weight:600}

/* Reveal animations (fade + rise). JS adds .is-visible when in view */
.reveal{opacity:0;transform:translateY(16px);transition:opacity .7s ease, transform .7s ease}
.reveal.is-visible{opacity:1;transform:translateY(0)}
.reveal.delay-1{transition-delay:.08s}
.reveal.delay-2{transition-delay:.16s}
.reveal.delay-3{transition-delay:.24s}
@media (prefers-reduced-motion:reduce){
  .reveal{opacity:1;transform:none;transition:none}
  .hero__photo,.btn,.cw__toggler{transition:none !important}
}

/* === Timeline for Work Experience === */
.timeline{position:relative;padding-left:34px;margin-top:8px}
.timeline::before{
  content:'';position:absolute;left:10px;top:6px;bottom:6px;width:2px;
  background:linear-gradient(180deg,var(--blue) 0%,var(--blue) 60%,var(--gold) 100%);
  border-radius:2px;
}
.timeline > .job{position:relative;margin:0 0 28px;padding:18px 20px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 1px 2px rgba(16,24,40,.03);transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease}
.timeline > .job:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(16,24,40,.08);border-color:rgba(47,110,186,.35)}
.timeline > .job::before{
  content:'';position:absolute;left:-31px;top:24px;width:14px;height:14px;border-radius:50%;
  background:#fff;border:3px solid var(--blue);
  box-shadow:0 0 0 4px rgba(47,110,186,.12);
}
.timeline > .job:first-child::before{border-color:var(--gold);box-shadow:0 0 0 4px rgba(212,175,55,.18)}
.timeline > .job h3{margin:0 0 6px;color:var(--blue);font-weight:800;font-size:17px;line-height:1.35}
.timeline > .job h4{margin:14px 0 6px}
.timeline > .job p:first-of-type{color:var(--muted);margin-top:2px}

/* === Language dropdown === */
.lang-select{position:relative;margin-left:14px}
.lang-select__btn{display:inline-flex;align-items:center;gap:8px;background:transparent;border:1px solid transparent;color:var(--blue);font-weight:700;padding:6px 12px;border-radius:8px;cursor:pointer;font:inherit;line-height:1;transition:background .15s, border-color .15s}
.lang-select__btn:hover{background:rgba(47,110,186,.08)}
.lang-select__btn[aria-expanded="true"]{background:rgba(47,110,186,.1);border-color:rgba(47,110,186,.25)}
.lang-select__btn .caret{font-size:10px;opacity:.7;transition:transform .2s}
.lang-select__btn[aria-expanded="true"] .caret{transform:rotate(180deg)}
.lang-select__menu{position:absolute;top:calc(100% + 6px);right:0;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 30px rgba(16,24,40,.12);padding:6px;min-width:140px;display:none;z-index:40}
.lang-select[open] .lang-select__menu,.lang-select__menu.open{display:block;animation:lsFade .18s ease}
@keyframes lsFade{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.lang-select__item{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:6px;color:var(--blue);text-decoration:none;font-weight:600;font-size:14px}
.lang-select__item:hover{background:rgba(47,110,186,.08)}

/* === Portfolio: thumbnails strip + counter === */
.slider-counter{display:inline-block;margin-top:10px;padding:4px 10px;background:rgba(47,110,186,.1);color:var(--blue);border-radius:999px;font-weight:700;font-size:13px;letter-spacing:.4px;font-variant-numeric:tabular-nums}
.slider-counter .slash{opacity:.5;margin:0 4px}

.thumbs{display:flex;gap:8px;margin-top:14px;padding:4px 2px;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:thin}
.thumbs::-webkit-scrollbar{height:6px}
.thumbs::-webkit-scrollbar-thumb{background:rgba(47,110,186,.35);border-radius:3px}
.thumb{flex:0 0 92px;height:58px;border-radius:6px;overflow:hidden;cursor:pointer;border:2px solid transparent;background:#000;opacity:.6;transition:opacity .18s, border-color .18s, transform .18s}
.thumb img{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
.thumb:hover{opacity:.85;transform:translateY(-1px)}
.thumb.active{opacity:1;border-color:var(--gold);box-shadow:0 0 0 2px rgba(212,175,55,.25)}

@media (max-width:768px){
  .hero__stats{gap:14px;padding:14px 0;margin:0 0 20px}
  .hero__stat-num{font-size:18px}
  .hero__stat-label{font-size:10px;letter-spacing:.6px}
  .timeline{padding-left:26px}
  .timeline::before{left:7px}
  .timeline > .job{padding:14px 14px;margin-bottom:20px}
  .timeline > .job::before{left:-25px;top:20px;width:12px;height:12px}
  .lang-select{margin-left:6px}
  .lang-select__btn{padding:5px 8px;font-size:13px}
  .thumb{flex:0 0 72px;height:46px}
  /* On mobile, home hero can scroll (stacked layout) */
  body.home .hero--vh,body.home main#top{height:auto;min-height:0;max-height:none;overflow:visible}
}

/* =================================================================== */
/* === v4 — user feedback patches                                  === */
/* =================================================================== */

/* Timeline: support Education & About Me cards (h3 + ul inside article.job) */
.timeline > .job h3{color:var(--blue);font-weight:800;font-size:17px;line-height:1.35;margin:0 0 8px}
.timeline > .job > ul.dash,.timeline > .job > ul.check{margin:6px 0 0;padding-left:18px}
.timeline > .job > ul.dash li,.timeline > .job > ul.check li{margin:.3rem 0;line-height:1.55}
.timeline > .job > p{margin:8px 0 0}

/* Portfolio: fit viewport strictly, show full slides (no cropping) */
html body .slider-wrap{max-width:100%}
html body .slider{min-height:0 !important;height:auto !important;background:#0B0B0B !important;border-radius:12px;overflow:hidden}
html body #pf .slides,html body #pf .slide{background:#0B0B0B}
html body #pf .slide img,
html[lang="en"] body #pf .slide img,
html[lang^="zh"] body #pf .slide img{
  object-fit:contain !important;
  width:100% !important;
  height:58vh !important;
  max-height:58vh !important;
  background:#0B0B0B;
  display:block;
}

/* Portfolio page: reduce main padding so everything fits */
body:has(.slider-wrap) main.section{padding:18px 0}
body:has(.slider-wrap) .dots{margin-top:10px}
body:has(.slider-wrap) .thumbs{margin-top:10px;max-height:58px}
body:has(.slider-wrap) .thumb{flex:0 0 78px;height:50px}

/* Arrows: keep inside on narrow screens so they don't get clipped */
@media (max-width:1100px){
  .ctrl.prev{left:8px !important}
  .ctrl.next{right:8px !important}
  .slider-wrap{overflow:visible}
}

@media (max-width:768px){
  html body #pf .slide img{height:44vh !important;max-height:44vh !important}
  body:has(.slider-wrap) main.section{padding:12px 0}
  body:has(.slider-wrap) .thumb{flex:0 0 64px;height:42px}
}

/* =================================================================== */
/* === v5 — normalize timeline spacing & make all sections identical === */
/* =================================================================== */

/* Consistent container padding (all accordion bodies that are timelines) */
html body .acc--flat .acc__body.timeline{padding:20px 0 8px}

/* Timeline vertical line: always spans full body */
html body .timeline{padding-left:34px;margin-top:0;position:relative}
html body .timeline::before{top:0;bottom:0}

/* All .job cards get IDENTICAL spacing, padding, visuals — in every timeline */
html body .timeline > .job{
  margin:0 0 24px !important;
  padding:18px 20px !important;
  background:#fff !important;
  border:1px solid var(--line) !important;
  border-radius:12px !important;
  box-shadow:0 1px 2px rgba(16,24,40,.03) !important;
  min-height:64px;
}
html body .timeline > .job:last-child{margin-bottom:0 !important}

/* Dot: identical size/position on every card */
html body .timeline > .job::before{
  content:'';position:absolute;left:-31px;top:22px;
  width:14px;height:14px;border-radius:50%;
  background:#fff;border:3px solid var(--blue);
  box-shadow:0 0 0 4px rgba(47,110,186,.12);
}
html body .timeline > .job:first-child::before{
  border-color:var(--gold);
  box-shadow:0 0 0 4px rgba(212,175,55,.18);
}

/* Heading + internal content: uniform rhythm */
html body .timeline > .job > h3{margin:0 0 8px !important;color:var(--blue);font-weight:800;font-size:17px;line-height:1.35}
html body .timeline > .job > h4{margin:14px 0 6px !important;color:var(--blue);font-weight:400}
html body .timeline > .job > p{margin:6px 0 0 !important}
html body .timeline > .job > ul{margin:6px 0 0 !important;padding-left:18px}
html body .timeline > .job > ul > li{margin:.35rem 0;line-height:1.55}

/* Accordion summary spacing equal across all three sections */
html body .acc--flat{margin-top:20px}
html body .acc--flat > summary{padding:18px 0}

/* =================================================================== */
/* === v5 — portfolio: scrollable lightbox with navigation         === */
/* =================================================================== */

/* Lightbox: dark overlay, centered, allows scrolling full-size image */
html body .lb{
  position:fixed;inset:0;background:rgba(0,0,0,.92);
  display:none;z-index:80;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding:24px;
}
html body .lb.open{display:block}
html body .lb__stage{
  min-height:100%;
  display:flex;align-items:center;justify-content:center;
}
html body .lb img{
  display:block;margin:0 auto;
  max-width:100%;
  max-height:none;
  width:auto;height:auto;
  cursor:zoom-in;
}
html body .lb.zoomed img{
  max-width:none;
  width:auto;
  cursor:zoom-out;
}

/* Lightbox controls (top-right close, side nav arrows, counter) */
html body .lb__close{
  position:fixed;top:14px;right:18px;z-index:82;
  width:44px;height:44px;border-radius:50%;border:none;
  background:rgba(17,24,39,.65);color:#fff;font-size:22px;
  cursor:pointer;display:grid;place-items:center;backdrop-filter:blur(4px);
}
html body .lb__close:hover{background:rgba(17,24,39,.9)}
html body .lb__nav{
  position:fixed;top:50%;transform:translateY(-50%);z-index:82;
  width:52px;height:52px;border-radius:50%;border:none;
  background:rgba(17,24,39,.55);color:#fff;
  cursor:pointer;display:grid;place-items:center;
  backdrop-filter:blur(4px);
  transition:background .15s;
}
html body .lb__nav:hover{background:rgba(17,24,39,.85)}
html body .lb__nav.prev{left:18px}
html body .lb__nav.next{right:18px}
html body .lb__nav svg{width:26px;height:26px;fill:#fff}
html body .lb__counter{
  position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:82;
  padding:6px 14px;background:rgba(17,24,39,.65);color:#fff;
  border-radius:999px;font-weight:700;font-size:13px;letter-spacing:.4px;
  font-variant-numeric:tabular-nums;backdrop-filter:blur(4px);
}
@media (max-width:640px){
  html body .lb{padding:12px}
  html body .lb__nav{width:44px;height:44px}
  html body .lb__nav.prev{left:8px}
  html body .lb__nav.next{right:8px}
  html body .lb__close{top:8px;right:8px;width:38px;height:38px;font-size:18px}
}
