:root{
  /* ---- LIGHT (default) ---- */
  --bg:#FFFFFF;
  --panel:#F8FAFC;
  --panel-2:#F1F5F9;
  --line:#E2E8F0;
  --text:#0F172A;
  --muted:#64748B;
  --accent:#2563EB;
  --accent-hover:#1D4ED8;
  --accent-soft:#EFF6FF;
  --accent-soft-border:#BFDBFE;
  --accent-ink:#FFFFFF;
  --shadow:0 1px 2px rgba(15,23,42,0.04), 0 8px 24px rgba(15,23,42,0.06);
  --radius-lg:14px;
  --radius-md:10px;
  --radius-sm:7px;
}
html[data-theme="dark"]{
  --bg:#0B1220;
  --panel:#111A2C;
  --panel-2:#182238;
  --line:#263349;
  --text:#EEF2F8;
  --muted:#93A1B8;
  --accent:#5B9CFB;
  --accent-hover:#7FB0FC;
  --accent-soft:rgba(91,156,251,0.12);
  --accent-soft-border:rgba(91,156,251,0.35);
  --accent-ink:#0B1220;
  --shadow:0 1px 2px rgba(0,0,0,0.3), 0 12px 32px rgba(0,0,0,0.4);
}
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg); color:var(--text); font-family:'Inter', system-ui, sans-serif;
  line-height:1.65; -webkit-font-smoothing:antialiased; transition:background .2s, color .2s;
}
h1,h2,h3{font-family:'Inter', system-ui, sans-serif; letter-spacing:-0.015em;}
a{color:inherit;}
.wrap{max-width:1080px; margin:0 auto; padding:0 28px;}
section{padding:88px 0;}
::selection{background:var(--accent-soft); color:var(--accent-hover);}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
.icon-defs{display:none;}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration:0.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:0.001ms !important;
    scroll-behavior:auto !important;
  }
}

.highlight{background:var(--accent-soft); color:var(--accent-hover); padding:1px 8px; border-radius:6px; font-weight:700;}

/* ---- NAV ---- */
nav{
  position:sticky; top:0; z-index:50;
  background:color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
nav .wrap{display:flex; align-items:center; justify-content:space-between; padding-top:14px; padding-bottom:14px; gap:14px; flex-wrap:nowrap;}
.brand{font-weight:700; font-size:14px; letter-spacing:0.04em; white-space:nowrap; display:inline-flex; align-items:center; gap:8px; text-transform:uppercase;}
.logo-slot{width:24px; height:24px; flex-shrink:0; display:inline-flex;}
.logo-slot img{width:100%; height:100%; object-fit:contain; display:block;}
.brand span{color:var(--muted); font-weight:500;}
.btn-cv{
  background:var(--accent); border:1.5px solid var(--accent); color:var(--accent-ink) !important;
  width:130px; height:34px; border-radius:20px; font-size:13px; font-weight:600; text-decoration:none;
  display:inline-flex; align-items:center; justify-content:center; gap:6px; line-height:1; white-space:nowrap;
  transition:background .15s, transform .15s;
}
.btn-cv:hover{background:var(--accent-hover); transform:translateY(-1px);}
.navlinks{display:flex; gap:18px; font-size:14px; color:var(--muted); align-items:center; flex-wrap:nowrap;}
.nav-primary{display:flex; gap:20px; align-items:center; margin-left:auto;}
.nav-link{
  text-decoration:none; color:var(--muted); font-size:14px; transition:color .15s;
  white-space:nowrap; text-align:right; display:inline-block;
}
.nav-link:hover{color:var(--text);}
.link-about{min-width:70px;}
.link-exp{min-width:82px;}
.link-portfolio{min-width:48px;}
.link-ach{min-width:76px;}
.link-contact{min-width:56px;}
.nav-actions{display:flex; align-items:center; gap:16px;}
.toggle-row{display:contents;}
.navlinks a{text-decoration:none; transition:color .15s; white-space:nowrap;}
.navlinks a:hover{color:var(--text);}
.nav-cta{
  background:var(--accent); border:1.5px solid var(--accent); color:var(--accent-ink) !important;
  width:130px; height:34px; border-radius:20px; font-size:13px; font-weight:600; line-height:1; white-space:nowrap;
  display:inline-flex; align-items:center; justify-content:center; text-decoration:none;
  transition:background .15s, transform .15s;
}
.nav-cta:hover{background:var(--accent-hover); transform:translateY(-1px);}

.icon-btn{
  width:34px; height:34px; border-radius:var(--radius-sm); border:1px solid var(--line); background:var(--panel);
  color:var(--text); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font-size:15px;
  line-height:1; padding:0; transition:border-color .15s;
}
.icon-btn:hover{border-color:var(--accent);}
#theme-toggle{background:#000; border-color:#000; color:#fff;}
html[data-theme="dark"] #theme-toggle{background:#fff; border-color:#fff; color:#000;}

.lang-dropdown{position:relative; width:96px;}
.lang-btn{
  border:1px solid var(--line); background:var(--panel); color:var(--text); border-radius:var(--radius-sm);
  width:96px; font-size:13px; font-weight:600; padding:0 10px; height:34px; cursor:pointer; line-height:1; white-space:nowrap;
  display:inline-flex; align-items:center; gap:6px; transition:border-color .15s;
}
.lang-btn:hover{border-color:var(--accent);}
.lang-btn .chev{font-size:9px; color:var(--muted); margin-left:auto; line-height:1;}
.fi{width:18px; height:13px; border-radius:2px; box-shadow:0 0 0 1px var(--line); flex-shrink:0; display:block; overflow:hidden;}
.lang-menu{
  position:absolute; top:calc(100% + 6px); right:0; background:var(--panel); border:1px solid var(--line);
  border-radius:var(--radius-sm); box-shadow:var(--shadow); overflow:hidden; min-width:150px;
  display:none; z-index:60;
}
.lang-menu.open{display:block;}
.lang-option{
  width:100%; display:flex; align-items:center; gap:9px; padding:10px 12px; background:none; border:none;
  color:var(--text); font-size:13.5px; font-weight:500; cursor:pointer; text-align:left; transition:background .1s;
}
.lang-option:hover{background:var(--accent-soft);}
.lang-option.active{color:var(--accent); font-weight:700;}

/* ---- HERO ---- */
.hero{padding:72px 0 56px;}
.hero-grid{display:grid; grid-template-columns:1.1fr 0.9fr; gap:56px; align-items:end;}
.eyebrow{
  font-size:13px; font-weight:600; color:var(--accent);
  text-transform:uppercase; letter-spacing:0.08em; margin-bottom:16px; display:flex; align-items:center; gap:8px;
}
.dot{width:6px; height:6px; border-radius:50%; background:var(--accent);}
.hero h1{font-size:26px; font-weight:700; line-height:1.4; margin-bottom:18px;}
.hero p.lede{color:var(--muted); font-size:16.5px; max-width:500px; margin-bottom:28px;}
.cta-row{display:flex; gap:12px; flex-wrap:wrap;}
.cta-row .btn{width:168px; justify-content:center;}
.btn{
  padding:12px 22px; border-radius:var(--radius-sm); font-size:14.5px; font-weight:600;
  text-decoration:none; display:inline-flex; align-items:center; gap:8px; transition:all .15s;
  border:1px solid transparent; cursor:pointer;
}
.btn-primary{background:var(--accent); color:var(--accent-ink); box-shadow:var(--shadow);}
.btn-primary:hover{background:var(--accent-hover); transform:translateY(-1px);}
.btn-ghost{border-color:var(--line); color:var(--text); background:var(--panel);}
.btn-ghost:hover{border-color:var(--accent); color:var(--accent);}
.btn-outline{background:transparent; border:1px solid var(--accent-soft-border); color:var(--accent);}
.btn-outline:hover{background:var(--accent-soft); border-color:var(--accent);}

.dash{background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-lg); padding:22px; box-shadow:var(--shadow);}
.dash-skills{margin-top:18px; padding-top:16px; border-top:1px solid var(--line);}
.dash-skills-label{font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:0.06em; margin-bottom:9px;}
.chips-mini{display:flex; flex-wrap:wrap; gap:6px;}
.chip-mini{font-size:11.5px; font-weight:500; padding:4px 9px; background:var(--bg); border:1px solid var(--line); border-radius:6px; color:var(--text);}
.dash-head{font-size:13px; font-weight:600; color:var(--muted); margin-bottom:18px;}
.dash-kpis{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:18px;}
.kpi{background:var(--bg); border:1px solid var(--line); border-radius:var(--radius-md); padding:11px 15px;}
.kpi .num{font-size:25px; font-weight:800; color:var(--accent); letter-spacing:-0.01em;}
.kpi .unit{font-size:13px; font-weight:600; color:var(--accent); margin-left:3px;}
.kpi .lbl{font-size:12px; color:var(--muted); margin-top:3px; font-weight:500;}
.bars{display:flex; align-items:flex-end; gap:6px; height:96px; padding:0 2px;}
.bars i{flex:1; background:linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent)); border-radius:3px 3px 0 0; display:block;}
.bars i.bar-last{background:linear-gradient(180deg, #16A34A, color-mix(in srgb, #16A34A 20%, transparent));}

/* ---- SECTION HEADINGS ---- */
.sec-head{margin-bottom:38px;}
.sec-head .eyebrow{margin-bottom:10px;}
.sec-head h2{font-size:26px; font-weight:700;}

/* ---- WORKED WITH STRIP ---- */
#worked-with{padding:36px 0 44px; border-top:1px solid var(--line);}
.worked-with-label{
  font-size:11.5px; font-weight:600; color:var(--muted); text-transform:uppercase;
  letter-spacing:0.08em; text-align:center; margin-bottom:22px;
}
.logo-strip{display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:18px;}
.logo-card{
  width:148px; height:80px; background:#fff; border:1px solid var(--line); border-radius:var(--radius-md);
  display:flex; align-items:center; justify-content:center; padding:14px 18px; flex-shrink:0;
}
.logo-card img{max-width:100%; max-height:100%; object-fit:contain; display:block;}

/* ---- ASK AI SECTION ---- */
#ask-ai{border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:var(--panel); padding:72px 0;}
.ask-badge{
  display:inline-flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600;
  color:var(--accent); border:1px solid var(--accent-soft-border);
  background:var(--accent-soft); padding:6px 13px; border-radius:20px; margin-bottom:18px;
}
.ask-grid{display:grid; grid-template-columns:0.85fr 1.15fr; gap:44px; align-items:start;}
.ask-copy h2{font-size:26px; font-weight:700; margin-bottom:12px; line-height:1.3;}
.ask-copy p{color:var(--muted); font-size:15px; margin-bottom:22px;}
.ask-copy ul{list-style:none; display:flex; flex-direction:column; gap:11px;}
.ask-copy li{font-size:14px; color:var(--text); display:flex; gap:10px; align-items:flex-start; font-weight:500;}
.ask-copy li::before{content:""; width:5px; height:5px; border-radius:50%; background:var(--accent); margin-top:7px; flex-shrink:0;}

.ask-box{background:var(--bg); border:1px solid var(--line); border-radius:18px; overflow:hidden; box-shadow:0 4px 12px rgba(15,23,42,0.05), 0 20px 48px rgba(15,23,42,0.08);}
.ask-head{padding:14px 18px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:10px;}
.ask-avatar{
  width:34px; height:34px; border-radius:10px; background:var(--panel-2); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; padding:5px;
}
.ask-avatar img{width:100%; height:100%; object-fit:contain; display:block;}
.ask-wordmark{height:44px; margin-bottom:14px; display:flex; align-items:center;}
.ask-wordmark img{height:100%; width:auto; display:block;}
.ask-head strong{font-size:14px; font-weight:700; display:block;}
.ask-head .sub{font-size:12px; color:#16A34A; display:flex; align-items:center; gap:5px; font-weight:500;}
.ask-head .sub::before{content:""; width:6px; height:6px; border-radius:50%; background:#16A34A;}

#chat-log{padding:16px 18px; display:flex; flex-direction:column; gap:10px; min-height:190px; max-height:320px; overflow-y:auto; background:var(--panel-2);}
.msg-row{display:flex; gap:8px; align-items:flex-end;}
.msg-row.user{justify-content:flex-end;}
.msg-avatar{
  width:24px; height:24px; border-radius:8px; background:var(--panel-2); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-bottom:2px; padding:3px;
}
.msg-avatar img{width:100%; height:100%; object-fit:contain; display:block;}
.msg{font-size:13.5px; line-height:1.55; max-width:78%; padding:10px 14px; border-radius:14px;}
.msg.bot{background:var(--bg); border:1px solid var(--line); border-bottom-left-radius:4px;}
.msg.user{background:var(--accent); color:var(--accent-ink); font-weight:500; border-bottom-right-radius:4px;}
.typing-dots{display:flex; gap:3px; padding:4px 2px;}
.typing-dots span{width:5px; height:5px; border-radius:50%; background:var(--muted); animation:typingBounce 1.2s infinite;}
.typing-dots span:nth-child(2){animation-delay:.15s;}
.typing-dots span:nth-child(3){animation-delay:.3s;}
@keyframes typingBounce{0%,60%,100%{transform:translateY(0); opacity:.4;} 30%{transform:translateY(-3px); opacity:1;}}

#chat-suggest{padding:12px 18px; display:flex; flex-wrap:wrap; gap:7px; border-top:1px solid var(--line);}
.suggest-chip{
  font-size:12.5px; font-weight:500; color:var(--accent);
  border:1px solid var(--accent-soft-border); padding:6px 12px; border-radius:14px; cursor:pointer; background:var(--accent-soft);
  transition:background .15s, border-color .15s;
}
.suggest-chip:hover{background:var(--accent); color:var(--accent-ink); border-color:var(--accent);}
#chat-input-row{display:flex; align-items:center; gap:8px; padding:12px 14px; border-top:1px solid var(--line);}
#chat-input{
  flex:1; background:var(--panel-2); border:1px solid var(--line); border-radius:22px; color:var(--text);
  padding:10px 16px; font-size:13.5px; outline:none; font-family:'Inter',sans-serif; transition:border-color .15s;
}
#chat-input:focus{border-color:var(--accent);}
#chat-send{
  width:38px; height:38px; border-radius:50%; background:var(--accent); color:var(--accent-ink); border:none;
  cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:background .15s;
}
#chat-send:hover{background:var(--accent-hover);}
#chat-send:disabled{opacity:0.6; cursor:not-allowed;}
#chat-attach{
  width:34px; height:34px; border-radius:50%; background:var(--panel-2); border:1px solid var(--line); color:var(--muted);
  cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:border-color .15s, color .15s;
}
#chat-attach:hover{border-color:var(--accent); color:var(--accent);}
#chat-attach:disabled{opacity:0.6; cursor:not-allowed;}
#chat-attach svg{width:16px; height:16px;}
#chat-send svg{width:16px; height:16px;}
.chat-note{font-size:11px; color:var(--muted); text-align:center; padding:0 14px 14px;}
.chat-privacy{font-size:10.5px; color:var(--muted); text-align:center; padding:0 14px 14px; opacity:0.75; line-height:1.4;}

/* ---- ABOUT ---- */
#about{border-top:1px solid var(--line);}
.about-grid{display:grid; grid-template-columns:1fr 1fr; gap:48px;}
.about-grid p{color:var(--muted); margin-bottom:16px; font-size:15.5px;}
.about-aside{color:var(--muted); font-size:15.5px;}
.about-edu{margin-top:28px; padding-top:20px; border-top:1px solid var(--line); font-size:13px; color:var(--muted);}
.col-header{font-size:26px; font-weight:700; margin-bottom:20px; line-height:1.3;}
.stack-groups{display:flex; flex-direction:column; gap:16px;}
.stack-group .label{font-size:12px; font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:0.06em; margin-bottom:9px; display:block;}
.chips{display:flex; flex-wrap:wrap; gap:8px;}
.chip{font-size:13px; font-weight:500; padding:6px 12px; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-sm); color:var(--text);}

/* ---- EXPERIENCE ---- */
#experience{border-top:1px solid var(--line); background:var(--panel);}
.timeline{display:flex; flex-direction:column;}
.tl-item{display:grid; grid-template-columns:180px 1fr; gap:28px; padding:26px 0; border-top:1px solid var(--line);}
.tl-item:first-child{border-top:none;}
.tl-when{font-size:13px; font-weight:600; color:var(--text); padding-top:3px;}
.tl-locs{margin-top:6px; display:flex; flex-direction:row; flex-wrap:wrap; gap:4px 12px;}
.tl-loc{display:flex; align-items:center; gap:6px; color:var(--muted); font-size:12px; font-weight:500; white-space:nowrap;}
.tl-loc .fi{width:15px; height:11px;}
.tl-suffix{color:var(--muted); font-size:11.5px; font-weight:500; margin-top:4px; font-style:italic;}
.tl-heading{display:flex; align-items:center; gap:12px; margin-bottom:10px;}
.tl-logo{width:52px; height:52px; flex-shrink:0; display:flex; align-items:center; justify-content:center;}
.tl-logo img{max-width:100%; max-height:100%; object-fit:contain; display:block;}
.tl-logo.chip{background:#fff; border-radius:8px; padding:6px; border:1px solid var(--line);}
.tl-body h3{font-size:17px; font-weight:700; margin-bottom:2px;}
.tl-body .company{font-size:13.5px; color:var(--accent); font-weight:600; display:block;}
.tl-body ul{list-style:none; display:flex; flex-direction:column; gap:7px;}
.tl-body li{color:var(--muted); font-size:14px; padding-left:16px; position:relative;}
.tl-body li::before{content:""; position:absolute; left:0; top:9px; width:5px; height:5px; border-radius:50%; background:var(--line);}
.tl-tags{display:flex; gap:6px; flex-wrap:wrap; margin-top:12px;}
.tl-tags span{font-size:11.5px; font-weight:600; color:var(--accent); background:var(--accent-soft); border:1px solid var(--accent-soft-border); padding:3px 9px; border-radius:var(--radius-sm);}
.tl-detail{display:inline-flex; align-items:center; gap:5px; margin-top:14px; font-size:13px; font-weight:600; color:var(--accent); text-decoration:none; background:none; border:none; padding:0; cursor:pointer; font-family:inherit;}
.tl-detail:hover{text-decoration:underline;}
.tl-detail svg{width:13px; height:13px;}

.exp-tabbox{display:flex; align-items:flex-end; gap:0; position:relative; z-index:1;}
.exp-tabbtn{
  padding:13px 26px 12px; font-size:14px; font-weight:600; cursor:pointer; transition:all .2s;
  border:1px solid var(--line); border-bottom:none; background:var(--panel-2); color:var(--muted);
  position:relative; margin-top:6px;
}
.exp-tabbtn:first-child{border-radius:12px 0 0 0;}
.exp-tabbtn:not(:first-child){border-radius:0 12px 0 0; margin-left:-1px;}
.exp-tabbtn.active{
  background:var(--bg); color:var(--text); border-bottom-color:var(--bg);
  margin-top:0; margin-bottom:-1px; z-index:2; padding-top:15px; box-shadow:0 -2px 8px rgba(15,23,42,0.04);
}
.exp-tabbtn:not(.active):hover{color:var(--text); background:var(--accent-soft);}
.exp-card{background:var(--bg); border:1px solid var(--line); border-radius:0 14px 14px 14px; box-shadow:var(--shadow); position:relative; z-index:1;}
.exp-panel{display:none; padding:8px 28px 8px;}
.exp-panel.active{display:block;}

/* ---- PORTFOLIO ---- */
#portfolio{border-top:1px solid var(--line);}
.proj-grid{display:grid; grid-template-columns:1fr 1fr; gap:18px;}
.proj-card{background:var(--bg); border:1px solid var(--line); border-radius:var(--radius-lg); padding:22px; transition:border-color .15s, box-shadow .15s; display:flex; gap:18px; align-items:center;}
.proj-card:hover{border-color:var(--accent-soft-border); box-shadow:var(--shadow);}
.proj-card .tag{font-size:11.5px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.05em;}
.proj-card h3{font-size:16px; font-weight:700; margin:8px 0 6px;}
.proj-card p{color:var(--muted); font-size:13.5px;}
.impact-visual{flex-shrink:0; width:76px; height:76px; position:relative; display:flex; align-items:center; justify-content:center;}
.impact-visual svg{width:76px; height:76px; transform:rotate(-90deg); display:block;}
.impact-visual .ring-num{position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-size:17px; font-weight:800; color:var(--accent); line-height:1;}
.impact-kpi{flex-shrink:0; width:84px; text-align:center; display:flex; flex-direction:column; align-items:center; justify-content:center;}
.impact-kpi .kpi-num{font-size:18px; font-weight:800; color:var(--accent); line-height:1.1; white-space:nowrap;}
.impact-kpi .kpi-unit{font-size:11px; color:var(--muted); font-weight:600; margin-top:2px; white-space:nowrap;}

/* ---- ACHIEVEMENTS ---- */
#achievements{border-top:1px solid var(--line); background:var(--panel);}
.ach-list{display:flex; flex-direction:column;}
.ach-item{display:grid; grid-template-columns:150px 1fr; gap:28px; padding:17px 0; border-top:1px solid var(--line);}
.ach-item:first-child{border-top:none;}
.ach-when{font-size:13px; font-weight:600; color:var(--muted);}
.ach-item p{font-size:14.5px; color:var(--text);}

/* ---- CONTACT ---- */
#contact{border-top:1px solid var(--line); text-align:center;}
#contact h2{font-size:25px; font-weight:700; margin-bottom:10px;}
#contact p{color:var(--muted); font-size:15px; margin-bottom:32px;}
.contact-icons{display:flex; gap:16px; justify-content:center;}
.contact-icon{
  width:56px; height:56px; border-radius:50%; background:var(--panel); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; color:var(--text); transition:all .15s; text-decoration:none;
}
.contact-icon:hover{background:var(--accent); border-color:var(--accent); color:var(--accent-ink); transform:translateY(-3px); box-shadow:0 8px 20px rgba(37,99,235,0.25);}
.contact-icon svg{width:24px; height:24px;}

footer{padding:26px 0; text-align:center; color:var(--muted); font-size:13px; border-top:1px solid var(--line);}

@media (max-width:820px){
  .hero-grid, .about-grid, .proj-grid, .ask-grid{grid-template-columns:1fr;}
  .tl-item, .ach-item{grid-template-columns:1fr;}
  .hero h1{font-size:22px;}
  section{padding:60px 0;}
  .nav-primary{display:none;}
  .nav-cta{font-size:0; padding:8px; width:34px; height:34px; justify-content:center; display:flex; align-items:center; border-radius:var(--radius-sm);}
  .nav-cta::before{content:"?"; font-size:14px;}
  .btn-cv{font-size:0; padding:8px; width:34px; height:34px; justify-content:center; border-radius:var(--radius-sm);}
  .btn-cv::before{content:"⬇"; font-size:14px;}
}
